Image Classification
timm
PyTorch
vision-transformer
knowledge-distillation
feature-distillation
model-compression
interpretability
explainability
representation-analysis
encoding-mismatch
spectral-energy-pattern
spectral-kd
low-rank
pca
svd
deit-tiny
distilled-deit-tiny
cait-s24
lift
widelast
icml-2026
Eval Results (legacy)
Instructions to use Huiyuancs/Encoding_Mismatch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use Huiyuancs/Encoding_Mismatch with timm:
import timm model = timm.create_model("hf_hub:Huiyuancs/Encoding_Mismatch", pretrained=True) - Notebooks
- Google Colab
- Kaggle
File size: 10,694 Bytes
334fe98 ab22fd3 334fe98 8fe8729 ab22fd3 | 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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | ---
license: apache-2.0
library_name: timm
pipeline_tag: image-classification
datasets:
- ILSVRC/imagenet-1k
metrics:
- accuracy
tags:
- vision-transformer
- image-classification
- knowledge-distillation
- feature-distillation
- model-compression
- interpretability
- explainability
- representation-analysis
- encoding-mismatch
- spectral-energy-pattern
- spectral-kd
- low-rank
- pca
- svd
- deit-tiny
- distilled-deit-tiny
- cait-s24
- lift
- widelast
- pytorch
- timm
- icml-2026
- arxiv:2511.15572
model-index:
- name: Lift
results:
- task:
type: image-classification
name: Image Classification
dataset:
type: ILSVRC/imagenet-1k
name: ImageNet-1K
split: validation
metrics:
- type: accuracy
name: Top-1 Accuracy (%)
value: 77.53
source:
name: ICML 2026 paper, Table 2
url: https://arxiv.org/abs/2511.15572
- name: WideLast
results:
- task:
type: image-classification
name: Image Classification
dataset:
type: ILSVRC/imagenet-1k
name: ImageNet-1K
split: validation
metrics:
- type: accuracy
name: Top-1 Accuracy (%)
value: 78.23
source:
name: ICML 2026 paper, Table 2
url: https://arxiv.org/abs/2511.15572
---
# From Per-Image Low-Rank to Encoding Mismatch
This repository releases the **Lift** and **WideLast** checkpoints from the ICML 2026 paper:
> **From Per-Image Low-Rank to Encoding Mismatch: Rethinking Feature Distillation in Vision Transformers**
> Huiyuan Tian, Bonan Xu, and Shijian Li
The paper studies why feature distillation between heterogeneous Vision Transformers can remain difficult even when individual feature maps are strongly low-rank. Its analysis distinguishes:
- **Per-image low-rank structure**, measured by sample-wise singular value decomposition (SVD).
- **Dataset-level representational structure**, measured by PCA over features from many images.
- **Spectral Energy Patterns (SEP)**, which characterize how feature energy is distributed across channels.
The central finding is an **encoding mismatch**: compact students and wider teachers can encode dataset-level information using substantially different channel-space geometries. Two simple architecture modifications reduce this mismatch:
- **Lift** retains a linear endpoint projector that lifts the student's final representation from 192 to 384 channels.
- **WideLast** widens only the last transformer block from 192 to 384 channels.
## Links
- [Paper on arXiv](https://arxiv.org/abs/2511.15572)
- [Paper on OpenReview](https://openreview.net/forum?id=2Ud1nkQrVZ)
- [Official code, analysis scripts, raw numeric data, and training recipes](https://github.com/thy960112/From-Per-Image-Low-Rank-to-Encoding-Mismatch)
- [ICML 2026 poster](https://huggingface.co/Huiyuancs/Encoding_Mismatch/blob/main/icml_poster.pdf)
## Released Checkpoints
| Checkpoint | File | Architecture | Distillation recipe | ImageNet-1K top-1 |
| ---------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------- | ----------------: |
| Lift | [`models/Lift/pytorch_model.pth`](https://huggingface.co/Huiyuancs/Encoding_Mismatch/blob/main/models/Lift/pytorch_model.pth) | DeiT-Tiny-derived student with a retained 192β384 endpoint projector | SoftKD + SpectralKD, CaiT-S24 teacher | **77.53%** |
| WideLast | [`models/WideLast/pytorch_model.pth`](https://huggingface.co/Huiyuancs/Encoding_Mismatch/blob/main/models/WideLast/pytorch_model.pth) | DeiT-Tiny-derived student with blocks 1β11 at 192 dimensions and block 12 at 384 dimensions | SoftKD + MSE, CaiT-S24 teacher | **78.23%** |
The reported baseline distilled DeiT-Tiny accuracy is **74.86%** under the paper's experimental protocol.
## Model Details
### Shared setting
- **Task:** ImageNet-1K image classification
- **Input resolution:** 224 Γ 224
- **Student family:** DeiT-Tiny-derived Vision Transformer
- **Teacher:** CaiT-S24
- **Framework:** PyTorch and `timm`
- **Training duration:** 300 epochs
- **Primary metric:** ImageNet-1K validation top-1 accuracy
These models use custom architectures and checkpoint-loading code from the accompanying GitHub repository. They are **not** packaged as `transformers.AutoModel` checkpoints and are not expected to run directly through the Hugging Face hosted inference widget.
### Lift
Lift preserves the standard 192-dimensional DeiT-Tiny transformer blocks and adds a learned linear projection at the student endpoint:
$$
\mathbb{R}^{192} \rightarrow \mathbb{R}^{384}.
$$
Unlike a training-only projector, this layer is retained at inference. The released Lift checkpoint corresponds to the **SoftKD + SpectralKD** result reported in Table 2 of the paper.
### WideLast
WideLast keeps the first eleven transformer blocks at 192 channels and widens only the final block to 384 channels. The final block uses six attention heads, while the preceding 192-dimensional blocks use three heads. The released WideLast checkpoint corresponds to the **SoftKD + MSE** result reported in Table 2.
## Evaluation Results
### Main ImageNet-1K results
| Student | Distillation objective | Top-1 accuracy |
| ---------------------------- | ----------------------- | -------------: |
| Distilled DeiT-Tiny baseline | Original baseline | 74.86% |
| Lift | SoftKD | 77.23% |
| Lift | SoftKD + MSE | 77.50% |
| **Lift** | **SoftKD + SpectralKD** | **77.53%** |
| WideLast | SoftKD | 77.88% |
| WideLast | SoftKD + SpectralKD | 78.16% |
| **WideLast** | **SoftKD + MSE** | **78.23%** |
### Inference cost
| Model | Parameters | Change vs. baseline | FLOPs | Change vs. baseline |
| ---------------------------- | ---------: | ------------------: | -----: | ------------------: |
| Distilled DeiT-Tiny baseline | 5,717,416 | β | 2.507G | β |
| Lift | 5,983,528 | +4.65% | 2.536G | +1.17% |
| WideLast | 7,239,016 | +26.61% | 3.089G | +23.20% |
Results are taken from the paper. Reproduction can vary with software versions, distributed-training configuration, data access, and numerical nondeterminism.
## Installation
Clone the implementation repository and install its dependencies:
```bash
git clone https://github.com/thy960112/From-Per-Image-Low-Rank-to-Encoding-Mismatch.git
cd From-Per-Image-Low-Rank-to-Encoding-Mismatch
conda create -n encoding-mismatch python=3.10 -y
conda activate encoding-mismatch
pip install -r requirements.txt
pip install huggingface_hub
```
Download this Hugging Face repository:
```python
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="Huiyuancs/Encoding_Mismatch",
local_dir="./Encoding_Mismatch",
)
```
Expected checkpoint paths:
```text
Encoding_Mismatch/
βββ models/
βββ Lift/
β βββ pytorch_model.pth
βββ WideLast/
βββ pytorch_model.pth
```
## Data Preparation
The evaluation and training scripts expect ImageNet-1K in the standard `ImageFolder` layout:
```text
/path/to/ILSVRC/
βββ train/
βββ val/
```
ImageNet is not redistributed with this repository. Users must obtain it under the dataset's applicable terms.
## Evaluate the Released Checkpoints
Run these commands from the cloned GitHub repository.
### Lift
```bash
cd training/lift
python main.py \
--eval \
--resume /absolute/path/to/Encoding_Mismatch/models/Lift/pytorch_model.pth \
--data-path /path/to/ILSVRC \
--model deit_tiny_patch16_224 \
--batch-size 256 \
--num_workers 8 \
--use-modified-student \
--expansion-start-layer 11 \
--expansion-type step \
--expansion-use-ln \
--expansion-target-dim 384
```
### WideLast
```bash
cd training/widelast
python main.py \
--eval \
--resume /absolute/path/to/Encoding_Mismatch/models/WideLast/pytorch_model.pth \
--data-path /path/to/ILSVRC \
--model deit_tiny_patch16_224 \
--batch-size 256 \
--num_workers 8 \
--custom-arch \
--arch-schedule heads_step
```
The repository's evaluation code expects a PyTorch checkpoint dictionary containing a `model` state dictionary.
## Reproduce Training
Set the dataset and distributed-training configuration:
```bash
export DATA_PATH=/path/to/ILSVRC
export GPUS=0,1,2,3
export NPROC=4
```
Train the released Lift recipe:
```bash
cd training/lift
bash scripts/run_cait_softkd_spectralkd.sh
```
Train the released WideLast recipe:
```bash
cd training/widelast
bash scripts/run_cait_softkd_mse.sh
```
Additional ablation recipes are available in the `training/lift/scripts/` and `training/widelast/scripts/` directories.
## Analysis Artifacts and Raw Data
The official GitHub repository includes:
- sample-wise SVD analysis;
- dataset-level PCA analysis;
- Spectral Energy Pattern analysis;
- SEP permutation-robustness analysis;
- scripts for regenerating figures and tables;
- prepared `.npz` and `.csv` numeric results in [`Raw data`](https://github.com/thy960112/From-Per-Image-Low-Rank-to-Encoding-Mismatch/tree/main/Raw%20data).
See the [ICML 2026 poster](https://huggingface.co/Huiyuancs/Encoding_Mismatch/blob/main/icml_poster.pdf) for a compact visual overview.
## Intended Use
The checkpoints are intended for:
- research on feature and knowledge distillation in Vision Transformers;
- analysis of teacherβstudent representation mismatch;
- controlled ImageNet-1K evaluation of Lift and WideLast;
- studies of low-rank structure, dataset-level subspaces, and spectral channel statistics;
- reproduction and extension of the ICML 2026 paper.
## Citation
```bibtex
@inproceedings{tian2026encodingmismatch,
title = {From Per-Image Low-Rank to Encoding Mismatch:
Rethinking Feature Distillation in Vision Transformers},
author = {Tian, Huiyuan and Xu, Bonan and Li, Shijian},
booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
year = {2026}
}
```
## License
This Hugging Face repository is marked as **Apache-2.0**. Users are responsible for complying with the licenses and terms of the code dependencies, ImageNet-1K, and any upstream assets. |