MedSigLIP TB Classifier
Fine-tuned MLP classifier head on top of Google's MedSigLIP-448 vision encoder for tuberculosis detection from chest X-rays.
Performance
| Metric | Test Set |
|---|---|
| AUC | 0.9975 |
| Sensitivity | 96.2% |
| Specificity | 98.5% |
| F1 Score | 0.944 |
| PPV | 92.7% |
| NPV | 99.3% |
Architecture
- Encoder: MedSigLIP-448 (frozen, 1152-dim embeddings)
- Classifier: 3-layer MLP (1152 โ 512 โ 128 โ 2) with ReLU, dropout=0.3, batch norm
- Training: 20 epochs, Adam (lr=1e-3), CrossEntropyLoss
- Training time: 7.6 seconds on RTX 4090
Training Data
- TBX11K: 8,812 images
- Shenzhen CXR: 662 images
- Montgomery County: 138 images
- Total: 9,342 chest X-rays (7,426 train / 957 val / 959 test)
3-Way Benchmark
| Method | AUC | Sensitivity | Specificity |
|---|---|---|---|
| Random baseline | 0.231 | 0.0% | 100% |
| MedSigLIP zero-shot | 0.837 | 77.2% | 75.7% |
| Fine-tuned (this model) | 0.9975 | 96.2% | 98.5% |
Usage
from tbscan.classifier import TBClassifier
from PIL import Image
classifier = TBClassifier(
model_id="google/medsiglip-448",
classifier_path="classifier.pt"
)
classifier.load()
image = Image.open("chest_xray.png").convert("RGB")
result = classifier.classify(image)
print(f"TB Probability: {result['prob_tb']:.1%}")
Part of TBScan
Built for the MedGemma Impact Challenge 2026. TBScan is an AI-powered TB screening system for low-resource clinics.
โ ๏ธ Research and educational purposes only. Not validated for clinical use.
Model tree for hongtai91/medsiglip-tb-classifier
Base model
google/medsiglip-448