A New Self-Adaptive Neuro Fuzzy Inference System for the Removal of Non-Linear Artifacts from the Respiratory Signal

Problem statement: In this study, a new ANFIS-based adaptive filter i s proposed to remove the non-linear artifacts from the respirator y signal measured using MEMS based accelerometer sensor. The data recorded from the abdomen movement includes the respiratory signal, electromyogram, 50Hz power line interference and th e random electrode noise. In order to avoid convergence into local extremes, the system employs ANFIS method. Approach: The proposed architecture is a combination of adaptive filter in which Least Mean Square and Recursive Least Square algorithms are employed and ANFIS, where ANF IS is recruited whenever the adaptive filter is suspected of reading a local extreme value. R sults: The results showed that the normalized LMS performs better when compared to other LMS algorith ms with SNR improvement of 4.17 dB and MSE value of 0.062. RLS provides least MSE value or 0.0 15 but only with highest filter order. Quantitative analysis reveals that ANFIS out performs the normal ized LMS and RLS algorithms. Conclusion: The result obtained indicates that ANFIS is a useful Ar tificial Intelligence technique to cancel the non linear interferences from the respiratory signal wi th very low mean square value of 0.011.


INTRODUCTION
The respiratory signal reflects the electrical activity of the respiration. It reveals information about the health of the human and therefore an early diagnosis of any cardiac defects increases the effectiveness of the appropriate treatment. There are several technical problems associated with the non-invasive extraction of respiratory signal recorded at the abdomen. These problems are mainly due to the various sources of interferences that overwhelm the weak respiratory signal component in such composite abdominal respiratory signal recordings. The interferences source includes the respiratory signal, electromyogram, 50Hz power line interference and the random electrode noise. Therefore it is reasonable to say that EMG signal component is the main source of interference which dominates the abdominal respiratory signal recording and severely overpowers the respiratory signal component embedded in it. Thus cancelling the unwanted signal component in an abdominal respiratory signal recording enables us to extract the original respiratory signal.
The Respiration can also be measured with the help of accelerometer, oximeter or piezo-electric sensors.
While recording the respiration signal, in addition with the actual signal, other effects may also get recorded. All these noises mask the tiny features of the signal and leads to false diagnosis. To allow doctors to view the best signal that can be obtained, we need to develop an adaptive filter to remove the artifacts in order to better obtain and interpret the respiratory signal data. The adaptive filter would take input both from the patient and from the power supply directly and would thus be able to track the actual frequency of the noise as it fluctuates. Application of LMS and its member algorithms to remove various artifacts in respiratory signal is carried out. Mean square error behavior, convergence and steady state analysis of different adaptive algorithms are analyzed.
This study describes the concept of adaptive noise cancelling, a method of estimating signals corrupted by additive noise. An adaptive neuro fuzzy inference system is proposed to remove the artifacts signals from respiratory signals. First the real-time artifact removal is also implemented by Least Mean Square and Recursive Least Square algorithms. The results show that the performance of the Normalized LMS algorithm is superior than conventional LMS algorithm, the performance of signed LMS and sign-sign LMS based realizations are comparable to that of the LMS based filtering techniques in terms of signal to noise ratio and computational complexity. RLS algorithm performs better with highest filter order but it leads to more complexity of filter structure. But the ANFIS being a neuro-fuzzy technique, it outperforms both the LMS and RLS adaptive filter algorithms. From the results obtained through these techniques, we infer that ANFIS cancels out the interference and gives better performance even if the complexity of the signal is very high.
Previous research: Several study have been presented in the area of noise removal from bio medical signal where an adaptive solution based on the various algorithms is suggested. The objective of the proposed approach in (WenNa et al., 2009) is to extract useful signals from background noise. It describes the adaptive detection of an unknown signal in a colored noise background. In the proposed technology, the ability for the Self-Adaptive Neural Network Fuzzy Inference System (ANFIS) approaching the nonlinear function is used. In the study (Kholdi et al., 2011), a new Genetic Algorithm (GA)-based adaptive filter is proposed to extract fetal heart signal, via two-channel method is used. Proposed architecture is a combination of adaptive filter and GA where the GA is recruited whenever the adaptive filter is suspected of reaching a local extremum. It is presented in (Rahman et al., 2009a) a simple and Efficient Normalized Signed Regressor LMS (NSRLMS) algorithm that can be applied to ECG signal in order to remove various artifacts from them. This algorithm enjoys less computational complexity because of the sign present in the algorithm and good filtering capability because of the normalized term.
It is described in (Miry et al., 2010) an adaptive noise canceller algorithm based fuzzy and neural network. The major advantage of the proposed system is its ease of implementation and fast convergence. The proposed algorithm is applied to noise canceling problem of long distance communication channel. The study (Marungsri et al., 2009) presents application of Adaptive Neuro-Fuzzy Inference Systems (ANFIS) for noise cancellation in partial discharge measurement signal which was detected by current transducer. The ANFIS uses a hybrid learning algorithm to identify parameters of Sugeno-type fuzzy inference systems. It applies a combination of the least-squares method and the back propagation gradient descent method for training FIS membership function parameters to emulate a given training data set. Finally, after training, the ANFIS output is demonstrated. It is evaluated in (Tseng, 2010) the performances of an Adaptive Noise Cancelling (ANC) based target detection algorithm on a set of real test data supported by the Defense Evaluation Research Agency (DERA UK) for multitarget wideband active sonar echolocation system. The hybrid algorithm proposed is a combination of an adaptive ANC neuro-fuzzy scheme in the first instance and followed by an iterative optimum Target Motion Estimation (TME) scheme.
In study (Li, 2010), to possess a desired robust model, the adaptive side lobe clutter cancellation system depended on ANFIS was introduced. Through the side lobe clutter cancellation, the Signal Noise Ratio (SNR) of echo signal got obviously improvement. The simulation results of experiments showed that the method of ANFIS can sharply improve the detecting performance of pulse Doppler radar seeker's looking for lower altitude target. The adaptive noise cancellation problem and how the neural network can be applied for weight convergence are discussed in (Kaur and Kaur, 2011). Adaptive filtering provides a nice tradeoff between complexity and convergence speed. The simulation results show that output error decreases with increase in number of iterations if back propagation approach is considered. Performance study and comparison of LMS and RLS algorithms for noise cancellation in ECG signal is carried out in (Islam et al., 2009). Block LMS being the solution of the steepest descent strategy for minimizing the mean square error is presented in (Rahman et al., 2009b). Arunachalam and Brown (2009) the authors present a real-time algorithm for estimation and removal of baseline wander noise and obtaining the ECG-derived respiration signal for estimation of a patient's respiratory rate. Rahman et al. (2009c), a simple and efficient normalized signed LMS algorithm is proposed for the removal of different kinds of noises from the ECG signal. The proposed implementation is suitable for applications requiring large signal to noise ratios with less computational complexity. The results in (Rahman et al., 2009d) show that the performance of the signed regressor LMS algorithm is superior than conventional LMS algorithm, the performance of signed LMS and sign-sign LMS based realizations are comparable to that of the LMS based filtering techniques in terms of signal to noise ratio and computational complexity. The use of two simple and robust variable step-size approaches in the adaptation process of the normalized least mean square algorithm in the adaptive channel equalization is investigated in (Jimaa et al., 2009).
In the study (Ramadan, 2010) introduced a variable step-size Least Mean-Square (LMS) algorithm in which the step-size is dependent on the Euclidian vector norm of the system output error. The performance of the algorithm was analyzed, simulated and compared to the Normalized LMS (NLMS) algorithm in several input environments.
Computer simulation results demonstrated substantial improvements in the speed of convergence of the proposed algorithms over other algorithms in stationary environments for the same small level of mis adjustment. The proposed method detects Foetal ECG by denoising abdominal ECG (AECG) and lead to the subsequent cancellation of maternal ECG (MECG) by adaptive filtering. The thoracic signal (TECG) which is purely of Mother signal (MECG) was used to cancel MECG in abdominal signal and the Foetal ECG detector extracts the FECG through Simple Genetic algorithm which enters as the editor of unwanted noise. An Artificial Neural Network (ANN) based approach was proposed for noise identification. The suggested technique involved selection of the noise samples and extracts their statistical features, which was then applied to a neural network to identify the noise. Neural networks provided a better solution in identifying the noise. In the work (Saifizul et al, 2006), first, the mathematical models of cart and single inverted pendulum system are presented. Then, the Position-Velocity controller is designed to swingup the pendulum considering physical behavior. For stabilizing the inverted pendulum, a Takagi-Sugeno fuzzy controller with Adaptive Neuro-Fuzzy Inference System (ANFIS) architecture is used to guarantee stability at unstable equilibrium position. In the study, it is proposed a digital hardware implementation of a neural system based on a Multilayer Perceptron (MLP). The neural system is used for the nonlinear adaptive prediction of nonstationary signals such as speech signals. The implemented architecture of the MLP is generated using a generic Elementary Neuron (EN). The polynomial approximation method is used to implement the sigmoidal activation function. The back-propagation algorithm is used to implant the prediction task.
In our previous work, we carried out (A. Bhavani Sankar et al, 2010a) a detailed study of various features of respiratory signal. The method we proposed in this work is based on the extraction of four main features of respiratory signal. The automatic signal classification starts by extracting signal features from 30 sec respiratory data through Autoregressive modeling (AR) and other techniques. Four features are: signal energy, zero crossing frequency, dominant frequency estimated by AR and strength of dominant frequency based on AR. These features are then compared to threshold values and introduced to a series of conditions to determine the signal category for each specific epoch. We focused (Sankar et al, 2010b) on modeling the Respiratory signal with second order Auto Regressive process. Then synthetic noises have been corrupted with respiratory signal and nullify these noises using various adaptive filter algorithms and to remove motion artifacts and 50Hz Power line interference from sinusoidal 0.18Hz respiratory signal using various adaptive filter algorithms. A performance study has been done between these algorithms based on various step sizes. It has been found that there will be always tradeoff between step sizes and Mean square error. It is examined in (Sankar et al, 2011) the classification of respiratory signals using an Artificial Neural Networks (ANN) system. We analyzed the performance of five back propagation training algorithms, namely, Levenberg-Marquardt, Scaled Conjugate Gradient, Quasi Newton BFGS Algorithm, One Step Secant and Powell-Beale Restarts algorithm for classification of the respiratory states. The Levenberg-Marquardt algorithm was observed to be correct in approximately 99% of the test cases.

Mathematical model of respiratory signal:
Respiration is the process by which the atmospheric oxygen is inhaled in to the body and the unwanted carbon dioxide is exhaled out through the nostrils and mouth. Respiratory signals are not a constant signal with common amplitude and regular variations from time to time. Hence to estimate the signal it is necessary to frame an algorithm which can analyze even the small variations in the input signal. Respiratory signal is modeled in to a second order AR equation so that the parameters can be utilized for determining the fundamental features of the respiratory signal. The Autoregressive (AR) model is one of the linear prediction formulas that attempt to predict an output Y(n) of a system based on the previous inputs {x(n), x(n-1), x(n-2)...}. The respiration signal can be modeled as a second order autoregressive model as the following Eq. 1: where, e (n) is the prediction error and {a 1 , a 2 } are AR model coefficients to be determined through burgs method.
Adaptive filters: Consider the wiener filtering problem within the context of non stationary processes. Specifically, let W N denote the unit sample response of the FIR Wiener filter that produces the minimum meansquare estimate of a desired process d (n) and the output y(n) is given by Eq. 2: In many respects, the design of a shiftvarying(adaptive) filter is much more difficult than the design of a (shift-invariant) Wiener filter since, for each value of n, it is necessary to find the set of optimum filter coefficients, W n (k), for k=0,1,…,p. However, the problem may be simplified considerably if we relax the requirement that w n minimize the mean-square error at each time n and consider, instead, a coefficient update equation of the form Eq. 3: where, ∆ wn is a correction that is applied to the filter coefficient w n at time n to form a new set of coefficient, ∆w n+1 , at time n+1. This update equation is the heart of the adaptive filters. Adaptive filtering can be considered as a process in which the parameters used for the processing of signals changes according to some criterion. Usually the criterion is the estimated mean squared error or the correlation. The general set up of adaptive filtering environment is shown in Fig. 1, where n is the iteration number, x(n) denotes the input signal, y(n) is the adaptive filter output and d (n) defines the desired signal. The error signal e (n) is calculated as d (n)-y (n).
The error is then used to form a performance function or objective function that is required by the adaptation algorithm in order to determine the appropriate updating of the filter coefficients. The minimization of the objective function implies that the adaptive filter output signal is matching the desired signal in some sense. Two types of adaptive algorithms are mostly used in the communication systems they are: Least mean square algorithm: Least Mean Squares (LMS) algorithms are a class of adaptive filter used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean squares of the error signal (difference between the desired and the actual signal). The steepest descent adaptive filter, which has a weight-vector update equation given by Eq. 4: Practical limitation with this algorithm is that the expectation E {e(n) X'(n)} is generally unknown. Therefore, it must be replaced with an estimate such as the sample mean. Incorporating this estimate into the steepest descent algorithm, the update for n w becomes Eq. 5: In this case, the weight vector update equation assumes a particularly simple form Eq. 7: n 1 n w w e(n)X (n) And is known as the LMS algorithm. The simplicity of the algorithm comes from the fact that the update for the kth coefficient Eq. 8: n 1 n W (k) w (k) e(n)x (n k) The different variation in LMS algorithm includes: The NLMS algorithm can be stated as Eq. 9: n 1 n 2 x (n) W w e(n) x(n) where, ∈ is some small positive number. Another set of simplifications to the LMS algorithm are found in the sign algorithms. In these algorithms, the LMS coefficient update equation is modified by applying the sign operator to either the error e (n), the data x (n), or the error and the data. For example, assuming that x (n) and d (n) are real-valued processes, the sign error algorithm is Eq. 10: w n + µ sgn{e(n)}x(n) Where: Sgn {e (n)} = 1; e (n) > 0 0; e (n) = 0 -1; e (n) < 0 Note that the sign error algorithm may be viewed as the result of applying a two-level quantizer to the error. The computational requirements of the LMS algorithm may be simplified by using the sign of the data as follows Eq. 11: w n+1 = w n +µe(n)sgn{x(n)} Which is the sign data algorithm. Note that, unlike the sign error algorithm, the sign-data algorithm alters the direction of the update vector. As a result, the sign data algorithm is generally less robust than the signerror algorithm. Quantizing both the error and the data leads to the sign-sign algorithm, which has a coefficient update equation given by Eq. 12: w n+1 = w n +µsgn{e(n)}sgn{x(n)} In this algorithm, the coefficients w n (k) are updated by either adding or subtracting a constant µ. For stability, a leakage term is often introduced into the sign-sign algorithm giving an update equation of the form Eq. 13: Generally, the sign-sign algorithm is slower than the LMS adaptive filter and has a larger excess mean square error.

Recursive least square algorithm: The Recursive
Least Squares (RLS) adaptive filter is an algorithm which recursively finds the filter coefficients that minimize a weighted linear least squares cost function relating to the input signals. In the derivation of the RLS, the input signals are considered deterministic, while for the LMS and similar algorithm they are considered stochastic. Compared to most of its competitors, the RLS exhibits extremely fast convergence. The RLS algorithm can be summarized as follows.
Parameters: P = Filter order Λ = Exponential weighting factor ∆ = Value used to initialize P (0) Initialization: w 0 = 0 P (0) = δ -1 I Computation: for n = 1, 2,… compute Z (n) = p (n-1) x * (n) G (n) = x (n) / (λ+x t (n) z (n)) Α (n) = d (n) -w t (n-1) x (n) W (n) = w (n-1)+α(n) g(n) P (n) = p (n-1)-g (n) z t (n)/λ Adaptive Neuro Fuzzy Inference System: The acronym ANFIS derives its name from Adaptive Neuro-Fuzzy Inference System. Using a given input/output data set, ANFIS constructs a Fuzzy Inference System (FIS) whose membership function parameters are tuned (adjusted) using either a back propagation algorithm alone or in combination with a least squares type of method. This adjustment allows your fuzzy systems to learn from the data they are modeling. Fuzzy inference systems incorporate human knowledge and perform inference and decision making. The basic idea of combining fuzzy systems and neural networks is to design an architecture that uses a fuzzy system to represent knowledge in an interpretable manner, in addition to possessing the learning ability of a neural network to optimize its parameters. ANFIS cancels out the interference and gives better performance even if the complexity of the signal is very high. The proper selection of the number, the type and the parameter of the fuzzy membership functions and rules is crucial for achieving the desired performance and in most situations, it is difficult. ANFIS are fuzzy Sugeno models put in the framework of adaptive systems to facilitate learning and adaptation. Such framework makes fuzzy logic more systematic and less relying on expert knowledge. Moreover, ANFIS architecture requirements and initializations are fewer and simpler compared to neural networks, which require extensive trails and errors for optimization of their architecture and initializations. Rule 1: if (x is A1) and (y is B1), then (f2 = p1x+q1y+r1) Rule 2: if (x is A2) and (y is B2), then (f2=p2x+q2y+r2) One possible ANFIS architecture to implement these two rules is shown in Fig. 2. Note that a circle indicates a fixed node whereas a square indicates an adaptive node (the parameters are changed during training).
Layer 1: Calculate membership value for premise parameter: All the nodes in this layer are adaptive nodes; is the degree of the membership of the input to the fuzzy Membership Function (MF) represented by the node: Layer 2: Firing strength of rule: The nodes in this layer are fixed (not adaptive).These are labeled to indicate that they play the role of a simple multiplier. The outputs of these nodes are given by: The output of each node is this layer represents the firing strength of the rule.
Layer 3: Normalize firing strength: Nodes in this layer are also fixed nodes. These are labeled N to indicate that these perform a normalization of the firing strength from previous layer. The output of each node in this layer is given by: Layer 4: Consequent Parameters: All the nodes in this layer are adaptive nodes. The output of each node is simply the product: O 4,i = 1 w f i = 1 1 1 1 2 1 w (p q r ) χ + χ + where, p i , q i and r i are design parameters (consequent parameter since they deal with the then-part of the fuzzy rule).

Layer 5: Overall output:
This layer has only one node labeled Σ indicated that is performs the function of a simple summer. The output of this single node is given by: The ANFIS architecture is not unique. Some layers can be combined and still produce the same output. In this ANFIS architecture, there are two adaptive layers (1-4). Layer 1 has three modifiable parameters (a i , b i , c i ) pertaining to the input MFs. These parameters are called premise parameters. Layer 4 has also three modifiable parameters (p i , q i , r i ) pertaining to the firstorder polynomial. These parameters are called consequent parameters.

Computations in ANFIS using MATLAB:
The basic steps used in the computation of ANFIS are given below: • Generate an initial Sugeno-type FIS system using the matlab command genfis 1. It will go over the data in a crude way and find a good starting system Give the parameters like number of epochs, tolerance error, number of MF, type of MF for learning. • Start learning process using the command anfis and stop when goal is achieved or the epoch is completed. Anfis applies the least squares method and the back propagation gradient descent for identifying linear and nonlinear parameters respectively • The evalfis command is used to determine the output of the FIS system for given input. In this study, we have taken the reference signal as respiratory signal. That signal act as training pair for ANFIS training. The model of input ANFIS architecture is shown in Fig. 3  The method proposed in this study is Adaptive Noise Cancellation (ANC) based on neuro fuzzy logic technique. ANC is a process by which the interference signal can be filtered out by identifying a non linear model between a measurable noise source and the corresponding immeasurable interference. The basic idea of an adaptive noise cancellation algorithm is to pass the corrupted signal through a filter that tends to suppress the noise while leaving the signal unchanged. Figure 4 shows noise cancellation with ANFIS filtering. Here x (k) represents the respiratory signal which is to be extracted from the noisy signal, n (k) is the noise source signal. The noise signal goes through unknown nonlinear dynamics (f) and generates a distorted noise d (k), which is then added to x (k) to form the measurable output signal y (k).The aim is to retrieve x (k) from the measured signal y (k) which consists of the required signal x (k) plus d (k), a distorted and delayed version of n (k) i.e., the interference signal.
The function f (.) represents the passage dynamics that the noise signal n (k) goes through. If f (.) was known exactly, it would be easy to recover x (k) by subtracting d (k) from y (k) directly. However, f (.) is usually unknown in advance and could be time-varying due to changes in the environment. Moreover, the spectrum of d (k) may overlap with that of x (k) substantially, invalidating the use of common frequency domain filtering techniques.
To estimate the interference signal d (k), we need to pick up a clean version of the noise signal n (k) that is independent of the required signal. However, we cannot access d (k) directly since it is an additive component of the overall measurable signal y (k). ANFIS is used to estimate the unknown interference d^(k). When d^(k) and d (k) are close to each other, these two get cancelled and we get the estimated output signal x^(k) which is close to the required signal. Thus by this method, the noise is completely removed and the required signal is obtained.

RESULTS
The results of simulation using MATLAB to investigate the performance behaviors of various adaptive filter algorithms and ANFIS in non stationary environment with step sizes of 0.06 and filter order of 16 is presented. The principle means of comparison is the error cancellation capability of the algorithms which depends on the parameters such as step size, filter length and number of iterations The Fig. 5 shows that the respiratory signal which is generated synthetically. This is the desired signal for the adaptive filter. A random noise is added with respiratory signals. It is then removed using ANFIS and adaptive filter algorithms such as LMS, Sign LMS, Sign-Sign LMS, Signed Regressor, LLMS and NLMS. All simulations presented are averages over 1975 independent runs.
The Fig. 6 shows that the noise is added with the respiratory signal which is generated synthetically. This is the input signal to the adaptive filter. Figure 7a and b shows the noise cancelled output respiratory signal and Mean squared error using LMS algorithms. A filter order of 16 and adaptive step size parameter (µ) of 0.06 are used for LMS. The merits of LMS algorithm is less consumption of memory and amount of calculation.
In the Table 1 filter order is fixed as constant to find, which step size value the LMS algorithm gives the best result. It is observed that for µ = 0.06 the LMS algorithm gives the best result. The value of MSE and SNR output for that step size value is 0.0592-7.6220 respectively. But there is always tradeoff between MSE and SNR. Hence choosing an algorithm depends on the parameter on which the system has more concern.
The Table 2 also provides the comparison table of the mean square error of various types of LMS to find best filter order. For that the step size value µ = 0.06 which is chosen from Table 1 is kept as constant and varies the filter order value. From this table it is infer that the filter order value 16 is giving the best result. Figure 8a and b shows the noise cancelled output respiratory signal and Mean squared error using NLMS algorithms. The Table 3 shows the comparison of resulting mean square error while eliminating noise from the respiratory signals using various adaptive filter algorithms with step size µ = 0.06, β=1(NLMS) and filter order = 16. Observing all cases, it is infer that NLMS has the minimum MSE value of 0.0589 and SNR improvement of 4.1733dB.      The Table 4 shows that comparison of MSE of various adaptive algorithms (LMS and RLS) with the filter order of 16 and step size value of 0.06. This table infers that the NLMS is better than the RLS. But for higher filter order the RLS algorithm converges fast.
Noise cancellation using ANFIS: The parameters used for ANFIS training are: The Fig. 9 shows the output signal. It is observed that the magnitude of the noise is very much reduced. Step size increases to 0.220000 after epoch 5: 6 0.628457 7 0.62439 8 0.62076 9 0.617658 Step size increases to 0.242000 after epoch 9:

DISCUSSION
The Table 5 shows that comparison of MSE with that of adaptive algorithms and ANFIS. It shows that MSE value of the estimated respiratory signal and convergence time is less when ANFIS technique is used. Also SNR is better for the same technique.

CONCLUSION
In this study, to record the respiratory signal, MEMS based accelerometer sensor is used. We proposed a new method to extract respiratory signal from the recorded abdomen movement using hybrid of neural and fuzzy inference system. Simulations are carried out to demonstrate the proposed system is sufficiently effective in suppressing the unwanted noise signals with fast convergence. The RLS is particularly useful in the case of signals where abrupt changes of amplitude or frequency may occur such as DC noises. But this better-quality performance comes at a price: The RLS takes more time to compute, especially when the filter length is large. In our study normalized LMS is compared with ANFIS. Quantitative analysis reveals that ANFIS out performance the NLMS. The result obtained indicates that ANFIS is a useful artificial Intelligence technique to cancel the non linear interferences from the respiratory signal. The future work includes the optimization of algorithms for all kinds of noises and to use the optimized one in the implementation of DSP microcontroller and LABVIEW that estimates the respiratory signal.