Home

Awesome

[MentorMix] "Beyond Synthetic Noise: Deep Learning on Controlled Noisy Labels" PyTorch Implementation

This repository implemented paper Beyond Synthetic Noise: Deep Learning on Controlled Noisy Labels in PyTorch version. Official code is here which is implemented by google-research with tensorflow.
Code of this repository provides training method from scratch with dataset CIFAR10/CIFAR100.

Requirements

torch 1.7.1
torchvision 0.8.1
tqdm
argparse

How to run

After you have cloned the repository, you can train each model from scratch with datasets CIFAR10, CIFAR100. Trainable models are ResNet. You can adjust this code if you want to train other kinds of architectures.

python train.py --dataset cifar10
                --StudentNet ResNet34 --MentorNet threshold --MentorNet_type PD
                --optimizer SGD --scheduler StepLR
                --lr 0.1 --batch_size 128 --epoch 500 --wd 2e-4
                --noise_rate 0.2 
                --ema 0.0001
                --gamma_p 0.8 --alpha 2.
                --second_reweight
                --trial 0
                --gpu_id 0
python3 train_MentorNet.py  --dataset cifar10
                            --StudentNet ResNet34 --MentorNet MentorNet --MentorNet_type PD
                            --optimizer SGD --scheduler CosineAnnealing
                            --lr 0.1 --batch_size 32 --epoch 100 --wd 2e-4
                            --noise_rate 0.
                            --ema 0.05
                            --gamma_p 0.75
                            --train_MentorNet
                            --trial 0
                            --gpu_id 0

(If you train MentorNet in Data-Driven way, noise rate has to be the same as one when training StudentNet later.)

Second, train StudentNet with pre-trained MentorNet.

python train.py --dataset cifar10
                --StudentNet ResNet34 --MentorNet MentorNet --MentorNet_type DD
                --optimizer SGD --scheduler StepLR
                --lr 0.1 --batch_size 128 --epoch 500 --wd 2e-4
                --noise_rate 0.2 
                --ema 0.0001
                --gamma_p 0.8 --alpha 2.
                --second_reweight
                --trial 0
                --gpu_id 0

Implementation Details

Most of the hyperparameters refers to the values mentioned in the paper. However, some hyperparameters such as γ<sub>p</sub> or α refers to the values used in the official code. Those hyperparameters are marked out according to the Noise Level below.

Hyperparameters referred by paper

epochlearning rateweight decayOptimizerMomentumNesterovschedulerEMAsecond reweight
4000.10.0002SGD0.9FalseStepLR(0.9)0.0001True

Hyperparameters referred by Official Code

Noise Level0.20.40.60.8
α2884
γ<sub>p</sub>0.80.60.60.2
second reweightFalseFalseTrueTrue
Noise Level0.20.40.60.8
α2848
γ<sub>p</sub>0.70.50.30.1
second reweightFalseFalseTrueTrue

Accuracy

Below is the result of the test accuracy trained with ResNet34. Results are averaged over 3 repeated experiments of same circumstances.
(All values are percentiles.)

CIFAR10

Noise Level0.20.40.60.8
Official95.6094.2091.3081.00
This repo95.4793.4788.8820.65

CIFAR100

Noise Level0.20.40.60.8
Official78.6071.3064.6041.20
This repo76.3071.8438.837.20