Downloads · 30 days
6
2% of all-time downloads
Gaykar/clip-food-model
clip-food-model is a zero-shot image classification model from Gaykar. Use it for the zero-shot image classification task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-2.0.
This model is a fine-tuned version of OpenAI CLIP trained for food image-text retrieval tasks. The model learns semantic alignment between food images and natural language captions, enabling multimodal retrieval and s…
Downloads · 30 days
6
2% of all-time downloads
All-time downloads
315
Public
Parameters
151M
605 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors605 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of OpenAI CLIP trained for food image-text retrieval tasks. The model learns semantic alignment between food images and natural language captions, enabling multimodal retrieval and similarity matching.
The model was fine-tuned using a custom food dataset containing paired food images and captions. The primary objective of this project is to improve food image understanding and text-image embedding alignment for retrieval-based applications.
This project focuses on multimodal representation learning using contrastive learning with CLIP architecture.
This model can be directly used for:
Example applications:
The model can be integrated into larger systems such as:
The embeddings generated by the model can also be used for clustering, similarity search, and recommendation pipelines.
This model is not intended for:
The model may also perform poorly on:
The model inherits limitations from the base CLIP model and the training dataset.
Potential limitations include:
The retrieval quality is strongly influenced by the diversity and quality of the caption dataset.
Users should:
from transformers import CLIPProcessor, CLIPModel
from PIL import Image
import torch
model = CLIPModel.from_pretrained("Gaykar/clip-food-model")
processor = CLIPProcessor.from_pretrained("Gaykar/clip-food-model")
image = Image.open("food.jpg")
inputs = processor(
text=["a delicious pizza"],
images=image,
return_tensors="pt",
padding=True
)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image
probs = logits_per_image.softmax(dim=1)
print(probs)
The model was trained on a custom food image-caption dataset containing food images paired with textual descriptions.
Dataset preparation included:
The dataset contains multiple food categories with semantic caption supervision.
The model was fine-tuned using the Hugging Face Transformers library with PyTorch backend.
Preprocessing steps included:
Evaluation was performed on a held-out test split from the food image-caption dataset.
The test data consisted of unseen food image-caption pairs.
Evaluation considered:
The model was evaluated using:
Future improvements may include:
The fine-tuned model demonstrated improved semantic alignment between food images and captions compared to baseline zero-shot CLIP retrieval on the custom dataset.
The model successfully learned domain-specific food representations and improved retrieval consistency.
The project demonstrates effective fine-tuning of CLIP for multimodal food retrieval tasks using custom image-caption supervision.
The model performs well for semantic food search and retrieval-oriented applications.
The model generates joint image-text embeddings using contrastive learning principles.
Embedding similarity analysis shows that semantically related food images and captions cluster closer in vector space after fine-tuning.
Carbon emissions can be estimated using the Machine Learning Impact calculator.
Hardware Type: NVIDIA T4 GPU
Cloud Provider: Google Colab / Local GPU
Compute Region: India
Carbon Emitted: Unknown
This model is based on the CLIP (Contrastive Language-Image Pretraining) architecture.
Architecture components include:
Training objective:
@article{radford2021learning,
title={Learning Transferable Visual Models From Natural Language Supervision},
author={Radford, Alec and Kim, Jong Wook and Hallacy, Chris and others},
journal={arXiv preprint arXiv:2103.00020},
year={2021}
}
Radford, A., Kim, J. W., Hallacy, C., et al. (2021). Learning Transferable Visual Models From Natural Language Supervision. arXiv preprint arXiv:2103.00020.
This project was developed as a multimodal AI research and engineering project focused on semantic food retrieval systems using CLIP fine-tuning techniques.
Future improvements may include:
Atharva Gaykar
Atharva Gaykar [email protected]