Alex Rudaev commited on
Commit
f3c2101
·
verified ·
1 Parent(s): 819bc96

Update model card: add training metrics (AUC 0.8008, epoch 60/75) and reflect actual training config

Browse files
Files changed (1) hide show
  1. README.md +140 -157
README.md CHANGED
@@ -1,157 +1,140 @@
1
- ---
2
- license: mit
3
- language:
4
- - en
5
- library_name: pytorch
6
- pipeline_tag: image-classification
7
- tags:
8
- - chexvision
9
- - medical-imaging
10
- - chest-xray
11
- - radiology
12
- - pytorch
13
- - multi-label-classification
14
- datasets:
15
- - HlexNC/chest-xray-14-320
16
- ---
17
-
18
- # CheXVision-ResNet
19
-
20
- > **CheXVision** — Deep Learning & Big Data university project.
21
- > 14-class chest X-ray pathology detection + binary normal/abnormal classification
22
- > on the NIH Chest X-ray14 dataset (112,120 images).
23
-
24
- ## Architecture
25
-
26
- ```mermaid
27
- graph LR
28
- IN["Input
29
- 3 × 224 × 224"] --> STEM["Stem
30
- 7×7 Conv · BN · ReLU
31
- 3→64ch · MaxPool ÷2"]
32
- STEM --> S1["Stage 1
33
- 3× SE-ResBlock
34
- 64ch"]
35
- S1 --> S2["Stage 2 ↓½
36
- 4× SE-ResBlock
37
- 128ch"]
38
- S2 --> S3["Stage 3 ↓½
39
- 6× SE-ResBlock
40
- 256ch"]
41
- S3 --> S4["Stage 4 ↓½
42
- 3× SE-ResBlock
43
- 512ch"]
44
- S4 --> GAP["Global Avg Pool
45
- Dropout(0.5)
46
- 512-dim"]
47
- GAP --> MLH["Multilabel Head
48
- Linear 512→14
49
- sigmoid · 14 pathologies"]
50
- GAP --> BH["Binary Head
51
- Linear 512→1
52
- sigmoid · Normal/Abnormal"]
53
- style MLH fill:#2e7d32,color:#fff
54
- style BH fill:#1565c0,color:#fff
55
- style IN fill:#37474f,color:#fff
56
- ```
57
-
58
- ## Training Pipeline
59
-
60
- ```mermaid
61
- flowchart TD
62
- DS[("🗄️ HlexNC/chest-xray-14
63
- 112,120 images · 36 shards · ~4.7 GB")]
64
- DS -->|snapshot_download| PREP["📂 data/images · data/labels.csv
65
- train 78,468 · val 11,210 · test 22,442"]
66
- PREP --> AUG["Augmentation Pipeline
67
- HFlip · Rotate±15° · RandomAffine
68
- ColorJitter · GaussianBlur · RandomErasing"]
69
- AUG --> FWD["⚡ Model Forward Pass
70
- torch.cuda.amp.autocast · fp16"]
71
- FWD --> ML["multilabel_logits B×14
72
- WeightedBCE + pos_weight · 14 classes"]
73
- FWD --> BIN["binary_logits B×1
74
- BCE · Normal vs. Abnormal"]
75
- ML --> LOSS["Combined Loss
76
- 1.0 × multilabel + 0.5 × binary"]
77
- BIN --> LOSS
78
- LOSS --> BACK["Backward · Grad Clip 1.0
79
- Gradient Accumulation ×4 · eff. batch 128"]
80
- BACK --> OPT["AdamW · CosineAnnealingLR
81
- early stop patience = 15"]
82
- OPT -->|"↑ best val AUC-ROC"| BEST["💾 Best Checkpoint
83
- model_state · best_val_metrics · config"]
84
- BEST -->|upload_model_artifacts| HUB["🤗 HF Hub
85
- checkpoint · history.json · model card"]
86
- ```
87
-
88
- ## Training Metrics
89
-
90
- - Best validation macro AUC-ROC: `0.8008`
91
- - Best validation binary AUC-ROC: `0.7571`
92
- - Best validation binary F1: `0.6474`
93
- - Best checkpoint epoch: `60`
94
-
95
-
96
- ## Per-Class AUC-ROC at Best Epoch
97
-
98
- | Pathology | AUC-ROC | Visual |
99
- |----------------------|----------|---------------|
100
- | Atelectasis | `0.7841` | `████████░░` |
101
- | Cardiomegaly | `0.8985` | `█████████░` |
102
- | Effusion | `0.8623` | `█████████░` |
103
- | Infiltration | `0.6872` | `███████░░░` |
104
- | Mass | `0.8322` | `████████░░` |
105
- | Nodule | `0.6899` | `███████░░░` |
106
- | Pneumonia | `0.6741` | `███████░░░` |
107
- | Pneumothorax | `0.8183` | `████████░░` |
108
- | Consolidation | `0.8110` | `████████░░` |
109
- | Edema | `0.9151` | `█████████░` |
110
- | Emphysema | `0.8267` | `████████░░` |
111
- | Fibrosis | `0.7579` | `████████░░` |
112
- | Pleural_Thickening | `0.7752` | `████████░░` |
113
- | Hernia | `0.8791` | `█████████░` |
114
-
115
- ## Training Configuration
116
-
117
- - Repository: `HlexNC/chexvision-scratch`
118
- - Dataset: [HlexNC/chest-xray-14-320](https://huggingface.co/datasets/HlexNC/chest-xray-14-320) · revision `44443e6ee968b3c6094b63f14a27698c40b50680`
119
- - Architecture: Custom residual CNN with Squeeze-Excitation channel attention (depth [3, 4, 6, 3]) trained from scratch with shared features and dual classification heads.
120
- - Platform: Kaggle GPU kernel (NVIDIA T4 / P100)
121
- - Batch size: `24` × grad_accum `4` = **effective batch `96`**
122
- - AMP (fp16): `enabled`
123
- - Optimizer: AdamW · Scheduler: CosineAnnealingLR
124
- - Epochs configured: `100` · Early stop patience: `15`
125
-
126
- ## Intended Use
127
-
128
- This model is intended for research and educational work on automated chest X-ray pathology detection.
129
- It outputs two predictions per image:
130
- 1. **Multi-label scores** — independent sigmoid probability for each of 14 NIH pathologies
131
- 2. **Binary score** — sigmoid probability of any abnormality (Normal vs. Abnormal)
132
-
133
- ## Limitations
134
-
135
- - Not validated for clinical use. Predictions must not substitute professional medical judgment.
136
- - Trained on NIH Chest X-ray14, which contains noisy radiologist annotations (patient-level labels, not lesion-level).
137
- - Performance degrades on images from equipment, patient populations, or preprocessing pipelines
138
- that differ from the NIH training distribution.
139
- - Reported AUC metrics are on the validation split, not the held-out test set.
140
-
141
- ## CheXNet Benchmark Context
142
-
143
- CheXNet (Rajpurkar et al., 2017) — the seminal paper establishing DenseNet-121 for chest X-ray
144
- classification — reported **0.841 macro AUC-ROC** on a comparable split of this dataset.
145
- CheXVision-DenseNet matches this benchmark. See the
146
- [CheXVision demo](https://huggingface.co/spaces/HlexNC/chexvision-demo) for live inference.
147
-
148
- ## Citation
149
-
150
- ```bibtex
151
- @misc{chexvision2026,
152
- title={CheXVision: Dual-Task Chest X-ray Classification with Custom CNN and DenseNet-121},
153
- author={BIG D(ATA) Team},
154
- year={2026},
155
- howpublished={\url{https://huggingface.co/HlexNC/chexvision-scratch}}
156
- }
157
- ```
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ library_name: pytorch
6
+ pipeline_tag: image-classification
7
+ tags:
8
+ - chexvision
9
+ - medical-imaging
10
+ - chest-xray
11
+ - radiology
12
+ - pytorch
13
+ - multi-label-classification
14
+ datasets:
15
+ - HlexNC/chest-xray-14-320
16
+ ---
17
+
18
+ # CheXVision-ResNet
19
+
20
+ > **CheXVision** — Deep Learning & Big Data university project.
21
+ > 14-class chest X-ray pathology detection + binary normal/abnormal classification
22
+ > on the NIH Chest X-ray14 dataset (112,120 images).
23
+
24
+ ## Architecture
25
+
26
+ ```mermaid
27
+ graph LR
28
+ IN["Input
29
+ 3 × 320 × 320"] --> STEM["Stem
30
+ 7×7 Conv · BN · ReLU
31
+ 3→64ch · MaxPool ÷2"]
32
+ STEM --> S1["Stage 1
33
+ 3× SE-ResBlock
34
+ 64ch"]
35
+ S1 --> S2["Stage 2 ↓½
36
+ 4× SE-ResBlock
37
+ 128ch"]
38
+ S2 --> S3["Stage 3 ↓½
39
+ 6× SE-ResBlock
40
+ 256ch"]
41
+ S3 --> S4["Stage 4 ↓½
42
+ 3× SE-ResBlock
43
+ 512ch"]
44
+ S4 --> GAP["Global Avg Pool
45
+ Dropout(0.5)
46
+ 512-dim"]
47
+ GAP --> MLH["Multilabel Head
48
+ Linear 512→14
49
+ sigmoid · 14 pathologies"]
50
+ GAP --> BH["Binary Head
51
+ Linear 512→1
52
+ sigmoid · Normal/Abnormal"]
53
+ style MLH fill:#2e7d32,color:#fff
54
+ style BH fill:#1565c0,color:#fff
55
+ style IN fill:#37474f,color:#fff
56
+ ```
57
+
58
+ ## Training Pipeline
59
+
60
+ ```mermaid
61
+ flowchart TD
62
+ DS[("🗄️ HlexNC/chest-xray-14-320
63
+ 112,120 images · 36 shards · ~7.97 GB")]
64
+ DS -->|snapshot_download| PREP["📂 data/images · data/labels.csv
65
+ train 78,468 · val 11,210 · test 22,442"]
66
+ PREP --> AUG["Augmentation Pipeline
67
+ HFlip · Rotate±15° · RandomAffine
68
+ ColorJitter · GaussianBlur · RandomErasing"]
69
+ AUG --> FWD["⚡ Model Forward Pass
70
+ torch.cuda.amp.autocast · fp16"]
71
+ FWD --> ML["multilabel_logits B×14
72
+ WeightedBCE + pos_weight · 14 classes"]
73
+ FWD --> BIN["binary_logits B×1
74
+ BCE · Normal vs. Abnormal"]
75
+ ML --> LOSS["Combined Loss
76
+ 1.0 × multilabel + 0.5 × binary"]
77
+ BIN --> LOSS
78
+ LOSS --> BACK["Backward · Grad Clip 1.0
79
+ Gradient Accumulation ×4 · eff. batch 96"]
80
+ BACK --> OPT["AdamW · CosineAnnealingLR
81
+ early stop patience = 15"]
82
+ OPT -->|"↑ best val AUC-ROC"| BEST["💾 Best Checkpoint
83
+ model_state · best_val_metrics · config"]
84
+ BEST -->|upload_model_artifacts| HUB["🤗 HF Hub
85
+ checkpoint · history.json · model card"]
86
+ ```
87
+
88
+ ## Training Metrics
89
+
90
+ - Best validation macro AUC-ROC: `0.8008`
91
+ - Best validation binary AUC-ROC: `0.7571`
92
+ - Best validation binary F1: `0.6474`
93
+ - Best checkpoint epoch: `60`
94
+
95
+
96
+ ## Training Configuration
97
+
98
+ - Repository: `HlexNC/chexvision-scratch`
99
+ - Dataset: [HlexNC/chest-xray-14-320](https://huggingface.co/datasets/HlexNC/chest-xray-14-320) · revision `44443e6ee968b3c6094b63f14a27698c40b50680`
100
+ - Architecture: Custom residual CNN with Squeeze-Excitation channel attention (depth [3, 4, 6, 3]) trained from scratch with shared features and dual classification heads.
101
+ - Platform: Kaggle GPU kernel (NVIDIA T4 / P100)
102
+ - Batch size: `24` × grad_accum `4` = **effective batch `96`**
103
+ - AMP (fp16): `enabled`
104
+ - CLAHE preprocessing: `disabled`
105
+ - Label smoothing: `0.0`
106
+ - Optimizer: AdamW · Scheduler: CosineAnnealingLR
107
+ - Epochs configured: `100` · Early stop patience: `15`
108
+
109
+ ## Intended Use
110
+
111
+ This model is intended for research and educational work on automated chest X-ray pathology detection.
112
+ It outputs two predictions per image:
113
+ 1. **Multi-label scores** independent sigmoid probability for each of 14 NIH pathologies
114
+ 2. **Binary score** — sigmoid probability of any abnormality (Normal vs. Abnormal)
115
+
116
+ ## Limitations
117
+
118
+ - Not validated for clinical use. Predictions must not substitute professional medical judgment.
119
+ - Trained on NIH Chest X-ray14, which contains noisy radiologist annotations (patient-level labels, not lesion-level).
120
+ - Performance degrades on images from equipment, patient populations, or preprocessing pipelines
121
+ that differ from the NIH training distribution.
122
+ - Reported AUC metrics are on the validation split, not the held-out test set.
123
+
124
+ ## CheXNet Benchmark Context
125
+
126
+ CheXNet (Rajpurkar et al., 2017) — the seminal paper establishing DenseNet-121 for chest X-ray
127
+ classification — reported **0.841 macro AUC-ROC** on a comparable split of this dataset.
128
+ CheXVision-DenseNet matches this benchmark. See the
129
+ [CheXVision demo](https://huggingface.co/spaces/HlexNC/chexvision-demo) for live inference.
130
+
131
+ ## Citation
132
+
133
+ ```bibtex
134
+ @misc{chexvision2026,
135
+ title={CheXVision: Dual-Task Chest X-ray Classification with Custom CNN and DenseNet-121},
136
+ author={BIG D(ATA) Team},
137
+ year={2026},
138
+ howpublished={\url{https://huggingface.co/HlexNC/chexvision-scratch}}
139
+ }
140
+ ```