Downloads · 30 days
18
0% of all-time downloads
brucewayne0459/paligemma_derm
paligemma_derm is a image-text-to-text model from brucewayne0459. Use it for the image-text-to-text 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 apache-2.0.
This model, based on the PaliGemma-3B architecture, has been fine-tuned for dermatology-related image and text processing tasks. The model is designed to assist in the identification of various skin conditions using a…
Downloads · 30 days
18
0% of all-time downloads
All-time downloads
4K
Public
Parameters
2.9B
11.7 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors11.7 GB · 100%
From the Hugging Face model README
This model, based on the PaliGemma-3B architecture, has been fine-tuned for dermatology-related image and text processing tasks. The model is designed to assist in the identification of various skin conditions using a combination of image analysis and natural language processing.
The model can be directly used for analyzing dermatology images, providing insights into potential skin conditions.
Skin Tone Bias: The model may have been trained on a dataset that does not adequately represent all skin tones, potentially leading to biased results. Geographic Bias: The model's performance may vary depending on the prevalence of certain conditions in different geographic regions.
import torch
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
from PIL import Image
# Load the model and processor
model_id = "brucewayne0459/paligemma_derm"
processor = AutoProcessor.from_pretrained(model_id)
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id, device_map={"": 0})
model.eval()
# Load a sample image and text input
input_text = "Identify the skin condition?"
input_image_path = " Replace with your actual image path"
input_image = Image.open(input_image_path).convert("RGB")
# Process the input
inputs = processor(text=input_text, images=input_image, return_tensors="pt", padding="longest").to("cuda" if torch.cuda.is_available() else "cpu")
# Set the maximum length for generation
max_new_tokens = 50
# Run inference
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=max_new_tokens)
# Decode the output
decoded_output = processor.decode(outputs[0], skip_special_tokens=True)
print("Model Output:", decoded_output)
The model was fine-tuned on a dataset of dermatological images combined with disease names
The model was fine-tuned using LoRA (Low-Rank Adaptation) for more efficient training. Mixed precision (bfloat16) was used to speed up training and reduce memory usage.
The model was evaluated on a separate validation set of dermatological images and Disease Names, distinct from the training data.
The model achieved a final validation loss of approximately 0.2214, indicating reasonable performance in predicting skin conditions based on the dataset used.
Bruce_Wayne