Downloads · 30 days
32
1% of all-time downloads
ashaduzzaman/vit-finetuned-food101
vit-finetuned-food101 is a image classification model from ashaduzzaman. Use it when you need a label for an image. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
32
1% of all-time downloads
All-time downloads
2.5K
Public
Parameters
85.9M
1.4 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors344 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the Food-101 dataset. The Vision Transformer (ViT) architecture is leveraged for image classification tasks, particularly for recognizing and categorizing food items.
The model achieves the following results on the evaluation set:
The model was fine-tuned on the Food-101 dataset, which consists of 101,000 images across 101 different food categories. Each category contains 1,000 images, with 750 used for training and 250 for testing. The dataset includes diverse food items but may be skewed towards certain cuisines or food types.
The model was fine-tuned using the following hyperparameters:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 2.7649 | 0.992 | 62 | 2.5733 | 0.831 |
| 1.888 | 2.0 | 125 | 1.7770 | 0.883 |
| 1.6461 | 2.976 | 186 | 1.6262 | 0.896 |
To run inference using this model, you can load an image from the Food-101 dataset and classify it as follows:
from datasets import load_dataset
from transformers import pipeline
from PIL import Image
import requests
from io import BytesIO
# Load a sample image from the internet
image_url = "https://example.com/path-to-your-image.jpg" # Replace with your image URL
response = requests.get(image_url)
image = Image.open(BytesIO(response.content))
# Load the fine-tuned model for image classification
classifier = pipeline(
"image-classification",
model="ashaduzzaman/vit-finetuned-food101"
)
# Run inference
result = classifier(image)
print(result)
If you use this model in your work, please cite it as:
@misc{vit_finetuned_food101,
author = {Ashaduzzaman},
title = {ViT Fine-tuned on Food-101},
year = {2024},
url = {https://huggingface.co/ashaduzzaman/vit-finetuned-food101},
}