Downloads · 30 days
21
7% of all-time downloads
DhruvParth/openai-clip-vit-base-patch32-skinRash-FineTuned
openai-clip-vit-base-patch32-skinRash-FineTuned is a feature extraction model from DhruvParth. Use it when you need embeddings to search or compare text. It is set up for transformers.
This model is a fine-tuned version of the CLIP model combining a vision model (openai/clip-vit-base-patch32) with a text model (roberta-base). The model is fine-tuned to better handle image-text matching tasks, utiliz…
Downloads · 30 days
21
7% of all-time downloads
All-time downloads
282
Public
Parameters
213M
852 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors852 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of the CLIP model combining a vision model (openai/clip-vit-base-patch32) with a text model (roberta-base). The model is fine-tuned to better handle image-text matching tasks, utilizing a variety of training strategies for enhanced performance.
Model fine tuned for Project: DermAi-Viz
This model card describes a Vision-Text Dual Encoder model fine-tuned from the original openai/clip-vit-base-patch32 and roberta-base models. The model is specifically adapted for tasks that involve joint processing of images and textual descriptions, leveraging both the image encoding capabilities of the CLIP model and the language understanding of RoBERTa.
This model can be directly used for image-text matching tasks, such as searching for relevant images based on a textual query or generating captions for images.
The model can be further fine-tuned for specific tasks such as image classification with text guidance, visual question answering, or any other task that benefits from multi-modal inputs.
This model is not suitable for tasks unrelated to image and text processing. It may also not perform well on non-English texts or images outside the scope of the fine-tuning data.
As with most large models, this model may inherit biases present in the pretraining datasets. Users should be cautious when deploying this model in sensitive applications, particularly where fairness and bias are of concern. Additionally, the model's performance might degrade on data that is significantly different from the training data, especially in terms of cultural, linguistic, or visual context.
Users should validate the model's performance on their specific use case, particularly looking for biases in the model's predictions. Additional fine-tuning with a carefully curated dataset may be necessary to mitigate biases. It's also recommended to monitor the model's outputs regularly to ensure its predictions remain relevant and unbiased.
from transformers import VisionTextDualEncoderModel, VisionTextDualEncoderProcessor
# Load the model and processor
model = VisionTextDualEncoderModel.from_pretrained("your-username/clip-roberta-finetuned")
processor = VisionTextDualEncoderProcessor.from_pretrained("your-username/clip-roberta-finetuned")
# Example usage
inputs = processor(text=["a photo of a cat"], images=["path_to_image.jpg"], return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image
The model was fine-tuned on a custom dataset containing paired image-text data, focusing on diverse skin tones and various diseases. This dataset includes high-resolution images of dermatological conditions along with descriptive captions. The training data was carefully preprocessed to ensure high quality, with images resized, normalized, and tokenized text inputs.
The fine-tuning process was conducted on a GPU-accelerated environment, leveraging the following setup and hyperparameters:
roberta-base tokenizer.fp16) training to optimize memory and computation.The fine-tuning process was conducted on a system with the following specifications:
<--- The evaluation was conducted on a held-out test set, which included images and captions not seen during training. The test set was designed to be diverse, representing various skin tones and dermatological conditions. ---->
The primary evaluation metric was eval_loss. Additionally, accuracy and recall metrics were used to assess the model's ability to correctly match images with their corresponding textual descriptions.
The model showed robust performance on the test set, particularly excelling in scenarios where both the image and text inputs were well-aligned with the training data. However, performance may vary with data significantly different from the training set.
Carbon emissions were monitored using Weights & Biases, with the following estimates:
The model integrates CLIP's vision encoder (clip-vit-base-patch32) with RoBERTa's language model (roberta-base) in a dual encoder setup. The objective was to fine-tune this model to improve its performance on image-text matching tasks, specifically within the medical domain, focusing on dermatological images.
BibTeX:
@inproceedings{parthasarathy2024cliproberta,
title={Fine-Tuned Vision-Text Dual Encoder Model for Image-Text Matching},
author={Parthasarathy, Dhruv},
year={2024},
howpublished={\url{https://huggingface.co/your-username/clip-roberta-finetuned}},
}
This model card was prepared by Dhruv Parthasarathy.
For questions or issues with the model, please contact [email protected] or linkedin.com/in/parthadhruv/.