/gcr

Official repository for ICCV 2023: Get the Best of Both Worlds: Improving Accuracy and Transferability by Grassmann Class

Primary LanguagePython

Grassmann Class Representation

🦢 - Paper 🌊 - Poster

Official code for "Get the Best of Both Worlds: Improving Accuracy and Transferability by Grassmann Class Representation (ICCV 2023)"

GrassmannClassRepresentation.mp4

Grassmann class representation

Installation

Run

python setup.py develop

Requirements

  • pytorch >= 1.13
  • mmpretrain

Prepare data

Put ImageNet1-K dataset on data/imagenet folder

ImageNet1-K Pretrained Weights

Architecture Trick Class Representation Dim Top1 Top5 Config Log Checkpoint
ResNet50-D Vector - 78.05 93.90 config log ckpt
ResNet50-D GCR 1 78.42 94.14 config log ckpt
ResNet50-D GCR 4 78.68 94.32 config log ckpt
ResNet50-D GCR 8 79.26 94.44 config log ckpt
ResNet50-D GCR 16 79.21 94.37 config log ckpt
ResNet50-D GCR 32 78.63 94.05 config log ckpt
ResNet50-D RSB-A1 Vector - 80.53 94.98 config log ckpt
ResNet50-D RSB-A1 GCR 8 81.00 95.40 config log ckpt
ResNet50-D RSB-A1 FixRes GCR 8 81.30 95.42 config log ckpt
ResNet50-D RSB-A2 Vector - 80.29 94.86 config log ckpt
ResNet50-D RSB-A2 GCR 8 80.75 95.24 config log ckpt
ResNet50-D RSB-A2 FixRes GCR 8 81.04 95.46 config log ckpt
ResNet50-D RSB-A3 Vector - 79.36 94.47 config log ckpt
ResNet50-D RSB-A3 GCR 8 79.64 94.85 config log ckpt
ResNet50-D RSB-A3 FixRes GCR 8 80.20 95.15 config log ckpt
ResNet101-D Vector - 79.31 94.67 config log ckpt
ResNet101-D GCR 8 80.24 94.95 config log ckpt
ResNet152-D Vector - 80.00 95.02 config log ckpt
ResNet152-D GCR 8 80.44 95.21 config log ckpt
VGG13-BN Vector - 72.02 90.79 config log ckpt
VGG13-BN GCR 8 73.40 91.30 config log ckpt
Swin-T Vector - 81.06 95.51 config log ckpt
Swin-T GCR 8 81.63 95.77 config log ckpt
Deit3-S Vector - 81.53 95.22 config log ckpt
Deit3-S GCR 8 82.18 95.73 config log ckpt

Training

# train ResNet50d baseline with 8 gpus
./tools/dist_train.sh configs/resnet/resnet50d_8xb32-coslr_in1k.py 8

# train the gcr version
./tools/dist_train.sh configs/resnet/resnet50d_8xb32-coslr_in1k_gcr8.py 8

Citation

@inproceedings{haoqi2023gcr,
title = {Get the Best of Both Worlds: Improving Accuracy and Transferability by Grassmann Class Representation},
author = {Wang, Haoqi and Li, Zhizhong and Zhang, Wayne},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
year = {2023}
}

Related Projects

ViM: Out-Of-Distribution with Virtual-logit Matching (CVPR 2022)