Machine Learning and Cardiology
Introduction
2.1 Preface
This report is directed towards lecturers and fellow students and can be
used as a source of information on the extraction of fetal electrocardiograms
developed by our group. It is designed so that future students can use this
as a start to their own research further into this field.
We would like to thank our project coordinator, Jan Paredis, who provided support and helped us during the whole project.
2.2 Abstract
When investigating the health of a fetus in the medical world, an electrocardiogram recording is made on several places around the thorax and abdomen. This report gives an insight into the extraction of fetal electrocardiograms in different stages of pregnancy. Furthermore, a classification method is explained which is able to classify ECGs by their pathological conditions. After preprocessing, a wavelet-based approach using a Gaussian-2 wavelet is taken for finding the fetal peaks and the fetal waveform is reconstructed.
The results of the fetal peak reconstruction are promising, but due to a lack of validation data, no definite conclusions can be made about this research. Using the MIT-BIH arrhythmia database, an approach based on the K-Nearest Neighbor is explained with which the pathological condition of a heartbeat can be determined. Despite of using RR-features (taking the interval of heartbeats into account), four different ways of representing a heartbeat's morphology are compared. With all four representations an accuracy of around 80% is achieved. The results show that the explained approach is promising, but further research is recommended.
2.3 Introduction
In the medical world, one of the most difficult tasks of doctors is to discern the health of babies, not after birth but when they are still in the fetal stages. A common indicator that is used is the heartbeat of the unborn child but this poses its own problem, namely that it is hard to retrieve for examination.
The issue lies in modern Electrocardiogram (ECG) technology. At the time of writing, an ECG is taken with electrodes that are fixed to a pregnant woman's chest and abdomen, see Figure 2.1

This is so that broad signals are taken of the mothers heart rate and what is hopefully the child's. The general consensus is that the thoracic (chest) signals show the maternal heartbeat, while the abdominal signals show the fetus with some background noise (Figure 2.2 shows an example).
The problem comes when trying to eliminate the `noise' from the fetal signal, as it is a mixture of the maternal heartbeat and echoes that drown out the fetus. A smaller problem comes in that each signal is slightly ahead or behind the other, this coming from time delays between each electrode due to there differing distances from the heart, making the signals asynchronous with each other.

This process is required for, as stated, discerning the health of the unborn child. With processing, a doctor can examine the morphology, the general shape and rhythm, of the isolated fetus signal. From this, one can judge whether it is the regular heartbeat of a healthy child or whether it has a minor or major heart condition. This is also the same method used on adults.
2.4 Background Information
Let us first examine a human heartbeat. When the heart muscle beats or contracts (called systole), it pumps blood from the heart. The heart contracts in two stages. In the first stage, (1) the right and left atria (two upper chambers of the heart) contract at the same time, pumping blood to the right and left ventricles. Then, (2) the ventricles (two lower chambers) contract together to propel blood out of the heart. Finally, (3) the heart muscle relaxes (called diastole) before the next heartbeat. This allows blood to fill the heart once more.
When an ECG is taken, the electrical activity is measured that results from the heart muscle cells in the atria and ventricles contract. In this way, one can analyze and interpret heartbeats with the aid of computers. A typical heartbeat consists of three succeeding electrical components, much like described above, in an ECG:
- P wave: representing the atrial depolarization. This is the necessary time for an electrical impulse from the sinoatrial (SA) node to spread throughout the atrial musculature.
- QRS complex: representing the ventricular depolarization.
- T wave: representing the polarization of the ventricles.
Further in the paper, the technique used to extract each of these components will be explained. This helps us to shift the different channels in a way that they are synchronized. Also, knowledge about the different components will allow us to analyze the morphology of the heartbeats. These morphologies can be divided into into four main classes:
- Normal Heartbeat
- Supraventricular ectopic beat
- Ventricular ectopic beat
- Fusion beat
A normal heartbeat is as its name states, where all complexes are within normal levels, Figure 2.3(a). Supraventricular ectopic, Figure 2.3(b), is also know as Premature Atrial Contraction, when the atrial beat (P waves) fires prematurely or there is an extra contraction, often followed by a long pause.
Ventricular ectopic is similar but when the beat occurs in the ventricles, Figure 2.3(c). Fusion beats could happen to either the atria or the ventricles. This is when there are two simultaneous impulses within one contraction, Figure 2.3(d). These classes are used later within the classification process.

2.5 Problem Definition
The goal of this report is to investigate extracting a fetal and maternal signal based on ECG recordings in different stages of pregnancy. The question is asked: can one interpret these ECGs separately using various types of signal analysis, and finally recognize any (predefined) pathological conditions in the maternal or fetal signal?
2.6 Overview
In Chapter 3 the first steps into the research are discussed, this being the acquisition and preprocessing of the data used. Then, in Chapter 3, the steps taken in retrieving heartbeats is discussed in depth followed by the results of testing. The final chapters go through the discussion of the results and the conclusions on the matter.