• Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official PyTorch implementation of the paper: "Solving ImageNet: a Unified Scheme for Training any Backbone to Top Results" (2022)

Solving ImageNet: a Unified Scheme for Training any Backbone to Top Results

Official PyTorch Implementation
Paper | Model Zoo | Speed-Accuracy Comparisons |

Tal Ridnik, Hussam Lawen, Emanuel Ben-Baruch, Asaf Noy
DAMO Academy, Alibaba Group

Abstract

ImageNet serves as the primary dataset for evaluating the quality of computer-vision models. The common practice today is training each architecture with a tailor-made scheme, designed and tuned by an expert. In this paper, we present a unified scheme for training any backbone on ImageNet. The scheme, named USI (Unified Scheme for ImageNet), is based on knowledge distillation and modern tricks. It requires no adjustments or hyper-parameters tuning between different models, and is efficient in terms of training times. We test USI on a wide variety of architectures, including CNNs, Transformers, Mobile-oriented and MLP-only. On all models tested, USI outperforms previous state-of-the-art results. Hence, we are able to transform training on ImageNet from an expert-oriented task to an automatic seamless routine. Since USI accepts any backbone and trains it to top results, it also enables to perform methodical comparisons, and identify the most efficient backbones along the speed-accuracy Pareto curve.

11/1/2023 Update

Added tests auto-generated by CodiumAI tool

How to Train on ImageNet with USI scheme

The proposed USI scheme does not require hyper-parameter tuning. The base training configuration works well for any backbone. All the results presented in the paper are fully reproducible.

First download teacher model weights from here

An example code - training ResNet50 model with USI:

python3 -u -m torch.distributed.launch --nproc_per_node=8 --nnodes=1 --node_rank=0 train.py  \
/mnt/Imagenet/
--model=resnet50
--kd_model_name=tresnet_l_v2
--kd_model_path=./tresnet_l_v2_83_9.pth

Some additional degrees of freedom that might be usefull:

  • Adjusting the batch size (defualt - 128): --batch-size=...
  • Training for more epochs (default - 300): --epochs=...

Acknowledgements

The training code is based on the excellent timm repository. Also, thanks EdgeNeXt authors for sharing their model.

Citation

@misc{https://doi.org/10.48550/arxiv.2204.03475,
  doi = {10.48550/ARXIV.2204.03475},  
  url = {https://arxiv.org/abs/2204.03475},  
  author = {Ridnik, Tal and Lawen, Hussam and Ben-Baruch, Emanuel and Noy, Asaf},  
  keywords = {Computer Vision and Pattern Recognition (cs.CV), Machine Learning (cs.LG), FOS: Computer and information sciences, FOS: Computer and information sciences},  
  title = {Solving ImageNet: a Unified Scheme for Training any Backbone to Top Results},  
  publisher = {arXiv},  
  year = {2022},  
}  

More Repositories

1

ASL

Official Pytorch Implementation of: "Asymmetric Loss For Multi-Label Classification"(ICCV, 2021) paper
Python
715
star
2

ImageNet21K

Official Pytorch Implementation of: "ImageNet-21K Pretraining for the Masses"(NeurIPS, 2021) paper
Python
713
star
3

TResNet

Official Pytorch Implementation of "TResNet: High-Performance GPU-Dedicated Architecture" (WACV 2021)
Python
465
star
4

ML_Decoder

Official PyTorch implementation of "ML-Decoder: Scalable and Versatile Classification Head" (2021)
Python
314
star
5

STAM

Official implementation of "An Image is Worth 16x16 Words, What is a Video Worth?" (2021 paper)
Python
219
star
6

PartialLabelingCSL

Official implementation for the paper: "Multi-label Classification with Partial Annotations using Class-aware Selective Loss"
Python
127
star
7

AudioClassfication

Python
75
star
8

HardCoReNAS

Python
34
star
9

HeadSharingKD

Implementation of the paper "It's All in the Head: Representation Knowledge Distillation through Classifier Sharing"
Python
34
star
10

ZS_SDL

Official Pytorch Implementation of: "Semantic Diversity Learning for Zero-Shot Multi-label Classification"(ICCV, 2021) paper
Python
28
star
11

PETA

Official Pytorch Implementation of "PETA: Photo Albums Event Recognition using Transformers Attention" (2021)
Python
18
star
12

CobBO

Coordinate Backoff Bayesian Optimization
Python
9
star
13

alibaba-miil.github.io

Curated list of miil papers
7
star
14

knapsack_pruning

Python
3
star
15

BINAS

Constructing interpretable bilinear accuracy predictors to serve as an objective function for an IQCQP problem that represents NAS under latency constraints and solve it with efficient algorithms.
Python
3
star