Artificial intelligence (AI) on an edge device has enormous potential, including advanced signal filtering, event detection, optimization in communications and data compression, improving device performance, advanced on-chip process control, and enhancing energy efficiency. In this tutorial, we provide a brief overview of AI deployment on edge devices, and describe the process of building and deploying a neural network model on a digital edge device. The primary challenge when deploying an AI model in circuits is to fit the model within the constraints of the limited resources as the restricted memory capacity on IoT circuits and the finite computational power impose constraints on the utilization of deep neural networks on IoT. We address this issue by elucidating methods for optimizing neural network models. Part of the tutorial also covers the deployment of deep neural network on logic circuits, as significantly enhanced computational speed can be attained by transitioning the AI paradigm from neural networks to learning automata algorithms. This shift involves a move from arithmetic-based calculations to logic-based approaches. This transformation facilitates the deployment of AI onto Field-Programmable Gate Arrays (FPGAs). The last part of the tutorial covers the emerging topic of in-memory computation of the multiply-accumulate operation. Transferring computations to analog memories has the potential to improve speed and energy efficiency compared to digital architectures, potentially achieving improvements of several orders of magnitude. It is our hope that this tutorial will assist researchers and engineers to integrate AI models on edge devices, facilitating rapid and reliable implementation.
29 January 2024 in IEEE Transactions on Biomedical Engineering
The Ear-ECG provides a continuous Lead I like electrocardiogram (ECG) by measuring the potential difference related to heart activity by electrodes which are embedded within earphones. However, the significant increase in wearability and comfort enabled by Ear-ECG is often accompanied by a degradation in signal quality - an obstacle that is shared by the majority of wearable technologies. We aim to resolve this issue by introducing a Deep Matched Filter (Deep-MF) for the highly accurate detection of R-peaks in wearable ECG, thus enhancing the utility of Ear-ECG in real-world scenarios. The Deep-MF consists of an encoder stage, partially initialised with an ECG template, and an R-peak classifier stage. Through its operation as a Matched Filter, the encoder searches for matches with an ECG template in the input signal, prior to filtering these matches with the subsequent convolutional layers and selecting peaks corresponding to the ground-truth ECG. The latent representation of R-peak information is then fed into a R-peak classifier, of which the output provides precise R-peak locations. The proposed Deep Matched Filter is evaluated using leave-one-subject-out cross-validation over 36 subjects with an age range of 18-75, with the Deep-MF outperforming existing algorithms for R-peak detection in noisy ECG. The Deep-MF achieves a median R-peak recall of 94.9% and a median precision of 91.2% across subjects when evaluated with leave-one-subject-out cross validation. Overall, this Deep-Match framework serves as a valuable step forward for the real-world functionality of Ear-ECG and, through its interpretable operation, the acceptance of deep learning models in e-Health.
Background: Ambulatory heart rate (HR) monitors that acquire electrocardiogram (ECG) or/and photoplethysmographm (PPG) signals from the torso, wrists, or ears are notably less accurate in tasks associated with high levels of movement compared to clinical measurements. However, a reliable estimation of HR can be obtained through data fusion from different sensors. These methods are especially suitable for multimodal hearable devices, where heart rate can be tracked from different modalities, including electrical ECG, optical PPG, and sounds (heart tones). Combined information from different modalities can compensate for single source limitations. Methods: In this paper, we evaluate the possible application of data fusion methods in hearables. We assess data fusion for heart rate estimation from simultaneous in-ear ECG and in-ear PPG, recorded on ten subjects while performing 5-min sitting and walking tasks. Results: Our findings show that data fusion methods provide a similar level of mean absolute error as the best single-source heart rate estimation but with much lower intra-subject variability, especially during walking activities. Conclusion: We conclude that data fusion methods provide more robust HR estimation than a single cardiovascular signal. These methods can enhance the performance of wearable devices, especially multimodal hearables, in heart rate tracking during physical activity.
At present, a medium-level microcontroller is capable of performing edge computing and can handle the computation of neural network kernel functions. This makes it possible to implement a complete end-to-end solution incorporating signal acquisition, digital signal processing, and machine learning for the classification of cardiac arrhythmias on a small wearable device. In this work, we describe the design and implementation of several classifiers for atrial fibrillation detection on a general-purpose ARM Cortex-M4 microcontroller. We used the CMSIS-DSP library, which supports Naïve Bayes and Support Vector Machine classifiers, with different kernel functions. We also developed Python scripts to automatically transfer the Python model (trained in Scikit-learn) to the C environment. To train and evaluate the models, we used part of the data from the PhysioNet/Computing in Cardiology Challenge 2020 and performed simple classification of atrial fibrillation based on heart-rate irregularity. The performance of the classifiers was tested on a general-purpose ARM Cortex-M4 microcontroller (STM32WB55RG). Our study reveals that among the tested classifiers, the SVM classifier with RBF kernel function achieves the highest accuracy of 96.9%, sensitivity of 98.4%, and specificity of 95.8%. The execution time of this classifier was 720 s per recording. We also discuss the advantages of moving computing tasks to edge devices, including increased power efficiency of the system, improved patient data privacy and security, and reduced overall system operation costs. In addition, we highlight a problem with false-positive detection and unclear significance of device-detected atrial fibrillation.
Artificial intelligence (AI) on an edge device has enormous potential, including advanced signal filtering, event detection, optimization in communications and data compression, improving device performance, advanced on-chip process control, and enhancing energy efficiency. In this tutorial, we provide a brief overview of AI deployment on edge devices, and we describe the process of building and deploying a neural network model on a digital edge device. The primary challenge when deploying an AI model in circuits is to fit the model within the constraints of the limited resources as the restricted memory capacity on IoT circuits and the finite computational power impose constraints on the utilization of deep neural networks on IoT. We addresses this issue by elucidating methods for optimizing neural network models. Part of the tutorial also covers the deployments of deep neural network into logic circuits, as significantly enhanced computational speed can be attained by transitioning the AI paradigm from neural networks to learning automata algorithms. This shift involves a move from arithmetic-based calculations to logic-based approaches. This transformation facilitates the deployment of AI onto Field-Programmable Gate Arrays (FPGAs). The last part of the tutorial covers the emerging topic of in-memory computation of the multiply-accumulate operation. Transferring computations to analog memories has the potential to improve speed and energy efficiency compared to digital architectures, potentially achieving improvements of several orders of magnitude. It is our hope that this tutorial will assist researchers and engineers to integrate AI models on edge devices, facilitating rapid and reliable implementation.
Hearable devices enable continuous monitoring of human electrophysiological signals, including electroencephalogram (EEG) and electrocardiogram (ECG) using in-ear electrodes. Therefore, electrophysiological signals recorded from inside the ear canal are typically a mixture of ECG and EEG. In addition, the contribution of each component may vary substantially across subjects, posing significant challenges in cardiac monitoring. This all calls for a robust method for extracting ear-ECG or ear-EEG from the ear electrical recordings. To this end, we employ the W-Net architecture, a network combining two auto-encoders, for the separation of ECG and EEG from mixed signals recorded from inside the ears. We are able to separate EEG features from ECG and attribute this to the subtraction connections between the two auto-encoders within the W-Net. We further evaluate whether skip and subtraction connections enhance W-Net performance in ECG reconstruction and test across various input signal sizes. The best results (MSE = 0.0036 ± 0.0041) are achieved with a 5-seconds input with both skip and subtraction connections. Next, we perform several robustness tests: leave-one-out validation, network response to artificial signals and changes in aliased signals. We find that the network is vulnerable to pink noise and that the starting position in overlapping segments affects network's predictions. We show that this phenomenon can in turn be used as a safety mechanism – the output of the network generated by sliding the input window can provide statistical confidence scores and can be visualized as a confidence plot. While promising for risk mitigation and human oversight, the confidence plot requires further clinical validation with expert cardiologists.