Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: google/vit-base-patch16-224
|
| 5 |
+
tags:
|
| 6 |
+
- image-classification
|
| 7 |
+
- cifar10
|
| 8 |
+
- computer-vision
|
| 9 |
+
- vision-transformer
|
| 10 |
+
- transfer-learning
|
| 11 |
+
metrics:
|
| 12 |
+
- accuracy
|
| 13 |
+
model-index:
|
| 14 |
+
- name: vit-base-cifar10-augmented
|
| 15 |
+
results:
|
| 16 |
+
- task:
|
| 17 |
+
type: image-classification
|
| 18 |
+
name: Image Classification
|
| 19 |
+
dataset:
|
| 20 |
+
name: CIFAR-10
|
| 21 |
+
type: cifar10
|
| 22 |
+
metrics:
|
| 23 |
+
- type: accuracy
|
| 24 |
+
value: 0.9554
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# vit-base-cifar10-augmented
|
| 28 |
+
|
| 29 |
+
This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the [CIFAR-10 dataset](https://www.cs.toronto.edu/~kriz/cifar.html) using data augmentation.
|
| 30 |
+
|
| 31 |
+
It achieves the following results on the evaluation set:
|
| 32 |
+
- **Loss:** 0.0445
|
| 33 |
+
- **Accuracy:** 95.54%
|
| 34 |
+
|
| 35 |
+
## 🧠 Model Description
|
| 36 |
+
|
| 37 |
+
The base model is a Vision Transformer (ViT) originally trained on ImageNet-21k. This version has been fine-tuned on CIFAR-10, a standard image classification benchmark, using PyTorch and Hugging Face Transformers.
|
| 38 |
+
|
| 39 |
+
Training was done using extensive **data augmentation**, including random crops, flips, rotations, and color jitter to improve generalization on small input images (32×32, resized to 224×224).
|
| 40 |
+
|
| 41 |
+
## ✅ Intended Uses & Limitations
|
| 42 |
+
|
| 43 |
+
### Intended uses
|
| 44 |
+
- Educational and research use on small image classification tasks
|
| 45 |
+
- Benchmarking transfer learning for ViT on CIFAR-10
|
| 46 |
+
- Demonstrating the impact of data augmentation on fine-tuning performance
|
| 47 |
+
|
| 48 |
+
### Limitations
|
| 49 |
+
- Not optimized for real-time inference
|
| 50 |
+
- Fine-tuned only on CIFAR-10; not suitable for general-purpose image classification
|
| 51 |
+
- Requires resized input (224×224)
|
| 52 |
+
|
| 53 |
+
## 📦 Training and Evaluation Data
|
| 54 |
+
|
| 55 |
+
- **Dataset**: [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html)
|
| 56 |
+
- **Size**: 60,000 images (10 classes)
|
| 57 |
+
- **Split**: 75% training, 25% test
|
| 58 |
+
|
| 59 |
+
All images were resized to 224×224 and normalized using ViT’s original mean/std values.
|
| 60 |
+
|
| 61 |
+
## ⚙️ Training Procedure
|
| 62 |
+
|
| 63 |
+
### Hyperparameters
|
| 64 |
+
|
| 65 |
+
- Learning rate: `1e-4`
|
| 66 |
+
- Optimizer: `Adam`
|
| 67 |
+
- Batch size: `8`
|
| 68 |
+
- Epochs: `10`
|
| 69 |
+
- Scheduler: `ReduceLROnPlateau`
|
| 70 |
+
|
| 71 |
+
### Data Augmentation Used
|
| 72 |
+
- `RandomResizedCrop(224)`
|
| 73 |
+
- `RandomHorizontalFlip()`
|
| 74 |
+
- `RandomRotation(10)`
|
| 75 |
+
- `ColorJitter(brightness=0.2, contrast=0.2, saturation=0.2, hue=0.1)`
|
| 76 |
+
|
| 77 |
+
### Training Results
|
| 78 |
+
|
| 79 |
+
| Epoch | Training Loss | Test Accuracy |
|
| 80 |
+
|-------|---------------|---------------|
|
| 81 |
+
| 1 | 0.1969 | 94.62% |
|
| 82 |
+
| 2 | 0.1189 | 95.05% |
|
| 83 |
+
| 3 | 0.0899 | **95.54%** |
|
| 84 |
+
| 4 | 0.0720 | 94.68% |
|
| 85 |
+
| 5 | 0.0650 | 94.84% |
|
| 86 |
+
| 6 | 0.0576 | 94.76% |
|
| 87 |
+
| 7 | 0.0560 | 95.33% |
|
| 88 |
+
| 8 | 0.0488 | 94.31% |
|
| 89 |
+
| 9 | 0.0499 | 95.42% |
|
| 90 |
+
| 10 | 0.0445 | 94.33% |
|
| 91 |
+
|
| 92 |
+
## 🧪 Framework Versions
|
| 93 |
+
|
| 94 |
+
- `transformers`: 4.50.0
|
| 95 |
+
- `torch`: 2.6.0+cu124
|
| 96 |
+
- `datasets`: 3.4.1
|
| 97 |
+
- `tokenizers`: 0.21.1
|