CoolFace
Modelpublic

ERISLab/TokenReductionPT

sourceHugging Faceupdated 2d agoView on Hugging Face
0likes
Model Card

TokenReductionPT: token reduction and cross-layer cache aggregation for fine-grained recognition

These are the checkpoints behind Cross-Layer Cache Aggregation for Token Reduction in Ultra-Fine-Grained Image Recognition (arXiv:2501.00243), ICASSP 2025, and behind its extension, in preparation. Vision transformers are fine-tuned with a token-reduction method (EViT, TopK, DynamicViT, ATS, ToMe, PatchMerger, SiT, DPC-KNN and the FGIR-aware MAWS, DMAWS, EDAR, NFEDAR and GLSF criteria), with and without cross-layer cache aggregation (CLCA). CLCA adds a cross-layer aggregation head (CLA) and a cross-layer cache (CLC) that keeps information from discarded tokens. Code: arkel23/TokenReductionPT.

2656 checkpoints, one per configuration, each the last epoch of one training run. 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: dataset, model (reduction method as prefix), keep rate, cla for the aggregation head, clc_1 for the cache, and the serial. Load them with fgir-zoo. The collection groups this repo with the ICASSP 2025 paper.

Layout

One folder per serial. setting is bl (no CLCA), cla (aggregation head only) or clca (head and cache). "Extension" is the extension of the ICASSP 2025 paper, in preparation.

FolderWhatUsed inFilesMean accuracy
serial_30CLCA main results: EViT and the plain ViT-B, nine pretrainings, bl/cla/clca, 448 pxICASSP 2025, extension40558.04
serial_31Plain ViT-B, two pretrainings, bl/cla, on CUB and Aircraft, 448 pxICASSP 2025, extension889.74
serial_1513 reduction methods x bl/clca, DeiT-T, 224 pxextension70265.39
serial_1613 reduction methods x bl/clca, DeiT-S, 224 pxextension70271.68
serial_6213 reduction methods x bl/clca, DeiT-T, 448 pxextension70273.37
serial_408TopK, DeiT-T, CUB, 288 px, keep rates 0.25-1.0extension477.01
serial_20DMAWS with CLCA, six ViT-B pretrainings, cotton and soybean datasets, 448 pxextension9375.47
serial_21ImageNet-1k: EViT and the five FGIR-aware criteria, DeiT-T/S/B, 224 pxextension4074.25

manifest.csv lists every file with its dataset, model, method, backbone, keep rate, setting, serial, seed, image size, class count, accuracy, the papers that use it, SHA-256 and size. The 224 px ablations of the ICASSP 2025 paper have no released checkpoints.

Load a checkpoint and classify an image

python
import torch
from PIL import Image
from torchvision import transforms
from fgir_zoo import tokenred

model = tokenred.create_model('serial_62/cub_evit_deit_tiny_patch16_224.fb_in1k_0.7_cla_clc_1_62')
cfg = model.config
# evaluation at 448 px resizes to a square without cropping
tf = transforms.Compose([
    transforms.Resize((cfg.input_size, cfg.input_size),
                      interpolation=transforms.InterpolationMode.BICUBIC),
    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.9315

Accuracy of the released checkpoints

Top-1 accuracy (%) is the run's own test accuracy after the last epoch, as logged in training. The papers average three seeds; where a configuration ran with several seeds, the released file is the seed with the highest accuracy, so the papers' tables can differ slightly. Per-file accuracy is in manifest.csv; 1 file has no recorded accuracy (serial_16/cub_edar_deit_small_patch16_224.fb_in1k_0.7_16). The table below covers serial_30, the ICASSP 2025 main results; method none is the plain ViT without token reduction.

Method, keep rate, settingBackbonecottonsoyageingsoygenesoyglobalsoylocal
evit 0.1 bldeit3_base_patch16_224.fb_in1k18.3366.4857.9930.0029.17
evit 0.1 bldeit3_base_patch16_224.fb_in22k_ft_in1k20.8364.3638.2512.1321.00
evit 0.1 bldeit_base_patch16_224.fb_in1k22.0871.7056.8116.9433.67
evit 0.1 blvit_base_patch16_224.dino27.0872.5747.8629.7229.00
evit 0.1 blvit_base_patch16_224.in1k_mocov328.7566.1040.893.8529.50
evit 0.1 blvit_base_patch16_224.mae10.4222.5937.313.8918.00
evit 0.1 blvit_base_patch16_224.orig_in21k35.4273.2957.1039.0333.67
evit 0.1 blvit_base_patch16_224_miil.in21k17.5069.5249.0221.5727.67
evit 0.1 blvit_base_patch16_clip_224.laion2b16.6758.9522.423.9026.50
evit 0.1 cladeit3_base_patch16_224.fb_in1k46.2586.3676.1560.2751.67
evit 0.1 cladeit3_base_patch16_224.fb_in22k_ft_in1k51.6787.2177.1751.4850.50
evit 0.1 cladeit_base_patch16_224.fb_in1k40.4283.1571.9646.9448.33
evit 0.1 clavit_base_patch16_224.dino52.0885.2370.5258.5747.33
evit 0.1 clavit_base_patch16_224.in1k_mocov340.0081.0366.4441.7644.17
evit 0.1 clavit_base_patch16_224.mae43.3378.7366.7258.0017.83
evit 0.1 clavit_base_patch16_224.orig_in21k55.8385.4570.8241.7351.67
evit 0.1 clavit_base_patch16_224_miil.in21k46.2579.8864.3552.9252.50
evit 0.1 clavit_base_patch16_clip_224.laion2b55.0087.6872.7065.6259.67
evit 0.1 clcadeit3_base_patch16_224.fb_in1k61.2587.3169.3561.9957.50
evit 0.1 clcadeit3_base_patch16_224.fb_in22k_ft_in1k56.6788.4276.7262.5653.67
evit 0.1 clcadeit_base_patch16_224.fb_in1k53.3385.6074.6559.0356.83
evit 0.1 clcavit_base_patch16_224.dino54.1785.4971.6160.8048.67
evit 0.1 clcavit_base_patch16_224.in1k_mocov349.1782.8969.1549.4847.50
evit 0.1 clcavit_base_patch16_224.mae25.4285.5465.3424.2542.67
evit 0.1 clcavit_base_patch16_224.orig_in21k54.5883.7871.3448.7451.67
evit 0.1 clcavit_base_patch16_224_miil.in21k55.0085.0771.9555.7151.17
evit 0.1 clcavit_base_patch16_clip_224.laion2b54.5889.3576.9758.1062.17
evit 0.7 bldeit3_base_patch16_224.fb_in1k37.5076.8166.7229.3833.83
evit 0.7 bldeit3_base_patch16_224.fb_in22k_ft_in1k35.0073.4153.066.6032.67
evit 0.7 bldeit_base_patch16_224.fb_in1k54.5882.2669.7533.3547.83
evit 0.7 blvit_base_patch16_224.dino40.4276.9555.7533.2041.00
evit 0.7 blvit_base_patch16_224.in1k_mocov355.8376.2258.582.1046.33
evit 0.7 blvit_base_patch16_224.mae15.4273.4120.8821.9336.33
evit 0.7 blvit_base_patch16_224.orig_in21k59.1779.6460.2839.5446.33
evit 0.7 blvit_base_patch16_224_miil.in21k40.0076.3248.9432.0137.33
evit 0.7 blvit_base_patch16_clip_224.laion2b7.5051.3715.258.899.67
evit 0.7 cladeit3_base_patch16_224.fb_in1k62.0888.7780.9758.5155.33
evit 0.7 cladeit3_base_patch16_224.fb_in22k_ft_in1k61.6786.8976.8053.5853.83
evit 0.7 cladeit_base_patch16_224.fb_in1k67.9287.8279.4059.1558.83
evit 0.7 clavit_base_patch16_224.dino68.3388.4073.2660.7557.83
evit 0.7 clavit_base_patch16_224.in1k_mocov365.8386.8374.3253.1358.33
evit 0.7 clavit_base_patch16_224.mae59.5890.6777.4751.3857.83
evit 0.7 clavit_base_patch16_224.orig_in21k58.7586.5171.7555.2655.17
evit 0.7 clavit_base_patch16_224_miil.in21k59.5887.0973.3964.0059.00
evit 0.7 clavit_base_patch16_clip_224.laion2b60.8389.9640.5757.2461.00
evit 0.7 clcadeit3_base_patch16_224.fb_in1k66.6788.0880.1859.8655.83
evit 0.7 clcadeit3_base_patch16_224.fb_in22k_ft_in1k62.5086.5173.7652.0559.00
evit 0.7 clcadeit_base_patch16_224.fb_in1k65.8388.6578.9362.3760.17
evit 0.7 clcavit_base_patch16_224.dino67.0888.1475.1264.6559.17
evit 0.7 clcavit_base_patch16_224.in1k_mocov365.8387.1575.2655.9059.00
evit 0.7 clcavit_base_patch16_224.mae57.9290.5174.3441.4054.83
evit 0.7 clcavit_base_patch16_224.orig_in21k64.1785.8474.6556.8157.33
evit 0.7 clcavit_base_patch16_224_miil.in21k65.0086.5972.4660.1758.83
evit 0.7 clcavit_base_patch16_clip_224.laion2b68.3391.2779.4862.6462.83
none bldeit3_base_patch16_224.fb_in1k47.9276.4066.2326.3233.83
none bldeit3_base_patch16_224.fb_in22k_ft_in1k35.0072.5952.8815.3832.33
none bldeit_base_patch16_224.fb_in1k56.2581.9072.8439.3444.00
none blvit_base_patch16_224.dino43.7575.5655.4235.7239.50
none blvit_base_patch16_224.in1k_mocov355.4276.7156.561.8646.00
none blvit_base_patch16_224.mae28.7574.1230.8210.5622.50
none blvit_base_patch16_224.orig_in21k58.7579.7061.9037.3949.00
none blvit_base_patch16_224_miil.in21k31.6775.2146.0635.3136.50
none blvit_base_patch16_clip_224.laion2b7.0840.9512.699.6114.17
none cladeit3_base_patch16_224.fb_in1k66.6787.7480.8858.8257.00
none cladeit3_base_patch16_224.fb_in22k_ft_in1k62.0885.5875.5252.2251.67
none cladeit_base_patch16_224.fb_in1k66.2587.4980.3663.8357.83
none clavit_base_patch16_224.dino68.3388.0275.6261.3057.83
none clavit_base_patch16_224.in1k_mocov367.5086.6976.1355.3559.33
none clavit_base_patch16_224.mae65.0090.0477.2351.4160.50
none clavit_base_patch16_224.orig_in21k65.0087.1772.0156.6657.83
none clavit_base_patch16_224_miil.in21k60.4287.1974.5964.5256.17
none clavit_base_patch16_clip_224.laion2b53.3390.9376.5955.2159.33
none clcadeit3_base_patch16_224.fb_in1k67.5088.0480.7161.7559.50
none clcadeit3_base_patch16_224.fb_in22k_ft_in1k59.5887.2179.0059.4350.33
none clcadeit_base_patch16_224.fb_in1k69.5888.7981.0462.4963.17
none clcavit_base_patch16_224.dino68.3388.0872.4964.7459.50
none clcavit_base_patch16_224.in1k_mocov365.0087.3776.7657.2958.83
none clcavit_base_patch16_224.mae52.9290.3276.4253.3260.50
none clcavit_base_patch16_224.orig_in21k65.0086.2674.5558.4657.00
none clcavit_base_patch16_224_miil.in21k61.6787.1774.7361.3056.83
none clcavit_base_patch16_clip_224.laion2b65.8390.7177.1362.9563.50

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{rios_cross-layer_2025,
  title         = {Cross-Layer Cache Aggregation for Token Reduction in Ultra-Fine-Grained Image Recognition},
  author        = {Rios, Edwin Arkel and Yuanda, Jansen Christopher and Ghanz, Vincent Leon and
                   Yu, Cheng-Wei and Lai, Bo-Cheng and Hu, Min-Chun},
  booktitle     = {IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
  year          = {2025},
  eprint        = {2501.00243},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV},
  doi           = {10.48550/arXiv.2501.00243},
  url           = {https://arxiv.org/abs/2501.00243}
}