Software design and optimization of ECG signal analysis and diagnosis for embedded IoT devices - Αζαριάδη, Δήμητρα (Εθνικό Μετσόβιο Πολυτεχνείο. Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών. Τομέας Τεχνολογίας Πληροφορικής και Υπολογιστών, 2016)
In the rst part of this work, we design the algorithm for ECG signal analysis and classi- cation and implement it in Matab environment. The database chosen as source for ECG recordings is the MIT-BIH Arrhythmia database, provided by PhysioNet. The structure of the algorithm consists of the following stages: ltering, heartbeat detection, heartbeat segmentation, feature extraction, classi cation. The input is an ECG signal, it is ltered, the heartbeats included in it are detected, the signal is segmented into beats, features are extracted from each beat, and the output of the nal stage is a label (Normal or Abnormal) for each heartbeat. For the implementation of these stages we used Matlab built-in functions, the LIBSVM library for the SVM classi er used, and also functions provided by PhysioNet in the WFDB Matlab toolkit. The classi cation stage consists of a SVM classi er, a supervised machine learning method. We use annotations les included in the database, which provide diagnosis labeling of each heartbeat included in each ECG recording, done by doctors. The problem detected at this point of the analysis, is that there is a mismatch in the heartbeats detected in a recording by the functions provided in the toolkit, and the heartbeats annotated by the doctors. This happens because heartbeat detectors fail to detect all heartbeats and some false detections also take place. We overcome this problem by forming a procedure that allows us to match the correctly detected heartbeats with their corresponding labels in the annotation les. Next, we perform a design space exploration over di erent features extracted from the signal in the feature extraction stage. We use discrete wavelet transform as feature extraction method. These features serve as input for the classi cation stage. The metrics used to decide upon the best design are the accuracy and computational cost of the classi cation stage. In the second part of the analysis, we suggest the addition of an extra stage to the algorithmic structure. This stage is placed right before the nal classi cation stage, and consists of an SVM classi er that would take as input the features extracted in the previous stage and classify the heartbeats as true or false detections. True beats will continue to the nal stage, while false beats will be discarded. A design space exploration is performed similarly as done in the initial structure. In the last part of the analysis, the initial algorithmic ow is implemented on the Intel IoT based Galileo board. To do so, the algorithm is converted in C code. In its nal form, the program reads sample by sample a digitized at 360 samples per second ECG signal, and the analysis ow is executed for every set of 3000 samples that is read. The 10 best con gurations, the 10 most demanding in computational cost con gurations, as well as 11 con gurations from inbetween, as resulted from the design space exploration in the rst part of the work, were implemented on the Galileo board. The accuracies achieved were above satisfactory, and the computational cost was such so that the ECG analysis and classi cation can be performed in real-time.