Research plan¶
Research project, not a build sprint. Each phase ends in a written deliverable under docs/research/; no phase starts until the previous one's write-up exists. A parallel docs/learn/ track teaches every prerequisite from zero — study its lessons alongside each phase as mapped in ../learn/README.md.
Research questions:
- Does adding a scalogram branch improve N/V/S/F/Q classification over raw signal alone?
- Does a dual-path late-fusion Mamba (Approach A) beat early fusion (Approach B)?
- Can V-class recall reach safety-relevant levels without collapsing macro F1?
Phase 0 — project docs (done)¶
- README, architecture, data, model, approaches docs.
- uv chosen for package management; no pyproject yet.
Phase 1 — literature review (first, before any code)¶
Survey and write up literature.md:
- MIT-BIH benchmarks on AAMI N/V/S/F/Q: reported per-class F1, splits used (de Chazal DS1/DS2 vs random — note which papers leak).
- Preprocessing standards: baseline removal, beat windowing, normalization.
- Time-frequency methods for ECG: CWT/scalogram papers, wavelet choice, scale ranges.
- Sequence models for ECG: CNN, LSTM, transformers, and SSM/Mamba on biosignals.
- Class imbalance handling in heartbeat literature: weighting, sampling, focal loss.
- Multi-label vs single-label framing per beat vs per record.
Acceptance: literature.md exists with a results table (paper, split, macro F1, V recall), a gap analysis naming what is missing (Mamba + scalogram fusion gap), and explicit decisions the survey forces (window length, scale range, split protocol, baseline set).
Phase 2 — data protocol + baselines¶
- MIT-BIH via wfdb, AAMI mapping, preprocessing exactly as the survey justifies.
- Patient-wise DS1/DS2 splits; publish class counts per split.
- Baseline experiments: 1D-CNN, CNN+LSTM. Write up baselines.md with numbers.
Acceptance: baselines.md reproduces literature ballpark on DS2; any deviation explained.
Phase 3 — Approach A experiments (primary)¶
- Branch A (signal Mamba) and Branch B (scalogram Mamba), single-batch overfit first.
- Full train, per-branch scores, then logit fusion + threshold tuning.
- Write up experiments-a.md: per-branch and fused results vs baselines.
Acceptance: fused A compared against Phase 2 baselines on macro F1 and V recall, with error analysis on Q/F failures.
Phase 4 — Approach B ablation + comparison¶
- Early-fusion single model as the ablation.
- Head-to-head A vs B write-up in experiments-b.md; keep whichever wins, report both.
Acceptance: the fusion question (RQ2) answered with numbers, not opinion.
Phase 5 — final evaluation + write-up¶
- Final DS2 eval, confusion matrices, PR curves, threshold table.
- Limitations + future work (second lead, record-level multi-label, real-time).
- results.md as the paper-style summary of the whole project.
Acceptance: results.md lets a stranger reproduce splits, training, and numbers.
Blocked on¶
- Terminal access (env check was denied) — Phases 2+ need you to approve commands.
- Open question: single-label per beat vs multi-label per window (to be settled in Phase 1).