YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
Lucario-K17/biomedclip_radiology_diagnosis
Multi-label medical image diagnosis model fine-tuned on chest X-rays to predict 14 common pathologies.
Built on top of BioViL-CLIP, pretrained by Microsoft.
Overview
Lucario-K17/biomedclip_radiology_diagnosis
predicts 14 key thoracic disease labels from chest X-rays.
It is fine-tuned from Microsoftโs BioViL-CLIP, using paired image-report data, and achieves >90% accuracy across all labels.
- Based on Microsoftโs pretrained BioViL-CLIP (ViT-B/32 + PubMedBERT)
- Supports multi-label predictions
- Optimized for chest radiology
- Evaluated on NIH ChestX-ray14 and MIMIC-CXR subsets
Disease Labels Predicted (14)
['Atelectasis', 'Cardiomegaly', 'Effusion', 'Infiltration', 'Mass',
'Nodule', 'Pneumonia', 'Pneumothorax', 'Consolidation', 'Edema',
'Emphysema', 'Fibrosis', 'Pleural Thickening', 'Hernia', 'Normal']
Setup Instructions
pip install torch torchvision transformers huggingface_hub pillow
Inference Example
import torch
from transformers import AutoProcessor, AutoModelForImageClassification
from huggingface_hub import hf_hub_download
from PIL import Image
# Load model
model = AutoModelForImageClassification.from_pretrained("Lucario-K17/biomedclip_radiology_diagnosis")
processor = AutoProcessor.from_pretrained("Lucario-K17/biomedclip_radiology_diagnosis")
# Load and preprocess image
img = Image.open("test_image.png").convert("RGB")
inputs = processor(images=img, return_tensors="pt")
# Predict
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits)
# Threshold and print predictions
labels = model.config.id2label.values()
predictions = {label: float(prob) for label, prob in zip(labels, probs[0])}
for label, score in sorted(predictions.items(), key=lambda x: x[1], reverse=True):
print(f"{label}: {score:.2%}")
Fine-tuning Details
Param | Value |
---|---|
Base Model | BioViL-CLIP (ViT-B/32 + PubMedBERT) |
Epochs | 10 |
Optimizer | AdamW |
Learning Rate | 2e-5 |
Batch Size | 32 |
Loss Function | BCEWithLogitsLoss |
Dataset Used | NIH ChestX-ray14 + MIMIC-CXR pairs |
Evaluation Metrics
Based on the Microsoft BioViL-CLIP baseline and fine-tuned results:
Metric | Value |
---|---|
Mean Accuracy | > 90.0% |
Macro AUC | 0.915 |
Macro F1 | 0.901 |
Average Precision | 0.912 |
Each of the 14 labels scored >90% accuracy, verified on balanced validation sets.
Citation (MIT-GA Style)
Please cite or link this model if used in your project or publication:
@misc{lucario2025biomedclip,
title = {BioMedCLIP Chest Radiology Diagnosis Model},
author = {Kishore Murugan},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Lucario-K17/biomedclip_radiology_diagnosis}},
note = {Licensed under MIT-GA; link or citation required for use}
}
License
MIT-GA License
You are free to use, modify, and distribute this model for any purpose,
including commercial, provided that you give proper credit by citing the model
or linking to: https://huggingface.co/Lucario-K17/biomedclip_radiology_diagnosis
The software is provided "AS IS", without warranty of any kind.
๐ Acknowledgements
- Pretrained Base: Microsoft BioViL-CLIP
- Transformer models: Hugging Face ๐ค
- Datasets:
- NIH ChestX-ray14
- MIMIC-CXR (image-report pairs)
Hugging Face Model Page
- Downloads last month
- 526
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support