Home

Awesome

GCL: Long-tailed Visual Recognition via Gaussian Clouded Logit Adjustment

This is the source code for our CVPR (2022) paper: Long-tailed Visual Recognition via Gaussian Clouded Logit Adjustment based on Pytorch. This version is a demo of how to use GCL loss. The version that supports more datasets is in the works and is coming soon.

This repository also include the source code for our TAI paper: Adjusting Logit in Gaussian Form for Long-Tailed Visual Recognition. The angular form GCL can be found in losses.py GCLAngLoss.

CIFAR10

First stage

$ python cifar_train_backbone.py --arch resnet32 /
                                 --dataset cifar10 --data_path './dataset/data_img' /
                                 --loss_type 'GCL' --imb_factor 0.01 /
                                 --batch_size 64 --learning_rate 0.1 

Second stage

$ python cifar_train_classifier.py --arch resnet32 /
                                 --dataset cifar10 --data_path './dataset/data_img' /
                                 --loss_type 'GCL' --imb_factor 0.01 /
                                 --train_rule 'BalancedRS'/
                                 --batch_size 64 --learning_rate 0.1 

Results and Models for Large-scale Datasets (temporarily)

*Note: I have modified the code several times. The code in this repository may need to be modified (Mainly the backbone and classifier loading parts, the classifier network layer names may be inconsistent.) to match the pth file. Since I left my previous workplace, there is no GPU retraining model now. I temporarily share previously stored pth file for the model. Sorry for the inconvience and hope you can understand.

Sorry. I have run out of the storage space and the model parameters are temporarily unavailable. Looking for other disk now.

DatasetArchTop-1 AccuracyLogModel
ImageNet-LTResNet-5052.928%linklink
iNat 2018ResNet-5070.327%linklink
Places-LTResNet-15234.589%linklink
DatasetArchTop-1 AccuracyLogModel
ImageNet-LTResNet-5054.884%link (train) link (val)link
iNat 2018ResNet-5072.005%linklink
Places-LTResNet-15240.641%linklink

<a name="Citation"></a>Citation

To do list:

Other Resources of long-tailed visual recognition

Awesome-LongTailed-Learning

Awesome-of-Long-Tailed-Recognition

Long-Tailed-Classification-Leaderboard

BagofTricks-LT

Connection

If you have any questions, please send the email to Mengke Li at: csmkli@comp.hkbu.edu.hk.

Citation

@inproceedings{Li2022GCL,
  author    = {Mengke Li, Yiu{-}ming Cheung, Yang Lu},
  title     = {Long-tailed Visual Recognition via Gaussian Clouded Logit Adjustment},
  pages = {6929-6938},
  booktitle = {CVPR},
  year      = {2022},
}
@article{Li2024AGCL,
  author={Li, Mengke and Cheung, Yiu-ming and Lu, Yang and Hu, Zhikai and Lan, Weichao and Huang, Hui},
  journal={IEEE Transactions on Artificial Intelligence}, 
  title={Adjusting Logit in Gaussian Form for Long-Tailed Visual Recognition}, 
  year={2024},
  volume={},
  number={},
  pages={1-15},
  doi={10.1109/TAI.2024.3401102}}

Acknowledgment

We refer to some codes from MisLAS. Many thanks to the authors.