Design and Realization of Non Invasive Fetal ECG Monitoring System

Early fetal cardiac diseases and heart abnormalities can be detected and appropriately treated by monitoring fetal health during pregnancy. Advancements in computer sciences and the technology of sensors show that is possible to monitor fetal electrocardiogram (fECG). Both signal processing and experimental aspects are needed to be investigated to monitor fECG. In this study, we aim to design and realize a non invasive fECG monitoring system. In the first part of this work, a remote study process of the electrical activity of the heart is achieved. In fact, our proposed design considers transmitting the detected signals in real time using a WiFi module and then analyzing the results on Raspberry Pi 3. As the signal acquired from the mother’s abdomen is contaminated by several noises, in the second part, we propose a method to extract the fetal electrocardiogram FECG by using Independent Component Analysis (ICA) and Wavelet Transform (WT). The proposed method was tested on real data recordings from the publicly available Physionet database. In this paper, we proposed an efficient hardware design to well monitor the heart activity. Then, we presented our adopted method for fECG extraction. The obtained results with the mentioned method show the effectiveness of our proposed algorithm and it is suggested to be used in the portable designed fECG monitoring system.


Introduction
During pregnancy, the fetus's health condition must be monitored to detect abnormalities that could affect the heart. Thus the clinical specialist could be able to intervene and apply the adequate treatment. The best technique for monitoring the fetal heart is detecting the fECG. This signal carries vital information about the cardiac function of the fetus. Most fetal diseases are discovered early in the fECG. This technique has been an interesting challenge for years in the biomedical field and in signal processing. Researchers provided two different methods to detect the fECG, where one is invasive and the other is noninvasive. In the invasive method, an electrode should pass through the mother's uterus and enter the womb to touch the fetus's head. This procedure may cause some problems to both the mother and the fetus. Thus the most common method nowadays is the non-invasive method and it consists of placing electrodes on the mother's abdomen. On the one hand, a sophisticated monitoring system should be designed to process the heart activity. On the other hand, the abdomen electrocardiogram (aECG) should be processed to extract the fECG. In fact, the aECG includes both the fetus's electrocardiogram (fECG) and the mother's electrocardiogram (mECG), along with noises and artifacts [1,2]. This is why fECG extraction needs complex signal processing techniques such as, Independent Components Analysis (ICA), Singular Value Decomposition (SVD) and Wavelet based techniques and Artificial Neural Networks (ANN) etc. [3,4].
Advancements in computer sciences and the technology of sensors have shown that it is possible to monitor the human heart rate. In the literature, researchers implemented various computational settings in terms of monitoring schemes, as well as processing frequencies. In what follows, we review recent proposed works in the heart monitoring systems; especially we consider efficient monitoring systems design.
Shelar et al. [5] developed a microcontroller based system for health monitoring. Heartbeats of patients were analyzed using wireless system based ZigBee module and any abnormalities detected in health conditions were sent by SMS to the doctors through GSM.
In [6], Rajani et al. presented a heart monitoring system based on Arduino wireless communication for biomedical applications. An application to monitor the patient heart beat was developed and once an abnormal situation was detected, the doctor should be informed via a message using 3G shield.
In [7], an Android based Wireless Body Area Network (WBAN) was proposed. The system detected the heart condition using wearable sensors which senses the activity of the heart and transmitted the information to the medical center to analyze the ECG signal. If any abnormalities were detected, doctors can interact with patients by sending messages with necessary recommendations.
In [8], a home-based wireless ECG monitoring system using Zigbee technology was considered. Zigbee is a typical open technology that can handle low-power and low-cost demands of wireless networks through short-range radio.
The remaining of this paper is organized as follows: In Section II, the first part is devoted to our proposed hardware design for ECG monitoring system. In the second part, we review some related works proposed in the literature and our adopted method for fECG extraction. Section III is devoted to experimental results and discussions. Finally, Section IV summarizes our work and draws some conclusions.

Proposed Hardware Design
In our work, we aim to develop an ECG monitoring system to control the safety of the heart. The basic idea behind this work is to capture from sensors the patient's heart measurements, process them, and display the results to the doctor via Smartphone. In addition, the collected data should be sent to the hospital server to be stored for further analysis. To be more precise, a local device (wirelessly connected to the sensors) based micro-controller reads the data from the sensors through a WiFi receiver. ECG adhesive electrodes are placed on body parts to collect bio-medical signals, and the NodeMCU ESP8266 is ready to send this ECG signal. The transmission unit is composed of the sensor AD8232 and the WiFi module which will read the data acquired from sensor and transmitted it throw WiFi network to the processing unit (see Fig. 1). The ESP8266 is used to make the connection with an available WiFi network. This module is used for sending data to the internet. This module involves simple and effective architecture. We notice that efficient communication is very important for the well-being of the patient and needs to be processed with precision and accuracy. The ESP8266 require a programming using Arduino IDE to read the sensor data and transmit it to the Raspberry Pi card in order to store and process it for final visualization on a web page hosted by the Raspberry pi. The Mosquito protocol MQTT is adopted in our work. An Arduino script is created to connect to MQTT Broker and publish on a topic using an ESP8266. Also, a Python script is created that will subscribe to the same subject via a Raspberry Pi which acts as MQTT Broker.

Fetal ECG Extraction Algorithms
The signal processing of fECG is quite complicated since the mECG is with higher amplitude compared to the fetal one. The major task of this part is to separate significantly the maternal and fetal heart rates. Although the progress made in the literature for fetal extractions process, this task still a challenge due to the weakness of the fetal ECG compared to the maternal ECG. Various efforts have been made in the literature and the obtained results on the literature show that there is still room for improvements to extract efficiently the fECG.
Different signal processing methods have been implemented to extract fECG from abdominal mixtures. These methods could be broadly divided into two groups: mECG canceling by Blind source separation (BSS), it aims to separate the different component of the abdominal mixtures without a prior knowledge of the signal. And linear and non-linear filtering methods which aim to denoise the fECG signal from the mECG signal.
The purpose of BSS methods is to recover the signals sources without, or with very little, prior information on the sources or function of mixture, hence the term "blind".
There are different methods of blind signal separation: Based on the literature review, ICA has been the most efficient method in BSS, and it has the close approximation to ideal waveform. That's why we are adopting this method in our work and it will be well defined and detailed in the next section.

Independent Component Analysis (ICA) Technique
ICA works by separating mixed signal into independent components. The source signals are generally time-varying signals that are sampled over a period of time. It's used in a wide class of problems in signal and image processing, where one needs to extract the underlying sources from a set of mixtures. Various estimation techniques are adopted to evaluate the independent components in an ICA model, including minimization of mutual information, non-gaussianity estimation and maximum likelihood estimation [9]. There are four critical constraints to assure the proper use and success of ICA technique: Independence: The fundamental assumption is independence of sources. Several measures of dependence can be used to find the least dependent components possible. Gaussianity: We must also assume that the independent components must have non-gaussian distributions. Number of recorded signals: The number of recorded signals in x must be greater than or equal to the number of source signals that ICA is attempting to extract. Linear Mixing: The ICA technique assumes that the source signals have been linearly mixed to produce the recorded signals.
The ICA technique is explained as follows. For example, if the mixed is composed of two source signals with N samples. The source signals can be defined as: Any number of these source signals can be combined into a unique source vector as follows.
The signals in s are linearly combined to form mixture signals with no additive constant, x 1 and x 2 .
x 1 ¼ as 1 þ bs 2 (4) These mixture signals form a new vector x, which represent the input to the ICA algorithm.
x ¼ x may also be called the recorded or observed signals.
This mixing process is described in terms of matrix multiplication, rather than calculating each element of x separately. For this purpose, a mixing matrix A; M Â M is defined that contains the entire scalar multipliers used to form the mixture signals. The 2 Â 2 matrix A is defined in what follows: The mixing model used in ICA, given in the following equation: x ¼ As Alternatively, this equation can be expressed with time varying signals.
With a i components are the columns of mixing matrix A.
ICA attempts to recover the mixing matrix A and the original signals s when only the mixed signals x are known. To do this, it attempts to find an un-mixing matrix W such that y ¼ Wx where y represents the vector of extracted signals that are expected to be equal to s.
To sum up, the fundamental concept behind the ICA method is that it takes into consideration mixtures of independent signals and separates them into independent components by finding an un-mixing matrix.

ICA Algorithm
Recently, many improved ICA algorithms are proposed in the literature [10]. Among them, the FastICA algorithm is one of the most popular algorithms [9,11]. The FastICA is a fixed point algorithm which is based on iteration maximizing non-Gaussianity of the variables as a measure of independence. The FastICA is a version of the ICA algorithm that can be considered as neuronal network. It has been widely used for the extraction of the fECG signal. However, this method is sensitive to the initial weight values which may lead to different convergence problems. To overcome these limitations, a novel power iteration for solving the eigenvalue problem called PowerICA algorithm was proposed in [12] as an amelioration of the FastICA. The updating of ICA matrix is fully multiplicative rather than multiplicative and additive in the conventional algorithms. Moreover, this algorithm offers the advantage of running on parallel computing nodes, which reduces the computational time. Therefore, we adopt in our work the PowerICA algorithm for the fECG extraction.

Wavelet Transform (WT)
A Wavelet Transform (WT) offers a time-frequency multi-resolution analysis of signals that allows simultaneous interpretation in both time and frequency domain.
In the literature review, many proposed works have shown that WT is a powerful tool for signal analysis [9,11,12]. Its application to bio-signal processing has shown promising results where it has been found particularly useful in the study of the ECG signal. A large number of wavelet families and functions are available. We are interested to bio-orthogonal wavelets because its wavelet functions have a shape which is close to the ECG morphology. We cited Coiflet, Haar, Symlet and Daubechies, etc. Among the promising proposed approaches for fECG extraction, we notice the BSS methods especially ICA used in conjunction with Wavelet Transform (WT) [12]. In fact, Wavelet decomposition allows us to suppress noise and eliminate the high amplitude (mECG) that dominates the acquired abdominal signal.

Performance Evaluation
To evaluate the performances of the proposed methods, some features are taken into consideration: The signal-to-noise ratio (SNR): based on eigenvalues and cross-correlation coefficients proposed by Outram [13]. Fetal Heart Rate (FHR): normal range for FHR is 110-120 to 160 bpm. Sample entropy: is an efficient tool for investigating the dynamic of the ECG. It is a measure of a time series signal. In the one hand, a large value of sample entropy indicates a higher irregularity of the signal [14] as speculated that the source component of the fetal ECG had the largest irregularity due to the complications of recording a fetus signal. In the other hand, the larger the value for sample entropy, the larger the amount of noise is contaminating the signal [14]. Root Mean Square Error (RMS): is a statistical parameter that shows the magnitude of a varying signal. Lower RMS values indicate better quality of fECG signal [14]. Skewness: shows the level of asymmetry of a signal. Among fECGs, the one with higher skewness value shows better Signal to Noise Ratio.
Kurtosis: The absolute kurtosis value of mECG is higher than fECG but among the fECGs those with higher kurtosis value and are more suited for representative fECG. Means of R-peaks: A higher mean for the R-peaks signifies higher SNR. Peak frequency and magnitude of PSD (Power Spectral Density): describes the power present in the signal as a function of frequency, per unit frequency. Therefore, the peak frequency of the PSD can be considered as a good recognizer of fECG. In fact, the magnitude of the PSD in the frequency range of 20 to 30 Hz can be representative for fECG.

Fetal ECG Analysis
In this part, we discuss the basic ECG signal components and processing methods to enhance the signal for better employment of ECG signal diagnostic. An electrocardiogram (ECG) signal represents electrical activity of a human heart. ECG is composed of five waves: P, Q, R, S and T as shown in Fig. 2. This signal can be measured by electrodes from a human body in typical engagement.
Generally, the recorded ECG signal is often contaminated by noise and artifacts that can be detected within the frequency band of interest. In order to extract useful information from the noisy ECG signals, we need to process the raw ECG signals. ECG signal processing can be roughly divided into two steps: pre-processing and feature extraction.
The pre-processing stage removes or suppresses noise from the raw ECG signal and the feature extraction stage extracts diagnostic and significant information from the ECG signal. In our work, we detect the R peaks of our patient. ECG signals pre-processing help us to remove contaminants from ECG signals. Broadly speaking, ECG contaminants can be classified into the following categories: Power line interference Contact noise Patient-electrode motion artifacts In this paper, we adopted method the Pan-Tompkin's for QRS detection on the independent components. In general, the R waves are generally of greater amplitude than the others. But this is not the case in all patients: sometimes, the T wave is of comparable amplitude, which could be a serious cause of an error. Indeed, good detection of QRS complexes, therefore, requires more efficient signal processing. We present here a method of digital filtering of the signal. This method presented by Pan et al. is described in the following steps [15,16]: Bandpass filtering Derivation Nonlinear transformation Integration Low pass filtering Adaptive thresholding The signal passes through filtering, derivation; squaring and integration phases before thresholds are set and QRS complexes are detected. In the first step the algorithm passes the signal through a low pass and a high pass filter in order to reduce the influence of the muscle noise, the power line interference, the baseline wander and the T-wave interference.

Results and Discussion
Many signal processing methods have been successfully applied to extract fECG and these methods were tested by using synthetic data. However, performance evaluation of such methods using real database is a more challenging task. That's why we evaluated our proposed method using real data. In fact, the algorithm was tested using the clinical database Abdominal and Direct Fetal Electrocardiogram Database (ADFECGDB) [17]. In this database, one-channel annotated fetal ECG that can be used as a standard signal which accurately provides the ECG of the fetal heart. The data were collected from five pregnant women of childbirth at 38-41 weeks of gestation. Each record contains four signals obtained from the maternal abdomen and one acquired directly from the fetal head at a sampling rate of 1 kHz with a 5 minutes collection time. In what follows, the original record of the maternal abdomen signal database named r01 is represented (Fig. 3).
The four ECG components of r01 extracted by the improved PowerICA algorithm are represented in Fig. 4.
As shown in the table Tab. 1, IC2 is the signal with the high SNR value. So it seems to be the best choice for fetal ECG. Therefore, IC2 will be processed to be compared to the standard fECG (Fig. 5). At the first glance, there is the same number of detected R peaks for the two signals. Therefore, some features are calculated for each signal to compare the quality of the extracted fECG to the standard one. These features are the skewness (Sk), the kurtosis (k), median (med) and means (mn) (Tab. 2).
Then, we go to test our method on another signal r08. After decomposition of the r08 signal with PowerICA (Fig. 6), we analze the IC1 component and the obtained results from r08 signal are shown on (Fig. 7). We note that there are missing R peaks compared to the standard fECG. In order to ameliorate these results, we apply the wavelet transform on the IC1 component. In fact, the approximate coefficients of the decomposed signal which estimate the mECG signal will be extracted from the IC1. So, we test different wavelet methods to choose the adequate one for our work. The best results are obtained using the symlet4 wavelet with 8 levels. Then, we detect the R peaks. All the R peaks are detected compared to the standard fECG as illustrated on Fig. 8.      As shown in Tab. 3, the results are ameliorated after using the wavelet with the ICA compared to the standard direct fECG features.

Conclusions
In this paper, an efficient hardware prototype developed on Raspberry Pi3 has been deployed to operate as a wireless ECG monitoring system. Then, our method based on the ICA for fECG extraction from real abdominal signals has been proposed. The obtained results for some signals showed that not all R peaks are detected. To ameliorate these results, we investigated the WT in conjunction with the ICA decomposition. As an example, for the r08 signal, the five missed R peaks are detected after applying the symlet4 wavelet with 8 levels on the IC1 component obtained from the ICA decomposition. The results show that with WT we can eliminate useless details and extract more significant information about the QRS complexes. There is still room to further improve the system performances. We intend, on the one hand, to reduce the size of the hardware prototype for better mobility and improve the power supply with a rechargeable battery. On the other hand, we aim to assess the quality of the acquired ECG signal by developing an assessment algorithm.