Views
No views yet
1 Doctor / User
2 |
3 +------------+------------+
4 | |
5 Chest X-ray Clinical Data
6 PNG / JPG / DICOM Text / PDF / Typed
7 | |
8 v v
9 Swin Transformer Clinical Data
10 Image Diagnosis Extraction
11 | |
12 | |
13 +-----------+-------------+
14 |
15 v
16 Fusion & Reasoning
17 |
18 v
19 LLM / Report Layer
20 |
21 +--------------+--------------+
22 | | |
23 v v v
24 Predicted Diseases Confidence Clinical
25 Scores Reasoning
26 |
27 v
28 Doctor-friendly ReportCurrent status: The Swin Transformer image branch is trained and evaluated. The clinical-data and LLM report-generation branch is the next development stage.
swin_tiny_patch4_window7_224224 × 224BCEWithLogitsLossbest_model.pth checkpoint is loaded.1Atelectasis
2Cardiomegaly
3Consolidation
4Edema
5Effusion
6Emphysema
7Fibrosis
8Hernia
9Infiltration
10Mass
11No Finding
12Nodule
13Pleural_Thickening
14Pneumonia
15Pneumothorax1nih-chestxray14-swin-clinical-report/
2│
3├── best_model.pth
4├── config.json
5├── labels.json
6├── model.py
7├── inference.py
8├── swin_chestxray14_training.ipynb
9├── requirements.txt
10└── README.md| File | Purpose |
|---|---|
best_model.pth | Trained Swin Transformer weights |
model.py | Recreates the Swin-Tiny architecture and loads the trained checkpoint |
inference.py | Runs X-ray inference and returns disease probabilities/predictions |
labels.json | Maps the 15 model outputs to disease names |
config.json | Model and training configuration |
swin_chestxray14_training.ipynb | Colab training/evaluation notebook |
requirements.txt | Python dependencies |
README.md | Project documentation |
pip install -r requirements.txt1torch
2torchvision
3timm
4Pillow
5numpypython inference.py path/to/xray.pngpython inference.py path/to/xray.jpg0.5python inference.py path/to/xray.png --threshold 0.51Predicted Labels:
2- Infiltration
3
4Probabilities:
5Atelectasis: 0.4172
6Cardiomegaly: 0.0345
7Consolidation: 0.0173
8...
9Infiltration: 0.1427
10...1Input Chest X-ray
2 |
3 v
4Resize to 224 × 224
5 |
6 v
7Image normalization
8 |
9 v
10Swin Tiny Transformer
11 |
12 v
1315 logits
14 |
15 v
16Sigmoid
17 |
18 v
1915 disease probabilities
20 |
21 v
22Threshold = 0.5
23 |
24 v
25Predicted labels1Chest X-ray
2 |
3 v
4Swin Transformer
5 |
6 v
7Disease Predictions + Confidence Scores
8 \
9 \
10 +--> Fusion & Reasoning --> LLM
11 /
12Clinical Data -----------/
13 |
14 v
15Age / Symptoms / Vitals / Laboratory Information / Otherbest_model.pth contains the trained model parameters. The model architecture is reconstructed by model.py before the checkpoint is loaded.1Medical Image
2 +
3Clinical Information
4 +
5AI Reasoning
6 |
7 v
8Structured, doctor-friendly report