ViT-S Fine-tuned on CIFAR-100 with LoRA

This model is a Vision Transformer Small (ViT-S/16) pretrained on ImageNet and fine-tuned on CIFAR-100 using LoRA (Low-Rank Adaptation) via the PEFT library.

Model Details

  • Base Model: vit_small_patch16_224 (timm)
  • Dataset: CIFAR-100 (100 classes)
  • Fine-tuning Method: LoRA (PEFT)
  • LoRA Configuration:
    • Rank: 8
    • Alpha: 8
    • Dropout: 0.1
    • Target Modules: QKV attention weights

Training Details

  • Epochs: 10
  • Batch Size: 16
  • Learning Rate: 0.0001
  • Optimizer: AdamW
  • Scheduler: Cosine Annealing with Warmup

Results

  • Best Validation Accuracy: 88.26%

Usage

import timm
from peft import PeftModel, LoraConfig
import torch

# Load base model
base_model = timm.create_model('vit_small_patch16_224', pretrained=True, num_classes=100)

# Load fine-tuned weights
checkpoint = torch.load('best_model.pth', map_location='cpu')
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()

Assignment Info

This model was trained as part of DLops Assignment 5.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train anchitya/vit-cifar100-lora

Evaluation results