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.
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.
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)
| Metric | Score |
|---|---|
| Accuracy | 99.3% |
| Precision | 98.3% |
| Recall (Sensitivity) | 98.9% |
| F1 Score | 0.9864 |
| AUC-ROC | 0.9992 |
| Confusion (TN/FP/FN/TP) | 7,435 / 41 / 26 / 2,429 |
IMU — fall detection (MobiFall, threshold=0.65)
| Metric | Score |
|---|---|
| Accuracy | 91.8% |
| Precision | 70.3% |
| Recall (Fall detection rate) | 96.5% |
| F1 Score | 0.813 |
| AUC-ROC | 0.981 |
| Missed falls | 8 of 228 |
Key engineering decisions — clinical reasoning behind each
| Challenge | Decision | Clinical reasoning |
|---|---|---|
| ECG class imbalance (~75% normal) | Class weights + WeightedRandomSampler | Arrhythmia beats are the clinically dangerous class — downweighting them for accuracy would produce a medically useless model |
| Over-regularisation reducing fall recall | Removed excess dropout; minimal regularisation | Recall on falls is the priority metric — regularisation that improves generalisation at the cost of recall is the wrong trade-off here |
| Detection threshold selection | Threshold = 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 failure | TorchScript instead | Production stability over theoretical framework preference — TorchScript produces a self-contained model file with no runtime dependencies |
| Edge latency target | 3-block 1D CNN; no RNN; no cloud | Sub-millisecond inference enables real-time response before the patient is moved — not achievable with cloud round-trip |
Contributions
2-person team — role breakdown
- ▸Tarun Sadarla (this portfolio): Full ECG pipeline — bandpass filter, R-peak segmentation, 1D CNN arrhythmia model, class imbalance handling, evaluation metrics, edge latency benchmarking. TorchScript export.
- ▸Ramyasri Murugesan (teammate): Full IMU pipeline — Butterworth filter, fall detection 1D CNN, threshold tuning, trial-level visualisation. Project lead, AIMS proposal, final report.
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.