Image Classification
Transformers
Safetensors
vit
Generated from Trainer
vision-transformer
stanford-cars
transfer-learning
Eval Results (legacy)
Instructions to use shalaado/vit-stanford-cars with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shalaado/vit-stanford-cars with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="shalaado/vit-stanford-cars") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("shalaado/vit-stanford-cars") model = AutoModelForImageClassification.from_pretrained("shalaado/vit-stanford-cars") - Notebooks
- Google Colab
- Kaggle
vit-stanford-cars
This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the Stanford Cars dataset.
It was produced as part of a course assignment to compare:
- Fine-tuned ViT (this model)
- Zero-shot CLIP baseline
- OpenAI vision baseline
Quick-run evaluation (CPU subset run) reported:
- Loss:
5.2723 - Accuracy:
0.0
Model description
The model predicts one of the official Stanford Cars fine-grained classes (196 total classes in the full dataset taxonomy).
Intended uses & limitations
Intended use:
- Educational benchmarking and demonstration of transfer learning on car classification.
Limitations:
- Quick subset run; accuracy is not representative of a full training run.
- May produce unstable predictions on unseen distributions.
- Not suitable for safety-critical or production decisions.
Training and evaluation data
Dataset:
- Source:
tanganke/stanford_cars - Full taxonomy:
196classes
Preprocessing:
- RGB conversion
- ViT
AutoImageProcessornormalization and resizing label -> labelsinteger mapping for supervised fine-tuning
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 1
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 5.2685 | 1.0 | 32 | 5.2723 | 0.0 |
Reproducibility notes
This checkpoint is intended as a minimum viable trained model for submission completeness. For better performance, retrain on the full Stanford Cars train split with more epochs.
Framework versions
- Transformers 5.5.4
- Pytorch 2.11.0+cpu
- Datasets 4.8.4
- Tokenizers 0.22.2
- Downloads last month
- 12
Model tree for shalaado/vit-stanford-cars
Base model
google/vit-base-patch16-224-in21kSpace using shalaado/vit-stanford-cars 1
Evaluation results
- accuracy on Stanford Carsself-reported0.000
- loss on Stanford Carsself-reported5.272