Code for 'Dynamic MLP for Fine-Grained Image Classification by Leveraging Geographical and Temporal Information'
Experiment Environment
- python 3.6
- pytorch 1.7.1+cu101
- torchvision 0.8.2
Get pretrained models for SK-Res2Net following here.
Get datasets following here.
Specify --image_only
for training image-only models.
- ResNet-50 (67.924% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
--name res50_image_only \
--data 'inat21_mini' \
--data_dir 'path/to/your/data' \
--model_file 'resnet' \
--model_name 'resnet50' \
--pretrained \
--batch_size 512 \
--start_lr 0.04 \
--image_only
- SK-Res2Net-101 (76.102% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
--name sk2_image_only \
--data 'inat21_mini' \
--data_dir 'path/to/your/data' \
--model_file 'sk2res2net' \
--model_name 'sk2res2net101' \
--pretrained \
--batch_size 512 \
--start_lr 0.04 \
--image_only
- ResNet-50 (78.751% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
--name res50_dynamic_mlp \
--data 'inat21_mini' \
--data_dir 'path/to/your/data' \
--model_file 'resnet_dynamic_mlp' \
--model_name 'resnet50' \
--pretrained \
--batch_size 512 \
--start_lr 0.04
- SK-Res2Net-101 (84.694% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
--name sk2_dynamic_mlp \
--data 'inat21_mini' \
--data_dir 'path/to/your/data' \
--model_file 'sk2res2net_dynamic_mlp' \
--model_name 'sk2res2net101' \
--pretrained \
--batch_size 512 \
--start_lr 0.04
Specify --resume
and --evaluate
for inference and --image_only
for testing image-only models.
python3 train.py \
--name sk2_dynamic_mlp \
--data 'inat21_mini' \
--data_dir 'path/to/your/data' \
--model_file 'sk2res2net_dynamic_mlp' \
--model_name 'sk2res2net101' \
--resume 'path/to/your/checkpoint' \
--evaluate
Backbone | Size | Acc@1 | Log | Download |
---|---|---|---|---|
ResNet-50 | 224 | 67.924 | log | model |
+ Dynamic MLP | 224 | 78.751 | log | model |
SK-Res2Net-101 | 224 | 76.102 | log | model |
+ Dynamic MLP | 224 | 84.694 | log | model |