Inspiration
Clinical care in high-volume screening settings and understaffed clinics is bottlenecked by attention and signal noise rather than a lack of medical knowledge. When a single-lead ECG or wearable strip is corrupted by motion artifact, baseline wander, or poor electrode contact, naive alert rules trigger false alarms that waste clinician focus—or mask subtle rhythm shifts. I wanted to build a system that checks signal quality first before making any classification decision, and rigorously evaluates where it succeeds or fails.
What it does
PulseGate is a two-stage ECG triage pipeline and diagnostic dashboard for screening prioritization:
- Stage 1 — Signal Quality Gate: Applies bandpass filtering and baseline-wander removal, then computes a Signal Quality Index ($\text{SQI} \in [0, 1]$). Strips below the $\text{SQI} = 0.65$ gate are flagged for re-capture instead of forcing an unreliable rhythm prediction.
- Stage 2 — Rhythm Classifier & Uncertainty: Evaluates clean or gated strips using waveform and beat-interval features (such as RR-interval variability, QRS width, and spectral entropy) alongside a neural/tabular classifier to estimate rhythm risk, calibrated confidence, and uncertainty.
- Evaluation & Interactive Console: Includes an interactive waveform console with live noise simulation, a held-out benchmark view comparing PulseGate against a standard peak/heart-rate rule baseline, and explicit failure-mode reporting.
How I built it
I structured PulseGate around a reproducible evaluation pipeline paired with an interactive web console so judges can inspect both live waveform behavior and held-out metrics without external setup:
- Data & Splitting: Used public ECG data (such as MIT-BIH Arrhythmia / PhysioNet-style 10-second strips) split strictly by patient ID with a fixed random seed (
--seed 42) to prevent patient leakage across train, validation, and test sets. - Pipeline & Benchmarking: Built signal pre-processing, SQI gating, rhythm classification, and a baseline peak/rate detector, then scripted
evaluate.pyto compute AUROC, sensitivity at fixed specificity, false-alarm reduction on noisy strips, and per-strip inference latency. - Frontend: Built a responsive dashboard with a custom SVG shield-and-pulse logo, dual-trace waveform display, real-time noise slider, and dedicated evaluation and clinical-honesty views.
Challenges I ran into
- Separating noise from true arrhythmias: High-amplitude muscle tremor and baseline wander can mimic irregular beats or trigger false heart-rate spikes in naive threshold detectors.
- Preventing data leakage and overfitting: Splitting ECG windows randomly instead of by patient ID inflates performance metrics, so enforcing strict patient-level grouping and fixed seeds was essential for honest benchmarking.
- Designing for reliable demos: Live demos fail easily if they depend on external APIs or manual environment setup, so I built offline simulation/replay mode and deterministic evaluation scripts directly into the repository.
Accomplishments that I'm proud of
- Built a true gate-before-classify architecture that rejects unreadable strips ($\text{SQI} < 0.65$) and cuts false alarms on noisy recordings compared to a simple rule baseline.
- Created a reproducible evaluation workflow (
evaluate.py --seed 42) reporting exact metrics, baseline comparisons, latency, and subgroup breakdowns rather than relying on cherry-picked examples. - Documented clear failure modes, clinical trade-offs (false negatives vs. false positives), and scope boundaries so the tool is framed honestly as screening support rather than standalone diagnosis.
What I learned
- A flashy demo without held-out metrics, a fair baseline, and failure analysis does not prove clinical utility.
- Explicit abstention ("re-capture recording" when signal quality is low) is often more valuable in noisy triage environments than guessing with high confidence on bad data.
- Clear documentation of limitations and data boundaries makes medical AI far more trustworthy and easier to audit.
What's next for PulseGate
- Validate across additional public ECG and wearable datasets with broader patient demographics and sensor types.
- Add calibration checks and confidence-interval reporting across rarer arrhythmia classes where sample counts are smaller.
- Test real-world workflow timing with clinicians or triage scenarios to refine alert thresholds and re-capture feedback.
Built With
- github
- lucide-react
- mit-bih
- nextjs
- numpy
- physionet
- python
- pytorch
- react
- scikit-learn
- scipy
- shadcn-ui
- tailwindcss
- typescript
- v0
- wfdb

