Research Article
Maternal ECG Cancellation in Abdominal Signal Using ANFIS and Wavelets
Department of EIE, Bits Pilani, Dubai, UAE
D.V. Prasad
Department of EIE, Bits Pilani, Dubai, UAE
The analysis of the electrocardiogram is a fairly reliable technique for cardiac disease diagnosis. The MECG signal is obtained by electrodes located on the maternal surface. The resulting signals are a mixture of MECG, FECG, interfering noise such as base line wander, maternal electromyogram, power line interference, thermal noise and other noise from electronic equipment (Mazzeo, 1994). In order to monitor the FECG, it has to be separated from these noisy elements.
Different methods have been proposed for the detection and extraction of FECG which includes subtraction of an averaged pattern (Horner et al., 1995), matched filtering (Pieri et al., 2001), adaptive filtering (Zarzoso et al., 1997), IIR adaptive filtering combined with genetic algorithms (Kam and Cohen, 1999), Blind source separation (Lathauwer et al., 2000), Singular value decomposition (Kanjilal et al., 1997), Wavelet transform (Mochimaru et al., 2002), Independent component analysis and wavelets (Vigneron et al., 2003). Some of the soft computing techniques are fuzzy logic (Azad, 2000), FIR neural network (Camps-Valls et al., 2001), dynamic neural network (Camps-Valls et al., 2004), polynomial network (Assaleh and Nashash, 2005), adaptive neuro fuzzy logic technique (Selva Vijila et al., 2006), singular value decomposition and neuro-fuzzy inference system (Al-Zaben and Al-Smadi, 2006) and ANFIS (Assaleh, 2007).
In this study, a new method of combining the adaptive neuro fuzzy inference system with wavelet is presented to extract the FECG from the composite abdominal signal. The proposed methods used in this work are (1) ANFIS method of FECG extraction (2) wavelet preprocessing of the abdominal signal followed by ANFIS to extract FECG (3) extracting FECG using ANFIS followed by post processing using wavelets. Real abdominal signals were used to test the algorithms.
The development of different algorithms to extract fetal ECG presented in this paper started in the year 2009 and the testing and evaluation of the algorithms was done using data sets from 5 patients. They are (1) Normal pregnancy data set with the sampling frequency of 250 Hz. (2) 40th week data set for normal pregnancy with sampling frequency of 1 KHz. (3) 37th week data set from a sport woman having no risk of pregnancy and sampling frequency is 250 Hz. (4) Data set during labor with no drug administration and sampling frequency of 400 Hz. (5) Data set during labor, after oxytocin administration with sampling frequency of 400 Hz.
Wavelet transform: The wavelet transform (Mallat and Hwang, 1992) is a time-scale representation technique, which describes a signal by using correlation with translation and dilation of a function called as mother wavelet. The Continuous Wavelet Transform (CWT) is defined as the sum over all times of the continuous signal f(t) multiplied by scaled, shifted versions of the mother wavelet Ψ((t-τ)/s) as shown in Eq. 1
(1) |
The parameter s is the scale factor that compresses the mother wavelet and τ is the translation of the mother wavelet along the time axis. The discrete wavelet transform (DWT) is defined by splitting f(t) in to smaller non overlapping parts fi(t), taking a finite number of scales N and down sampling the discrete wavelet coefficients samples to M, the number of samples of fi(t), as shown in Eq. 2.
(2) |
The DWT is a batch method, which analyses a finite-length, time-domain signal at different frequency bands with different resolutions by successive decomposition in to coarse approximation and detail information. The approximation is the high scale, low frequency components of the signal and the details are the low scale, high frequency components. The wavelets are used as a decomposition and denoising tool (Najumnissa and Devi, 2008). The wavelet denoising method consists of applying DWT to the original signal, thresholding the detail and approximation coefficients and inversing the threshold coefficients to obtain the time domain denoised data (Paraschiv-Ionescu et al., 2002). The performance of the wavelet denoising depends upon the type of wavelet transform, type of the wavelet, thresholding rule and the number of decomposition levels. The steps for denoising are:
• | Decompose the signal-Choose a wavelet, choose a level n. Compute the wavelet decomposition of the signal s at level n |
• | After the wavelet decomposition, the wavelet coefficients are modified and then the reconstruction takes place |
• | Reconstruction of the signal-compute wavelet reconstruction using the original approximation coefficients of level n and the modified coefficients of level from 1 to n |
ANFIS: Adaptive Neuro Fuzzy Inference System (ANFIS) was originally presented by Jang (1993). It has architecture and learning procedure for the Fuzzy Inference System (FIS) that uses a neural network learning algorithm for constructing a set of fuzzy if-then rules with appropriate Membership Functions (MFs) from the specified input-output pairs. This procedure of developing a FIS using the framework of adaptive neural networks is called an adaptive neuro fuzzy inference system. ANFIS has the advantages of easy implementation and learning ability by combining the neural networks with fuzzy inference system (Jang et al., 1997). There are two methods that ANFIS learning employs for updating membership function parameters: (1) back propagation for all parameters (a steepest descent method) and (2) a hybrid method consisting of back propagation for the parameters associated with the input membership functions and least squares estimation for the parameters associated with the output membership functions. As a result, the training error decreases, at least locally, throughout the learning process. Therefore, the more the initial membership functions resemble the optimal ones, the easier it will be for the model parameter training to converge. Human expertise about the target system to be modeled may aid in setting up these initial membership function parameters in the FIS structure (Jang, 1993). The type of fuzzy model uses fuzzy inputs and rules but its outputs are non-fuzzy sets (Takagi and Sugeno, 1985).
For simplicity, assume that the fuzzy inference system has two inputs x and y and one output z. A first-order Takagi and Sugeno fuzzy model has the following rules:
• | Rule 1: If x is A1 and y is B1, then f1 = p1x + q1y + r1 |
• | Rule 2: If x is A2 and y is B2, then f2 = p2x + q2y + r2 |
Here, x is A1 and y is B1 and x is A2 and y is B2 are called as the premise section (non linear section), while f1 = p1x + q1y + r1and f2 = p2x + q2y + r2 are called as the consequent section (linear section). i.e., p1, p2, q1, q2, r1, r2 are linear parameters and A1, A2, B1, B2 are non linear parameter. The corresponding equivalent ANFIS architecture is shown in Fig. 1a and b (Jang, 1993).
ANFIS architecture: ANFIS is a multilayer feed forward network. The system architecture consists of five layers namely, fuzzy layer, product layer, normalized layer, de-fuzzy layer and total output layer. The circular nodes represent nodes that are fixed whereas the square nodes are nodes that have parameters to be learnt. The following section discusses in depth the relationship between the input and output of each layer in ANFIS.
Fig. 1: | (a) First-order Sugeno fuzzy model and (b) corresponding ANFIS architecture |
Layer 1: It is the fuzzy layer. Every node i in this layer is an adaptive node with a node function. Ol,i is the output of the ith node of the layer l which is shown in Eq. 3:
(3) |
x (or y) is the input node i and Ai (or Bi-2) is a linguistic label associated with this node. Therefore O1,i is the membership grade of a fuzzy set (A1, A2, B1, B2). In this work, bell shaped Membership Functions (MF) are chosen and it is shown in Eq. 4:
(4) |
where, ai, bi and ci is are the premise parameter set to be learnt.
Layer 2: It is the product layer that consists of two nodes labeled as Π. The output is the product (X) of all the incoming signals which is shown in Eq. 5:
(5) |
Each node represents the firing strength of the rule. w1, w2 are the weight functions of the next layer.
Layer 3: It is the normalized layer. Every node in this layer is a fixed node labeled Norm. Its function is to normalize the weight function with the following condition, where O3,i denotes the Layer 3 output as shown in Eq. 6
(6) |
Outputs are called normalized firing strengths.
Layer 4: It is the defuzzy layer. Every node i in this layer is an adaptive node. The defuzzy relationship between the input and output of this layer can be defined below, where O4,i denotes the layer 4 output as shown in Eq. 7:
(7) |
where, is the normalized firing strength from layer 3. pi, qi, ri denote the linear parameters which are also called consequent parameters of the node.
Layer 5: It is the total output layer, whose node is labeled as sum, which computes the overall output as the summation of all incoming signals. The result can be written as follows where as O5,i denotes the layer 5 output as shown in Eq. 8:
(8) |
The ANFIS can be trained by a hybrid learning algorithm which combines the gradient descent method and least square method. Each epoch of hybrid learning consists of forward pass and backward pass. In the forward pass the algorithm uses least-squares method to identify the consequent parameters on the layer 4. In the backward pass the errors are propagated backward and the premise parameters are updated by gradient descent (Jang and Gulley, 1995).
FECG extraction using ANFIS: The inputs to the ANFIS are (1) abdominal signal (MECG +FECG) acting as the reference signal (2) thoracic signal (TECG) acting as the desired signal as shown in Fig. 2. The ANFIS uses hybrid learning technique to calculate the linear, non linear parameters. The output of the ANFIS is the estimated thoracic signal present in the abdominal signal. The error between the estimated thoracic signal and the abdominal signal gives the FECG. Real data was used to illustrate the effectiveness of our proposed method in extracting FECG signals. The training and learning procedure is needed only one time and can be done offline. Thus the computational complexity can be reduced. The ANFIS converts the fuzzy inference engine in to an adaptive network that learns the relationship between the inputs and outputs. Extraction of FECG using ANFIS (Assaleh, 2007) yielded satisfactory results. In this proposed methods, generalized bell shape (gbellmf) MF is used for ANFIS training. Selecting an appropriate number of membership functions is essential for improving the convergence speed of the ANFIS algorithm.
Fig. 2: | FECG extraction using ANFIS |
Fig. 3: | ANFIS structure |
In this study, the number of membership function for each input variable is determined by a trial and error process and we propose 6 membership functions generating 36 fuzzy rules. The structure of ANFIS used in this extraction of FECG is shown in Fig. 3. There are two inputs in the input layer. Fuzzification is done by layer1 (inputmf) which has 6 membership functions to each input. Totally 36 fuzzy rules are used in layer 2 (rule). Layer 3 is the normalizing layer which is not included in this architecture. Layer 4 is the defuzzification layer (outmf). Layer 5 is the summation layer. Two inputs, 6 membership functions generating 36 fuzzy rules yielded 101 nodes, 108 consequent parameters, 36 premise parameters for training data pair of 601samples.
FECG extraction using wavelet and ANFIS: In this method, the abdominal ECG is first wavelet preprocessed as shown in Fig. 4. The wavelet preprocessing includes wavelet decomposition and reconstruction. The wavelet decomposition and reconstruction were performed by coiflets wavelets and only the approximation coefficients are retained as a signal carrying the useful information.
Fig. 4: | FECG extraction using wavelet and ANFIS |
Fig. 5: | FECG extraction using ANFIS and wavelet |
The number of levels of decomposition was chosen as 5.
The property of coiflets wavelet is good for this application because it reduces the noise and provides high resolution output. Also, the chosen wavelet has a shape similar to FECG. The approximation coefficient is taken as a noise free abdominal signal which is one of the inputs to ANFIS and the other input is the thoracic signal. The output of ANFIS is the extracted fetal ECG.
FECG extraction using ANFIS and wavelet post processing: In this method, the inputs to the ANFIS are the abdominal signal and the thoracic signal. The error signal is the FECG signal which is decomposed to 5 levels using coiflets wavelet as shown in Fig. 5. The approximation coefficient is taken as a noise free FECG signal which is the output from the wavelet post processing block.
The extraction of FECG was done using the following methods:
• | ANFIS |
• | Wavelet preprocessing followed by ANFIS |
• | ANFIS followed by wavelet post processing |
The above methods are tested with the data for the 5 patients.
Analysis of case I: Case I is the normal pregnancy data set with a sampling frequency of 250 Hz. Figure 6a-c shows the abdominal ECG, estimated thoracic signal and the extracted fetal ECG using ANFIS method. The estimated thoracic ECG is seen to be closely following the maternal ECG which is present in the abdominal ECG signal. The FECG is extracted by canceling the thoracic ECG signal from the abdominal ECG signal. In Fig. 7a-c, the results of FECG extraction using wavelets and ANFIS are shown. In this method there is an oscillatory phenomena present in the position of maternal ECG in the extracted signal.
Fig. 6: | FECG extraction using ANFIS-case I. (a) Original signal, (b) estimated TECG and (c) extracted FECG |
Fig. 7: | FECG extraction using wavelet and ANFIS-case I. (a) Original signal, (b) estimated TECG and (c) extracted FECG |
Fig. 8: | FECG extraction using ANFIS and wavelet-case I. (a) Original signal, (b) estimated TECG and (c) extracted FECG |
Such a phenomena is insignificant in ANFIS followed by wavelet post processing method as shown in Fig. 8a-c where the extracted FECG is also noise free. Figure 6a-c to 8a-c show the total absence of MECG in the extracted FECG. The overlapping of FECG with MECG is seen at sample 500 in the abdominal signal. The proposed methods were able to extract FECG even when, FECG is overlapping with the maternal ECG. Thus the extracted FECG is the actual FECG present in the abdominal signal. The visual quality of the extracted signal is seen to be better in ANFIS and wavelet post processed extraction method.
Fig. 9: | FECG extraction using ANFIS-case II. (a) Abdominal ECG and (b) extracted FECG |
Fig. 10: | FECG extraction using wavelet and ANFIS-case II. (a) Abdominal ECG and (b) extracted FECG |
Fig. 11: | FECG extraction using ANFIS and wavelet-case II. (a) Abdominal ECG and (b) extracted FECG |
Analysis of case II: Case II is the 40th week data set with a sampling frequency of 1 kHz. Figure 9 shows the abdominal signal which has very large magnitude of maternal ECG compared to fetal ECG present in the composite abdominal signal. The recorded signal has higher magnitude and large variations due to large contraction of uterus nearing the delivery time. The different methods used in this work are able to suppress maternal ECG and extract fetal ECG even in the presence of large P and T waves as shown in Fig. 9a, b to 11a, b. The visual quality of extracted FECG shows gradual decrease in noise content from Fig. 9a, b to 11a, b with significant presence of fetal ECG.
Analysis of case III: Case III is the 37th week data set from a sport woman having no risk of pregnancy and with sampling frequency of 250 Hz.
Fig. 12: | FECG extraction using ANFIS-Case III. (a) Original signal and (b) Extracted FECG |
Fig. 13: | FECG extraction using wavelet and ANFIS-Case III. (a) Original signal and (b) Extracted FECG |
Fig. 14: | FECG extraction using ANFIS and wavelet-Case III. (a) Original signal and (b) Extracted FECG |
In this case, the abdominal signal shows no overlapping between the fetal ECG and maternal ECG. Also, the numbers of FECG components present in the signal are more compared to previous data sets. The proposed methods are able to extract all the fetal ECG present in the composite abdominal signal as shown in Fig. 12a, b to 14a, b. The FECG is the dominant component in extracted signal.
Analysis of case IV: Case IV is the data set which is recorded during labor without oxytocin administration with sampling frequency of 400 Hz. All the methods were able to extract FECG successfully and suppress the maternal ECG to a very large extent as shown in Fig. 15a, b to 17a, b. The visual quality of the extracted signal in Fig. 15a, b and 17a, b are similar.
Fig. 15: | FECG extraction using ANFIS-Case IV. (a) Original signal and (b) Extracted FECG |
Fig. 16: | FECG extraction using wavelet and ANFIS-Case IV. (a) Original signal and (b) Extracted FECG |
Fig. 17: | FECG extraction using ANFIS and wavelet-Case IV. (a) Original signal and (b) Extracted FECG |
However in Figure 16a, b there is a small presence of maternal ECG at sample number 950 in the extracted FECG signal.
Analysis of case V: Case V is the data set which is recorded during labor, after oxytocin administration with sampling frequency of 400 Hz. The recorded abdominal signal has higher magnitude and large variations due to large contraction caused by oxytocin administration. The overlapped FECG signal near sample number 700 is extracted undistorted, even when T wave larger than the fetal QRS complex and also if the baseline has fluctuations due to the uterine contractions.
Fig. 18: | FECG extraction using ANFIS-Case V. (a) Original signal and (b) Extracted FECG |
Fig. 19: | FECG extraction using wavelet and ANFIS-Case V. (a) Original signal and (b) Extracted FECG |
Fig. 20: | FECG extraction using ANFIS and wavelet-Case V. (a) Original signal and (b) Extracted FECG |
The visual quality of extracted FECG shows gradual decrease in noise content as seen from Fig. 18a, b to 20a, b.
EVALUATION AND DISCUSSION OF THE PROPOSED METHODS
The proposed methods have been analyzed for the quality of extracted FECG. The parameters used to assess the quality of the FECG are Signal to Noise Ratio (SNR), correlation coefficients (CORR) and performance indices. Correlation coefficient is obtained between the composite abdominal signal and the extracted FECG. The correlation value of 1 indicates the high presence of maternal ECG and the value 0 indicates no presence of fetal ECG.
Table 1: | Performance evaluation for case I |
The signal to noise ratio is obtained for extracted FECG signal. The performance indices for extracted FECG are assessed by the following parameters (Kohler et al., 2002).
• | Sensitivity (SEN) = TP/ (TP+FN) |
• | Specificity (SPE) = TN/ (FP+TN) |
• | Positive predictive value (PPV) = TP/ (TP+FP) |
• | Negative predictive value (NPV) = TN/ (FN+TN) |
• | Accuracy (ACC) = TP+TN/ (TP+FP+FN+TN) |
where, TP (True positive) is the total number of positive peaks detected in extracted FECG. TN (True Negative) is the total number of negative peaks detected in extracted FECG. FN is (False Negative) when an artifact is detected as negative peak. FP is (False Positive) when an artifact is detected as a positive peak. The evaluation parameters for case I to case V with three proposed methods are shown from Table 1 to 5.
Evaluation of case I: The performance evaluation for case I was done for the three methods which includes correlation coefficient, signal to noise ratio and performance indexes SEN, SPE, PPV, NPV and accuracy. The results are shown in Table 1. For all the three methods the performance indices have the same value, however the correlation is seen to be very close in ANFIS method and ANFIS wavelet post processing method. Thus comparing the SNR it is concluded that the ANFIS and wavelet post processing method is better of all the three methods.
Evaluation of case II: The results of performance evaluation of case II are shown in Table 2. All the performance indices have the same and maximum value in ANFIS and wavelet post processing method. The correlation coefficient for all the methods has the similar range of values. Thus comparing SNR the ANFIS and wavelet post processed method has the highest value and to conclude this method is the better method of all the three methods.
Evaluation of case III: The results of performance evaluation for case III are shown in Table 3. All the performance indices have the same and maximum value in method II and method III.
Table 2: | Performance evaluation for case II |
Table 3: | Performance evaluation for case III |
Table 4: | Performance evaluation for case IV |
Table 5: | Performance Evaluation for case V |
However the correlation is seen to be very close in ANFIS method and ANFIS wavelet post processing method. Thus comparing SNR the ANFIS and wavelet post processed method has the highest value and to conclude this method is the better method of all the three methods.
Evaluation of case IV: The results of performance evaluation for case IV are shown in Table 4. All the performance indices have the same and maximum value in method II and method III. The correlation coefficient and SNR has the maximum value in ANFIS and wavelet post processing method. To conclude this method is better method.
Evaluation of case V: The results of performance evaluation for case V are shown in Table 5. All the performance indices have the same and maximum value in ANFIS and wavelet post processing method. And also the correlation coefficient and SNR has the higher value in ANFIS and wavelet post processing method. To conclude this method is better for FECG extraction.
The correlation is high, in case IV and case V for ANFIS and wavelet post processing method. However, the correlation in case I, case II and case III has similar values for ANFIS, ANFIS and wavelet post processing method.
Table 6: | Summary of existing methods |
The comparison between all the methods, in all the cases shows that the SNR is highest in ANFIS and wavelet post processing method. This method shows considerable improvement in performance indices also. To conclude the correlation coefficient, SNR and performance indices indicate that the ANFIS and wavelet post processing method is more preferred method for FECG extraction. The visual quality indicates that the extracted FECG is of superior quality in ANFIS and wavelet post processing method.
Comparison of existing methods and proposed method: Table 6 shows the results obtained by other methods in the literature for fetal ECG extraction. The proposed ANFIS and wavelet post processing method is compared to other methods in terms of accuracy. It should be noted that there is lack of standard reference data base available in the literature. This means that different methods in the literature cannot be directly compared since they were evaluated using different data set. The majority of the methods were either tested using simulated signal or a small number of real recordings.
In this study, we have proposed a new method of combining ANFIS and wavelets to extract FECG from abdominal ECG. Three different methods namely (1) ANFIS (2) wavelet preprocessing followed by ANFIS (3) ANFIS followed by wavelet post processing have been suggested. The advantages of these methods are it requires only one abdominal signal and one thoracic signal for FECG extraction. This is done by applying ANFIS to identify the non linear relationship between the maternal component in the abdominal ECG and the thoracic ECG which is assumed to have no fetal component in it. The FECG can be extracted by subtracting the MECG signal from the abdominal signal. The mathematical analysis is very less because of the qualitative aspects of the artificial intelligence. The proposed methods have been evaluated using the SNR, correlation coefficient and performance indices. The comparison shows that the ANFIS and wavelet post processing is the better method for fetal ECG extraction. The extracted FECG is seen to be of high quality in this method. This method is capable of extracting FECG even when, the FECG is overlapping with MECG. And also the morphology of the extracted FECG remains same and it can be used by the physicians to diagnose.
The authors would like to thank Prof. M. Ramachandran, Director, BITS Pilani-Dubai for his constant encouragement and support. We would like to thank the management of BITS Pilani-Rajasthan, India in completion of this work. We would also like to thank Physionet.org and Sista/Daisy group at K.U. Leuven, the Netherlands for providing the ECG data. We are extremely thankful to Dr. G. Mihaela Ungureanu, Romania for providing the three data sets.