**PASE: Partial Multi-Label Learning via Label-Specic Feature Corrections**

Jun-Yi Hang, Min-Ling Zhang



*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/1S8sbMiM5msTN7TNgaqkPddCejDlfoTvN/view?usp=sharing).

Download and then unrar the data into the current directory. Please ensure the file structure the same as follows:

```
PASE
├── Cores
    └── ...
├── Datasets
    ├── Music_style
        └── Music_style.mat
    └── COCO2014
        └── train2014
        └── val2014
        └── annotations
    └── VG
        └── VG_100K
        └── vg_category_200_labels_index.json
    └── ...
└── ...  
```

For MS-COCO and VG-200 data sets, please check the `README.md` files under `Datasets/COCO2014` and `Datasets/VG` folders to download and prepare necessary data files.

### Train and Test PASE

For example, to perform 10-fold cross validation on *Music_style* (a real-world PML data set):

```
python PASE_10-fold_cv.py cv_exp -dataset Music_style -lr 1e-3 -max_epoch 500 -cuda
```

For another example, to perform 10-fold cross validation on *yeast* with low-level label noise (a synthetic PML data set):
```
python PASE_10-fold_cv.py cv_exp -dataset yeast -n low_level -lr 1e-3 -max_epoch 500 -cuda
```

To train and test PASE on multi-label image data set *MS-COCO*:

```
python PASE-Deep_traintest.py coco_exp --dataset coco --noise_level low_level --extra_val --cuda --early_stop
```

### Hyperparameters for More Data Sets

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

```
python PASE_10-fold_cv.py cv_exp -dataset Music_style -default_cfg -cuda
python PASE_10-fold_cv.py cv_exp -dataset yeast -n low_level -default_cfg -cuda
```

### Running on Additional Data Sets

To run PASE on data sets in addition to the 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.
