Open access peer-reviewed chapter

Breathing Monitoring and Pattern Recognition with Wearable Sensors

Written By

Taisa Daiana da Costa, Maria de Fatima Fernandes Vara, Camila Santos Cristino, Tyene Zoraski Zanella, Guilherme Nunes Nogueira Neto and Percy Nohama

Submitted: 18 November 2018 Reviewed: 26 February 2019 Published: 03 June 2019

DOI: 10.5772/intechopen.85460

From the Edited Volume

Wearable Devices - the Big Wave of Innovation

Edited by Noushin Nasiri

Chapter metrics overview

3,910 Chapter Downloads

View Full Metrics


This chapter introduces the anatomy and physiology of the respiratory system, and the reasons for measuring breathing events, particularly, using wearable sensors. Respiratory monitoring is vital including detection of sleep apnea and measurement of respiratory rate. The automatic detection of breathing patterns is equally important in other respiratory rehabilitation therapies, for example, magnetic resonance exams for respiratory triggered imaging, and synchronized functional electrical stimulation. In this context, the goal of many research groups is to create wearable devices able to monitor breathing activity continuously, under natural physiological conditions in different environments. Therefore, wearable sensors that have been used recently as well as the main signal processing methods for breathing analysis are discussed. The following sensor technologies are presented: acoustic, resistive, inductive, humidity, acceleration, pressure, electromyography, impedance, and infrared. New technologies open the door to future methods of noninvasive breathing analysis using wearable sensors associated with machine learning techniques for pattern detection.


  • breathing analysis
  • sensors
  • wearable device
  • respiration monitoring
  • pattern recognition

1. Introduction

Wearable devices mean whatever a person can wear since they do not restrict daily activities or mobility [1]. Recently, progress has been made in the use of wearable sensors for breathing monitoring devices, so that it is considered a promising area [2]. Many applications, including sleep monitoring [3], breathing pattern detection, and respiratory rate detection [4, 5], require comfortable and wearable devices that patients can wear in their homes, if possible, for continuous monitoring and storage of relevant data. Other requirements for wearable devices involve (i) the ability to share patient data with healthcare professionals, researchers, and family, (ii) very low energy consumption and long battery autonomy, and (iii) wireless communication with other devices [1, 6].

The main topics for the development of wearable devices for breathing monitoring and pattern detection are discussed in this chapter.

1.1 Why is it important to monitor breathing activity with wearable devices?

The development of wearable devices to monitor breathing activity allows giving rise to various medical care services. For example, considering people with asthma or chronic obstructive pulmonary disease, the environmental conditions directly affect their breathing, and a wearable device is able to continually measure air quality and pulmonary function [7]. The device could trigger alarm functions for drug uptake, contact a general practitioner for an appointment, or call emergency services [8].

The measurement of air quality is important, as pollutant exposure can lead to acute asthma attacks [7]. This happens usually after days under exposure. If a system detects pollutant exposure, it can warn the person and help to prevent attacks [7, 9].

Other applications of wearable devices include sleep monitoring for apnea detection [3], speaking detection as an indicator of social interaction [10], respiratory impedance [8], etc. The detection and tracking of respiratory movement for image-guided chest and abdomen radiotherapy, for compensation of movement during treatment, are additional uses of wearable devices [11]. Moreover, researchers have studied ways to develop smart fabrics, which are comfortable and nonintrusive, for different applications such as healthcare, sports, and military scenarios [5].

1.2 What is important to know for the development of a wearable device for breathing monitoring and pattern detection?

The creation of these wearable devices requires understanding the anatomy and physiology of the respiratory system. The knowledge about its structure and function leads to the development of devices that do not interfere with respiratory mechanics or daily life activities. It also allows selecting the best sensors in each case. Therefore, it is important to have an overview of the main types of electronic sensors used in recent years and how they have been applied, as well as signal processing and machine learning methods.

This chapter covers these topics concisely as a guide for people interested in developing wearable devices for respiratory monitoring. The next section introduces the anatomy and physiology of the respiratory system. The sections 3, 4, and 5 discuss, respectively, the electronic sensors, signal processing methods, and machine learning techniques applied to respiratory signals for pattern recognition.


2. Anatomy and physiology: mechanics of respiration

When one thinks of breathing, the airways and the airflow come to mind. Therefore, an understanding starting with the structures involved in this process is very important.

2.1 Respiratory system

The respiratory system consists of the following structures [12, 13] (Figure 1):

  • Nose: nasal fossae; nasal cavity; pharynx (muscle tube); larynx (cartilage tube); trachea—bifurcates into two primary bronchi, which enter the pulmonary lobes, then subdivided into progressively smaller structures: bronchioles, ducts, and alveoli (where gas exchange occurs).

  • Airways: space from the nose to the bronchioles (where no gas exchange occurs). The structures up to the trachea are responsible for conducting, filtering, heating, and humidifying the air.

  • Lungs: the principal organs of the respiratory system, surrounded by a membrane of connective-elastic tissue called visceral pleura. There are also the parietal pleura, which cover the thoracic cavity. Between them, there is pleural fluid, which contributes to respiratory mechanics.

Figure 1.

Breathing process: (a) structures involved in the breathing process; (b) inhalation event; and (c) exhalation event.

Not only structures play an important role in respiration. Airflow direction delimits the breathing phases. Breathing comprises two steps. The first is the transport of oxygen (O2) through inhalation, from the environment to the cells. The second is the transport of carbon dioxide (CO2) from the intracellular to the environment. Breathing aims to supply the cells with adequate amounts of O2 and withdraw CO2 from the body to maintain homeostasis [13].

The lungs are positioned in an airtight space, and the oscillation of their pressure volume is the basis for respiratory control. The intrathoracic pressure is negative compared to the lung pressure. The lung functions as an elastic structure that resists deformation. The ability of the lung to expand is called compliance [14] and is expressed as Eq. (1).

C = dV / dP E1

Compliance requires a respiratory effort under conditions of normality. When compliance is reduced, more effort is demanded from the respiratory system, and, in more severe cases, it may lead to respiratory insufficiency.

Thorax compliance (CT), lung compliance (CL), and lung-thorax system compliance (CLT) may be expressed by Eqs. (2), (3) and (4), respectively, according to [14].

C T = dV d P T E2
C L = dV d P L E3
C LT = dV dP LT E4

Breathing also involves air diffusion, exchange from a more concentrated to a less concentrated medium. Poiseuille’s law governs the flow resistance as expressed by Eq. (5).

R = 8 ηL π r 4 E5

Where R is the flow resistance, L is the length, η is the viscosity of air, and r is the radius of the tubes.

Figure 1 shows the main structures and processes involved in breathing.

2.2 Muscles involved in breathing and their functions

The diaphragm is the most important muscle of inspiration. When it contracts, there is a decrease in intrapleural pressure and an increase in lung volume [13]. Simultaneously, an increase in abdominal pressure is transmitted to the chest through the apposition zone to expand the lower thoracic cavity. When the diaphragm contracts, the lower rib cage expands. One may observe the bucket handle movement that causes an increase in thorax transverse diameter due to the elevation of the ribs during inspiration [15]. Elevation and sternum forward movement during inspiration causes the increase of thorax anteroposterior diameter. Diaphragm contraction also contributes to increasing the longitudinal thorax diameter [12].

Scalene muscle, sternocleidomastoid muscle, and intercostal muscle are inspiration auxiliary muscles. During forced expiration, the abdominal muscles contract, and the diaphragm is pushed upward, thus causing a decrease in chest diameters. Abdominal muscle is also important for coughing [16].

2.3 Different etiologies, types, and characteristics of pathological respiratory patterns

If structural and/or functional changes occur, then adequate air transport to and from the lungs can be compromised. There are different etiologies, types, and pathological respiratory patterns in which wearable systems may assist in the characterization of movement patterns [1]. This capacity helps in the analysis of the health condition of patients, providing important additional information.

Thoracic mobility is related to the integrity of the nerve pathways and respiratory muscles [13]. In clinical practice, thoracic and abdominal amplitude measurements during respiratory movement may provide information on changes in the respiratory system or eventual diseases [17]. Some paradoxical movements may occur when patients present weakness, muscle paralysis, or chronic obstructive pulmonary disease (COPD), with pulmonary hyperinflation, among other commitments [18]. Another example is Cheyne-Stokes breathing, which is a type of central sleep apnea with an unstable breathing pattern throughout the night. It can cause changes in respiratory frequency and depth of patients with congestive heart failure [19].

Other impairments may cause changes in the thoracic and abdominal mobility relation such as dyspnea, orthopnea, alternate breathing, forced expiration, etc. Wearable systems capable of monitoring the contribution of different muscles and changes in mobility patterns can help monitor the evolution of the respiratory functional condition of a person.

2.4 Pulmonary auscultation: sounds in healthy and diseased lungs

Lung sounds occur because of air turbulence in the larger airways [15, 20]. They are the results of pulmonary vibrations and the respective airways transmitted to the thoracic wall. Sounds that occur during natural breathing differ depending on where they are acquired as well as the moment of the ventilatory cycle [20]. So, controlling where to place wearable devices and their sampling frequency and duration allows obtaining significant data from lung sounds.

Normal pulmonary sounds are classified into:

  • Tracheal sound: it is audible in the region of the trachea from cervical to sternal height, having an intense and tubular sound. Inspiration is slightly shorter than expiration, with a pause between events [21].

  • Bronchial sound: it is audible in the region of the bronchi, at the height of the sternal manubrium, having less intensity than the tracheal sound. The duration of inspiration and expiration is similar, with a pause between events [22].

  • Bronchovesicular sound: it is audible in the first and second intercostal spaces and between the scapulae. The duration of inspiration and expiration is similar, with no pause between events [22].

  • Vesicular murmur: it is audible in the peripheral regions of the lungs, having less intensity than the bronchial sound. Inspiration is longer than expiration, with no pause between events [21].

The anatomical structures may influence the sound heard during normal breathing [21].

Pathological changes in the lungs directly affect the perception of lung sounds from the airways to the thoracic surface. Abnormal lung sounds, also called adventitious noises, are classified into:

  • Wheezing: it occurs with the oscillations of the bronchial pathways [22].

  • Rhonchus: similar to snoring, it can be heard during inspiration and/or expiration [21].

  • Crackles: they are discontinuous sounds, presented in a short and explosive manner, usually classified considering their duration and loudness, during the respiratory cycle [22].

There are other sounds and more details about each of them, and wearable systems contribute to distinguishing the different sounds in clinical practice.

The concepts presented in this section are very important for understanding the respiratory system in healthy and unhealthy conditions. Depending on the event one aims to observe, this information helps to identify the best location for sensor placement. It also contributes to a better interpretation of the respiratory signals obtained.

After this brief overview of the main concepts involving respiratory anatomy and physiology, the next section explains how wearable devices for respiratory monitoring have been made.


3. Respiratory wearable sensors

Wearable sensors for respiratory monitoring employ various types of electronic sensors that can be mounted into clothes [23], attached to belts [5, 24], fixed on the skin [3, 7], etc. There are many ways to make wearable devices and some of them are described separately by the type of primary sensor in the following sections.

3.1 Pressure sensors

We can take advantage of the events of diaphragm contraction (as shown in Figure 1b) and relaxation (as illustrated in Figure 1c) to create wearable devices based on pressure sensors. As an example, researchers have used an electromechanical film (EMFit) to develop a respiratory rate sensor designed as a belt [24] (as shown in Figure 2a). They attached the sensor to the belt so that the expansion of the chest during breathing applies a force to the sensor, and produces a voltage change proportional to this movement. EMfit is a capacitive pressure sensor that has a thin porous polypropylene film structure with a sensitivity of 30–170 pC/N.

Figure 2.

Wearable pressure sensors: (a) pressure sensor (EMFit) attached to the belt and against the skin: the variations of ribcage volume during respiration compresses the sensor, producing a proportional charge [24]; (b) system developed by [8] for respiratory impedance measurement based on the forced oscillation technique.

Another way to use pressure sensors is to use them directly in contact with the inhaled and exhaled air pressure during breathing. The facemask introduced in [8] measures the respiratory impedance and was targeted to home and clinical applications. The solution consists of two pressure transducers, two low power consumption fans, a field-programmable gate array, and a real-time processing engine. The device is based on the forced oscillation technique (FOT), which is a nonstandardized lung function test. The idea is to use fans to input a periodic sinusoidal air pressure signal and measure the opposite force produced by the respiratory tract. With these data, respiratory resistance and compliance, as shown in Eq. (1), can be calculated and sent via Bluetooth to a smartphone (Figure 2b).

The EMFit sensor is less intrusive and performed well in the detection of respiratory rate. However, body movements affect the accuracy of the measurement, so the sensor only worked well for still or moderate moving patients [24]. The facemask sensor also performed well and estimated the respiratory impedance satisfactorily. Nevertheless, it was a prototype and its use was not comfortable [8].

3.2 Acoustic sensors

As seen in Section 2.4, it is possible to monitor lung sounds using acoustic sensors. Acoustic signals related to breathing are usually obtained with the sensors located close to the nose, mouth, throat, and suprasternal notch [3, 25, 26]. Figure 3a shows a wireless microphone that is a portable, cheap, and easy-to-use wearable device positioned next to the nose [3]. The purpose was to measure the respiratory rate in sleep. The microphone is fixed near the nose with a tape, and the signals are sent to a smartphone via wireless communication.

Figure 3.

Acoustic devices for respiratory monitoring: (a) a wireless microphone connected to a smartphone application [3]; (b) BodyScope system: Bluetooth headset attached with a microphone and a stethoscope chestpiece [25]; (c) a wireless acquisition module embedded into a wearable mechanical design [23] and placed over the right chest.

BodyScope was developed to record the sounds produced by the throat region in order to classify them into the following categories [25]: eating, drinking, speaking, laughing, and coughing. The developers modified a wireless headset attaching a microphone and a stethoscope chestpiece to minimize external source audio, as illustrated in Figure 3b. The position selected to place the sensor was close to the carotid artery region as indicated the preliminary test results. The device sends the audio signals to a computer or smartphone likewise solution shown in Figure 3a [3].

Figure 3c shows a real-time wheeze detector that consists of a wireless sound acquisition module, a wearable mechanical design and a host system [23]. The sensor module was an omnidirectional condenser microphone and a stethoscope bell.

A commercial repository of normal and abnormal lung sounds (referred to as the R.A.L.E lung repository) was used to implement and evaluate a wearable sensor that monitors lung sounds continuously for asthma attack detection [27]. The sensor is a microphone array for pre-filtered acoustic signal acquisition. It is an acoustic resonator array consisting of 13 paddle-shaped piezoelectric cantilevers. The results showed that accessing a repository to test for event detections did not hinder its application as a wearable system.

Acoustic wearable sensors can be very practical. However, some challenges are faced during the project design phase such as determining the optimal sensor position, canceling the acoustic ambient noise and the detection of movement artifacts. Depending on the setting, its use is not possible.

3.3 Humidity sensors

Wearable humidity sensors based on the porous graphene network (a chemical structure capable of detecting moisture) have been tested for breathing analysis [4]. The sensors are capable of sensing the human respiration, apnea, speaking, and whistle rhythm. The sensors are attached to the body with a facemask, as shown in Figure 4. The disadvantage of using this sensor is that long time use is also uncomfortable. It still needs some improvements to further commercialization.

Figure 4.

Humidity sensor attached to a facemask [4].

3.4 Oximetry sensors

Oximetry is the technique used to measure oxygen saturation. It consists, basically, of a small infrared emitter that illuminates a small portion of the skin and a receiver that measures the light absorption depending on the oxygenated and deoxygenated blood levels [28]. Wearable oximetry sensors can be worn on the wrist, finger, head, earphones, earlobe, thigh, and ankle, and they have been widely commercialized [1] (Figure 5).

Figure 5.

Location of some oximetry wearable devices [1].

3.5 Acceleration sensors

Accelerometers can be used to capture the respiratory movements during inhalation and exhalation events [29]. An adhesive sensor (called BiostampRC®) made of a triaxial accelerometer that can be placed on the chest wall (Figure 6b) has been used [29].

Figure 6.

(a) The 1-axis accelerometers were mounted perpendicularly and parallel relative to the chest plane [24]; (b) the BiostampRC® system.

Researchers adapted the EMFit-based sensor to evaluate MEMS (microelectro mechanical system) high-resolution capacitive accelerometers for the detection of respiratory rate at the same time [24]. They attached two monoaxial accelerometers to the belt as shown in Figure 6a.

A better signal can be obtained depending on the location of the sensor [30, 31], because people may have disorders that affect muscle contraction during breathing [32], as seen in Section 2.3. Accelerometers have found application in many areas, recently, since sensors operate in a wide spectral range and have small dimensions [33, 34]. In spite of that, in the clinical setting, body movement seriously influences them [35]. The sensitivity can be set to measure vibrations with amplitude varying from gross body movements to small artery pulsation [36]. Therefore, likewise applications with acoustic sensors, unwanted artifacts have to be detected in order to prevent taking decisions based on contaminated lung signals [37]. The activation of synchronized functional electrical stimulation should consider these undesirable artifacts.

3.6 Resistive sensors

Another work used a textile sensor to detect talk events based on changes in breathing patterns [10]. The solution consisted of resistive stretch sensors that are made with a conductive material and a polymer mixture. These components were attached to three different belts: upper chest, lower chest, and abdomen as illustrated in Figure 7a. The events of thoracic or abdominal expansion and relaxation result in variation in the resistance of the stretch sensor with this sensor configuration. The idea is that the sensor can be directly integrated into the clothing in the future.

Figure 7.

(a) System consisting of different belts to monitor chest and/or abdominal breathing [10]; (b) piezoresistive sensor [5].

Piezoresistive sensors can also be used for the production of wearable devices. Figure 7b shows an example in which a smart textile fabric for respiratory rate monitoring was developed using a conductive piezoresistivity-based yarn garment [5].

Movement artifacts are also a problem for this kind of sensor. Researchers are working on improvements to incorporate these sensors in clothes and allow for activities such as running and cycling in the future [5, 38, 39].

3.7 Multimodal sensing platforms

Low-power multimodal wearable systems for the continuous monitoring of respiratory activity have been developed. Figure 8 shows a system with a sensing platform that consists of a chest-patch, a wristband, and a handheld spirometer [7]. Its aim is to monitor health and the environment for asthma management. The chest-patch measures electrocardiogram (ECG), skin impedance, photoplethysmography (PPG), movement, and acoustic signals. The spirometer can measure forced expiratory volume in 1 s (FEV1), peak expiratory flow (PEF), and forced expiratory capacity (FVC). The wristband sensors are intended to measure ozone exposure, ambient temperature, relative humidity, PPG, and movement. The idea is to create a system for continuous long-term monitoring of the state of health and the environmental factors relevant to respiratory problems such as asthma.

Figure 8.

Multimodal system [7].

This brief overview revealed that different sensors can monitor the same respiratory event and there are different ways to apply them. The sensors discussed are not limited to the applications mentioned in this chapter; they can be used in many other applications and combinations. One of the most difficult tasks is to develop a respiratory wearable device that is low cost, low power consuming, and immune to movement artifacts other than the pulmonary ones.


4. Signal processing methods for respiratory signals

4.1 Amplification

Some sensor signals have very low amplitude and need to be processed. The sensitivity of the EMFit, for example, is about 2.2–7 mV/mmHg. For signals so small, high-impedance voltage amplifiers must be used [24].

4.2 Filtering

Depending on the signal, filtering is advantageous for processing [40]. Filters are quite common in biomedical engineering applications to emphasize the spectral contents of electrophysiological signals [41]. There are signals with a well-known spectrum that researchers have extensively investigated. Once the frequency range of the signal is determined, an electronic circuit prevents unwanted energy from contributing to the processing and decision-making [42]. As an example, if the acoustic signal band frequency of interest of a solution is between 500 and 900 Hz, then a band-pass filter encompassing this spectrum is inserted into the circuit [43]. For each sensor, one filter should be placed.

Filters can be applied to minimize high-frequency noise, preserving the shape of the respiratory signal [29]. A band-pass filter with cutoff frequencies of 0.1 and 1.5 Hz was applied to compensate for possible drifts and to reduce the total noise level in the signals [10]. Table 1 shows some types of filters used by the researchers in this area.

Reference Sensor Type of filter Cutoff frequencies (Hz)
[24] Pressure and accelerometer 2nd order Butterworth low-pass filter 0.2
[44] Acoustic 2nd order Butterworth high-pass and low-pass filters in series 20–2000
[23] Acoustic Band-pass filter 150–1000
[10] Resistive Band-pass filter 0.1–1.5
[5] Piezoresistive Band-pass filter 0.05–2
[45] Accelerometer Low-pass filter 1

Table 1.

Synthesis of the use of filters in respiratory signals.

4.3 Analog to digital processing

Despite the advances in digital technologies, we still live in a world full of analog phenomena and human physiology is no exception. Almost all electronic biomedical devices use some kind of quantity conversion, from analog to digital. The exceptions are those devices that work entirely in analog mode.

Key factors of analog to digital conversion need to be considered in order to understand the operation of mobile wearable devices. One factor relates to Claude Shannon’s [46] and Harry Nyquist’s theories [47]. The sampling theory helps to determine the acquisition frequency (or sampling frequency f s ) of analog signals. To digitize a pure sinusoidal wave properly, an acquisition frequency of at least twice the maximum frequency of the analog signal must be used. Knowledge of the spectral range is therefore crucial for determining f s .

Human electrophysiological signals are not purely sinusoidal so that the developers of biomedical systems should be far more conservative in determining f s . Knowing the maximum frequency of the bandwidth (  f max ) is useful, because the theory indicates to set f s at least twice that value (  f s 2 × f max ). In some cases, however, f s must be high enough to keep the signal’s significant energy depending on the frequencies of interest. Acoustic sounds, for instance, revealed that signal power was mainly distributed below 5000 Hz [25]. The researchers, therefore, set f s = 22,050 Hz, which covers up to 11,025 Hz, because the range was considered enough for their application. Table 2 shows some of the sampling rates used.

Reference Sensor Objective Sample rate
[10] Chest or abdominal belt with a resistive sensor Talking detection 100 Hz
[25] Acoustic sensor configured as a headset over the throat Activity detection of deep breath, eating, drinking, speaking, whispering, whistling, laughing, sighing, and coughing. 22,050 Hz
[3] Acoustic sensor fixed with tape near the nose Sleep apnea detection 44.1 kHz
[44] Acoustic sensor fixed with tape on the thoracic region Measurement of acoustic sounds from the thorax, including the lung sounds 4 kHz
[23] Acoustic sensor embedded in a wearable mechanical design over the right chest Wheeze detection 2048 Hz

Table 2.

Examples of sampling rates.

Other equally important factors affect the quality of the acquisition, operation, and energy efficiency of wearable devices, such as the duration of acquisition, signal conditioning, conversion resolution, etc. However, these are not explored in this chapter.

4.4 Fast Fourier transform (FFT)

Fast Fourier Transform (FFT) is an algorithm that converts the signal from the time domain to the frequency domain and vice versa [40, 48]. This algorithm is important because it is the first step to extract spectral features, which can be used by machine learning algorithms and other algorithms for signal processing.


5. Machine learning for respiratory signal pattern detection

Machine Learning is the result of pattern recognition and the assumption that computers can learn to execute a task. As a field of artificial intelligence, machine learning is the ability of a machine to learn, identify, and classify from being exposed to specific data in an interactive way, and to not only learn and make reliable decisions but also to adapt when exposed to new data.

This technique can be useful for automatic pattern recognition in respiratory signals such as sleep apnea, respiratory patterns, and talking detection [10, 49, 50]. The steps to implement a machine learning algorithm are introduced in the following sections.

5.1 Feature extraction

First, for machine learning classification, some features must be given to the classification algorithm. These features must be extracted from the original signal, and they must be well chosen for better results.

For example, when working with a wearable acoustic sensor [50] aiming to recognize activity patterns like sitting, eating, and drinking and respiratory patterns such as whispering, deep breath, and coughing, the features extracted from the sensor signals were related to time, frequency, and cepstral:

  • Time domain features: these features were obtained using the zero-crossing rate, that is, the rate of sign changes along a signal.

  • Frequency domain features: to obtain these features, the FFT needs to be calculated. The features include total spectrum power, subband powers (summed power signal in logarithmically divided bands), brightness (frequency centroid), spectral roll-off (skewness of the spectral distribution), and spectral flux (L2-norm of the spectral amplitude difference of two adjacent frames, representing how drastically the sound changes between two frames).

  • Cepstral features: commonly used for speech recognition and audio, the mel-frequency cepstral coefficients are extracted with the application of a discrete cosine transform to the log-scaled outputs of the FFT coefficients filtered by a triangular band-pass filter bank.

It is also possible to use a tool that automatically extracts the features of the signals being studied. With the purpose of identifying talking in respiratory signals [10], more than 10 features were extracted using the Python library “tsfresh” [51]; those that presented more than 10% of recurrence between the tests were manually selected in order to use that feature for classification in the algorithm.

It is common to extract a variety of features in a study, but the effectiveness of a machine learning algorithm strongly depends on which one will be selected and how the data will be selected for training and validation.

5.2 Classification selection

After the selection of features to be used in the algorithm, it is important to decide which the classes are and how the data will be processed. It is important to select what will be used to train the algorithm and what will be used to validate it. There are several ways of separating the acquired data so that the network is trained without the risk of overfitting.

For instance, in Yatani and Tuong [25], two approaches were carried out:

  • “Leave-one-participant-out”: they worked with 9 samples of data, training the chosen algorithm and using one participant to validate the results.

  • “Leave-one-sample-per-participant”: an example of each class of each participant was left out for validation and the rest used for training.

A different approach was used by Ejupi and Menon [10]: the data were obtained executing different activities such as walking, standing, and sitting, and an algorithm was trained for each one. For classification, 70% of the database was used for training and 30% for validation.

These techniques prevent the major problem in machine learning, overfitting [52]. In case an algorithm is overfitted, it will produce inaccurate results creating unrealistic patterns. It is always wise to select which data will be used to train the algorithm and which will be used to validate the results, never using all dataset to just one task.

5.3 Machine learning algorithms

The strategy or algorithm to be used in a project as well as its effectiveness and performance are strongly dependent on the problem domain (e.g., data structure, database size, etc.) [53]. It is therefore impossible to choose a method as the best one regardless of domain intricacies. Some popular machine learning algorithms are presented in the following topics.

5.3.1 Support Vector Machines

In order to identify speech pattern using a wearable textile-based sensor [10], the best results were obtained with Support Vector Machines (SVMs). The basic approach for SVM algorithms is to give a set of basic examples and their weight, generally understood as positive and negative (binary) examples for the algorithm, interpreted as classes, where there is a degree of similarity between them, a kernel function, as a means of comparison [52].

SVM was applied for identifying activities using an acoustic sensor [50]. They used more than two classes, comparing one against the other as a strategy to obtain results, using the Radial Basis Function (RBF) as a kernel function. All the implementation using a library “LIBSVM” [54] reaches almost 80% of accuracy.

5.3.2 Naïve Bayes

The Naïve Bayes algorithm can be used when it is necessary to recognize the user activities in real time [25]. The theorem is based on the Bayes statistical theorem that describes the probability of an event based on conditions or previous knowledge. The “naïve” comes from the naivety of the assumption that the results are independent given the cause [52].

From the Bayes’ theorem, we have Eq. (6):

P A | B = P B | A P A P B E6

where, P(A|B) is the probability that hypothesis A is true given data of type B. P(B|A) is the probability of data B given that hypothesis A was true.

P(A) is the probability that A is true independently of data, and P(B) is the probability of data B regardless of the hypothesis.

The algorithm uses this probability structure to classify at least two independent sets, which can lead to another set of classification or decision and, at the same time, to another independent set.

This algorithm is simple, computationally cost-effective and can be used for small datasets, as it was used to identify activity patterns such as speaking, laughing, and coughing, presenting good results of accuracy [25].

5.3.3 Artificial neural networks

An artificial neural network (ANN) is a technique based on a series of connected inputs and outputs. Its structure resembles neurons, each one connected and with associated weights. The weights represent information being used by the net to solve the problem and can be adjusted as required. The networks can be supervised or not, the fundamental difference is that in supervised learning, the target vectors indicate what is wanted from the network.

For example, the application of an ANN in talking [10, 25] recognition through respiratory patterns [10] is of supervised learning as the targets to classify are provided to the algorithm.

The neural networks can also be more complex, which depends of the problems intricacies. Aiming to recognize activity patterns such as respiratory effort, using a wearable piezo sensor [25] it was applied networks with up to 17 layers and inputs, a very complex ANN, to achieve the best classification.

Overall, the use of machine learning has become increasingly common in health implementations and has proved a very beneficial tool in classifying and recognizing respiratory activities and patterns when combined with wearable sensors [10, 25, 55].


6. Conclusion

Wearable devices for breathing monitoring and pattern detection are not simple devices. They must not interfere with the respiratory system activities and need to be highly immune to external perturbations. The understanding of the respiratory mechanics is crucial to the development of wearable sensors, and to know how to connect them in an optimal way. The methods, whether manual processing or the use of machine learning algorithms, depend substantially on the type of the signal studied and are a crucial step for a study development.



The authors thank CAPES (Coordenação de Aperfeiçoamento de Pessoal de Nível Superior), Fundação Araucária de Apoio ao Desenvolvimento Científico e Tecnológico do Estado do Paraná, and CNPq (Conselho Nacional de Desenvolvimento Científico e Tecnológico), Brazil, for the scholarships and the financial support.


Conflict of interest

The authors declare no conflict of interest.


  1. 1. Aliverti A. Wearable Technology: Role in Respiratory Health and Disease. Breathe [Internet]. 2017 Jun 18;13(2):e27-e36. Available from:
  2. 2. Dias D, Cunha JPS. Wearable health devices—vital sign monitoring, systems and technologies. Sensors (Switzerland). 2018;18(8):1-28
  3. 3. Fang Y, Jiang Z, Wang H. A Novel Sleep Respiratory Rate Detection Method for Obstructive Sleep Apnea Based on Characteristic Moment Waveform. Journal of Healthcare Engineering [Internet]. 2018;2018:1-10. Available from:
  4. 4. Pang Y, Jian J, Tu T, Yang Z, Ling J, Li Y, et al. Wearable Humidity Sensor Based on Porous Graphene Network for Respiration Monitoring. Biosensors and Bioelectronics [Internet]. 2018 Sep;116(March):123-129. Available from:
  5. 5. Molinaro N, Massaroni C, Lo Presti D, Saccomandi P, Di Tomaso G, Zollo L, et al. Wearable Textile Based on Silver Plated Knitted Sensor for Respiratory Rate Monitoring. In: 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC) [Internet]. IEEE. 2018:2865-2868. Available from:
  6. 6. Steinhubl SR, Muse ED, Topol EJ. The Emerging Field of Mobile Health. Science Translational Medicine [Internet]. 2015 Apr 15;7(283):283rv3-283rv3. Available from:
  7. 7. Dieffenderfer J, Goodell H, Mills S, McKnight M, Yao S, Lin F, et al. Low-power Wearable Systems for Continuous Monitoring of Environment and Health for Chronic Respiratory Disease. IEEE Journal of Biomedical and Health Informatics [Internet]. 2016 Sep;20(5):1251-1264. Available from:
  8. 8. Ionescu CM, Copot D. Monitoring Respiratory Impedance by Wearable Sensor Device: Protocol and Methodology. Biomedical Signal Processing and Control [Internet]. 2017 Jul;36:57-62. Available from:
  9. 9. Ho K, Paez J, Liu B. Air Quality Alerts Benefit Asthmatics. The Lancet Planetary Health [Internet]. 2018 Dec 1 [cited 2019 Feb 4];2(12):518. Available from:
  10. 10. Ejupi A, Menon C. Detection of Talking in Respiratory Signals: A Feasibility Study Using Machine Learning and Wearable Textile-Based Sensors. Sensors [Internet]. 2018 Jul 31;18(8):2474. Available from:
  11. 11. Ernst F, Saß P. Respiratory Motion Tracking Using Microsoft’s Kinect v2 Camera. Current Directions in Biomedical Engineering [Internet]. 2015;1(1):192-195. Available from:
  12. 12. De Troyer A. Effect of hyperinflation on the diaphragm. The European Respiratory Journal. 1997;10(3):708-713
  13. 13. Tortora GJ, Derrickson B. Principles of Anatomy & Physiology. 14th ed. Wiley; 2014. p. 1232
  14. 14. Grigor Abrahamyan M. Some Aspects of the Physics of Gas Flow in the Respiratory System. International Journal of Clinical and Experimental Medical Sciences [Internet]. 2018;4(1):1. Available from:
  15. 15. Lehrer S. Understanding Lung Sounds: Third Edition [Internet]. CreateSpace Independent Publishing Platform; 2002. p. 158. Available from:
  16. 16. Caruso P, Albuquerque ALP de, Santana PV, Cardenas LZ, Ferreira JG, Prina E, et al. Diagnostic Methods to Assess Inspiratory and Expiratory Muscle Strength. Jornal Brasileiro de Pneumologia [Internet]. 2015 Apr;41(2):110-123. Available from:
  17. 17. Liu H, Guo S, Liu H, Zhang H. The best body spot to detect the vital capacity from the respiratory movement data obtained by the wearable strain sensor. Journal of Physical Therapy Science. 2018;586-589
  18. 18. Johnston CR, Krishnaswamy N, Krishnaswamy G. The Hoover’s Sign of Pulmonary Disease: Molecular Basis and Clinical Relevance. Clinical and Molecular Allergy [Internet]. 2008 Dec 5;6(1):8. Available from:
  19. 19. Maestri R, Robbi E, Lovagnini M, Bruschi C, La Rovere MT, Pinna GD. Arterial Oxygen Saturation During Cheyne-Stokes Respiration in Heart Failure Patients: Does Measurement Site Matter? Sleep Medicine [Internet]. 2018 Dec; Available from:
  20. 20. Fouzas S, Anthracopoulos MB, Bohadana A. Clinical Usefulness of Breath Sounds. In: Breath Sounds [Internet]. Cham: Springer International Publishing; 2018. p. 33-52. Available from:
  21. 21. Bohadana A, Izbicki G, Kraman SS. Fundamentals of Lung Auscultation. The New England Journal of Medicine. 2014;370(8):744-751
  22. 22. Sarkar M, Madabhavi I, Niranjan N, Dogra M. Auscultation of the Respiratory System. Annals of Thoracic Medicine [Internet] 2015;10(3):158. Available from:
  23. 23. Li S-H, Lin B-S, Tsai C-H, Yang C-T, Lin B-S. Design of Wearable Breathing Sound Monitoring System for Real-Time Wheeze Detection. Sensors [Internet]. 2017 Jan 17;17(12):171. Available from:
  24. 24. Reinvuo T, Hannula M, Sorvoja H, Alasaarela E, Myllyla R. Measurement of Respiratory Rate with High-Resolution Accelerometer and Emfit Pressure Sensor. In: Proceedings 2006 IEEE Sensors Applications Symposium, 2006 [Internet]. IEEE; 2006 [cited 2015 Jan 6]. 192-195. Available from:
  25. 25. Yatani K, Truong KN. BodyScope. In: Proceedings of the 2012 ACM Conference on Ubiquitous Computing - UbiComp ‘12 [Internet]. New York, New York, USA: ACM Press; 2012. 341. Available from:
  26. 26. Yuasa Y, Takahashi K, Suzuki K. Wearable Flexible Device for Respiratory Phase Measurement Based on Sound and Chest Movement. 2017 IEEE International Conference on Systems, Man, and Cybernetics (SMC). 2017;2017–Jan:2378-2383
  27. 27. Shkel AA, Kim ES. Wearable Low-power Wireless Lung Sound Detection Enhanced by Resonant Transducer Array for Pre-filtered Signal Acquisition. In: 2017 19th International Conference on Solid-State Sensors, Actuators and Microsystems (TRANSDUCERS) [Internet]. IEEE; 2017. 842-845. Available from:
  28. 28. Jubran A. Pulse Oximetry. Critical Care [Internet]. 2015 Dec 16 [cited 2019 Feb 2];19(1):272. Available from:
  29. 29. Jortberg E, Silva I, Bhatkar V, McGinnis R, Sen-Gupta E, Morey B, et al. A Novel Adhesive Biosensor System for Detecting Respiration, Cardiac, and Limb Movement Signals During Sleep: Validation with Polysomnography. Nature and Science of Sleep [Internet]. 2018 Nov;10:397-408. Available from:
  30. 30. Moussavi ZK, Leopando MT, Pasterkamp H, Rempel G. Computerised acoustical respiratory phase detection without airflow measurement. Medical & Biological Engineering & Computing. 2000;38:198-203
  31. 31. Amini N, Sarrafzadeh M, Vahdatpour A, Xu W. Accelerometer-based On-body Sensor Localization for Health and Medical Monitoring Applications. Pervasive and Mobile Computing [Internet]. 2011 Dec [cited 2019 Feb 2];7(6):746-760. Available from:
  32. 32. Jin A, Yin B, Morren G, Duric H, Aarts RM. Performance Evaluation of a Tri-axial Accelerometry-based Respiration Monitoring for Ambient Assisted Living. In: 2009 Annual International Conference of the IEEE Engineering in Medicine and Biology Society [Internet]. IEEE; 2009. 5677-5680. Available from:
  33. 33. Wu Y. Novel High Sensitivity Accelerometer based on a Microfiber Loop Resonator. Optical Engineering [Internet]. 2010 Jan 1;49(1):014402. Available from: doi: 10.1117/1.3294883
  34. 34. Gomathi T, Shaby SM. Capacitive Accelerometers for Microelectromechanical Applications: A Review. In: 2016 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT) [Internet]. IEEE; 2016. 486-490. Available from:
  35. 35. Hung PD, Bonnet S, Guillemaud R, Castelli E, Yen PTN. Estimation of Respiratory Waveform Using an Accelerometer. In: 2008 5th IEEE International Symposium on Biomedical Imaging: From Nano to Macro [Internet]. IEEE; 2008. 1493-1496. Available from:
  36. 36. Rendon DB, Ojeda JLR, Foix LFC, Morillo DS, Fernandez MA. Mapping the Human Body for Vibrations using an Accelerometer. In: 2007 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society [Internet]. IEEE; 2007. 1671-1674. Available from:
  37. 37. Burnett TA, Mann EA, Stoklosa JB, Ludlow CL. Self-Triggered Functional Electrical Stimulation During Swallowing. Journal of Neurophysiology [Internet]. 2005 Dec;94(6):4011-4018. Available from:
  38. 38. Zięba J, Frydrysiak M. Textronics – Electrical and electronic textiles. Sensors for breathing frequency measurement. Fibres & Textiles in Eastern Europe. 2006;14(5):43-48
  39. 39. Mitchell E, Coyle S, O’Connor NE, Diamond D, Ward T. Breathing Feedback System with Wearable Textile Sensors. In: 2010 International Conference on Body Sensor Networks [Internet]. IEEE; 2010. 56-61. Available from:
  40. 40. Antoniou A. Digital Signal Processing: Signals, Systems and Filters [Internet]. McGraw-Hill; 2006. p. 965. Available from:
  41. 41. Zhao T, Liu X, Zhang G, Su Y. Design of a Programmable and Low-frequency Filter for Biomedical Signal Sensing Applications. In: 2016 9th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI) [Internet]. IEEE; 2016. p. 1746-1750. Available from:
  42. 42. RM R. Introduction to Biomedical Signals. In: Biomedical Signal Analysis. John Wiley & Sons; 2015
  43. 43. Corbishley P, Rodriguez-Villegas E. Breathing Detection: Towards a Miniaturized, Wearable, Battery-Operated Monitoring System. IEEE Transactions on Biomedical Engineering [Internet]. 2008 Jan [cited 2015 Jan 6];55(1):196-204. Available from:
  44. 44. Kirchner J, Souilem S, Fischer G. Wearable System for Measurement of Thoracic Sounds with a Microphone Array. In: 2017 IEEE Sensors Journal [Internet]. IEEE; 2017. 1-3. Available from:
  45. 45. Bates A, Ling MJ, Mann J, Arvind DK. Respiratory Rate and Flow Waveform Estimation from Tri-axial Accelerometer Data. In: 2010 International Conference on Body Sensor Networks [Internet]. IEEE; 2010 [cited 2014 Dec 25]. 144-150. Available from:
  46. 46. Shannon CE. A Mathematical Theory of Communication. Bell System Technical Journal [Internet]. 1948 Jul;27(3):379-423. Available from:
  47. 47. Nyquist H. Nyquist-Shannon Sampling Theorem. Princeton University; 2012
  48. 48. Walker JS. Fast Fourier Transforms. CRC Press; 2017. p. 464. (Studies in Advanced Mathematics)
  49. 49. McCaughey EJ, McLachlan AJ, Gollee H. Non-Intrusive Real-time Breathing Pattern Detection and Classification for Automatic Abdominal Functional Electrical Stimulation. Medical Engineering & Physics [Internet]. 2014;36(8):1057-1061. Available from:
  50. 50. Yatani K, Truong KN. BodyScope: A Wearable Acoustic Sensor for Activity Recognition. In: Ubicomp ‘12 The 2012 ACM Conference on Ubiquitous Computing. Pittsburgh, PA, USA; 2012. 341-350
  51. 51. Pedregosa F, Weiss R, Brucher M. Scikitlearn: Machine learning in Python. Journal of Machine Learning Research. 2011;12:2825-2830
  52. 52. Domingos P. The Master Algorithm: How the Quest for the Ultimate Learning Machine Will Remake Our World. 2015. p. 316
  53. 53. Hernández-Pereira EM, Álvarez-Estévez D, Moret-Bonillo V. Automatic Classification of Respiratory Patterns Involving Missing Data Imputation Techniques. Biosystems Engineering [Internet]. 2015 Oct;138:65-76. Available from:
  54. 54. Chang C, Lin C, Tieleman T. LIBSVM : A Library for Support Vector Machines. ACM Transactions on Intelligent Systems and Technology. 2008;307:1-39
  55. 55. Parkka J, Ermes M, Korpipaa P, Mantyjarvi J, Peltola J, Korhonen I. Activity Classification Using Realistic Data From Wearable Sensors. IEEE Transactions on Information Technology in Biomedicine [Internet]. Jan 2006;10(1):119-128. Available from:

Written By

Taisa Daiana da Costa, Maria de Fatima Fernandes Vara, Camila Santos Cristino, Tyene Zoraski Zanella, Guilherme Nunes Nogueira Neto and Percy Nohama

Submitted: 18 November 2018 Reviewed: 26 February 2019 Published: 03 June 2019