Alex Rudaev commited on
Commit
8bf278d
·
verified ·
1 Parent(s): f3c2101

Style diagram images with centred HTML + width constraints

Browse files
Files changed (1) hide show
  1. README.md +6 -58
README.md CHANGED
@@ -23,67 +23,15 @@ datasets:
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
 
 
23
 
24
  ## Architecture
25
 
26
+ <p align="center">
27
+ <img src="https://huggingface.co/HlexNC/chexvision-scratch/resolve/main/arch_scratch.png" width="88%" alt="SE-ResNet Architecture"/>
28
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  ## Training Pipeline
31
 
32
+ <p align="center">
33
+ <img src="https://huggingface.co/HlexNC/chexvision-scratch/resolve/main/pipeline_training.png" width="42%" alt="Training Pipeline"/>
34
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ## Training Metrics
37