Next Article in Journal
From the Eye of the Storm: An IoT Ecosystem Made of Sensors, Smartphones and UAVs
Next Article in Special Issue
Design of User-Customized Negative Emotion Classifier Based on Feature Selection Using Physiological Signal Sensors
Previous Article in Journal
Wearable Hardware Design for the Internet of Medical Things (IoMT)
Previous Article in Special Issue
Validation of Instantaneous Respiratory Rate Using Reflectance PPG from Different Body Positions
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Smartphone-Based System for Automated Bedside Detection of Crackle Sounds in Diffuse Interstitial Pneumonia Patients

by
Bersain A. Reyes
1,*,
Nemecio Olvera-Montes
2,
Sonia Charleston-Villalobos
2,
Ramón González-Camarena
3,
Mayra Mejía-Ávila
4 and
Tomas Aljama-Corrales
2
1
Faculty of Sciences, Universidad Autónoma de San Luis Potosí, San Luis Potosi 78290, Mexico
2
Electrical Engineering Department, Universidad Autónoma Metropolitana Iztapalapa, Mexico City 09340, Mexico
3
Health Science Department, Universidad Autónoma Metropolitana Iztapalapa, Mexico City 09340, Mexico
4
National Institute of Respiratory Diseases, Mexico City 14080, Mexico
*
Author to whom correspondence should be addressed.
Sensors 2018, 18(11), 3813; https://doi.org/10.3390/s18113813
Submission received: 28 September 2018 / Revised: 30 October 2018 / Accepted: 3 November 2018 / Published: 7 November 2018
(This article belongs to the Special Issue Sensors for Biosignal Processing)

Abstract

:
In this work, we present a mobile health system for the automated detection of crackle sounds comprised by an acoustical sensor, a smartphone device, and a mobile application (app) implemented in Android. Although pulmonary auscultation with traditional stethoscopes had been used for decades, it has limitations for detecting discontinuous adventitious respiratory sounds (crackles) that commonly occur in respiratory diseases. The proposed app allows the physician to record, store, reproduce, and analyze respiratory sounds directly on the smartphone. Furthermore, the algorithm for crackle detection was based on a time-varying autoregressive modeling. The performance of the automated detector was analyzed using: (1) synthetic fine and coarse crackle sounds randomly inserted to the basal respiratory sounds acquired from healthy subjects with different signal to noise ratios, and (2) real bedside acquired respiratory sounds from patients with interstitial diffuse pneumonia. In simulated scenarios, for fine crackles, an accuracy ranging from 84.86% to 89.16%, a sensitivity ranging from 93.45% to 97.65%, and a specificity ranging from 99.82% to 99.84% were found. The detection of coarse crackles was found to be a more challenging task in the simulated scenarios. In the case of real data, the results show the feasibility of using the developed mobile health system in clinical no controlled environment to help the expert in evaluating the pulmonary state of a subject.

1. Introduction

Chronic respiratory diseases (CRDs) are among the principal causes of mortality and morbidity around the world, according to the World Health Organization [1]. The first approach employed in the diagnosis of pulmonary diseases is the clinical examination of the pulmonary function that includes clinical history and auscultation of the lungs with the stethoscope. During the auscultation procedure, adventitious lung sounds added on the breath or base lung sounds are a common finding. Although the stethoscope remains the most widely used instrument in clinical medicine and still guides diagnosis when other pulmonary function tests are not available, the auscultation by the stethoscope has several limitations, e.g., it is a subjective process that depends on the ability and expertise of the physician [2], it is limited by human audition [3], the stethoscope may be more adequate for cardiac auscultation [4], and the lung sounds are not permanently recorded for further analysis.
Nowadays, it is recognized that respiratory sounds (RS) make it possible to obtain information about the respiratory health of a subject in a non-invasive fashion, e.g., the characteristics of RS differ between different pulmonary disorders, reflecting different pathophysiologies and severity levels [5]. To overcome the limitations of the auscultation, the use of Computerized Respiratory Sound Analysis (CORSA) systems has been proposed [6]. The use of CORSA systems also helped to arrive at a classification of RS, and nowadays they are understood as those sounds produced while breathing and classified according to their characteristics as breath sounds (basal sounds) or adventitious sounds (added or superimposed sounds) [7]. In turn, adventitious sounds are classified according to their duration as continuous, e.g., wheezes, and discontinuous or crackle sounds. In particular, crackle sounds are traditionally classified according to their temporal characteristics as fine (short duration) or coarse (long duration) crackles [3]. Among the adventitious sounds heard during auscultation, crackle sounds are a usual finding in patients with hypersensitive pneumonia (HP), chronic obstructive pulmonary disease, bronchiectasis, and other diffuse interstitial pneumonia diseases [8]. For audiovisual detection of crackles, the use of CORSA systems, via the method of time-expanded waveform analysis (TEWA), is an improvement when compared to the auscultation [9]. However, the detection of crackle sounds by TEWA is a challenging task due to crackle’s temporal and spectral characteristics, i.e., their transient and short lasting behavior (<20 ms), broad frequency content with their main power ranging from 100 Hz to more than 1 kHz, time-varying spectra that decreases over time [10], temporal overlapping of crackle waveforms and low signal-to-noise ratios along the respiratory phases. Accordingly, several methods have been proposed to automatically detect crackle sounds including, non-linear digital filtering [11], fuzzy logic-based filters [12], wavelet-based filters [13], fractal dimension analysis [14], empirical mode decomposition [15], independent component analysis [16], time-varying autoregressive modeling [17], and time-frequency analysis [18,19]. Unfortunately, these algorithms were designed and implemented in traditional CORSA systems which have been mainly conceived to specialized research and clinical settings. Furthermore, these systems may not be easily translated to the primary point-of-care settings because their limited mobility, high costs and low integration between acquisition and analysis stages, i.e., processing of the information is usually performed offline by means of commercial and general purposes numerical computer software.
As an alternative to traditional CORSA systems, mobile health CORSA (mHealth CORSA, mCORSA) systems have been proposed in the field of respiratory sounds. According to the WHO, mHealth is understood as the use of mobile and wireless technologies to support the achievement of health objectives and it has the potential to transform the ways of health delivery around the world [20]. Nowadays, mobile devices like smartphones and tablets have characteristics like being ubiquitous, equipped with multiple cost-effective sensors, continuously updated in software and upgraded in hardware, embedded multimedia capabilities, and tactile interaction with the user, that give them advantages over other architectures in terms of implementation an integration with other health monitoring systems [21]. Around one fifth of the world population owns a smartphone and their market penetration continues to rise. In addition, both patients and healthcare professionals have reported multiple reasons for adopting mHealth systems, e.g., ability to obtain information not easily granted or impossible to get without these applications, to take a greater control of their healthcare, and to reduce healthcare costs [22]. In the field of respiratory sounds, several efforts have been done to develop mCORSA systems including mobile applications (apps). For example, smartphone-based systems have been employed to develop an asthma monitoring system using wireless communications [23], to record respiratory sounds for snoring and sleep apnea severity [24], to record respiratory sounds for snoring detection [24], to study the characteristics of RS and to extract respiration-related information from them like respiratory frequency [25] and tidal volume [26], to detect respiratory symptoms like sneeze and cough [27], to record wheezes in pediatric populations [28], to record respiratory sounds with snores for classification purposes [29], and to record respiratory sounds for analysis of obstruction sites in patients with obstructive sleep apnea [30]. Hence, smartphone-based systems have been particularly used to record respiratory sounds and analyze continuous adventitious sounds, i.e., wheezes and snores, that result helpful in the study of asthma and sleep apnea. An extensive review of mobile apps developed particularly for snoring can be found in [31]. Efforts regarding crackle analysis and detection have been more limited. A smartphone-based system with an app using a time-frequency analysis for detection of wheezes have been reported, and although there was mention to crackle sounds, just their time-frequency representation was presented, leaving the user the task to manually detect them and count them [32]. A similar scenario was reported where a smartphone system was developed for automatic classification of adventitious sounds. Results were presented in terms of wheezes and although there was mention about the presence of crackle sounds in the recordings, details about their detection or the algorithm employed was not provided [33]. To the best of our knowledge, a smartphone-based system designed with capabilities for automated detection of respiratory crackle sounds directly in the mobile device is still missing.
The presence of crackle sounds is considered to reflect a pathological process in pulmonary airways and tissue [3]. In addition, the timing of crackle sounds during the respiratory cycle has been found to reflect different pulmonary disorders, e.g., presence of crackles during the initial/final portion of the inspiration have been associated with restrictive pulmonary diseases/severe airway obstruction [34] while expiratory coarse crackles are found to be less frequent than inspiratory crackles but they specially occur in chronic airway obstructions [35]. However, crackles could be missed by traditional auscultation due to their very short duration and often low intensity for which the human audition has limitations. To overcome the former limitations, in this study a smartphone-based system for recording and processing of respiratory sounds including an algorithm for the automated detection of crackles is introduced. The detection algorithm was implemented in an Android app and is based on modeling the respiratory sounds as output of a time-varying autoregressive (TVAR) equation where the TVAR coefficients are estimated via the recursive least squares (RLS) algorithm. In addition to the counting of crackles, their timing is also provided by the algorithm and the results summarized in terms of their occurrence in the breathing cycle. The performance of the algorithm was tested using both simulated scenarios inserting synthetic crackles in acquired basal sounds from healthy subjects and data acquired from patients with respiratory diseases.

2. Material and Methods

2.1. Healthy Subjects and Diffuse Interstitial Pneumonia (DIP) Patients

For this study, two sets of respiratory sounds recordings were employed: (1) from ten (N = 10) healthy subjects to test the performance of the crackle detector in controlled scenarios with inserted crackles, and (2) from nine (N = 9) patients with DIP, to test the performance of the crackle detector with real data found in the clinical environment. Both sets of recordings were performed at the National Institute of Respiratory Diseases (INER) in Mexico City. All the subjects gave their signed informed consent for participation in the study approved by the Ethics Committee of INER (Project ID number: C19-12, Approval date: 11 January 2017). Investigations were carried out following the rules of the Declaration of Helsinki of 1975, revised in 2008.

2.1.1. Acquisition from Healthy Subjects

Respiratory sounds from ten (N = 10) healthy, non-smoking volunteers with an age 24.3 ± 1.5 years, weight 77.8 ± 11.00 kg and height 174.8 ± 7.8 cm, were acquired. All volunteers were residents of Mexico City located at 2240 m above sea level. Exclusion criteria included individuals with previous pneumothorax, those with chronic respiratory illnesses such as asthma, and anyone who was currently ill, e.g., common cold or upper respiratory infection. Respiratory sounds were acquired at posterior left basal lung locations using acoustical sensors consisting of subminiature electret microphones coupled in air bells and having a flat frequency response in the range of 50–3000 Hz. In addition to the respiratory sounds, airflow was acquired with a previously calibrated pneumotachometer (Fleisch, KS, USA) and located in front of the volunteers for visual feedback purposes. During acquisition, volunteers were standing still and were asked to breath at a maximum airflow of 1.5 L/s for at least five respiratory cycles. Sounds and airflow data were simultaneously acquired at a sampling frequency fs = 10 kHz and digitized with a 12-bit A/D card. Data was stored in a binary file for their further analysis using Matlab (The Mathworks Inc., Natick, MA, USA) and using the developed smartphone app.

2.1.2. Acquisition from DIP Patients

Recordings from nine (N = 9) patients diagnosed with DIP, with ages ranging from 43 to 65 years (65.11 ± 12.47 years, mean ± std), were acquired using the developed smartphone-based system described in the next section. Three recordings were acquired from each patient and they were performed at the bedside where flow or volume measurement was not available. Hence, to perform the respiratory maneuver, patients followed a volume-like signal displayed in the developed smartphone app as a visual feedback, in conjunction with a guidance of the physician. In this way, this respiratory maneuver allowed to have a reference signal useful to determine the location of crackle sounds in respiratory phases, i.e., inspiration or expiration. Respiratory sounds were recorded at pulmonary zones indicated by the physician after he performed a pulmonary auscultation with a mechanical stethoscope to find the presence of crackle sounds. In the same way as healthy subjects, all the patients gave their signed informed consent for participation in the study approved by the Ethics Committee of INER (Project ID number: C19-12, Approval date: 11 January 2017) in accordance to the rules of the Declaration of Helsinki of 1975, revised in 2008.

2.2. Smartphone-Based System for Automatic Crackle Detection

2.2.1. Hardware

The proposed mHealth system, shown in Figure 1, consists basically of two hardware components: (1) an electret subminiature microphone (BT-2159000, Knowles Electronics, Itasca, IL, USA) encapsulated in a plastic bell designed for adequate acquisition of respiratory sounds and connected to the 3.5 mm audio input of the smartphone [17], and (2) a smartphone device containing the developed mobile app governing sounds acquisition, display and processing. The developed app was mainly tested in two Android smartphone devices of low and medium performance classes, the Galaxy S4 (Samsung Group, Seoul, Korea), with 1.6 GHz quad-core processor, 2 GB RAM and running Android v5.0.1—Lollipop, and the Moto G Turbo Edition (Motorola, Chicago, IL, USA), with 1.5 GHz octa-core processor, 2 GB RAM and running Android v6.0—Marshmallow. It is worth mentioning that both smartphone devices provide reliable digitalization requirements as recommended in guidelines for respiratory sound acquisition [36]. Respiratory sound recording using the developed system is illustrated in Figure 1 for a DIP patient.

2.2.2. Mobile Application (App)

In addition of being the world’s most popular mobile operating system (OS) and given the experience of our research group in developing smartphone apps, the app for this work was developed for the Android mobile OS (Google Inc., Mountain View, CA, USA). The mobile app was developed with the official Integrated Development Environment (IDE) Android Studio (Google Inc.) using XML (W3C, Cambridge, MA, USA) and Java (Oracle Corp., Redwood Shores, CA, USA) programming languages on a personal computer running Windows 10 OS with Intel i7-6500U processor (Intel Corp., Santa Clara, CA, USA) with 4 MB Cache and up to 3.10 GHz processing frequency, 16 GB of RAM, and NVIDIA GTX 950 graphics card (NVIDIA Corp., Santa Clara, CA, USA). Android Studio allowed testing the developed app using emulated devices in addition to finally test the app on both the Galaxy S4 and Moto G physical smartphones. The mobile app was designed to satisfy functionality requirements stated by the pneumologist collaborators. To complement the automatic crackle detection algorithm, the mobile app allows the acquisition and storage of respiratory sounds from new or existing patients as well as audiovisual display of the sounds.

2.2.3. App Activities and Graphical User Interface

To achieve the abovementioned functionalities, a set of app activities were designed and implemented in the Graphical User Interface of the app and organized as shown in Figure 2. It is worth mentioning that the main libraries employed in the development of the mobile app were Audio Record to record sound signals, Media Player to reproduce the recorded sound signals [37] and MPAndroid Chart to display the recorded sound signals [38]. A diversity of classes and methods were implemented in Java to perform all the signal processing stages like digital filtering employing finite impulse response filter designed with the windows method and the Fast Fourier Transform algorithm. A description of the task performed for each activity is as follows:
  • Welcome activity (WA). Two seconds splash-screen that contains the application name and affiliation logos of the developers. In addition, WA asks the user for permissions for memory reading/writing, recording, and playing of audio files. Otherwise, the app does not allow to continue. The first time the app is opened, and the permissions conceded, a folder called Crackles is created to store the patient’s information and their recordings obtained with the app. Additionally, a folder called AnotherSignals allows to store signals obtained with other systems and transferred to the smartphone for audiovisual display and analysis by the app. Finally, a validation of the sampling frequency, equal to 10 kHz, is performed. If not supported, the app does not allow to continue.
  • Selection activity (SA). SA allows the user to choose between two data visualization options: (1) list of registered patients, and (2) list with all existing recordings. SA also contains menu buttons to visualize the app developing credits.
  • Patients list activity (PLA). PLA displays a list with all the registered patients in the app so that the user has the option to choose an existing patient from the list or to add a new patient via a floating action button (FAB).
  • App add patient activity (APA). This activity allows to add a new patient by introducing his/her surname, given name, gender and age. Alphabetic or numeric keyboards are displayed depending the case. The app does not allow to add a new patient until all required fields have been filled and validates the provided information preventing duplicates.
  • Patient activity (PA). The PA app displays patient information and a list with his/her existing sound recordings so that one can be selected to analyze it, or the user can opt to acquire a new recording.
  • Acquire recording activity (ARA). ARA allows the acquisition of a new respiratory sound recording at a specific auscultation point by following a respiratory maneuver designed for this study.
  • Analyze patient recording activity (APRA). This activity allows to analyze respiratory sounds to automatically detect crackles. After the analysis, the time locations of the detected crackles are stored in a text file and APRA displays the obtained results in terms of:
    o
    A figure displaying the acquisition location (auscultation point)
    o
    A table with a summary of the crackles counting, as well as the total amount of crackles detected
    o
    A graph with the whole respiratory sound recording and location of the detected
    o
    crackles. This graph cannot be manipulated
    o
    A graph with a segment of the respiratory sound with tactile manipulation capabilities for temporal zoom and scroll. In addition, the user can play the audio.
  • Recording list activity (RLA). RLA performs as a file explorer displaying a list of folders and files contained in the folder OtherSignals so that the user can analyze it.
  • Analyze signal activity (ASA). It allows to detect crackle sounds in the selected recording manually added by the user, i.e., in respiratory signals acquired with other systems. The app allows the user to perform pre-processing (filtering and normalization). After the signal analysis finishes, detection results are presented in terms of the number of detected crackles in conjunction with the two graphs of respiratory sounds explained above.
A block diagram summarizing the acquisition and processing of the respiratory sounds performed in the app is shown in Figure 3. In the next subsections, details about the acquisition and preprocessing of respiratory sounds as well as the crackle detection stage are provided.

2.2.4. Acquisition and Pre-Processing of Respiratory Sounds

Respiratory sound signals s ( t ) were digitized using the internal A/D converter of the smartphone devices at fs = 10 kHz using 16 bits-per-sample. The app temporary stores an audio file in .wav format to be played by the physician before choosing to store or discarded it and acquired a new one. The smartphone-acquired sounds are digital filtered in the mobile app using a 500th order finite impulse response (FIR) bandpass filter between 75 and 1000 Hz to reduce the possible presence of heart sounds and other muscular noises. Filtered sound signals are normalized in amplitude in the range [−1, 1] to account for different amplitude variations between recordings. Both raw acquired signal s [ n ] and its filtered and normalized version s F N [ n ] can be discarded by the user after their audiovisual display so that another acquisition can be performed. If decided, both s [ n ] and s F N [ n ] time series can be stored in the mobile app in text and audio files for further visualization and analysis in terms of crackle detection directly in the smartphone device.

2.2.5. Selection of Auscultation Points and Respiratory Maneuver

Before starting the acquisition of respiratory sounds, the Acquire recording activity allows the user to graphically select an auscultation point from a schematic array of locations proposed by our research group to cover the thoracic area as shown in Figure 4. The nomenclature for the 3 × 2 array consists of:
  • Lateral side of the thorax. L: left, R: right
  • Thoracic row level. A: apical, M: medial, B: basal
  • Hemithorax line level. e: exterior, i: interior
Accordingly, a sound recorded over the basal region of the right hemithorax at the exterior line would be denoted as LBe by the app. Because our research group and collaborators are interested in analyzing also tracheal sounds, an auscultation point on the trachea (T) is also available for tactile selection in the array. Similar auscultation points have been proposed by other research groups to facilitate the registration of recording locations [33]. In the case of the array proposed in this work, it corresponds to a simpler version of the previously introduced by our research group for multichannel acquisition and processing of respiratory sounds [39].
After selecting an auscultation point, the Acquire recording activity allows the user to control the sound recording. Because the low availability of a spirometer, or another respiration activity recording system, in primary care settings or it is commonly underutilized [40,41], a respiratory maneuver was designed in order to provide a temporal reference from which information about the respiratory phases, i.e., inspiration (I) and expiration (E), can be obtained, see Figure 4 right side. Accordingly, a respiratory maneuver consisting of 2 s of initial apnea, four respiratory cycles with a duration of 4 s each with I:E ratio of 2:3, and 2 s of final apnea, was designed. A visual feedback was implemented in the app activity so that the area under the maneuver curve is filled to aware the physician and the patient about when to inspire and expire. At the end of the recording, the physician can replay the sound and decide between discard or stored it to analyze it with the crackle detection algorithm implemented in the app.

2.2.6. Time-Varying Autoregressive Algorithm for Automated Detection of Crackles

The rationale behind the algorithm implemented in the app for the automated detection of crackles was that crackles are nonstationary events that provoke abrupt changes in the coefficients of a time-varying autoregressive (TVAR) model in comparison to the basal respiratory sound [17]. For a discrete stochastic signal s F N [ n ] , the filtered and normalized version of acquired respiratory sound signal, its TVAR model of order M is given by:
  s F N [ n ] = k = 1 M a k [ n ] s F N [ n k ] + v [ n ]  
where the set of { a k [ n ] } k = 1 , , M are the TVAR coefficients at time n, s F N [ n k ] are past samples of s F N [ n ] and, and v [ n ] is a white noise process [42]. The developed mobile app estimates the TVAR coefficients at each time instant using the recursive least squares algorithm (RLS) with constant forgetting factor, λ, to controls the influence of prior information while minimizing a cost function ξ [ n ] defined by
  ξ [ n ] = i = 1 n λ n i | e [ i ] | 2  
where e [ n ] refers to the error of the adaptive filter. Details about RLS algorithm can be found elsewhere [42].
The RLS algorithm implemented in the Analyze Patient Recording activity employs a 4th order TVAR model ( M = 4), and a forgetting factor close to the unity, λ = 0.97. This selection was previously found to be adequate for crackle detection in a previous effort by our research group, which in turn was based on Akaike’s criterion [17]. Once the TVAR coefficients of the signal s F N [ n ] are computed, their abrupt changes are detected via the local maxima in the slopes of the sum of the absolute value of the TVAR derivatives by employing a threshold value equal to t h r = 0.024 and a 4 ms moving window. The threshold parameter was set using a grid search approach as described in the results section. The overall implemented algorithm for automatic detection of respiratory crackle sounds is schematic illustrated in Figure 5 and consists of the steps described in Table 1.

2.3. Performance Evaluation of the Crackle Detection Algorithm

The performance of the crackle detector implemented in the mobile app was tested in two different sets of data. First, controlled scenarios with synthetic crackle waveform were generated and randomly inserted in the acquired respiratory sounds from healthy volunteers. Second, real acquired respiratory sounds were recorded at the bedside of patients with diffuse interstitial pneumonia.

2.3.1. Simulated Scenarios of Respiratory Sounds with Crackles

Synthetic fine and coarse crackles were generated and inserted at random locations in the acquired respiratory sounds from ten healthy volunteers in the following six different scenarios intended to reflect conditions found in clinical practice, see Table 2.
Synthetic crackles were generated by amplitude modulating an oscillatory signal whose frequency content decreases over time according to the following equation with normalized duration:
  x ( t ) = s i n 2 ( π t )   sin ( 4 π t log ( 0.25 ) log ( T 0 ) ) ,     0 t 1  
where T 0 refers to the initial deflection width (IDW) and the two cycles duration (2 CD) corresponds to the crackle duration. The IDW parameter was set to 0.5 and 1.2 ms, and the 2 CD parameter was set 5 and 9 ms, for the generated fine and coarse crackles, respectively. For each scenario, the synthetic crackles were randomly added to base respiratory sounds with three different gain factors equal to 1.5, 2.5 and 3.5 times the variance of the basal sound in the corresponding insertion window to simulate different signal-to-noise-ratios (SNR). Figure 6 shows the generated fine and coarse crackles and illustrates the insertion procedure for a fine crackle at the end of an inspiration.

2.3.2. Performance Indices

The simulated scenarios in Table 2 allow to know the exact amount and location of inserted crackles. Accordingly, the indices of accuracy ( A c c ), sensitivity ( S e n ), and specificity ( S p e ) were employed to quantify the performance of the implemented crackle detector according to:
  A c c = T P T P + F N + F P   S e n =   T P T P + F N   S p e =   T N T N + F P  
where TP are the true positives (correct detection), FN are the false negatives (missing detections), FP are the false positives (extra detections), and TN (correct no-detection). A detection was counted as correct if the detection point was at a distance less or equal than 3 samples from the real insertion point. In addition, the absolute time difference | Δ t l o c | between the true location of the inserted crackle and the detected location with the implemented app was quantified.

2.3.3. Respiratory Sounds from DIP Patients

Regarding the acquired respiratory sounds from patients, their labeling, i.e., manual location and counting of crackle sounds across the recordings, was performed by pneumologists using an audiovisual GUI developed in Matlab with capabilities to perform TEWA analysis, i.e., time expansion of the signals. It is worth mentioning that labeling of respiratory sounds using TEWA criteria is a cumbersome and time demanding procedure considering that recordings have a much longer duration (around 20 s) compared to the events of interest (around 10 ms). As a mean to aid the manual labeling, audio reproduction and time-frequency analysis of the respiratory sounds were also provided to the GUI. To this end, physicians were asked to analyze one respiratory cycle of each acquired recording. In contrast to the simulated scenarios, the exact beginning location and amount of crackles is not known or cannot be obtained without subjectivity. Accordingly, a double-blind approach was employed to test the performance of the algorithm by comparing the amount of crackles obtained with the mobile app with the amount and location of crackles provided by the physician.

3. Results

3.1. Mobile Application (App)

The implemented Android app requires 10 MB of space to be installed on smartphone devices. Screenshots of the implemented app are shown in Figure 7. The Patient List activity that displays the list with patients already registered is shown in Figure 7a. A FAB also allows the user to register a new patient. Figure 7b shows the Patient activity which displays the entered information of a patient. A list with the sounds already recorded for that patient is displayed in the inferior portion of the app so that the user can select one to analyze it or can use a FAB to acquire a new respiratory sound recording. Figure 7c,d shows the activities concerning the sound acquisition. The selection of the auscultation point is performed by touching a location in the graphical array (Figure 7c) and once selected, the sound acquisition activity is started so that the user can start the recording while simultaneously receiving visual feedback about the respiratory maneuver to performed by the patient (Figure 7d). The user can replay the acquired sound to analyze its quality and decide if discard it or store it for further analysis in the app (Figure 7e). Figure 7d shows the activity in charge of displaying the analysis results in terms of crackle detection. The location of the crackles is displayed as red markers on top of the respiratory sound. The user can manipulate a graph in the lower portion of the activity in terms of scrolling and zooming. In the presented example, an interval containing one crackle sound detected from a recording from a patient with respiratory disease is displayed in the zoomed version of the signal. As can be seen, the detected crackle sound resembles the morphology reported in the classical literature [3,9]. Regarding the performance of the developed app, the average computation time employed to process the recorded signals was around 3.5 min and was distributed as follows, 195 s for mean removal and digital filtering, 0.8 s for signal normalization, 17.9 s for signal display, and 14.1 s for automated crackle detection. In addition, it was found that the mobile app employed around 2% of the battery when 5 consecutive data acquisitions and processing, including crackle detection, were continuously performed and starting from a full charge in a 2740 mAh device, i.e., it consumed around 55 mAh in a commonly available smartphone device. Finally, it was found that, on average, only 20 MB of RAM were employed by the mobile app to run on the smartphone device.

3.2. Estimation of TVAR Coefficients in the App

The implemented algorithm for automated detection of crackle sounds relies on the estimation of the TVAR coefficients via the RLS algorithm with fixed forgetting factor. An example of the TVAR coefficients estimated using the implemented Android app is displayed in Figure 8 for a simulated scenario with fine crackles inserted at the end the inspiratory phase. The a 0 coefficient is not shown as its constant valued equals to 1. In Figure 8 is possible to notice the presence of simulated crackles in the respiratory sound by looking at the transients in the TVAR coefficients time series. The implementation of the RLS algorithm was tested by comparing the TVAR coefficients estimation results with those provided by a Matlab implementation using one recording. The estimated coefficients used to test the statistical significance were obtained completely in each system; i.e., after performing digital filtering; normalization and applying the RLS algorithm in a personal computer and in the app using the developed system to the same recording. No statistically significant differences were found between the two sets of estimates as analyzed by a Wilcoxon signed-rank test for any of the TVAR coefficients; p > 0.99 for a 1 ( t ) to a 4 ( t ) . Figure 9 shows the distribution for a TVAR coefficient using a box plot as well as the amplitude difference versus time between its estimation using Matlab and the implemented app.

3.3. Performance of the App for the Detection of Crackle Sounds

A relevant parameter for the mobile app is the selection of the threshold value. This selection was performed by varying its value from 0.010 to 0.060 and obtaining the performance indices introduced in previous section for all the simulated scenarios in Table 2 considering the respiratory information of 10 healthy subjects. Figure 10 shows the performance indices versus the threshold value employed in the developed automated crackle detector. Figure 10 top side shows the accuracy, sensitivity and specificity indices, while Figure 10 bottom side shows the receiver operating characteristic (ROC) curve. Selection of the threshold value employed in this study was based on these two results as follows. The optimum value for the pair sensibility-specificity was obtained from the ROC curve inflection and regarded as the lower limit ( t h r = 0.019). The upper limit for the threshold value was established as the maximum point for accuracy curve ( t h r = 0.029) where above this threshold the specificity achieves its maximum value and reaches a plateau while the sensitivity value reduced below 90%. Accordingly, the threshold value was set to the middle point between the lower and upper limits, i.e., t h r = 0.024. Table 3 shows the results regarding the performance indices obtained with the selected threshold value ( t h r = 0.024) for all analyzes recordings with synthetic crackles inserted for each scenario with different signal-to-noise-ratios.
Regarding the crackle detection from recordings of nine patients diagnosed with DIP, the authors used the threshold value obtained during the simulated stage by the ROC curve, i.e., the threshold was 0.019. The results are summarized in Table 4 in terms of the number of crackles detected in each of the available recordings by the mobile app (via the automated crackle detection algorithm) and by the pneumologists (via the visual detection using TEWA criteria and audio playing of the signals). Due to the cumbersome manual detection of crackles by the pneumologists, just one respiratory cycle was analyzed from each recording. It is worth mentioning that in the case of the mobile app the complete acquisition and processing was performed in the developed mCORSA system. An example of the detection results from a DIP patient using the developed app is shown in Figure 6f, where it can be seen that the detected crackle sound resembles the morphology reported in the classical literature [3,9].
Regarding the performance indexes obtained for these real data, an average of 51% and 63% were found for the accuracy and specificity, respectively. Interestingly, a specificity of 100% was found in two cases where neither the pneumologist or the mobile app detected the presence of crackle sounds. It is worth mentioning that the detection of crackles that relies only on an auditory approach is difficult even for experts, as reported in the literature [2,43]. The task appears to be also challenging when using the TEWA criteria as illustrated by the examples shown in Figure 11, where the detected location marked by pneumologists and the app are represented by blue and red dots, respectively. Two examples of real crackles correctly detected by both pneumologists and the app are shown in Figure 11a where TEWA criteria correctly holds. Figure 11b shows an example where both the pneumologists and the app match the detection of a crackle sound (around 4.82 s) but the physician also indicates the presence of another crackle (around 4.81 s) which does not appear to resemble the classical morphology expected, while the smartphone does not detect it. Figure 11c shows an example when the app detects a crackle sound while the physician does not (around 4.91 s) although it follows the expected morphology. The additional crackle indicated by the physician (around 4.89 s) is another example of a case where doubts arise regarding the presence of a real crackle.

4. Discussion and Conclusions

In this paper, we proposed a smartphone-based CORSA system for the task of automated detection of adventitious discontinuous respiratory sounds, called crackles. In particular, we employed commercial Android devices and an acoustical sensor designed by our research group for the recording of respiratory sounds. A mobile app was implemented in Android Studio to govern the data acquisition, pre-processing, processing and display of results. The automated detection of crackles was performed by detecting abrupt changes in the coefficients of a time-varying autoregressive model of the recorded sounds. Real respiratory sounds from healthy and patients diagnosed with diffuse interstitial pneumonia were acquired using the developed mCORSA system.
The developed mCORSA system was designed to allow the physician to record respiratory sounds at the primary contact point which represents the first approach employed in the complicated and often long-lasting diagnosis of respiratory diseases. To this end, the core of the system is the mobile app designed with a friendly graphical user interface that allows one to introduce information from patients and to acquire respiratory sounds with the aid of a respiratory maneuver displayed in the device. The recorded sounds can be completely processed in the device and the detection results are provided in terms of the signal waveforms and as a summarized table for the respiratory phases. In addition, the app offers flexibility to load and analyze recordings obtained from another systems.
The automated algorithm for crackle detection was implemented in the app using Java programming language via an object-oriented approach. Because this language is not intended for numerical computation, a set of classes with their correspondent methods were implemented to perform the signal pre-processing and processing stages, including the digital filtering using FIR filters, direct and inverse FFT operations, as well as the RLS algorithm to estimate the TVAR coefficients of the recorded sounds. Implementation of these stages in the mobile device was compared to their counterpart in Matlab running in a personal computer, and no statistically significant differences were found (p > 0.99). The computation time and energy performance tests of the developed mobile app seems to show the feasibility of being used to record and analyze respiratory sound in an online scheme during several consecutive recordings performed directly in point-of-care settings. It is worth mentioning that the algorithms implemented in the smartphone device are subject to further improvement to reduce the computational time employed during the pre-processing stage, mainly the digital filtering scheme.
After testing a reliable estimation of the TVAR coefficients of the smartphone-recorded sounds, the performance of the automated crackle detector was tested using simulated scenarios found in clinical practice. Six different scenarios were created by randomly inserting synthetic crackles in basal respiratory sounds from healthy subjects with a variety of insertion timing along the respiratory cycles, signal-to-noise ratios, and crackle types. The threshold value employed in the crackle detection was selected using information from the ROC and accuracy curve. Regarding the detection of inserted fine crackles, it was performed, on average, with an accuracy ranging from 84.86% to 89.16%, a sensitivity ranging from 93.45% to 97.65%, and a specificity ranging from 99.82% to 99.84% for the studied scenarios. For the scenarios involving coarse crackles the average values were found to range from 57.95% to 85.18% for the accuracy, from 64.02% to 94.68% for the sensitivity, and from 99.83% to 99.85% for the specificity, respectively. For scenarios with combined fine and coarse crackles during the inspiration, the performance of the algorithm shows an average behavior between those previous two, with an average accuracy, sensitivity and specificity around 81%, 89%, and 99%, respectively. As can be noticed, the automated detection of crackle sounds is a more challenging task for coarse crackles than for fine crackles, perhaps due to their lower frequency content, compared to the one of fine crackles, which in turn becomes more masked by the frequency components of respiratory sounds with more power located at lower frequencies where it is also recognized that inspiration has a broader frequency band than the expiration. Consequently, the TVAR coefficients produced by the RLS does not change as much in comparison with the background as those associated with fine crackles, see Figure 5b. Other studies have also reported an increase in the failed detection of coarse crackles in comparison to fine crackles [43]. Accordingly, in the simulated scenario where fine crackles (higher frequency) were only inserted in the inspiration and coarse crackles (lower frequency) were only inserted in the expiration, the performance indexes increased with an accuracy, sensitivity and specificity around 91%, 95%, and 99%, respectively. Results from estimated locations of inserted crackles was found to be consistent for the different simulated scenarios and an average error distance ranging from 0.18 to 0.19 ms was found. The median value of the error distance for correctly detected crackles was found to be equal to 2 samples from the actual inserted location.
Regarding the crackle detection results from DIP patients, the obtained results show that the mobile app tends to underestimate the number of crackles present in the recordings in comparison with the pneumologist. Interestingly, in the recordings where the expert did not detect the presence of crackles using audiovisual labeling the proposed algorithm also reflects this absence or detect a minimum amount. Although the detection results obtained in real data seems to greatly diverge from the ones from simulated scenarios as accuracy reduced to around 52%, it is worth mentioning that the audiovisual detection is a time-demanding and cumbersome procedure while the mobile app performs this task faster and with repeatability from one analysis time to another. In addition, the detection of crackle sounds performed by expert physicians is not exempt of errors and it depends on their training and auscultation abilities. As illustrated in the Results section, pneumologists could provide extra detections and miss crackles based on their experience and limitations. Variability among physicians has been reported in the literature regarding detection of crackle sounds [43]. We consider that the detected locations obtained automatically by this and similar systems could help to validate the initial detection provided by the experts.
Although the results look promising, this study presents several limitations. First, the number of patients employed for validation is still limited and more real data is required to further evaluate the proposed system. Although the developed mCORSA system allows to record and analyze recordings easily and fast, its labeling by the pneumologist is not. Second, the performance of the developed system relies on the selection of the threshold detection value which was based on simulated scenarios. Although crackles were simulated accordingly to mathematical functions emulating real crackles found in clinical practice and with different signal-to-noise ratios and timing locations, the results from real data reflects that these functions would not capture all the dynamics of the underlying crackle generation. We consider that the development of a big database with real acquire respiratory sounds with adventitious sounds from patients will result beneficial to the improvement of this and similar detection algorithms, and that this data collection task would be greatly aided with this and similar mCORSA systems.
Current work involves the implementation of signal processing techniques that complement the information obtained from the waveform analysis by the physician. Future work will involve: (a) the development of a wireless version of the acoustical sensor that will enable data acquisition during a diversity of maneuvers involving conditions not restricted to stationary subjects, (b) improvement in the detection of coarse crackles by evaluating other techniques as independent component analysis and high-resolution time-frequency analysis, and (c) to add more microphones to count with spatial information. In addition, given the mobility characteristics of the system, it is being used to record a greater number of recordings in the clinical setting, directly at the bedside of the patients, which will be useful to develop more robust detection algorithms as well as to analyze them.
Finally, the authors emphasize that the developed mCORSA system was intended to provide an accessible tool to quantitatively analyze respiratory sounds while maintaining the desired properties of the auscultation like being non-invasive, ubiquitous, low-cost, and easy-to-use. In particular, the mobility characteristic of the system allows one to record respiratory sounds at the bedside of the patients without the need to move them, for example, to a specialized laboratory with an anechoic chamber. We consider that this and similar efforts will enable the acquisition of large samples of data with the benefits of a better understanding of pulmonary pathologies at early stages of the disease which in turn can help to deal with the underestimation of respiratory diseases among the general population that without the availability of mobile solutions found difficult to access, or access to late, to the specialized levels of the healthcare system.

Author Contributions

Conceptualization, B.A.R., S.C.-V. and T.A.-C.; Data curation, R.G.-C., M.M.-A. and T.A.-C.; Formal analysis, B.A.R. and N.O.-M.; Investigation, B.A.R., N.O.-M., S.C.-V., R.G.-C. and T.A.-C.; Methodology, B.A.R., S.C.-V., R.G.-C. and T.A.-C.; Project administration, B.A.R. and T.A.-C.; Software, N.O.-M.; Supervision, B.A.R., S.C.-V., R.G.-C. and T.A.-C.; Validation, B.A.R., N.O.-M., S.C.-V., R.G.-C., M.M.-A. and T.A.-C.; Writing—original draft, B.A.R.; Writing—review & editing, N.O.-M., S.C.-V., R.G.-C., M.M.-A. and T.A.-C.

Funding

This research was funded by the Program for Professional Professor Development from Secretary of Public Education (PRODEP-SEP) and by a graduate scholarship from National Council of Science and Technology (CONACyT) in Mexico.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. WHO. WHO|Chronic Respiratory Diseases (CRDs). 2018. Available online: http://www.who.int/respiratory/en/ (accessed on 24 May 2018).
  2. Brooks, D.; Thomas, J. Interrater reliability of auscultation of breath sounds among physical therapists. Phys. Ther. 1995, 75, 1082–1088. [Google Scholar] [CrossRef] [PubMed]
  3. Piirila, P.; Sovijarvi, A.R. Crackles: Recording, analysis and clinical significance. Eur. Respir. J. 1995, 8, 2139–2148. [Google Scholar] [CrossRef] [PubMed]
  4. Pasterkamp, H.; Kraman, S.S.; Wodicka, G.R. Respiratory sounds: Advances beyond the stethoscope. Am. J. Respir. Crit. Care Med. 1997, 156, 974–987. [Google Scholar] [CrossRef] [PubMed]
  5. Reichert, S.; Gass, R.; Brandt, C.; Andres, E. Analysis of respiratory sounds: State of the art. Clin. Med. Circ. Respir. Pulm. Med. 2008, 2, 45–58. [Google Scholar] [CrossRef]
  6. Earis, J.E.; Cheetham, B.M.G. Current methods used for computerized respiratory sound analysis. Eur. Respir. Rev. 2000, 10, 586–590. [Google Scholar]
  7. Sovijarvi, A.R.A.; Dalmasso, F.; Vanderschoot, J.; Malmberg, L.P.; Righini, G.; Stoneman, S.A.T. Definition of terms for applications of respiratory sounds. Eur. Respir. Rev. 2000, 10, 597–610. [Google Scholar]
  8. Piirilä, P.; Sovijärvi, A.R.; Kaisla, T.; Rajala, H.M.; Katila, T. Crackles in patients with fibrosing alveolitis, bronchiectasis, COPD, and heart failure. Chest 1991, 99, 1076–1083. [Google Scholar] [CrossRef] [PubMed]
  9. Murphy, R.L.H.; Holford, S.K.; Knowler, W.C. Visual lung-sound characterization by time-expanded wave-form analysis. N. Engl. J. Med. 1977, 296, 968–971. [Google Scholar] [CrossRef] [PubMed]
  10. Reyes, B.A.; Charleston-Villalobos, S.; González-Camarena, R.; Aljama-Corrales, T. Assessment of time—Frequency representation techniques for thoracic sounds analysis. Comput. Methods Programs Biomed. 2014, 114, 276–290. [Google Scholar] [CrossRef] [PubMed]
  11. Ono, M.; Arakawa, K.; Mori, M.; Sugimoto, T.; Harashima, H. Separation of fine crackles from vesicular sounds by a nonlinear digital filter. IEEE Trans. Biomed. Eng. 1989, 36, 286–291. [Google Scholar] [CrossRef] [PubMed]
  12. Tolias, Y.A.; Hadjileontiadis, L.J.; Panas, S.M. Real-time separation of discontinuous adventitious sounds from vesicular sounds using a fuzzy rule-based filter. IEEE Trans. Inf. Technol. Biomed. 1998, 2, 204–215. [Google Scholar] [CrossRef] [PubMed]
  13. Hadjileontiadis, L.J.; Panas, S.M. Separation of discontinuous adventitious sounds from vesicular sounds using a wavelet-based filter. IEEE Trans. Biomed. Eng. 1997, 44, 1269–1281. [Google Scholar] [CrossRef] [PubMed]
  14. Hadjileontiadis, L.J.; Rekanos, I.T. Detection of explosive lung and bowel sounds by means of fractal dimension. IEEE Signal Process. Lett. 2003, 10, 311–314. [Google Scholar] [CrossRef]
  15. Charleston-Villalobos, S.; Gonzalez-Camarena, R.; Chi-Lem, G.; Aljama-Corrales, T. Crackle sounds analysis by empirical mode decomposition. IEEE Eng. Med. Biol. Mag. 2007, 26, 40–47. [Google Scholar] [CrossRef] [PubMed]
  16. Castañeda-Villa, N.; Charleston-Villalobos, S.; González-Camarena, R.; Aljama-Corrales, T. Assessment of ICA algorithms for the analysis of crackles sounds. In Proceedings of the 2012 Annual International Conference of the IEEE Engineering in Medicine and Biology Society, San Diego, CA, USA, 28 August–1 September 2012; pp. 605–608. [Google Scholar]
  17. Charleston-Villalobos, S.; Dorantes-Méndez, G.; González-Camarena, R.; Chi-Lem, G.; Carrillo, J.G.; Aljama-Corrales, T. Acoustic thoracic image of crackle sounds using linear and nonlinear processing techniques. Med. Biol. Eng. Comput. 2011, 49, 15–24. [Google Scholar] [CrossRef] [PubMed]
  18. Chen, X.; Shao, J.; Long, Y.; Que, C.; Zhang, J.; Fang, J. Identification of Velcro rales based on Hilbert–Huang transform. Phys. Stat. Mech. Its Appl. 2014, 401, 34–44. [Google Scholar] [CrossRef]
  19. Li, J.; Hong, Y. Crackles detection method based on time-frequency features analysis and SVM. In Proceedings of the 2016 IEEE 13th International Conference on Signal Processing (ICSP), Chengdu, China, 6–10 November 2016; pp. 1412–1416. [Google Scholar]
  20. WHO Global Observatory for eHealth, G.O. For eHealth WHO|Global Observatory for eHealth Series—Volume 3. Available online: http://www.who.int/goe/publications/ehealth_series_vol3/en/ (accessed on 7 June 2011).
  21. Agu, E.; Pedersen, P.; Strong, D.; Tulu, B.; He, Q.; Wang, L.; Li, Y. The smartphone as a medical device: Assessing enablers, benefits and challenges. In Proceedings of the 2013 IEEE International Workshop of Internet-of-Things Networking and Control (IoT-NC), New Orleans, LA, USA, 24 June 2013; pp. 48–52. [Google Scholar]
  22. Statista, Inc. Top Drivers for Adoption of mHealth Applications and Services by Patients as of 2012. Available online: https://www.statista.com/statistics/328661/reasons-for-patient-use-of-mhealth-apps-and-services/ (accessed on 2 June 2012).
  23. Oletic, D.; Arsenali, B.; Bilas, V. Towards continuous wheeze detection body sensor node as a core of asthma monitoring system. In Proceedings of the Wireless Mobile Communication and Healthcare, Kos Island, Greece, 5–7 October 2011; pp. 165–172. [Google Scholar]
  24. Nakano, H.; Hirayama, K.; Sadamitsu, Y.; Toshimitsu, A.; Fujita, H.; Shin, S.; Tanigawa, T. Monitoring sound to quantify snoring and sleep apnea severity using a smartphone: Proof of concept. J. Clin. Sleep Med. 2014, 10, 73–78. [Google Scholar] [CrossRef] [PubMed]
  25. Reyes, B.A.; Reljin, N.; Chon, K.H. Tracheal sounds acquisition using smartphones. Sensors 2014, 14, 13830–13850. [Google Scholar] [CrossRef] [PubMed]
  26. Reljin, N.; Reyes, B.A.; Chon, K.H. Tidal volume estimation using the blanket fractal dimension of the tracheal sounds acquired by smartphone. Sensors 2015, 15, 9773–9790. [Google Scholar] [CrossRef] [PubMed]
  27. Sun, X.; Lu, Z.; Hu, W.; Cao, G. SymDetector: Detecting sound-related respiratory symptoms using smartphones. In Proceedings of the 2015 ACM International Joint Conference on Pervasive and Ubiquitous Computing, (ACM), Osaka, Japan, 7–11 September 2015; pp. 97–108. [Google Scholar]
  28. Bokov, P.; Mahut, B.; Flaud, P.; Delclaux, C. Wheezing recognition algorithm using recordings of respiratory sounds at the mouth in a pediatric population. Comput. Biol. Med. 2016, 70, 40–50. [Google Scholar] [CrossRef] [PubMed]
  29. Fischer, T.; Schneider, J.; Stork, W. Classification of breath and snore sounds using audio data recorded with smartphones in the home environment. In Proceedings of the 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Shanghai, China, 20–25 March 2016; pp. 226–230. [Google Scholar]
  30. Koo, S.K.; Kwon, S.B.; Kim, Y.J.; Moon, J.S.; Kim, Y.J.; Jung, S.H. Acoustic analysis of snoring sounds recorded with a smartphone according to obstruction site in OSAS patients. Eur. Arch. Otorhinolaryngol. 2017, 274, 1735–1740. [Google Scholar] [CrossRef] [PubMed]
  31. Camacho, M.; Robertson, M.; Abdullatif, J.; Certal, V.; Kram, Y.A.; Ruoff, C.M.; Brietzke, S.E.; Capasso, R. Smartphone apps for snoring. J. Laryngol. Otol. 2015, 129, 974–979. [Google Scholar] [CrossRef] [PubMed]
  32. Uwaoma, C.; Mansingh, G. Detection and classification of abnormal respiratory sounds on a resource-constraint mobile device. Int. J. Appl. Inf. Syst. 2014, 7, 35–40. [Google Scholar] [CrossRef]
  33. Chamberlain, D.; Mofor, J.; Fletcher, R.; Kodgule, R. Mobile stethoscope and signal processing algorithms for pulmonary screening and diagnostics. In Proceedings of the 2015 IEEE Global Humanitarian Technology Conference (GHTC), Seattle, WA, USA, 8–11 October 2015; pp. 385–392. [Google Scholar]
  34. Nath, A.R.; Capel, L.H. Inspiratory crackles—Early and late. Thorax 1974, 29, 223–227. [Google Scholar] [CrossRef]
  35. Vyshedskiy, A.; Alhashem, R.M.; Paciej, R.; Ebril, M.; Rudman, I.; Fredberg, J.J.; Murphy, R. Mechanism of inspiratory and expiratory crackles. Chest 2009, 135, 156–164. [Google Scholar] [CrossRef] [PubMed]
  36. Cheetham, B.M.G.; Charbonneau, G.; Giordano, A.; Helisto, P.; Vanderschoot, J. Digitization of data for respiratory sound recordings. Eur. Respir. Rev. 2000, 10, 621–624. [Google Scholar]
  37. Android Developers Application Fundamentals|Android Developers. Available online: https://developer.android.com/guide (accessed on 23 September 2016).
  38. Jahoda, P. A Powerful Android Chart View/Graph View Library, Supporting Line-Bar-Pie-Radar-Bubble- and Candlestick Charts as Well as Scaling, Dragging and Animations: PhilJay/MPAndroidChart. Available online: https://github.com/PhilJay/MPAndroidChart (accessed on 11 July 2018).
  39. Charleston-Villalobos, S.; Martinez-Hernandez, G.; Gonzalez-Camarena, R.; Chi-Lem, G.; Carrillo, J.G.; Aljama-Corrales, T. Assessment of multichannel lung sounds parameterization for two-class classification in interstitial lung disease patients. Comput. Biol. Med. 2011, 41, 473–482. [Google Scholar] [CrossRef] [PubMed]
  40. Kaminsky, D.A.; Marcy, T.W.; Bachand, M.; Irvin, C.G. Knowledge and use of office spirometry for the detection of chronic obstructive pulmonary disease by primary care physicians. Respir. Care 2005, 50, 1639–1648. [Google Scholar] [CrossRef] [PubMed]
  41. O’Dowd, L.C.; Fife, D.; Tenhave, T.; Panettieri, R.A. Attitudes of physicians toward objective measures of airway function in asthma. Am. J. Med. 2003, 114, 391–396. [Google Scholar] [CrossRef]
  42. Haykin, S.O. Adaptive Filter Theory; Prentice Hall: Upper Saddle River, NJ, USA, 2001. [Google Scholar]
  43. Kiyokawa, H.; Greenberg, M.; Shirota, K.; Pasterkamp, H. Auditory detection of simulated crackles in breath sounds. Chest J. 2001, 119, 1886–1892. [Google Scholar] [CrossRef]
Figure 1. (a) Smartphone-based system developed for the automatic detection of respiratory crackle sounds for displaying, processing, and provide crackle detection results, (b) Acquisition at bedside of a patient diagnosed with diffuse interstitial pneumonia.
Figure 1. (a) Smartphone-based system developed for the automatic detection of respiratory crackle sounds for displaying, processing, and provide crackle detection results, (b) Acquisition at bedside of a patient diagnosed with diffuse interstitial pneumonia.
Sensors 18 03813 g001
Figure 2. Mobile app flowchart for the automated detection of respiratory crackles. In the flowchart each block represents an activity that was implemented in the app.
Figure 2. Mobile app flowchart for the automated detection of respiratory crackles. In the flowchart each block represents an activity that was implemented in the app.
Sensors 18 03813 g002
Figure 3. Block diagram of the acquisition, processing and display of results from respiratory sounds with the developed mobile app.
Figure 3. Block diagram of the acquisition, processing and display of results from respiratory sounds with the developed mobile app.
Sensors 18 03813 g003
Figure 4. Auxiliary activities for the acquisition of respiratory sounds in the developed app. Left: In the mobile screen an array of possible acquisition locations appears to associate a name to the acquired sound. Right: a second screen is shown by the app where the respiratory maneuver with dynamic filling provide a visual guidance to the physician and patient about the inspiration and expiration timing.
Figure 4. Auxiliary activities for the acquisition of respiratory sounds in the developed app. Left: In the mobile screen an array of possible acquisition locations appears to associate a name to the acquired sound. Right: a second screen is shown by the app where the respiratory maneuver with dynamic filling provide a visual guidance to the physician and patient about the inspiration and expiration timing.
Sensors 18 03813 g004
Figure 5. Schematic illustration of the processing steps implemented in the mobile app for the automated detection of respiratory crackles. (a) The sound signal sFN[n] is modeled using a 4th order TVAR model. (b) RLS-TVAR coefficients and their abrupt changes by the presence of crackles around 5.05 s, 5.1 s, etc., (c) Derivates of the coefficients time series in (b) where the abrupt changes are emphasized. (d) Segmenting of each coefficients time series derivates (TSD) by sliding 4 ms window where a threshold value is employed to determine presence of crackles. (e) If presence of crackles is detected inside a window for all the derivates then add the absolute values of the TSD and the maximum is found. The time location of the maximum is regarded as the starting point of the detected crackle sound.
Figure 5. Schematic illustration of the processing steps implemented in the mobile app for the automated detection of respiratory crackles. (a) The sound signal sFN[n] is modeled using a 4th order TVAR model. (b) RLS-TVAR coefficients and their abrupt changes by the presence of crackles around 5.05 s, 5.1 s, etc., (c) Derivates of the coefficients time series in (b) where the abrupt changes are emphasized. (d) Segmenting of each coefficients time series derivates (TSD) by sliding 4 ms window where a threshold value is employed to determine presence of crackles. (e) If presence of crackles is detected inside a window for all the derivates then add the absolute values of the TSD and the maximum is found. The time location of the maximum is regarded as the starting point of the detected crackle sound.
Sensors 18 03813 g005
Figure 6. Simulated scenarios with synthetic crackle sounds. Left: Waveform of simulated fine and coarse crackles. Right: Insertion of a synthetic fine crackle at a random location using a gain factor equal to 3.5 times the variance of the basal sound in the insertion window.
Figure 6. Simulated scenarios with synthetic crackle sounds. Left: Waveform of simulated fine and coarse crackles. Right: Insertion of a synthetic fine crackle at a random location using a gain factor equal to 3.5 times the variance of the basal sound in the insertion window.
Sensors 18 03813 g006
Figure 7. Different activities of the mobile app. (a) Patient list activity. (b) Patient activity. (c) Selection of auscultation point activity. (d) Sound recording activity. The area under the curve fills during the acquisition to provide a visual aid. (e) Activity to replay, discard or save the recording. (f) Analyze patient activity. The upper graph displays the whole recorded respiratory sound and the detected locations of crackles. This graph is fixed. The bottom graph displays a segment of the signal selected by the user so that it can be zoomed, scrolled and tactile select a data point to know its exact time location on the screen.
Figure 7. Different activities of the mobile app. (a) Patient list activity. (b) Patient activity. (c) Selection of auscultation point activity. (d) Sound recording activity. The area under the curve fills during the acquisition to provide a visual aid. (e) Activity to replay, discard or save the recording. (f) Analyze patient activity. The upper graph displays the whole recorded respiratory sound and the detected locations of crackles. This graph is fixed. The bottom graph displays a segment of the signal selected by the user so that it can be zoomed, scrolled and tactile select a data point to know its exact time location on the screen.
Sensors 18 03813 g007
Figure 8. Example of RLS-TVAR coefficients estimates using the implemented mobile app. Top: Time waveform of an inspiratory sound with inserted fine crackles at the end portion. Bottom: Time course of the RLS-TVAR coefficients estimated in the app.
Figure 8. Example of RLS-TVAR coefficients estimates using the implemented mobile app. Top: Time waveform of an inspiratory sound with inserted fine crackles at the end portion. Bottom: Time course of the RLS-TVAR coefficients estimated in the app.
Sensors 18 03813 g008
Figure 9. Comparison of TVAR coefficients estimated using the implemented RLS algorithms in the mobile app and Matlab. Left: Example of estimates and difference between the estimates in both systems. Right: Distribution of the TVAR coefficient estimated in both systems.
Figure 9. Comparison of TVAR coefficients estimated using the implemented RLS algorithms in the mobile app and Matlab. Left: Example of estimates and difference between the estimates in both systems. Right: Distribution of the TVAR coefficient estimated in both systems.
Sensors 18 03813 g009
Figure 10. Performance indices of the developed automated crackle detector versus threshold value. Top: accuracy, sensibility and specificity indices. Bottom: Receiver operating characteristic (ROC) curve of the developed automated crackle detector. Results are for all simulated scenarios in Table 2.
Figure 10. Performance indices of the developed automated crackle detector versus threshold value. Top: accuracy, sensibility and specificity indices. Bottom: Receiver operating characteristic (ROC) curve of the developed automated crackle detector. Results are for all simulated scenarios in Table 2.
Sensors 18 03813 g010
Figure 11. Examples of crackle detection performed by pneumologists (blue dots) and the developed smartphone application (red dots) in real acquired data from DIP patients. (a) Example of matching detection between pneumologists and the app. (b) Example of an extra detection provided by pneumologists but not by the app. (c) Example of an extra detection provided by pneumologists but not by the app and of a missing detection by pneumologists but detected by the app.
Figure 11. Examples of crackle detection performed by pneumologists (blue dots) and the developed smartphone application (red dots) in real acquired data from DIP patients. (a) Example of matching detection between pneumologists and the app. (b) Example of an extra detection provided by pneumologists but not by the app. (c) Example of an extra detection provided by pneumologists but not by the app and of a missing detection by pneumologists but detected by the app.
Sensors 18 03813 g011
Table 1. Algorithm for automated detection of respiratory crackle sounds.
Table 1. Algorithm for automated detection of respiratory crackle sounds.
StepProcessing Stage
1.Estimate the coefficients of the RLS-TVAR model of s F N [ n ] .
2.Obtain the derivate of each TVAR coefficient time series (CTS) to enhance abrupt changes due to crackles.
3.Segment each derivative in 4 ms windows and compute the standard deviation in each window
4.In each window, if the standard deviations of the four derivative CTS are above the t h r value, then add the absolute values of the derivatives.
5.In each window, obtain the maxima of the sum of the absolute values of derivatives
6.In each window, if in the maximum point exist a slope change (positive to negative), then that point indicates the initial point of a respiratory crackle
Table 2. Simulated scenarios for performance evaluation of the proposed apps.
Table 2. Simulated scenarios for performance evaluation of the proposed apps.
ScenarioCondition of Simulation
110 fine crackles inserted along each inspiratory phase
210 fine crackles inserted at the end of each inspiration
310 coarse crackles inserted at end of each inspiration
45 fine crackles and 5 coarse crackles inserted along each inspiration
510 coarse crackles inserted along each expiration
610 fine crackles inserted along each inspiration plus10 coarse inserted along each expiration
Table 3. Performance indices of the automated crackle detector implemented in the app for all simulated scenarios with inserted crackles to basal respiratory sounds from healthy subjects (N = 10).
Table 3. Performance indices of the automated crackle detector implemented in the app for all simulated scenarios with inserted crackles to basal respiratory sounds from healthy subjects (N = 10).
FactorInserted CracklesAcc (Unitless)Sen (Unitless)Spec (Unitless) | | Δ t l o c | |   ( Ms )
Scenario 1: Inspiratory fine crackles
1.562089.16 ± 4.4697.65 ± 1.8299.84 ± 0.120.19 ± 0.03
2.562088.60 ± 4.2997.45 ± 2.1199.83 ± 0.120.18 ± 0.04
3.562088.01 ± 3.6097.11 ± 2.0799.82 ± 0.110.18 ± 0.05
Scenario 2: Late inspiratory fine crackles
1.562086.77 ± 3.9695.05 ± 2.3199.84 ± 0.110.19 ± 0.03
2.562085.73 ± 4.0194.46 ± 1.8799.82 ± 0.110.18 ± 0.04
3.562084.86 ± 2.6193.45 ± 2.3799.83 ± 0.090.18 ± 0.05
Scenario 3: Late inspiratory coarse crackles
1.562074.76 ± 13.0881.46 ± 12.7299.84 ± 0.100.19 ± 0.03
2.562082.49 ± 7.0589.87 ± 4.2299.84 ± 0.100.18 ± 0.04
3.562083.75 ± 6.5091.00 ± 3.9699.85 ± 0.100.18 ± 0.04
Scenario 4: Inspiratory fine and coarse crackles
1.562079.70 ± 8.2886.94 ± 6.6499.84 ± 0.100.19 ± 0.03
2.562083.03 ± 6.0990.37 ± 3.7899.85 ± 0.100.19 ± 0.04
3.562083.10 ± 6.1990.46 ± 4.0799.85 ± 0.100.18 ± 0.04
Scenario 5: Expiratory coarse crackles
1.553057.95 ± 19.4664.02 ± 19.5599.83 ± 0.120.19 ± 0.03
2.553081.50 ± 10.3490.48 ± 7.6899.83 ± 0.110.19 ± 0.04
3.553085.18 ± 7.4194.68 ± 4.0099.83 ± 0.120.18 ± 0.04
Scenario 6: Inspiratory fine crackles plus expiratory coarse crackles
1.5115091.66 ± 3.1496.16 ± 1.9199.84 ± 0.090.18 ± 0.04
2.5115091.37 ± 2.8995.70 ± 1.7399.85 ± 0.090.18 ± 0.04
3.5115090.99 ± 3.9595.54 ± 2.5499.84 ± 0.090.18 ± 0.04
Data presented as mean ± standard deviation for all sound recordings
Table 4. Crackle detection results in recordings from DIP patients (N = 9) using the automated detector implemented in the app and by a pneumologist.
Table 4. Crackle detection results in recordings from DIP patients (N = 9) using the automated detector implemented in the app and by a pneumologist.
PatientRecording # 1Recording # 2Recording # 3
AppPhysicianAppPhysicianAppPhysician
171048----
2232000
3797111116
4546476
5458654
6100077
77638----
81722117
94568129
Total384938475349

Share and Cite

MDPI and ACS Style

Reyes, B.A.; Olvera-Montes, N.; Charleston-Villalobos, S.; González-Camarena, R.; Mejía-Ávila, M.; Aljama-Corrales, T. A Smartphone-Based System for Automated Bedside Detection of Crackle Sounds in Diffuse Interstitial Pneumonia Patients. Sensors 2018, 18, 3813. https://doi.org/10.3390/s18113813

AMA Style

Reyes BA, Olvera-Montes N, Charleston-Villalobos S, González-Camarena R, Mejía-Ávila M, Aljama-Corrales T. A Smartphone-Based System for Automated Bedside Detection of Crackle Sounds in Diffuse Interstitial Pneumonia Patients. Sensors. 2018; 18(11):3813. https://doi.org/10.3390/s18113813

Chicago/Turabian Style

Reyes, Bersain A., Nemecio Olvera-Montes, Sonia Charleston-Villalobos, Ramón González-Camarena, Mayra Mejía-Ávila, and Tomas Aljama-Corrales. 2018. "A Smartphone-Based System for Automated Bedside Detection of Crackle Sounds in Diffuse Interstitial Pneumonia Patients" Sensors 18, no. 11: 3813. https://doi.org/10.3390/s18113813

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop