SAVRN
Search Contact SAVRN

Open-weight model · Image classification

vit-base-oxford-iiit-pets

by Ilias Strub ISxOdin/vit-base-oxford-iiit-pets

This model is a fine-tuned version of google/vit-base-patch16-224 on the pcuenq/oxford-pets dataset.

Parameters86M
Context
Weights343.3 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads175.4k

Runs On

What it takes to serve vit-base-oxford-iiit-pets (86M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.2 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By Ilias Strub, published under apache-2.0, revision 6fcb4ce433d4.

This model is a fine-tuned version of google/vit-base-patch16-224 on the pcuenq/oxford-pets dataset. It achieves the following results on the evaluation set: This model is a fine-tuned version of a pre-trained Vision Transformer (google/vit-base-patch16-224) for image classification on the Oxford-IIIT Pet Dataset. It uses transfer learning to adapt a generic vision model to identify 37 different cat and dog breeds. The model head is adjusted to output the number of classes in the dataset, and it is trained end-to-end using standard classification loss. - Educational demos on transfer learning and fine-tuning vision models. - Pet breed classification in structured datasets similar to Oxford…

Read Ilias Strub's full model card

This model is a fine-tuned version of google/vit-base-patch16-224 on the pcuenq/oxford-pets dataset. It achieves the following results on the evaluation set: - Loss: 0.1924 - Accuracy: 0.9445

Model description

This model is a fine-tuned version of a pre-trained Vision Transformer (google/vit-base-patch16-224) for image classification on the Oxford-IIIT Pet Dataset. It uses transfer learning to adapt a generic vision model to identify 37 different cat and dog breeds. The model head is adjusted to output the number of classes in the dataset, and it is trained end-to-end using standard classification loss.


Intended uses & limitations

Intended Uses: - Educational demos on transfer learning and fine-tuning vision models. - Pet breed classification in structured datasets similar to Oxford Pets. - Comparative analysis with zero-shot models like CLIP.

Limitations: - May not generalize well to breeds outside of the Oxford-IIIT dataset. - Not suitable for real-world medical or safety-critical applications. - Input images should be clear, centered, and close in style to the training data (cropped pet portraits).

Training and evaluation data

The model is trained and evaluated on the Oxford-IIIT Pet Dataset, which contains 7,349 images of cats and dogs spanning 37 different breeds. The dataset includes equal representation of pets and was split into training, validation, and test sets. Evaluation metrics used include accuracy, precision, and recall.

Training procedure

Training hyperparameters

The following hyperparameters were used during training: - learning_rate: 0.0003 - train_batch_size: 16 - eval_batch_size: 8 - seed: 42 - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments - lr_scheduler_type: linear - num_epochs: 5

Training results

Training Loss Epoch Step Validation Loss Accuracy
0.3716 1.0 370 0.3013 0.9242
0.2048 2.0 740 0.2342 0.9310
0.1764 3.0 1110 0.2124 0.9350
0.1617 4.0 1480 0.2050 0.9350
0.1235 5.0 1850 0.2032 0.9350

Zero-Shot Classification Evaluation (CLIP)

Evaluated the Oxford-IIIT Pet dataset using a zero-shot image classification model: openai/clip-vit-base-patch32. Instead of training, the CLIP model was evaluated using a list of breed names (e.g., "Siamese", "Persian", "Chihuahua") as candidate labels for zero-shot classification.

Evaluation Results:

  • Accuracy: 0.8800
  • Precision: 0.8768
  • Recall: 0.8800

Framework versions

  • Transformers 4.50.0
  • Pytorch 2.6.0+cu124
  • Datasets 3.4.1
  • Tokenizers 0.21.1

Configuration

Architecture
ViTForImageClassification
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Stored precision
float32
Model type
vit

Identity and Version

Repository
ISxOdin/vit-base-oxford-iiit-pets
Publisher
Ilias Strub
Task
Image classification
Modality
Image
Library
transformers
Parameters
86M parameters
Languages
vit
Revision
6fcb4ce433d4b43a19bd9b4d2d906b2646858d45
First published
2025-04-01
Last updated
2025-04-11

Files and Weights

8 files, 343.4 MB in total. The weights are 2 files totalling 343.3 MB in bin, safetensors.

Weights2 files · 343.3 MB
Configuration2 files · 2.8 KB
Documentation1 file · 3.4 KB
Other2 files · 13.1 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights343.3 MB 534df4dd01c2
training_args.binWeights5.4 KB d33510da3843
config.jsonConfiguration2.5 KB
preprocessor_config.jsonConfiguration351 B
README.mdDocumentation3.4 KB
runs/Apr01_15-21-10_ip-10-192-10-121/events.out.tfevents.1743520871.ip-10-192-10-121.15731.0Other12.7 KB 1053f1d82f57
runs/Apr01_15-21-10_ip-10-192-10-121/events.out.tfevents.1743521355.ip-10-192-10-121.15731.1Other411 B 425f0f5ca67a
.gitattributesRepository1.5 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
343.3 MB
Download from Ilias Strub

Released by Ilias Strub through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published343.3 MB
16-bit0.2 GB
8-bit0.1 GB
4-bit0.0 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About vit-base-oxford-iiit-pets

How much GPU memory does vit-base-oxford-iiit-pets need?

About 0.2 GB at 16-bit and 0.1 GB at 4-bit: the weights (86M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run vit-base-oxford-iiit-pets on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use vit-base-oxford-iiit-pets commercially?

Yes. vit-base-oxford-iiit-pets is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Image classification

nsfw-classifier

Giacomo Arienti

In today's digital world, user-generated content is a double-edged sword. While it fosters creativity and engagement, it also opens the door to inappropriate or illegal content being shared. Our NSFW Image Classifier is specifically designed to identify and filter out explicit images, including pornography, hentai, and sexually suggestive content, ensuring your platform remains safe, secure, and legally compliant. With more than 2M downloads, our NSFW Image Classifier has become the go-to solution for platforms looking to maintain a clean and safe environment for their users. Many developers and companies have already chosen our solution to protect their communities—will you be next? 1.…

Open weights cc-by-nc-nd-4.0 86M parameters transformers

Model · Image classification

nsfw_image_detection

Falcons.ai

The Fine-Tuned Vision Transformer (ViT) is a variant of the transformer encoder architecture, similar to BERT, that has been adapted for image classification tasks. This specific model, named "google/vit-base-patch16-224-in21k," is pre-trained on a substantial collection of images in a supervised manner, leveraging the ImageNet-21k dataset. The images in the pre-training dataset are resized to a resolution of 224x224 pixels, making it suitable for a wide range of image recognition tasks. During the training phase, meticulous attention was given to hyperparameter settings to ensure optimal model performance. The model was fine-tuned with a judiciously chosen batch size of 16. This choice not…

Open weights apache-2.0 86M parameters transformers

Model · Image classification

gender-classification

Rizvan Dwikifirdaus

Autogenerated by HuggingPics Create your own image classifier for anything by running the demo on Google Colab. Report any issues with the demo at the github repo.

Open weights 86M parameters transformers

Model · Image classification

rorshark-vit-base

Chester Enright

This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the imagefolder dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 2e-05 - trainbatchsize: 8 - evalbatchsize: 8 - lrschedulertype: linear - numepochs: 5.0 - Transformers 4.36.0.dev0 - Pytorch 2.1.1+cu118 - Datasets 2.15.0 - Tokenizers 0.15.0

Open weights apache-2.0 86M parameters transformers