Blog
How to Build: Edge AI Model Training for Cardiac Anomaly Detection on ECGs using TMB-7115 Medical AI Computer
Teguar Engineering Team · May 22, 2025
An engineering guide showing how to implement edge ai model training for cardiac anomaly detection on ecgs on Teguar's purpose-built TMB-7115 Medical AI Computer with computer vision & model training.
title: "How to Build: Edge AI Model Training for Cardiac Anomaly Detection on ECGs using TMB-7115 Medical AI Computer" excerpt: "An engineering guide showing how to implement edge ai model training for cardiac anomaly detection on ecgs on Teguar's purpose-built TMB-7115 Medical AI Computer with computer vision & model training." date: "2026-07-07" skill: "Computer Vision & Model Training" hardware_name: "TMB-7115 Medical AI Computer" hardware_img: "medical-ai-computer-tmb-7115.jpg" hardware_type: "medical-box-pc"
Introduction
Cardiac anomaly detection using Electrocardiogram (ECG) data is a critical application of Edge AI in modern healthcare. By analyzing ECG signals in real-time at the bedside, medical systems can instantly identify anomalies such as arrhythmias, myocardial infarction, or conduction blocks. However, processing high-frequency sensor data with deep learning models requires local, low-latency computational power.
In this guide, we walk through training and deploying an Edge AI model for real-time ECG analysis on the TMB-7115 Medical AI Computer, a fanless medical box PC equipped with dedicated AI hardware acceleration.
The Hardware Foundation: TMB-7115 Medical AI Computer
The TMB-7115 Medical AI Computer is engineered for high-reliability medical environments. Its key features include:
- Medical-Grade Certifications: Full UL/EN 60601-1 4th Edition compliance, ensuring electrical safety near patients.
- Fanless Design: Eliminates the risk of circulating airborne pathogens or dust in sterile settings.
- AI Acceleration: Integrated NPU/GPU compute blocks capable of running deep neural networks locally at low power.
- Abundant I/O: Rich serial ports and USB options to interface directly with patient monitors and ECG digitizers.
Step-by-Step Implementation
Step 1: Data Preparation and Preprocessing
ECG signal processing begins with noise filtering (removing powerline interference and baseline wander) using bandpass filters. The raw signal is segmented into individual beats or fixed-length time windows.
import numpy as np
from scipy.signal import butter, filtfilt
def bandpass_filter(data, lowcut=0.5, highcut=45.0, fs=360, order=4):
nyq = 0.5 * fs
low = lowcut / nyq
high = highcut / nyq
b, a = butter(order, [low, high], btype='band')
return filtfilt(b, a, data)
Step 2: Model Architecture
We train a 1D Convolutional Neural Network (1D-CNN) or a lightweight ResNet architecture optimized for time-series anomaly detection.
import tensorflow as tf
from tensorflow.keras import layers, models
def build_ecg_model(input_shape):
model = models.Sequential([
layers.Conv1D(32, 5, activation='relu', input_shape=input_shape),
layers.MaxPooling1D(2),
layers.Conv1D(64, 5, activation='relu'),
layers.MaxPooling1D(2),
layers.Flatten(),
layers.Dense(64, activation='relu'),
layers.Dense(1, activation='sigmoid') # Binary anomaly classification
])
return model
Step 3: Quantization and Edge Deployment
To ensure low-latency inference on the TMB-7115 Medical AI Computer, the model is converted to TensorFlow Lite and quantized to INT8 using post-training quantization.
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_quant_model = converter.convert()
Conclusion
By running lightweight 1D-CNN models directly on the TMB-7115 Medical AI Computer, hospitals can implement continuous, real-time cardiac monitoring at the edge, reducing latency and protecting patient privacy.