**DELA: Dual Perspective of Label-Specific Feature Learning for Multi-Label Classification**

Jun-Yi Hang, Min-Ling Zhang

*Accepted by ICML 2022*



*This code package can be used freely for academic, non-profit purposes. For other usage,  please contact us for further information (Prof. Min-Ling Zhang: zhangml@seu.edu.cn ).*

## Requirements

* Python 3.8.3
* Pytorch 1.6.0
* torchnet 0.4.0
* scikit-learn 0.23.1
* numpy 1.18.5

## Usage

### Download and Prepare the Data

All data sets can be downloaded from the Google [drive](https://drive.google.com/file/d/1aVWaPmYahxUtxslRKU543SYukJCUkw8V/view?usp=sharing).

Download and then unrar the data into the current directory.

### Train and Test DELA

For example, to perform 10-fold cross validation on *corel5k* data set:

```
python DELA_10-fold_cv.py cv_exp -dataset corel5k -beta 1e-4 -lr 3e-3 -max_epoch 50 -lr_s step_epoch -step 4 -cuda
```

### Hyperparameters for More Data Sets

We provide tuned hyperparameters for all the 10 data sets used in the paper. To perform 10-fold cross validation with these provided hyperparameters:

```
python DELA_10-fold_cv.py cv_exp -dataset corel5k -default_cfg -cuda
```

### Running on Additional Data Sets

To run DELA on data sets in addition to the 10 data sets used in the paper, one needs to write a simple interface for loading data set. Please check the `dataset.py` file under `Cores` folder for some examples.
