Home

Awesome

SMMix: Self-Motivated Image Mixing for Vision Transformers (ICCV 2023)

This a Pytorch implementation of our paper SMMix: Self-Motivated Image Mixing for Vision Transformers

Requirements

Data Preparation

ImageNet
├── train
│   ├── folder 1 (class 1)
│   ├── folder 2 (class 2)
│   ├── ...
├── val
│   ├── folder 1 (class 1)
│   ├── folder 2 (class 2)
│   ├── ...

Pre-trained Models

ModelTop-1 AccuracyDowmload
DeiT-T73.6model & log
DeiT-S81.1model & log
PVT-T76.4model & log
PVT-S81.0model & log
PVT-M82.2model & log
PVT-L82.7model & log

Evaluation

./script/eval.sh --data-path DATASET_PATH --model MODEL_NAME --resume CHECKPOINT_PATH

examples:

./script/eval.sh --data-path /media/DATASET/ImageNet --model pvt_small --resume ./checkpoints/pvt_small_smmix.pth
./script/eval.sh --data-path /media/DATASET/ImageNet --model vit_deit_small_patch16_224 --resume ./checkpoints/deit_small_smmix.pth

Training

./script/train.sh --data-path DATASET_PATH --model MODEL_NAME --output_dir LOG_PATH --batch_size 256

examples:

./script/train.sh --data-path /media/DATASET/ImageNet --model pvt_small --output_dir ./log/pvt_small_smmix --batch_size 256
./script/train.sh --data-path /media/DATASET/ImageNet --model vit_deit_small_patch16_224 --output_dir ./log/deit_small_smmix --batch_size 256