--- license: mit tags: - image-classification - vision-transformer - cifar-100 - lora - peft - fine-tuning datasets: - cifar100 metrics: - accuracy model-index: - name: ViT-S-CIFAR100-LoRA results: - task: type: image-classification dataset: name: CIFAR-100 type: cifar100 metrics: - name: Accuracy type: accuracy value: 88.26 --- # 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 ```python 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.