This is a PyTorch implementation of the MoPro paper (Blog post):
@article{MoPro, title={MoPro: Webly Supervised Learning with Momentum Prototypes}, author={Junnan Li and Caiming Xiong and Steven C.H. Hoi}, journal={ICLR}, year={2021} }
- WebVision dataset
- ImageNet dataset (for evaluation)
- Python ≥ 3.6
- PyTorch ≥ 1.4
This implementation currently only supports multi-gpu, DistributedDataParallel training, which is faster and simpler.
To perform webly-supervised training of a ResNet-50 model on WebVision V1.0 using a 4-gpu or 8-gpu machine, run:
python train.py \ --data [WebVision folder] \ --exp-dir experiment/MoPro\ --dist-url 'tcp:https://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0
WebVision V1 | WebVision v2 |
---|
python noise_cleaning.py --data [WebVision folder] --resume [pre-trained model path] --annotation pseudo_label.json
python classifier_retrain.py --data [WebVision folder] --imagenet [ImageNet folder]\ --resume [pre-trained model path] --annotation pseudo_label.json --exp-dir experiment/cRT\ --dist-url 'tcp:https://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0
python finetune_imagenet.py \ --data [ImageNet path] \ --model-path [pre-trained model path] \ --exp-dir experiment/Finetune \ --low-resource 0.01 \ --dist-url 'tcp:https://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0
Result for WebVision-V1 pre-trained model:
Percentage | 1% | 10% |
---|---|---|
Accuracy | 71.2 | 74.8 |
python lowshot_svm.py --model_path [your pretrained model] --dataset VOC --voc-path [VOC data path]
Result for WebVision-V1 pre-trained model:
VOC | k=1 | k=2 | k=4 | k=8 | k=16 |
---|---|---|---|---|---|
mAP | 59.5 | 71.3 | 76.5 | 81.4 | 83.7 |
Places | k=1 | k=2 | k=4 | k=8 | k=16 |
---|---|---|---|---|---|
Acc | 16.9 | 23.2 | 29.2 | 34.5 | 38.7 |