You are on page 1of 4

Respiration Estimation and Apnea Detection Using Fuzzy Logic

Akrit Mudvari, Student Member, IEEE and Taikang Ning, Senior Member, IEEE

Abstract— This paper presents a fuzzy logic-based II. METHOD


respiration monitoring algorithm that is capable of providing
accurate respiration rate and detecting apnea episodes. The To provide an accurate estimation of the respiration rate
proposed algorithm employs several signal processing and to correctly detect the apnea episode, we have employed
techniques to extract useful features that signify different several signal processing methods to extract key features that
respiratory behaviors. We implement a fuzzy logic-based score the respiration behavior.
system that examines the extracted respiratory signal features A. Adaptive Thresholding
and categorizes the respiratory signals into respiration, body
motion, and apnea. The performance of the underlying In this method, breath information is extracted based on
algorithm is validated using both the MIT physiology database the waveform fluctuations across an adaptive threshold. This
and in-house respiration measurements. threshold is dynamically adjusted using most recently
I. INTRODUCTION detected breathing features. Weighted average of previous
breaths is calculated, where most recent breaths are assigned
Sleep apnea syndrome is a serious health threat problem more weight. The main advantage of an adaptive threshold is
that affects 5% of the world’s total population. The that the breath waveform changes due to body movement or
percentage is even higher among certain demographics. For loosening of respiration transducer during sleep will have
example, it rises up to 30% for males over the age of 70 [1]. much less effect on accuracy of the respiration rate
Apnea is known to result in multiple problems including estimation. The threshold of adaptive thresholding is
abnormal behavior during sleep such as body movements initialized and calibrated using several normal breaths from
resulting in injuries, nocturnal enuresis, headache in the the human subject.
morning, and drowsiness during the day due to lack of proper
sleep [2]. While sleep apnea is a prevalent disease, clinical In case of respiration with body movement, the signal
diagnosis of sleep apnea still has a lot of room for resembles amplitude variation of normal breathing but
improvement [3]. exhibits aperiodic and irregular waveform. Time period
between consecutive signals of breath is taken into account
In this paper, four signal processing methods were used in and anomalous data is excluded. As such, the processed
our study to extract multiple respiration signal features. result enables us to know whether the recorded signal is
Adaptive approach was utilized to dynamically adjust the caused by normal respiration or motion artifacts. Fig.1
thresholding values to gain better accuracy in respiration rate exemplifies the classification of detected peaks into normal
estimation. For instance, adaptive threshold was used to breathing and breathing with body motion artifacts.
account for loosening of the abdominal strain gauge, which is
an impedance measurement device strapped to an elastic B. Zero-crossing and Signal Energy
band [6]. This is a necessary measure because respiration rate In the second process, strength of the signal is acquired in
varies by the health condition [6] and the patient’s age. real time, and a few seconds-long samples are processed to
Once the breathing activity is recognized using these have zero average. In order to acquire a zero-average,
methods, respiration rates measured using different methods weighted averages of the most recent data are taken and the
and signal strength are used to detect the definite instances of weights are assigned to allocate more importance to the most
apnea. Here, higher preference is allocated to eliminating
false negatives because a real time detection would enable
immediate medical attention. However, it is necessary to
realize that with the onset of apnea, body struggles could
result in some activity in strain gauge, which resembles but is
not identical to body movements during normal breath [8].
Since it is more difficult to separate normal breathing activity
from signals effected by the noises due to body movement,
fuzzy logic-based approach is employed to process the signal
and classify a period of respiration into normal breathing and
body movement. Episodes with overlapping time periods are
taken to minimize the chances of missing out on instances of
apnea, and data obtained for different source are used to
verify that the apnea is detected in each case.
_____________________________
A. Mudvari and T. Ning are with the Engineering Department of Trinity Figure 1: Adaptive thresholding detection: detected breaths are
noted by as vertical lines where lines having amplitude near 200
College, Hartford, CT 06106, USA (tel: 860-297-2517; fax: 860-297-2531;
represent body movement noise.
e-mail: akrit.mudvari@trincoll.edu)

978-1-5090-2809-2/17/$31.00 ©2017 IEEE 2818


recent data. This ensures that loosening or tightening of the
strain gauge does not reduce accuracy of the algorithm. Zero
crossing method allows the algorithm to detect and
distinguish “normal breath” and “breath with movement” in
real-time and calculate the respiration rate. A difference
between this technique and the threshold crossing method is
that here, the standard deviation of the data is used to
measure the threshold, rather than the average.
Another used of the zero averaged data is calculation of
the signals “energy” (root mean squared of the signal’s zero-
averaged amplitude for a particular sample collected in real
time). This method is particularly useful in detecting apnea
because the absence of adequate expansion and contraction of
abdominal strain gauge means that there is neither normal
breathing nor any signal generation due to body movements.
Figure 2: Membership function of the relative magnitude of
C. Respiration Waveform Slope dominant frequency for normal respiration (solid line) and body
movement artifacts (dashed line)
This method uses the magnitude and the rate of change in
respiration amplitude to categorize the signal into normal A. Membership Function Using AR Coefficient Magnitude
respiration, apnea, and body movement artifacts. Normal
After obtaining data on episodes that are definitively
breathing signal is used to obtain the baseline data that
normal (based on the observation of healthy breathing
characterize normal respiration. The “rise” and “fall” of a
episodes), the average and the standard deviation of relative
breath signal are noted by their associated “slopes.” These
magnitude of the dominant frequency are obtained. Same
waveform slope features are included in the proposed
process is repeated for episodes that were classified as a
algorithm to classify respiration waveform signals.
result of body movement. The membership functions as
D. Autoregressive (AR) modelling shown in Fig.2 are constructed using the obtained values.
Input membership functions (IM) for normal breath is
The respiration rate can be efficiently estimated using obtained using the following formula:
second order autoregressive (AR) model. While higher order
AR models are also applicable, it is sufficient to use a
second-order AR model (1) to capture the dominant
frequency of a short data segment [9]. (3)

e k  x ( k )  a1 x ( k  1)  a 2 x ( k  2 ) (1)
Similarly, IMmovement is calculated with 1 for x<µmovement.
AR model coefficients {a1, a2} are estimated using a short
data segment and the respiration rate is estimated by B. Membership Function Using Peak Average of ‘normal’
and ‘movement artifact’:
2
f samp 4 a 2  a1 Once the respiration rates for signals classified as ‘normal’
). (2)
1
freq  tan ( and as ‘affected with movement’ are obtained, membership
2 a1
functions are heuristically assigned (the assignment emulated
where fsamp is the sampling frequency used during respiration decision-making of the experts and was later statistically
measurement. verified). Table I. shows the example of assigned
Since the normal breath signals were found to exhibit membership function values.
regular behavior similar to a sinusoidal signal while body
movement artifacts displayed irregular fluctuations, the 2nd
order AR model refection coefficient (a2) can be used to TABLE I: ASSIGNED MEMBERSHIP FUNCTIONS OF NORMAL RESPIRATION AND
signify the closeness to a sine wave, where the magnitude of MOTION ARTIFACTS
a2 closer to 1 indicates a regular waveform.
Motion Peaks Normal Respiration Peaks
0 1 2 3 4
III. FUZZY LOGIC APPROACH
0 0 0.1 0.6 0.9 1
A Fuzzy-logic [9] based approach is used in our study to
1 0 0.1 0.5 0.85 0.96
analyze respiration signals. We developed membership
functions that assign varying degrees of membership to the 2 0 0.1 0.45 0.85 0.93
variables that are used in decision-making [9]. The first input
3 0 0.07 0.45 0.83 0.88
variable used in the calculation is the relative magnitude of
the dominant frequency obtained from autoregressive >=4 0 0.05 0.35 0.8 0.85
modelling. For the second input, average of healthy peaks
detected using adaptive threshold method, zero crossing
method and respiration waveform slope method are used.
2819
Figure 3: Detection of apnea (apnea is signified by a lack of signal Fig 4: Detection of episodes of body movement (noisy signal).
strength). The program increases the amplitude (of dashed line in the Detection of such episodes is shown by horizontal line with non-zero
figure) to about 180 when apnea episode is detected. amplitude (~50).

by overlapping 50% of the episode with adjacent segments.


C. Fuzzy Inference and Classification For instance, the first 20 seconds are considered to compose
first episode while the second episode covers 10-30 seconds.
Based on the aforementioned membership functions, The 50% overlapping increases the detection of short apnea
output memberships are calculated using fuzzy inference episodes. Two key parameters were used to ensure that every
engine [11]. An algorithm is used where the following instance of apnea is detected. They are strength of the signals
equation gives output membership function for normal breath (i.e., root mean square of energy) and the average respiration
) rate (detected using threshold crossing method, zero-crossing
method and waveform slope measurement method). If either
Where, OM refers to output membership function, technique detects an instance of apnea, it would be safe to
ARMAG refers to relative magnitude of the dominant assume that the analyzed episode represents apnea.
frequency and PD refers to detected peaks. a and b are the For data containing mostly respiration activities and
weights assigned to each membership function (a+b=1). The apnea episodes in between, our algorithm successfully
values of a and b were obtained after statistical analysis of the detected all apnea instances. The more complicated situations
acquired set of data, and these values can be further were when either possible apnea episodes were distorted with
strengthened with further study and use of more data. The significant body movement artifacts, or when the data
following equation is used to calculate the output segment under examination was the combination of apnea
membership function (OMF) for movement: and respiration. The former was categorized as “body
(5) struggle” by the algorithm. When we changed the disjoint
20-second data segments into 50% overlapped data segments,
Each output membership function is compared to decide the precision of detecting the onset of apnea was improved.
whether the episode should be categorized as normal breath Fig.3 shows that our algorithm can accurately detect the onset
episode or episode with body movements. of apnea.
It was observed from data that respiratory measurement
iT

IV. RESULTS AND DISCUSSION caused by body movements was characterized by a lack of
To examine the performance of the proposed algorithm, signal regularity, inconsistency in frequency and amplitude
respiration signals measured by an abdominal strain gauge recording, and a sudden change of the waveform. To classify
were used [4] with a sampling rate of 20 Hz. Respiratory such waveforms, fuzzy logic-based decision making was
measurements were classified as ‘breathing with instances of used. Fig. 4 shows a set of signals resulting from body
apnea’, ‘normal breathing’ and ‘breathing with body movements, and our algorithm was able to correctly
movement’. The algorithm was designed to process categorize these instances as body movements. In case of the
respiratory data in short segments of duration of 10 seconds body movements, our fuzzy-logic based heuristic
or 15 seconds. Each short segment will be categorized classification algorithm achieved more than 90% agreement
according to the extracted respiration features. with human experts. In case of episodes where the human
judgment and the fuzzy logic based algorithm differed, the
Apnea is characterized by a lack of breathing for a period input membership functions for “normal breathing” and
of 10 seconds or longer; an average of 25 seconds was noted “instances of body movement” were found to be very close to
in the literature [3]. In our algorithm, we used an interval of each other. Here, expert opinion and the use of more data for
20 seconds as a time frame for a respiration segment for statistical treatment could make the decision making process
analyzing the data and classifying the episodes into apnea, even more robust.
normal breath or body movements. The algorithm is also run

2820
Figure 6. Real-time detection of i) body movement artifacts (shown by
low-amplitude (~50) horizontal dashed line for a duration of 15-35
Figure 5. Detection of the onset of body movements (after seconds, and ii) apnea (shown by high amplitude (~200) horizontal
around 10 seconds). Detection of the episodes with body dashed line for a duration of 75-95 seconds).
movements is signified by horizontal dashed line with non-zero
amplitude. REFERENCES
[1] P. Varady ; T. Micsik ; S. Benedek ; Z. Benyo, “A novel method for
the detection of apnea and hypopnea events in respiration signals.”,
As Fig. 5 illustrates, the proposed algorithm is capable of IEEE Trans.Biomedical Eng., Volume: 49, Issue: 9, Sept. 2002.
separating episodes of healthy breathing from episodes with [2] C. Guilleminault; A. Tilkian; W. C. Dement, “The Sleep Apnea
significant disturbances of body movement. The results were Syndromes”, Annual review of medicine, 1976, 27(1), 465-484.
[3] T. Young; L. Evans; L. Finn;M Palta, “Estimation of the clinically
agreeable with human experts. In Fig. 6, we can see that the diagnosed proportion of sleep apnea syndrome in middle-aged men
algorithm is capable of detecting apnea and body movement. and women.” Sleep, 1997, 20, 705–706. Medline.
[4] T. Ning and J. D. Bronzino, "Autoregressive and bispectral analysis
The performance of our approach was also validated techniques: EEG applications," Special Issue on Biomedical Signal
using the PhysioBank MIT database [10]. We used both Processing for IEEE Engineering in Medicine and Biology Magazine,
healthy breathing and apnea episodes. The algorithm was Vol.9, No.1, pp.47-50, March 1990.
successful in detecting all apnea episodes as shown in Fig.7. [5] K. Nepal ; E. Biegeleisen ; T. Ning, “Apnea detection and respiration
rate estimation through parametric modelling.”, Bioengineering
Conference, Proceedings of the IEEE 28th Annual Northeast, 2002
[6] Farah Q Al-Khalidi, Reza Saatchi, Derek Burke, Heather E Elphick,
V. CONCLUSION Stephen Tan. Respiration Rate Monitoring Methods: A Review.
Pediatric Pulmonology, Wiley, 2011, 46 (6), pp.523.
This paper demonstrates the performance of a new [7] L.A. Wallis; M. Healy; M.B. Undy, I. Maconochie. “Age related
respiration monitoring system. In absence of the apnea reference ranges for respiration rate and heart rate from 4 to 16 years.”
episodes, our algorithm was able to accurately estimate the Arch Dis Child, 2005;90:1117-21.
respiration rate. Our results have shown that respiratory [8] M. Nishyama; M. Miyamoto; K. Watanabe, “Respiration and body
signal features extracted from multiple signal processing movement analysis during sleep in bed using hetero-core fiber optic
pressure sensors without constraint to human activity.” J. Biomed.
methods can be effectively analyzed in real time using a Opt. 2011, Volume 16, Issue 1.
fuzzy logic-based expert system to correctly categorize [9] L. A. Zahed, “Fuzzy Sets”, Information and Control, 1965, volume 8,
respiratory signals into normal breathing, breathing with 338-358
motion artifacts, and apnea. [10] A.L. Goldberger, L.A.N. Amaral, L Glass, et al.“PhysioBank,
PhysioToolkit, and PhysioNet: Components of a New Research
Resource for Complex Physiologic Signals.” Circulation 101(23),
2014, e215-e220

Figure 7. Detection of normal breathing (left) and detection of apnea (right) for signal collected from MIT online database [10]. Discussed
algorithm shifts the horizontal dashed line from amplitude of 0 to 1.5 when it detects apnea, as shown above.

2821

You might also like