Skip to content

puar-playground/LRA-diffusion

Repository files navigation

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

@article{chen2024label,
  title={Label-retrieval-augmented diffusion models for learning from noisy labels},
  author={Chen, Jian and Zhang, Ruiyi and Yu, Tong and Sharma, Rohan and Xu, Zhiqiang and Sun, Tong and Chen, Changyou},
  journal={Advances in Neural Information Processing Systems},
  volume={36},
  year={2024}
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages