Run this model with HF Jobs

Run ArchitRastogi/vit-food-classifier-3class on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/ArchitRastogi/vit-food-classifier-3class. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/ArchitRastogi/vit-food-classifier-3class on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

ViT-Chef β€” Fine-tuned Vision Transformer for Food Classification

A fine-tuned Vision Transformer (ViT) model trained to classify pizza, steak, and sushi images. Achieves 96% accuracy on the test set, demonstrating the strong performance of transfer learning for visual food recognition.


Model Details

  • Base model: google/vit-base-patch16-224-in21k
  • Input size: 224 Γ— 224
  • Classes: ["pizza", "steak", "sushi"]
  • Accuracy: 96% (Test set)
  • Training: 5-fold cross-validation with AdamW optimizer and early stopping
  • Dataset: Custom curated set (225 train, 75 test)

Usage

from transformers import ViTImageProcessor, ViTForImageClassification
from PIL import Image
import torch

model = ViTForImageClassification.from_pretrained("archit/vit-chef")
processor = ViTImageProcessor.from_pretrained("archit/vit-chef")

image = Image.open("example.jpg")
inputs = processor(images=image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits
pred = logits.argmax(-1).item()

print(model.config.id2label[pred])

Results

Metric Baseline Fine-tuned Improvement
Accuracy 46.67% 96.00% +49.33 pp
Error Reduction β€” 92.5% β€”

Downloads last month
136
Safetensors
Model size
85.8M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for ArchitRastogi/vit-food-classifier-3class

Finetuned
(2,598)
this model