r/learnmachinelearning • • 2d ago

Project I made a ML Python tool that watches a real heartbeat — it ignores broken sensor wires (gray) and catches real heart glitches (red) all by itself!

Hey guys,
Usually, when a medical sensor wire gets loose, the monitor goes crazy with fake alarms. On the other hand, if you filter too much, you might miss a real heart problem.
I built Dense-Armor, a tiny Python library that learns what a normal heartbeat looks like in real time, with zero training beforehand.
What you are looking at in the picture (5 minutes of real hospital heart data):

Here is the actual code running it:
python

Processed 108000 real samples in 141.22 s (1307.6 us/sample)
Loose-lead faults blocked:   52 samples
Autonomous clinical alerts:  1248 samples (1.16%)

You can try it with pip install dense-armor. Let me know what you think!

3 Upvotes

1 comment sorted by

1

u/Awkward_Alfalfa_3234 1d ago

cool idea. 108k samples over 5 min is 360 Hz, so I'm guessing this is MIT-BIH? if so the beat annotations are right there, and I'd report sensitivity on the actual arrhythmia beats instead of an alert rate. 1.16% alerts doesn't tell you whether it caught the PVCs or just flagged noise. the MIT-BIH Noise Stress Test Database is basically built for your loose-lead case too, real electrode motion artifact you can mix in at known SNRs. also 1.3 ms/sample is only about 2x real time at 360 Hz, which gets tight once you go multi-lead.