LujianYao / LRA-diffusion

This is the source code of LRA-diffusion for learning from noisy labels

Home Page:https://arxiv.org/abs/2305.19518

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Label-Retrieval-Augmented Diffusion Models for Learning from Noisy Labels

source code of the LRA-Diffusion Models for Learning from Noisy Labels.

1. Preparing python environment

Install requirements.

pip install -r requirements.txt

2. Pre-trained model & Checkpoints

  • The pre-trianed SimCLR encoder for CIFAR-10 and CIFAR-100 is provided in the model folder.
  • CLIP models are available in the python package at here. Install without dependency:
pip install ftfy regex tqdm
pip install git+https://github.com/openai/CLIP.git  --no-dependencies

Trained checkpoints for the diffusion models are available at here.

3. Generate the Poly-Margin Diminishing (PMD) Noisy Labels

The noisy labels used in our experiments are provided in folder noisy_label. The noisy labels are generated following the original paper.

4. Run demo script to train the LRA-diffusion

4.1 CIFAR-10 and CIFAR-100

Default values for input arguments are given in the code. An example command is given:

python train_CIFAR.py --device cuda:0 --noise_type cifar10-1-0.35 --fp_encoder SimCLR --nepoch 200 --warmup_epochs 5

4.2 Food-101N and Food-101

The dataset should be downloaded according to the instruction here: Food-101N
Default values for input arguments are given in the code. An example command is given:

python train_Food101N.py --gpu_devices 0 1 2 3 --nepoch 200 --warmup_epochs 1 --feature_dim 1024

4.3 Clothing1M

The dataset should be downloaded according to the instruction here: Clothing1M. Default values for input arguments are given in the code.

The training data is selected by the pre-trained CC classifier. An example command using multiple gpus is given:

python train_Clothing1M.py --gpu_devices 0 1 2 3 --nepoch 200 --warmup_epochs 1 --feature_dim 1024

4.4 WebVision

Download WebVision 1.0 and the validation set of ILSVRC2012 datasets. The ImageNet synsets labels for ILSVRC2012 validation set is provided here.

python train_WebVision.py --gpu_devices 0 1 2 3 --nepoch 200 --warmup_epochs 1 --feature_dim 1024

Reference

@inproceedings{
  chen2023labelretrievalaugmented,
  title={Label-Retrieval-Augmented Diffusion Models for Learning from Noisy Labels},
  author={Jian Chen and Ruiyi Zhang and Tong Yu and Rohan Sharma and zhiqiang xu and Tong Sun and Changyou Chen},
  booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
  year={2023},
  url={https://openreview.net/forum?id=o778eWSr1S}
}

About

This is the source code of LRA-diffusion for learning from noisy labels

https://arxiv.org/abs/2305.19518

License:MIT License


Languages

Language:Python 100.0%