Ubuntu commited on
Commit
a6b2e50
Β·
1 Parent(s): 53e89c2

Add README

Browse files
Files changed (1) hide show
  1. README.md +112 -0
README.md ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ECG Digitization Experiments
2
+
3
+ This repository contains archived PyTorch `.pth` checkpoints from ECG digitization research experiments (Kaggle competition).
4
+
5
+ ## About
6
+
7
+ These are model weights for ECG image-to-signal digitization - extracting ECG waveform values from paper ECG images.
8
+
9
+ **Competition:** [ECG Image Digitization Challenge](https://www.kaggle.com/competitions/ecg-image-digitization)
10
+
11
+ ## Experiments Overview
12
+
13
+ | Experiment | Architecture | Description | Best SNR |
14
+ |------------|--------------|-------------|----------|
15
+ | v7 | EfficientNet-B4 | Early baseline | ~15 dB |
16
+ | v9 | EfficientNet-B4 | Improved training | ~16 dB |
17
+ | v10 | EfficientNet-B4 | Multi-scale features | ~17 dB |
18
+ | v10_1 | EfficientNet-B4 | Refinements | ~17 dB |
19
+ | v11 | EfficientNet-B4 | 1.5x scale | ~17 dB |
20
+ | v14 | ConvNeXt + SimDR | SimDR heatmap approach | ~18 dB |
21
+ | v15 | Per-Lead CNN | Per-lead extraction | ~18 dB |
22
+ | v16 | Per-Lead + BiLSTM | Temporal coherence | ~19 dB |
23
+ | v18 | Refiner Network | Post-processing refiner | ~19 dB |
24
+ | v19 | Augraphy Augmentation | Paper degradation aug | ~20 dB |
25
+ | v20 | Integral Regression | Integral loss | ~20 dB |
26
+ | v21 | GRU Refiner | GRU-based refinement | ~20 dB |
27
+ | v22 | ConvNeXt-Base + U-Net | Multi-scale fusion + Height Attention + BiLSTM | ~22 dB |
28
+ | **v23** | **V22 + DSNT** | **DSNT Sub-Pixel Head (Rank 3 technique)** | **~22.35 dB** |
29
+ | mixed | Various | Early mixed training | ~16 dB |
30
+ | mixed_v4 | Various | Mixed v4 | ~17 dB |
31
+ | mixed_v5 | Various | Mixed v5 | ~17 dB |
32
+
33
+ ## V23 Architecture (Best Model)
34
+
35
+ ```
36
+ β‘  ConvNeXt-Base Encoder β†’ L3 + L4 multi-scale features
37
+ β‘‘ Feature Fusion (fine details + semantics)
38
+ β‘’ U-Net Decoder with skip connections
39
+ β‘£ Height Attention (learns vertical regions)
40
+ β‘€ BiLSTM (temporal coherence)
41
+ β‘₯ Conv1D + Linear β†’ Sigmoid (V22 head)
42
+ ⑦ DSNT Sub-Pixel Head (Rank 3 winner technique)
43
+ ```
44
+
45
+ ## Directory Structure
46
+
47
+ ```
48
+ β”œβ”€β”€ README.md
49
+ β”œβ”€β”€ v7/ # EfficientNet-B4 baseline
50
+ β”œβ”€β”€ v9/ # Improved training
51
+ β”œβ”€β”€ v10/ # Multi-scale features
52
+ β”œβ”€β”€ v10_1/ # Refinements
53
+ β”œβ”€β”€ v11/ # 1.5x scale
54
+ β”œβ”€β”€ v14/ # ConvNeXt + SimDR
55
+ β”œβ”€β”€ v15/ # Per-lead CNN
56
+ β”œβ”€β”€ v16/ # Per-lead + BiLSTM
57
+ β”œβ”€β”€ v18/ # Refiner network
58
+ β”œβ”€β”€ v19/ # Augraphy augmentation
59
+ β”œβ”€β”€ v20/ # Integral regression
60
+ β”œβ”€β”€ v21/ # GRU refiner
61
+ β”œβ”€β”€ v22/ # ConvNeXt-Base + U-Net
62
+ β”œβ”€β”€ v23/ # V22 + DSNT (BEST)
63
+ β”œβ”€β”€ mixed/ # Mixed training v1
64
+ β”œβ”€β”€ mixed_v4/ # Mixed training v4
65
+ β”œβ”€β”€ mixed_v5/ # Mixed training v5
66
+ └── code/
67
+ β”œβ”€β”€ scripts/ # All training scripts
68
+ └── notebooks/ # Kaggle inference notebooks
69
+ ```
70
+
71
+ ## Checkpoint Format
72
+
73
+ Each `.pth` file contains:
74
+ - `model`: Model state dict
75
+ - `opt`: Optimizer state dict
76
+ - `epoch`: Training epoch
77
+ - `snr`: Validation SNR (dB)
78
+ - `mae`: Mean Absolute Error (pixels)
79
+
80
+ ## Usage
81
+
82
+ ```python
83
+ import torch
84
+
85
+ # Load checkpoint
86
+ checkpoint = torch.load("v23/v23_epoch038.pth", map_location="cpu")
87
+
88
+ # Load model state
89
+ model.load_state_dict(checkpoint['model'])
90
+
91
+ # Check metrics
92
+ print(f"Epoch: {checkpoint['epoch']}")
93
+ print(f"SNR: {checkpoint['snr']:.2f} dB")
94
+ ```
95
+
96
+ ## Key Files
97
+
98
+ - `v23/v23_epoch038.pth` - Best V23 checkpoint (22.35 dB)
99
+ - `v22/v22_best_snr.pth` - Best V22 checkpoint
100
+ - `code/scripts/train_v23.py` - V23 training script
101
+ - `code/scripts/inference_v23.py` - V23 inference script
102
+ - `code/notebooks/kaggle_v23_inference.ipynb` - Kaggle submission notebook
103
+
104
+ ## License
105
+
106
+ Research use only. Please cite if you use these weights.
107
+
108
+ ## Framework
109
+
110
+ - PyTorch 2.x
111
+ - timm (ConvNeXt-Base encoder)
112
+ - albumentations (augmentation)