DirMixE
April 28, 2026 ยท View on GitHub
This repository is the official code for the paper Harnessing Hierarchical Label Distribution Variations in Test Agnostic Long-tail Recognition (ICML 2024).
Paper Title: Harnessing Hierarchical Label Distribution Variations in Test Agnostic Long-tail Recognition.
Author: Zhiyong Yang, Qianqian Xu*, Zitai Wang, Sicong Li, Boyu Han, Shilong Bao, Xiaochun Cao, Qingming Huang*

๐ฅ News
- [2026] Our work has been further extended in a TPAMI version with improved methodology and more comprehensive experiments.
๐ Please check the new repository: https://github.com/scongl/DirMixE_TPAMI
Installation
- Clone the repository
git clone https://github.com/scongl/DirMixE.git
- Install the required libraries
pip install -r requirements.txt
Datasets
Four bechmark datasets
- Please download these datasets and put them to the /data file.
- ImageNet-LT can be found at here.
- iNaturalist data should be the 2018 version from here.
- CIFAR-100 and CIFAR-10 will be downloaded automatically with the dataloader.
data
โโโ CIFAR-10
โย ย โโโ cifar-10-batches-py
โโโ CIFAR-100
โย ย โโโ cifar-100-python
โโโ ImageNet_LT
โย ย โโโ test
โย ย โโโ train
โย ย โโโ val
โโโ iNaturalist
โโโ test2018
โโโ train_val2018
Txt files
- We provide txt files for test-agnostic long-tailed recognition for ImageNet-LT and iNaturalist 2018. CIFAR-100 and CIFAR-10 will be generated automatically with the code.
- For iNaturalist 2018, please unzip the iNaturalist_train.zip.
data_txt
โโโ ImageNet_LT
โย ย โโโ ImageNet_LT_backward10.txt
โย ย โโโ ImageNet_LT_backward25.txt
โย ย โโโ ImageNet_LT_backward2.txt
โย ย โโโ ImageNet_LT_backward50.txt
โย ย โโโ ImageNet_LT_backward5.txt
โย ย โโโ ImageNet_LT_forward10.txt
โย ย โโโ ImageNet_LT_forward25.txt
โย ย โโโ ImageNet_LT_forward2.txt
โย ย โโโ ImageNet_LT_forward50.txt
โย ย โโโ ImageNet_LT_forward5.txt
โย ย โโโ ImageNet_LT_test.txt
โย ย โโโ ImageNet_LT_train.txt
โย ย โโโ ImageNet_LT_uniform.txt
โย ย โโโ ImageNet_LT_val.txt
โโโ iNaturalist18
โโโ iNaturalist18_backward2.txt
โโโ iNaturalist18_backward3.txt
โโโ iNaturalist18_forward2.txt
โโโ iNaturalist18_forward3.txt
โโโ iNaturalist18_train.txt
โโโ iNaturalist18_uniform.txt
โโโ iNaturalist18_val.txt
Script
CIFAR10-LT
Training
- To train the DirMixE model, run this command:
python train.py -c configs/train/cifar10.json
Evaluate
- To evaluate DirMixE under ours setting, run this command:
python test_train_cifar_dirmixe.py -c configs/test/test_cifar10.json -r checkpoint_path
- To evaluate DirMixE under sade's setting, run this command:
python test_train_cifar_sade.py -c configs/test/test_cifar10.json -r checkpoint_path
CIFAR100-LT
Training
- To train the DirMixE model, run this command:
python train.py -c configs/train/cifar100.json
Evaluate
- To evaluate DirMixE under ours setting, run this command:
python test_train_cifar_dirmixe.py -c configs/test/test_cifar100.json -r checkpoint_path
- To evaluate DirMixE under sade's setting, run this command:
python test_train_cifar_sade.py -c configs/test/test_cifar100.json -r checkpoint_path
ImageNet-LT
Training
- To train the DirMixE model, run this command:
python train.py -c configs/train/imagenet.json
Evaluate
- To evaluate DirMixE under ours setting, run this command:
python test_train_cifar_dirmixe.py -c configs/test/test_imagenet.json -r checkpoint_path
- To evaluate DirMixE under sade's setting, run this command:
python test_train_cifar_sade.py -c configs/test/test_imagenet.json -r checkpoint_path
iNaturalist
Training
- To train the DirMixE model, run this command:
python train.py -c configs/train/inaturalist.json
Evaluate
- To evaluate DirMixE under ours setting, run this command:
python test_train_cifar_dirmixe.py -c configs/test/test_inaturalist.json -r checkpoint_path
- To evaluate DirMixE under sade's setting, run this command:
python test_train_cifar_sade.py -c configs/test/test_inaturalist.json -r checkpoint_path
Citation
If you find our work inspiring or use our codebase in your research, please cite our work.
@inproceedings{yang2024harnessing,
title={Harnessing Hierarchical Label Distribution Variations in Test Agnostic Long-tail Recognition},
author={Zhiyong Yang and Qianqian Xu and Zitai Wang and Sicong Li and Boyu Han and Shilong Bao and Xiaochun Cao and Qingming Huang},
booktitle={International Conference on Machine Learning},
year={2024}
}
@article{yang2026dirmixe,
title = {DirMixE: Harnessing Test Agnostic Long-tail Recognition with Hierarchical Label Vartiations},
author = {Zhiyong Yang and Qianqian Xu and Sicong Li and Zitai Wang and Xiaochun Cao and Qingming Huang},
journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
year = {2026},
}
Acknowledgements
Our codes are based on the repository SADE.