Instructions to use danielaxv3/lungcv-xray-multilabel-v32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use danielaxv3/lungcv-xray-multilabel-v32 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://danielaxv3/lungcv-xray-multilabel-v32") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
LungCV v3.2 β Multitask + Multi-label (production)
Multi-label chest X-ray finding classifier with an auxiliary lung-segmentation head: v2's proven segmentation-aided training recipe + v3's independent sigmoid output design + OOD rejection. Each finding (NORMAL / PNEUMONIA / COVID / TB) is scored independently; films where nothing crosses the reporting threshold are flagged uncertain; films far from the training distribution are flagged out-of-distribution.
Research prototype only β not a medical diagnosis.
Head-to-head vs v2 (864 held-out tiles, identical inputs, same patient-wise split)
| Metric | v2 multitask | v3.2 |
|---|---|---|
| Argmax accuracy | 88.4% | 89.8% |
| Macro-F1 | 0.892 | 0.903 |
| NORMAL | 68.0% | 71.6% |
| COVID | 96.0% | 97.6% |
| PNEUMONIA | 99.6% | 99.6% |
| TB | 92.1% | 91.2% |
| Unfamiliar films (5 CC0) | 1/5 (20%) | 3/5 (60%) |
| Uncertain-flag rate (familiar) | β (always answers) | 6.4% |
Own-validation (1,800 images): 89.4% accuracy, macro-F1 0.894.
Architecture
- Backbone: EfficientNetB0 (ImageNet), frozen head training then two-stage fine-tune (top 40 encoder layers unfrozen, BatchNorm frozen, Adam 1e-5)
- Heads: GAP β Dropout(0.3) β Dense(4, sigmoid) (binary cross-entropy) + U-Net-style segmentation decoder (weight 0.3, ground-truth + U-Net pseudo-masks)
- Training data: 12,000 balanced tiles (3,000/finding) from 7 public datasets, patient-wise 70/15/15 split (seed 42)
- OOD: per-class centroids in the 1,280-d GAP feature space; threshold 9.85 (95th percentile of train distances)
Preprocessing contract
- Grayscale
- Resize 224Γ224 (no crop, no CLAHE)
- Replicate to 3 channels, raw [0,255] (EfficientNetB0 built-in rescaling)
Files
best_v32.kerasβ the model (77 MB, classifier + segmentation head)metrics.json,preprocessing_config.json(includesood_distance_threshold),class_names.json,ood_centroids.json,confusion_matrix.png
Model history
| Version | Design | Familiar acc (shared cohort) | Unfamiliar |
|---|---|---|---|
| v1 | EfficientNetB0 softmax | β | β |
| v2 | multitask softmax | 88.4% | 20% |
| v3 | DenseNet121 + CLAHE, sigmoid, no seg head | 79.8% | 60% |
| v3.2 | multitask + sigmoid + OOD | 89.8% | 60% |
The v3 experiment isolated the lessons that built v3.2: CLAHE hurt NORMAL recall (kept out), the seg-head learning signal matters (brought back), the sigmoid + OOD design is the differentiator (kept).
- Downloads last month
- 39