maceythm/vit-90-animals
vit-90-animals
Model description
This model is a fine-tuned Vision Transformer version of google/vit-base-patch16-224 on the animal image dataset from kaggle - trained to classify images into 90 different animal species. It achieves high accuracy on unseen data and was trained using supervised learning. The model can be used for general-purpose image classification in the animal domain and serves as a comparison baseline for zero-shot classification models such as CLIP.
The model achieves the following results on the evaluation set:
- Loss: 0.0840
- Accuracy: 0.9796
Intended uses & limitations
Intended uses
- Animal image classification (educational, demo, prototyping)
- Benchmarking against zero-shot classification models
- Use in Gradio interfaces or image analysis tools
Limitations
- The model is limited to the 90 animal classes it was trained on
- It may not generalize well to image domains outside of its training distribution
- Performance can degrade with poor image quality or occlusions
Training and evaluation data
The model was trained on a dataset containing 5,400 animal images categorized into 90 distinct classes. The dataset was obtained from Kaggle and according to the creator originally sourced from Google Images. The training/validation/test split was 80/10/10, and the label distribution is relatively balanced across classes.
Evaluation was conducted on the test split and compared to results from a zero-shot model (openai/clip-vit-large-patch14) using the same label set.
Training procedure
- Base model: google/vit-base-patch16-224
- Fine-tuning method: Supervised training using the Hugging Face Trainer class
- Data augmentation: Applied during training (e.g., RandomHorizontalFlip, ColorJitter)
- Training time: ~5 epochs with and without augmentation
- Optimizer: AdamW (default settings)
- Evaluation metrics: Accuracy, precision, and recall
- Best performance (no augmentation): 98.3% test accuracy
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0003
- trainbatchsize: 16
- evalbatchsize: 8
- seed: 42
- optimizer: Use adamwtorch with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
- lrschedulertype: linear
- num_epochs: 5
Training results
Framework versions
- Transformers 4.50.0
- Pytorch 2.6.0+cu124
- Datasets 3.4.1
- Tokenizers 0.21.1
