DMT for Image Classification

June 7, 2021 ยท View on GitHub

This folder contains code for the CIFAR-10 image classification experiments for Dynamic Mutual Training (DMT).

Results

Semi-supervised learning accuracy on CIFAR-10 test:

methodnetwork4000 labels
BaselineWRN-28-286.08
Mean TeacherWRN-28-289.64
DCT (two models)CNN-1390.97
Dual StudentCNN-1391.11
MixMatchWRN-28-293.76
DAGCNN-1393.87
Curriculum labelingWRN-28-294.02
DMTWRN-28-294.21

Preparations

1. Set dataset paths:

Set the directory that you want your dataset at here and here.

2. Download and process the dataset:

The CIFAR-10 dataset can be downloaded and splitted to 5 random splits and validation set (200 image small validation set) by:

./generate_splits.sh

Run the code

For multi-GPU/TPU/Distributed machine users, first run:

accelerate config

More details can be found at Accelerate. Note that the mixed precision config cannot be used, you should still use --mixed-precision for that.

We provide examples in scripts and commands. Final results can be found at log.txt after training.

For example, with 1000 labels, to compare CL and DMT in a controlled experiment with same baseline model to start training:

./ss-cl-full-1.sh
./ss-dmt-full-1.sh

You'll need to run 5 times average to determine performance by changing the seed parameter (we used 1,2,3,4,5) in shell scripts.

For small validation set, use --valtiny; for fine-grained testing, use --fine-grain.