Instructions to use ERISLab/FGIR-KD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use ERISLab/FGIR-KD with timm:
import timm model = timm.create_model("hf-hub:ERISLab/FGIR-KD", pretrained=True) - Notebooks
- Google Colab
- Kaggle
File size: 8,444 Bytes
184ed33 ae626b8 184ed33 9f7c0b9 184ed33 9f7c0b9 184ed33 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | ---
pipeline_tag: image-classification
library_name: pytorch
tags:
- fine-grained-image-recognition
- image-classification
- knowledge-distillation
- timm
---
# FGIR-KD: how to choose your teacher for fine-grained image recognition
These are the checkpoints behind *How to Choose Your Teacher for Fine Grained Image Recognition* ([arXiv:2605.15689](https://arxiv.org/abs/2605.15689)), presented at the FGVC13 workshop at CVPR 2026. Small students (ResNet-18, LCNet, LeViT, ViT-T) are distilled from a range of fine-grained teachers to study which teacher helps most. `teachers/` holds the teachers themselves; `students/` the distilled students. The model code is shared with TGDA ([arkel23/TGDA](https://github.com/arkel23/TGDA)).
2083 checkpoints, one per configuration, each the last epoch of one training seed. Each file
is a `torch.save` dict with `config` (the full training configuration), `model` (the state dict),
`accuracy` and `epoch`, with no optimizer state. File names are the runs' experiment-log names,
ending in the serial. Load them with [fgir-zoo](https://github.com/arkel23/fgir-zoo). The
[collection](https://huggingface.co/collections/ERISLab/fgir-kd-how-to-choose-your-teacher-fgvc13-cvpr-2026-6ab32cd35061af167deb14d6) groups this repo with the paper.
## Layout
| Folder | Models | Teachers | Datasets | Files | Mean accuracy |
|---|---|---|---|---|---|
| `teachers/serial_15` | `resnet101.a1_in1k`, `resnetv2_101.a1h_in1k`, `vgg19_bn` | - | 8 | 8 | 90.46 |
| `teachers/serial_16` | `convnext_base.fb_in22k`, `resnet101.a1_in1k`, `resnetv2_101.a1h_in1k`, `resnetv2_101x3_bit.goog_in21k`, `swin_base_patch4_window7_224.ms_in22k`, `van_b3`, `vgg19_bn`, `vit_b16` | - | 6 | 48 | 82.21 |
| `teachers/serial_17` | `convnext_base.fb_in22k`, `resnet101.a1_in1k`, `resnetv2_101.a1h_in1k`, `resnetv2_101x3_bit.goog_in21k`, `swin_base_patch4_window7_224.ms_in22k`, `van_b3`, `vgg19_bn`, `vit_b16` | - | 1 | 8 | 81.45 |
| `teachers/serial_18` | `convnext_base.fb_in22k`, `resnet101.a1_in1k`, `resnetv2_101.a1h_in1k`, `resnetv2_101x3_bit.goog_in21k`, `swin_base_patch4_window7_224.ms_in22k`, `vgg19_bn`, `vit_b16` | - | 1 | 7 | 78.83 |
| `teachers/serial_400` | `convnext_base.fb_in22k`, `resnet101.a1_in1k`, `resnetv2_101.a1h_in1k`, `resnetv2_101x3_bit.goog_in21k`, `swin_base_patch4_window7_224.ms_in22k`, `van_b3`, `vgg19_bn`, `vit_b16` | - | 1 | 9 | 71.90 |
| `teachers/serial_501` | `resnetv2_101x3_bit.goog_in21k` | - | 5 | 5 | 86.01 |
| `students/serial_1` | `resnet18` | 1 | 1 | 1 | 73.78 |
| `students/serial_2` | `lcnet_035` | 8 | 9 | 72 | 66.13 |
| `students/serial_3` | `lcnet_035` | 8 | 9 | 72 | 64.36 |
| `students/serial_4` | `lcnet_035` | 8 | 9 | 72 | 62.50 |
| `students/serial_7` | `levit_128s` | 8 | 8 | 57 | 63.23 |
| `students/serial_102` | `resnet18` | 1 | 1 | 1 | 63.62 |
| `students/serial_104` | `vit_t16` | 1 | 1 | 1 | 14.38 |
| `students/serial_105` | `lcnet_035` | 1 | 2 | 2 | 33.97 |
| `students/serial_106` | `levit_128s` | 1 | 2 | 2 | 39.34 |
| `students/serial_193` | `lcnet_035` | 1 | 1 | 1 | 76.86 |
| `students/serial_201` | `resnet18` | 8 | 10 | 72 | 74.73 |
| `students/serial_202` | `resnet18` | 8 | 9 | 65 | 71.92 |
| `students/serial_203` | `resnet18` | 8 | 13 | 104 | 72.22 |
| `students/serial_204` | `resnet18` | 8 | 13 | 104 | 66.47 |
| `students/serial_205` | `resnet18` | 8 | 13 | 104 | 70.14 |
| `students/serial_206` | `resnet18` | 8 | 13 | 104 | 64.09 |
| `students/serial_207` | `resnet18` | 8 | 13 | 104 | 68.60 |
| `students/serial_208` | `resnet18` | 8 | 13 | 104 | 63.21 |
| `students/serial_209` | `lcnet_035` | 8 | 13 | 104 | 55.43 |
| `students/serial_210` | `lcnet_035` | 8 | 13 | 104 | 54.11 |
| `students/serial_211` | `lcnet_035` | 8 | 13 | 104 | 53.87 |
| `students/serial_212` | `levit_128s` | 8 | 13 | 104 | 59.39 |
| `students/serial_213` | `levit_128s` | 8 | 13 | 103 | 57.04 |
| `students/serial_214` | `levit_128s` | 8 | 13 | 103 | 57.31 |
| `students/serial_215` | `lcnet_035` | 8 | 13 | 104 | 58.93 |
| `students/serial_216` | `levit_128s` | 8 | 13 | 101 | 60.95 |
| `students/serial_253` | `lcnet_035` | 1 | 1 | 1 | 77.43 |
| `students/serial_259` | `resnet18` | 1 | 1 | 1 | 85.47 |
| `students/serial_260` | `levit_128s` | 1 | 1 | 1 | 82.02 |
| `students/serial_305` | `levit_128s` | 8 | 1 | 8 | 63.62 |
| `students/serial_309` | `lcnet_035` | 7 | 1 | 7 | 61.52 |
| `students/serial_311` | `lcnet_035` | 1 | 1 | 1 | 0.52 |
| `students/serial_321` | `lcnet_035` | 8 | 1 | 8 | 60.81 |
| `students/serial_322` | `lcnet_035` | 8 | 1 | 8 | 54.30 |
| `students/serial_323` | `lcnet_035` | 8 | 1 | 8 | 0.64 |
| `students/serial_324` | `lcnet_035` | 8 | 1 | 8 | 51.13 |
| `students/serial_401` | `resnet18` | 8 | 1 | 8 | 70.81 |
| `students/serial_402` | `lcnet_035` | 8 | 1 | 8 | 61.19 |
| `students/serial_403` | `levit_128s` | 3 | 1 | 3 | 72.06 |
| `students/serial_551` | `resnet18` | 4 | 2 | 4 | 77.20 |
| `students/serial_552` | `lcnet_035` | 1 | 1 | 1 | 57.28 |
| `students/serial_553` | `levit_128s` | 8 | 5 | 40 | 75.94 |
| `students/serial_554` | `resnet18` | 1 | 1 | 1 | 54.37 |
| `students/serial_555` | `lcnet_035` | 2 | 2 | 2 | 66.50 |
| `students/serial_556` | `levit_128s` | 8 | 3 | 10 | 92.36 |
| `students/serial_999` | `lcnet_035` | 1 | 1 | 1 | 7.04 |
`manifest.csv` lists every file with its dataset, student, teacher, serial, seed, image size,
class count, accuracy, SHA-256 and size.
## Load a checkpoint and classify an image
```python
import torch
from PIL import Image
from torchvision import transforms
from fgir_zoo import tgda
model = tgda.create_model('students/serial_203/cub_resnet18_vgg19_bn_cal_203')
cfg = model.config
tf = transforms.Compose([
transforms.Resize((cfg.test_resize_size, cfg.test_resize_size),
interpolation=transforms.InterpolationMode.BICUBIC),
transforms.CenterCrop(cfg.student_image_size or cfg.image_size),
transforms.ToTensor(),
transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
])
# a CUB-200-2011 test image, class index 50 (051.Horned_Grebe)
x = tf(Image.open('Horned_Grebe_0050_34561.jpg').convert('RGB')).unsqueeze(0)
with torch.no_grad():
logits = model(x)
print(logits.argmax(-1).item(), logits.softmax(-1).max().item()) # 50 0.9423
```
## Accuracy of the released checkpoints
Top-1 accuracy (%) stored in each file, on the dataset's test split at the end of training.
Each value is one seed; the paper reports its own aggregates, so its tables can differ slightly. Per-file accuracy for the 2,000 students is in `manifest.csv`; the table below covers the teachers.
### `teachers/`
| Model | aircraft | bach | bdctkidney | cars | cub | dogs | flowers | idriddr | idridme | imagenet1k | lublung | moe | nabirds | pets |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `convnext_base.fb_in22k` | | 92.50 | 99.96 | | | | | 62.14 | 82.52 | 77.94 | 96.71 | | | |
| `resnet101.a1_in1k` | | 77.50 | 99.96 | 91.94 | | | 96.41 | 54.37 | 77.67 | 83.91 | 94.08 | | | |
| `resnetv2_101.a1h_in1k` | | 67.50 | 99.96 | | | | | 50.49 | 72.82 | 77.70 | 92.34 | | 89.05 | |
| `resnetv2_101x3_bit.goog_in21k` | | 87.50 | 99.90 | | | | | 57.14 | 89.29 | 47.81 | 96.23 | | | |
| `swin_base_patch4_window7_224.ms_in22k` | | 95.00 | 99.96 | | | | | 59.22 | 82.52 | 71.39 | 96.86 | | | |
| `van_b3` | | 92.50 | 100.00 | | | | | 54.37 | 82.52 | 85.46 | 96.06 | | | |
| `vgg19_bn` | 88.87 | 91.25 | 100.00 | | 86.93 | 83.83 | | 60.19 | 81.55 | 54.08 | 94.57 | 93.71 | | 92.94 |
| `vit_b16` | | 86.25 | 100.00 | | | | | 51.46 | 82.52 | 76.65 | 96.64 | | | |
## Requirements
- `fgir-zoo` (`pip install git+https://github.com/arkel23/fgir-zoo.git`), which pins
`timm==0.9.12`
- `torch` (checked with 2.5.1)
## Citation
```bibtex
@inproceedings{gosal_choose_teacher_2026,
title = {How to Choose Your Teacher for Fine Grained Image Recognition},
author = {Gosal, Oswin and Rios, Edwin Arkel and Surya, Augusto Christian and Mikael, Fernando and
Lai, Bo-Cheng and Hu, Min-Chun},
booktitle = {The 13th Workshop on Fine-Grained Visual Categorization (FGVC13) at CVPR 2026},
note = {Non-archival extended abstract},
year = {2026},
eprint = {2605.15689},
archivePrefix = {arXiv},
primaryClass = {cs.CV},
doi = {10.48550/arXiv.2605.15689},
url = {https://arxiv.org/abs/2605.15689}
}
```
|