File size: 1,851 Bytes
41902cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
tags:
- lung
- segmentation
- medical
- medical-imaging
- xray
- pytorch
---
# Model description

This model performs automatic lung segmentation on chest X-ray images.
It ouputs a binary lung mask that can be used as a preprocessing step before downstream tasks such as classification.

This model was designed to focus the classifier on the lung region only, reducing background bias and improving interpretability.

# Intended use

- Automatic lung masking for chest X-ray images
- Preprocessing step before a Covid-19 classification model
- Research and educational purposes

/!\ NOT intended for medical diagnosis or clinical use.

# Model details
- Framework : PyTorch
- Model format : TorchScript (.pt)
- Task : Image segmentation
- Input : RGB chest X-ray image
- Out put : Binary lung mask

# Input format
- Image size to 192x192 px
- 3 channels (RGB)
- Pixel values normalized to [0,1]

# Output format
- Single-channel binary mask
- Vlaues in {0,1}
- Can be resized back to original image size and applied as a mask

# Example usage

```python
import torch

model = torch.jit.load("mask_auto.pt", map_location="cpu")
model.eval()

with torch.no_grad():
    mask = model(input_tensor)
```

# Training data

The model was trained in chest X-ray images with corresponding lung masks, from the public dataset :

**COVID-19 Radiography Dataset (Kaggle)**

https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database/data

The dataset contains chest X-ray images labeled as COVID, Normal, Lung-Opacity and Viral Pneumonia.

# Limitations
- Performance may degrade on low-quality or non-frontal X-ray images
- Trained on a specific data distribution; generalization is not guaranteed
- Should not be used for clinical decision-making

# Licence

This model is shared for research and educational purposes.

# Author 

Asma Sima