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...
Model source
Source description
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.
Sources
1 sourceVerified Sep 17
Model artifacts
1 artifactSource excerpts
2 excerptsThis 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]
--- library_name: transformers license: cc-by-2.0 language: - en --- # Model Card for Fine-Tuned CLIP Food Retrieval Model ## Model Details ### Model Description 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. * **Developed by:** Atharva Gaykar * **Funded by [optional]:** Self-funded academic/research project * **Shared by [optional]:** Atharva Gaykar * **Model type:** Vision-Language Model (CLIP Fine-Tuned Retrieval Model) * **Language(s) (NLP):** English * **License:** CC-BY-2.0 * **Finetuned from model [optional]:** openai/clip-vit-base-patch32 ### Model Sources [optional] * **Repository:** [Add Your GitHub Repository Link] * **Paper [optional]:** https://arxiv.org/abs/2103.00020 * **Demo [optional]:** [Add Demo Link if Available] --- # Uses ## Direct Use This model can be directly used for: * Food image-to-text retrieval * Text-to-food image retrieval * Semantic food search * Food recommendation systems * Image similarity matching * Multimodal embedding generation Example applications: * AI-powered food search engines * Smart restaurant menu systems * Food recommendation assistants * Vision-language research projects --- ## Downstream Use [optional] The model can be integrated into larger systems such as: * FastAPI-based retrieval APIs * FAISS vector search systems * Food recognition applications * Mobile food search apps * Multimodal recommendation engines The embeddings generated by the model can also be used for clustering, similarity search, and recommendation pipelines. --- ## Out-of-Scope Use This model is not intended for: * Medical diagnosis * Nutritional estimation * Sensitive biometric analysis * Surveillance applications * Safety-critical decision systems The model may also perform poorly on: * Non-food images * Extremely low-quality images * Highly ambiguous or abstract captions *...
Source context: 10 downloads · 2 likes · Pipeline zero-shot-image-classification · Library transformers · Repo Gaykar/clip-food-model