// Edge AI · Wearable · Cardiac & Fall Detection · On-Device

WECARE — Wearable Emergency
Cardiac & Fall Response

An on-device AI framework that fuses ECG and IMU sensor streams for real-time arrhythmia and fall detection — entirely on-device, no cloud dependency, no latency penalty. Inference at 0.033ms vs a 40ms clinical threshold. Transforms wearables from passive monitors into active emergency responders.

ECG F1: 0.9864 Fall Recall: 96.5% 0.033ms Inference 8 Missed Falls / 228 TorchScript · Edge Deploy · No Cloud AI Wearables · Fall 2025 · UNT · 2-person team

Clinical Context

The problem with cloud-dependent wearables

In cardiac and fall emergencies, round-trip latency to the cloud is clinically unacceptable.

Current consumer wearables send sensor data to the cloud for processing before triggering alerts. In a cardiac arrhythmia event or fall, that round-trip introduces delays measured in seconds — clinically unacceptable when the intervention window is often under 2 minutes (the American Heart Association's 2-minute CPR initiation benchmark). WECARE eliminates this bottleneck entirely: the complete detection pipeline runs on-device, with inference times of 0.033ms — providing 1,200× safety margin against the 40ms real-time threshold.

The system fuses two complementary physiological signals: ECG for continuous cardiac arrhythmia detection and IMU (accelerometer + gyroscope) for real-time fall event classification. Both streams feed independent compact 1D CNNs whose outputs converge in a shared emergency alert engine deployed via TorchScript — fully portable, no runtime framework dependencies.

99.3%
ECG Accuracy
MIT-BIH test set
0.9992
ECG AUC-ROC
Arrhythmia detection
8
Missed Falls
of 228 — 96.5% recall
0.033ms
Inference Latency
vs 40ms threshold

Critical safety metric — the 8 missed falls: Only 8 false negatives out of 228 fall instances. Missing a fall in an elderly patient who cannot call for help is far more dangerous than a false alarm. The detection threshold (0.65, not the default 0.5) was deliberately set to minimise missed falls — accepting more false alarms to ensure near-complete fall coverage. This threshold is a clinical safety decision, not a hyperparameter to optimise for accuracy.


Architecture

Dual-stream 1D CNN — designed for the edge

Both streams share a 3-block architecture optimised for edge inference — compact enough to run on microcontroller-class hardware with significant latency headroom.

# Shared 1D CNN architecture (both ECG and IMU streams)
Block 1: Conv1D(in → 64, kernel=7) → ReLU → MaxPool(2)
Block 2: Conv1D(64 → 128, kernel=7) → ReLU → MaxPool(2)
Block 3: Conv1D(128 → 256, kernel=5) → ReLU → MaxPool(2)
Flatten → Dense(128) → Dropout → Dense(n_classes)

# ECG: 256-sample heartbeat segments at 360 Hz (MIT-BIH Arrhythmia Database)
# IMU: 100×9 sliding windows (3-axis accel + 3-axis gyro + 3-axis mag at 87–100 Hz)

ECG stream — arrhythmia detection

Dataset: MIT-BIH Arrhythmia Database (PhysioNet) — ~10,000 beat segments, 44 subjects, 360 Hz. Bandpass filter (0.5–40 Hz) → R-peak segmentation → 256-sample normalised windows.

Class imbalance: ~75% normal beats. Addressed with class weights + WeightedRandomSampler — prevents the model from ignoring arrhythmia beats without oversampling artefacts. In clinical ECG monitoring, missing an arrhythmia is the dangerous error, not a false alarm.

IMU stream — fall detection

Dataset: MobiFall_processed (Kaggle) — ~40,000 windows, 24 participants, 87–100 Hz. Butterworth filter → sliding window (100 samples × 9 channels) → StandardScaler per channel.

Threshold tuning: Set at 0.65 (vs default 0.50) to minimise missed falls. At 0.65: 8 FN, 93 FP, F1=0.8133. At 0.50: fewer false alarms but more missed falls — the wrong direction for a patient safety system. TFLite deployment failed due to dependency conflicts; TorchScript used — stable and self-contained.


Performance

Full results — both detection streams

ECG — arrhythmia detection (MIT-BIH)

MetricScore
Accuracy99.3%
Precision98.3%
Recall (Sensitivity)98.9%
F1 Score0.9864
AUC-ROC0.9992
Confusion (TN/FP/FN/TP)7,435 / 41 / 26 / 2,429

IMU — fall detection (MobiFall, threshold=0.65)

MetricScore
Accuracy91.8%
Precision70.3%
Recall (Fall detection rate)96.5%
F1 Score0.813
AUC-ROC0.981
Missed falls8 of 228

Key engineering decisions — clinical reasoning behind each

ChallengeDecisionClinical reasoning
ECG class imbalance (~75% normal)Class weights + WeightedRandomSamplerArrhythmia beats are the clinically dangerous class — downweighting them for accuracy would produce a medically useless model
Over-regularisation reducing fall recallRemoved excess dropout; minimal regularisationRecall on falls is the priority metric — regularisation that improves generalisation at the cost of recall is the wrong trade-off here
Detection threshold selectionThreshold = 0.65 (not default 0.50)Minimises missed falls at the cost of more alarms — correct asymmetry for patient safety in elderly fall monitoring
TFLite deployment failureTorchScript insteadProduction stability over theoretical framework preference — TorchScript produces a self-contained model file with no runtime dependencies
Edge latency target3-block 1D CNN; no RNN; no cloudSub-millisecond inference enables real-time response before the patient is moved — not achievable with cloud round-trip

Contributions

2-person team — role breakdown

Extended vision — AIMS proposal: The repository includes a grant-style AIMS proposal outlining the long-term system architecture: ECG + IMU + PPG fusion, automated emergency contact alerts, multi-actor coordination with bystanders and telemedicine platforms. Core innovation: a wearable orchestration engine addressing the pre-responder window (the critical minutes before emergency services arrive) where no existing clinical platform currently operates.

Technical stack

PyTorchTorchScript1D CNN MIT-BIH Arrhythmia DatabaseMobiFall (Kaggle) scikit-learnNumPymatplotlib PhysioNetWeightedRandomSampler

View full code, AIMS proposal, and notebooks.

ECG + IMU pipelines, TorchScript export, and extended AIMS document in the repository.

GitHub → Get in Touch