Instructions to use moxeeeem/pubmedclip-gpt2-captioner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moxeeeem/pubmedclip-gpt2-captioner with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="moxeeeem/pubmedclip-gpt2-captioner")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("moxeeeem/pubmedclip-gpt2-captioner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -5,6 +5,7 @@ tags:
|
|
| 5 |
- CLIP
|
| 6 |
- GPT-2
|
| 7 |
- dermatology
|
|
|
|
| 8 |
library_name: transformers
|
| 9 |
license: other
|
| 10 |
language:
|
|
@@ -12,20 +13,22 @@ language:
|
|
| 12 |
pipeline_tag: image-to-text
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
Trained in two stages: Stage A (META) for generalization and Stage B (SkinCAP) for style/terminology.
|
| 19 |
|
| 20 |
|
| 21 |
## Metrics
|
| 22 |
**Stage A (META)**
|
| 23 |
-
val_loss=1.
|
| 24 |
-
BLEU=36.
|
| 25 |
|
| 26 |
**Stage B (SKINCAP)**
|
| 27 |
-
val_loss=1.
|
| 28 |
-
BLEU=
|
| 29 |
|
| 30 |
## Inference
|
| 31 |
|
|
@@ -53,16 +56,22 @@ for c in caps:
|
|
| 53 |
## Files
|
| 54 |
| File | Size | Check |
|
| 55 |
|---|---:|---|
|
| 56 |
-
| `best_stageA.pt` | 2 GB | sha256[:12]=
|
| 57 |
-
| `best_stageB.pt` | 2 GB | sha256[:12]=
|
| 58 |
-
| `final_captioner_gpt2-
|
| 59 |
-
| `final_captioner_gpt2-
|
| 60 |
-
| `
|
| 61 |
|
| 62 |
## Details
|
| 63 |
|
| 64 |
-
- **
|
|
|
|
|
|
|
| 65 |
- **Prefix tokens**: 32
|
| 66 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
_Auto-generated on 2025-08-
|
|
|
|
| 5 |
- CLIP
|
| 6 |
- GPT-2
|
| 7 |
- dermatology
|
| 8 |
+
- pubmedclip
|
| 9 |
library_name: transformers
|
| 10 |
license: other
|
| 11 |
language:
|
|
|
|
| 13 |
pipeline_tag: image-to-text
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# PubMedCLIP + GPT-2 Dermatology Captioner
|
| 17 |
|
| 18 |
+
A dermatology image captioning model combining PubMedCLIP vision encoder with gpt2-medium language model. Trained on dermatological images for generating clinical descriptions of skin lesions.
|
| 19 |
+
|
| 20 |
+
**Architecture**: PubMedCLIP (ViT-B/32) → learnable prefix → GPT-2 (`gpt2-medium`).
|
| 21 |
Trained in two stages: Stage A (META) for generalization and Stage B (SkinCAP) for style/terminology.
|
| 22 |
|
| 23 |
|
| 24 |
## Metrics
|
| 25 |
**Stage A (META)**
|
| 26 |
+
val_loss=1.1222 • PPL=3.07
|
| 27 |
+
BLEU=36.6 • ROUGE-L=0.521 • CIDEr-D=0.10 • CLIP=34.7 • BERT_F1=0.526
|
| 28 |
|
| 29 |
**Stage B (SKINCAP)**
|
| 30 |
+
val_loss=1.1997 • PPL=3.32
|
| 31 |
+
BLEU=9.3 • ROUGE-L=0.267 • CIDEr-D=0.12 • CLIP=40.5 • BERT_F1=0.348
|
| 32 |
|
| 33 |
## Inference
|
| 34 |
|
|
|
|
| 56 |
## Files
|
| 57 |
| File | Size | Check |
|
| 58 |
|---|---:|---|
|
| 59 |
+
| `best_stageA.pt` | 2 GB | sha256[:12]=4c3f773c92f9 |
|
| 60 |
+
| `best_stageB.pt` | 2 GB | sha256[:12]=2b1b7e6aaa8f |
|
| 61 |
+
| `final_captioner_gpt2-medium_TimmModel.json` | 899 B | sha256[:12]=40f3fb250eab |
|
| 62 |
+
| `final_captioner_gpt2-medium_TimmModel.pt` | 2 GB | sha256[:12]=799a4d1b831d |
|
| 63 |
+
| `loss_biomedclip_pubmedbert.png` | 112 KB | sha256[:12]=92c3b8dfdf7f |
|
| 64 |
|
| 65 |
## Details
|
| 66 |
|
| 67 |
+
- **Vision Encoder**: PubMedCLIP (ViT-B/32)
|
| 68 |
+
- **Language Model**: GPT-2 (`gpt2-medium`)
|
| 69 |
+
- **CLIP weights**: `hf-hub:microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224`
|
| 70 |
- **Prefix tokens**: 32
|
| 71 |
+
- **Training prompt**: `Describe the skin lesion concisely (morphology, color, scale, border, location) in one sentence.Conclude with the most likely diagnosis (1–3 words).`
|
| 72 |
+
|
| 73 |
+
### Model Type Detection
|
| 74 |
+
- Detected as: `pubmedclip`
|
| 75 |
+
- Repository: `moxeeeem/pubmedclip-gpt2-captioner`
|
| 76 |
|
| 77 |
+
_Auto-generated on 2025-08-30 06:06 UTC._
|