Downloads · 30 days
103
6% of all-time downloads
a1mohamadd/lung-disease-detection
lung-disease-detection is a image classification model from a1mohamadd. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
A multi-model chest X-ray analysis system for lung segmentation, healthy/unhealthy screening, and disease subtype classification.
Downloads · 30 days
103
6% of all-time downloads
All-time downloads
1.7K
Public
Repo size
1.4 GB
Likes
1
Public
Click a slice to open those files.
.keras602 MB · 73%
From the Hugging Face model README
A multi-model chest X-ray analysis system for lung segmentation, healthy/unhealthy screening, and disease subtype classification.
This repository contains the deployable Keras and ONNX artifacts used by the public Lung Disease Detection web application and FastAPI inference service.
| Resource | Description |
|---|---|
| Launch Web App | Interactive chest X-ray analysis interface |
| Open API Space | FastAPI and ONNX Runtime inference service |
| View Source Repository | Application, research, deployment, MLOps, and testing code |
| Explore Research Lab | Research methodology, experiments, and results |
| View Dataset | COVID-19 Radiography Database on Kaggle |
The system uses a multi-stage inference pipeline:
Chest X-ray
|
v
U-Net/Xception lung segmentation
|
|-- binary lung mask
|-- lung ROI
|-- mask overlay
v
Healthy/unhealthy ensemble
|
|-- DenseNet121
|-- EfficientNetV2B3
|-- InceptionV3
|-- MobileNetV3
v
Final binary prediction
|
+-- Healthy
|
+-- Unhealthy
|
v
DenseNet121 disease classifier
|
|-- COVID-19
|-- Viral Pneumonia
+-- Lung Opacity
The four binary classifiers produce unhealthy probabilities that are averaged to create the final ensemble probability.
Disease subtype classification runs only when the ensemble predicts an unhealthy chest X-ray.
| Model | Task | Version | Formats |
|---|---|---|---|
| U-Net/Xception | Lung segmentation | v1.0 | Keras, ONNX |
| DenseNet121 | Healthy/unhealthy classification | v1.0 | Keras, ONNX |
| EfficientNetV2B3 | Healthy/unhealthy classification | v2.0 | Keras, ONNX |
| InceptionV3 | Healthy/unhealthy classification | v3.0 | Keras, ONNX |
| MobileNetV3 | Healthy/unhealthy classification | v3.0 | Keras, ONNX |
| DenseNet121 | Disease subtype classification | v1.0 | Keras, ONNX |
healthy_unhealthy/
|-- densenet/
|-- efficientnet/
|-- inception/
+-- mobilenet/
diseases/
+-- densenet/
segmentation/
+-- unet_xception/
Each model directory contains:
metadata.yaml inference contractThe metadata defines model paths, preprocessing, input dimensions, thresholds, output labels, and reported metrics.
The pipeline accepts chest X-ray images in common formats such as:
Images are:
256 x 256DICOM input is not currently supported.
The complete API response can contain:
| Label | Class |
|---|---|
0 | Healthy |
1 | Unhealthy |
| Label | Class |
|---|---|
0 | COVID |
1 | Viral Pneumonia |
2 | Lung Opacity |
| Label | Class |
|---|---|
0 | Background |
1 | Lung |
These values come from the metadata associated with each individual model. They are not combined ensemble metrics.
| Model | Accuracy | Dice | IoU |
|---|---|---|---|
| U-Net/Xception | 0.9885 | 0.9660 | 0.9533 |
| Model | AUC | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|
| DenseNet121 | 0.9711 | 0.9212 | 0.9183 | 0.9308 | 0.9245 |
| EfficientNetV2B3 | 0.9871 | 0.9550 | 0.9641 | 0.9448 | Not reported |
| InceptionV3 | 0.9699 | 0.9171 | 0.9244 | 0.9077 | Not reported |
| MobileNetV3 | 0.9730 | 0.9214 | 0.9259 | 0.9153 | Not reported |
| Model | AUC | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|
| DenseNet121 | 0.9982 | 0.9763 | 0.9781 | 0.9763 | 0.9782 |
The models were developed using the COVID-19 Radiography Database.
The source dataset contains four classes:
For binary classification, the labels are remapped as:
Normal -> Healthy
COVID
Viral Pneumonia
Lung Opacity -> Unhealthy
For disease subtype classification, normal samples are excluded and the three abnormal classes are remapped to contiguous labels.
Users must review and comply with the original dataset license and terms separately from this model repository's MIT software license.
The models were trained and evaluated using TensorFlow and Keras.
The research workflow includes:
Research artifacts and methodology are available in the Research Lab.
Download the complete model repository with huggingface_hub:
from huggingface_hub import snapshot_download
model_root = snapshot_download(
repo_id="a1mohamadd/lung-disease-detection",
repo_type="model",
)
print(model_root)
Download into a specific local directory:
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="a1mohamadd/lung-disease-detection",
repo_type="model",
local_dir="saved_models",
)
The recommended way to use these artifacts is through the deployed API or source repository because the full pipeline coordinates segmentation, model-specific preprocessing, binary ensembling, disease classification, and artifact generation.
This model collection is intended for:
The models must not be used:
Model performance may be affected by:
The reported metrics were obtained from the project's evaluation workflow and do not establish clinical validity.
External, prospective, and institution-specific validation would be required before any real clinical deployment.
Chest X-ray models can reproduce biases present in their training data. Predictions should be reviewed by qualified professionals alongside patient history, clinical findings, and additional diagnostic evidence.
Generated masks and overlays are visual review aids. They do not prove that a prediction is correct or provide a complete clinical explanation.
Both formats are included:
ONNX releases are numerically validated against their source Keras models before publication.
The software and model repository are released under the MIT License.
Dataset rights remain governed by the original dataset provider.
Amir Mohammad Askari