ViT-B/16 fine-tuned on ImageNet-C corruptions

torchvision's vit_b_16 (pretrained weights ViT_B_16_Weights.IMAGENET1K_V1), fully fine-tuned once on clean ImageNet and once on each ImageNet-C corruption and severity: 41 runs, covering 8 corruptions (brightness, contrast, defocus_blur, gaussian_noise, glass_blur, motion_blur, pixelate, snow). The 1000-class ImageNet head is kept.

Files

Each run <run> (clean, or <corruption>_s<severity> such as brightness_s1) has:

  • finetuned_vit16_<run>_best.pth: the weights with the best validation accuracy (evaluated 4 times per epoch)
  • finetuned_vit16_<run>_epoch{1,2,3}.pth: the weights at the end of each epoch
  • finetuned_vit16_<run>_history.json: train loss, train accuracy and validation accuracy at each evaluation; step 0 is the pretrained model before fine-tuning

Each .pth file is a plain PyTorch state_dict for torchvision.models.vit_b_16.

Usage

import torch
from huggingface_hub import hf_hub_download
from torchvision.models import vit_b_16, ViT_B_16_Weights

path = hf_hub_download("Austout/vit-b16-imagenet-c", "finetuned_vit16_brightness_s1_best.pth")
model = vit_b_16()
model.load_state_dict(torch.load(path, map_location="cpu", weights_only=True))
model.eval()

# ImageNet-C images are already 224x224 crops, so skip the default resize to 256:
preprocess = ViT_B_16_Weights.IMAGENET1K_V1.transforms(resize_size=224)
# For full-size photos (the clean run), use the default resize to 256 + center crop to 224:
# preprocess = ViT_B_16_Weights.IMAGENET1K_V1.transforms()

To download every file into a local folder: hf download Austout/vit-b16-imagenet-c --local-dir checkpoints

Training

  • Data: booooorb/imagenet-c-splits, one train/validation split per run
  • Full fine-tune with AdamW: learning rate 1e-5, weight decay 0.05, batch size 32, 3 epochs
  • Schedule: linear warmup over the first 10% of steps, then cosine decay to 0
  • Loss: cross-entropy

Results

Validation accuracy of each run before fine-tuning (pretrained) and at its best checkpoint.

Run Corruption Severity Pretrained Best Best at epoch
clean clean – 81.38% 81.60% 2
brightness_s1 brightness 1 79.66% 81.02% 2.5
brightness_s2 brightness 2 79.24% 80.88% 2
brightness_s3 brightness 3 77.86% 79.80% 1.25
brightness_s4 brightness 4 75.20% 79.28% 2
brightness_s5 brightness 5 71.88% 78.06% 1.75
contrast_s1 contrast 1 76.96% 80.54% 1.25
contrast_s2 contrast 2 74.70% 79.66% 2
contrast_s3 contrast 3 70.54% 78.64% 1.75
contrast_s4 contrast 4 53.60% 75.62% 2.5
contrast_s5 contrast 5 18.32% 68.94% 2.75
defocus_blur_s1 defocus_blur 1 68.32% 77.88% 2
defocus_blur_s2 defocus_blur 2 62.72% 75.82% 2
defocus_blur_s3 defocus_blur 3 51.98% 71.60% 2
defocus_blur_s4 defocus_blur 4 41.20% 67.70% 2.75
defocus_blur_s5 defocus_blur 5 31.28% 62.66% 2.5
gaussian_noise_s1 gaussian_noise 1 75.58% 79.20% 1.75
gaussian_noise_s2 gaussian_noise 2 71.56% 76.46% 2
gaussian_noise_s3 gaussian_noise 3 64.76% 73.44% 2.25
gaussian_noise_s4 gaussian_noise 4 51.98% 67.94% 2
gaussian_noise_s5 gaussian_noise 5 34.62% 59.94% 3
glass_blur_s1 glass_blur 1 69.56% 78.96% 1.75
glass_blur_s2 glass_blur 2 61.14% 76.46% 1.5
glass_blur_s3 glass_blur 3 39.26% 71.16% 1.75
glass_blur_s4 glass_blur 4 32.86% 68.30% 3
glass_blur_s5 glass_blur 5 24.74% 63.74% 2.25
motion_blur_s1 motion_blur 1 74.48% 79.88% 2
motion_blur_s2 motion_blur 2 69.28% 78.24% 2
motion_blur_s3 motion_blur 3 58.46% 75.70% 1.5
motion_blur_s4 motion_blur 4 44.34% 72.70% 1.75
motion_blur_s5 motion_blur 5 35.38% 71.00% 2.75
pixelate_s1 pixelate 1 76.86% 80.36% 2
pixelate_s2 pixelate 2 74.76% 80.24% 1.75
pixelate_s3 pixelate 3 69.24% 78.78% 2
pixelate_s4 pixelate 4 55.14% 76.30% 1.25
pixelate_s5 pixelate 5 39.62% 74.76% 1.75
snow_s1 snow 1 69.86% 78.02% 2.5
snow_s2 snow 2 55.62% 72.98% 2
snow_s3 snow 3 59.90% 73.94% 1.75
snow_s4 snow 4 49.38% 70.88% 2.25
snow_s5 snow 5 41.90% 70.04% 1.75
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train Austout/vit-b16-imagenet-c