Machine learning · cardiology research
Detecting Wolff-Parkinson-White from a 12-lead ECG
A machine learning research project, trained on 53,540 real hospital recordings. Tested on 6,713 ECGs it had never seen.
A needle in a haystack
Machine learning needs examples to learn from, and the more the better. But WPW is rare. In the two public hospital datasets this project uses, there are 142 confirmed cases among 66,951 ECGs. That is one in every 471. In the heart, one dot in 471 is orange.
Seven ways to read the same heartbeat
There is no single right way to turn an ECG into numbers a model can learn from. So this project builds seven, each looking at the signal through a different lens, then combines the ones that see best.
M1, QRS onset morphology
The shape of the QRS onset, where the delta wave lives.
M2, Global statistics
The shape of the whole signal, summarized.
M3, Wavelet localization
Focusing in on the exact millisecond that matters.
M4, Median-beat morphology
One clean, representative heartbeat.
M5, Spatial VCG
How the leads relate to each other geometrically.
M6, Commercial baseline
A benchmark from an industry system.
M7, 1D-CNN
A neural network, letting a deep model find its own patterns.
The surprising result: the bottleneck was never the algorithm. It was the data.
Tested where it had never looked
The honest test of a model is data it has never seen. The deployed detector, an equal-weight vote between M3 and M4, was scored once, at the very end, on a held-out fold kept untouched throughout. It reached an AUC of 0.95: show it one real WPW tracing and one healthy one at random, and it ranks the WPW higher about 95 times out of 100.
Why I built this
I was diagnosed with Wolff-Parkinson-White as a child. In 2024, a catheter ablation at the Montreal Children's Hospital removed that extra pathway, and I am healthy today because of it.Years later, I took a machine learning class and fell for it. This project sits exactly where the two met: the condition I had lived with, and the thing I had just discovered I loved doing. I wanted to know whether a machine could learn to detect WPW on an ECG, and help doctors catch a condition that is genuinely hard to see...
Read the full story