Breath Sounds as a Biomarker for Screening Infectious Lung Diseases

: Periodic monitoring of breath sounds is essential for early screening of obstructive upper respiratory tract infections, such as inflammation of the airway typically caused by viruses. As an immediate first step, there is a need to detect abnormalities in breath sounds. The adult average male lung capacity is approximately 6 liters and the manifestation of pulmonary diseases, unfortunately, remains undetected until their advanced stages when the disease manifests into severe conditions. Additionally, such rapidly progressing conditions, which arise due to viral infections that need to be detected via adventitious breath sounds to take immediate therapeutic action, demand frequent monitoring. These tests are usually conducted by a trained physician by means of a stethoscope, which requires an in-person visit to the hospital. During a pandemic situation such as COVID-19, it is difficult to provide periodic screening of large volumes of people with the existing medical infrastructure. Fortunately, smartphones are ubiquitous, and even developing countries with skewed doctor-to-patient ratios typically have a smartphone in every household. With this technology accessibility in mind, we present a smartphone-based solution that monitors breath sounds from the user via the in-built microphone of their smartphone and our Artificial Intelligence (AI) -based anomaly detection engine. The presented automated classifier for abnormal breathing sounds is able to detect abnormalities in the early stages of respiratory dysfunctions with respect to their individual normal baseline vesicular breath sounds, with an accuracy of 95%, and it can flag them, and thus enhances the possibility of early detection.


Introduction
In humans, the respiratory system consists of the respiratory muscles, the lungs, and the airways. Breath sounds are the sounds produced by the structures of the lungs during breathing. The exchange of air between the atmosphere and the lungs (inspiration) and vice-versa (expiration) generates these breathing sounds. Breathing sounds are broadly classified as normal and abnormal breathing sounds. Normal breathing sounds can be loud, high pitched sounds heard over the trachea, medium pitched bronchovesicular sounds heard over the mainstream bronchi and soft, low pitched vesicular sounds heard over the chest. The most common types of abnormal breathing sounds are crackles, wheezes, rhonchi, and stridor [1]. Each of these abnormal breathing sounds can be a symptom of some serious respiratory diseases. Therefore, listening to breath sounds is an important part of early diagnosis. In this paper, we present an automated detection of anomalies in breath sounds using a smartphone [2,3] with nearly 95% accuracy against the user's normal baseline and it offers a personalized report and trend of the results. In [1], measuring lung function is achieved by calculating the exhaled flow rate from the smartphone microphone. In [4], sequence classification models such as Hidden Markov Model (HMM) and Long Short-Term Memory (LSTM) variations are used to identify breath cycles followed by feedback. In [5], respiratory sounds are classified using adaptive neuro-fuzzy inference systems and artificial neural networks using the power spectrum density PSD as a feature. In [6], automation of lung analysis is carried out using time and frequency domain features such as variance, sum of moving average, spectrum mean, etc. In [7], the features of the Mel Frequency Cepstral Coefficients (MFCC) are analyzed using one-way ANOVA and are fed to some classification algorithms. In [8], spectral and wavelet features are used with various classification algorithms. In [9], Mel frequency analysis of breathing sounds is achieved with pattern recognition techniques to separate the breathing phases, to estimate the lung volume, and detect the presence of COVID-19.
In this paper, we have made use of a sound sensor in a smartphone without requiring any external sensors as shown in Figure 1. The sounds acquired are analyzed using various machine learning as well as deep learning algorithms.

Methodology
The flowchart of the steps used in this paper is represented in Figure 2.

Breath Detector
The data used for the breath detector are collected from various sources, including the Environmental Sound Classification (ESC-50) dataset [10]. The ESC-50 dataset is a publicly available dataset that provides a huge collection of speech and environmental sounds. This collection of sounds is categorized into 50 classes, one of them being breath sounds. We have used 592 breath sounds and 592 other environmental sounds to train our breath detector. As a pre-processing step, normalization is performed on the signals to remove sharp or sudden changes. Further, to remove background noise, the signals were filtered using a band-pass filter with a frequency range of 100-2500 Hz. We calculated the Mel Frequency Cepstral Coefficients (MFCC) for audio samples. For the feature vector, we took the mean of the MFCC features corresponding to all the frames [6], the feature vector is fed as input to the breath detector, which uses 3 different machine learning algorithms, which are Random Forest (RF), Logistic Regression (LR) and K-Nearest Neighbors (KNN) for binary classification.
We selected the final class label by majority voting on the predictions of all the 3 models.

Anomaly Detection Engine
The diagnosis engine gives the final result to the users-whether they have normal or labored breathing. The data for normal and abnormal breathing sounds are collected from various data sources e.g., RALE database [11]. At the time of writing the paper, we had 295 normal and 295 abnormal sounds.

Machine Learning-Based Classifiers
The audio samples were pre-processed and by applying fast Fourier transform (FFT), we calculated the power spectrum density (PSD) of the data set. Since the PSD has excessive data points, we decided to divide the PSD of each signal into 32 segments for which the individual averaged PSD is calculated. These 32 averaged values along with MFCCs make up the feature vector [5]. The feature vector is fed to 5 different learning algorithms [12], which are Artificial Neural Networks (ANN), Support Vector Machines (SVM), Random Forest (RF), Logistic Regression (LR), and K-Nearest Neighbors (KNN) for classification into normal and labored breathing sounds [7]. The final class label is obtained by majority voting.

Convolutional Neural Network
The audio signals are pre-processed, and spectrogram images are generated using FFT ( [8,12]). The images are resized into 28 × 28 grayscale images. The images are passed into the Convolutional Neural Network (CNN) for classification ( [13,14]). The images are passed to two convolutional layers consisting of 32 filters and 3 × 3 kernel size with a 2 × 2 max-pooling layer in between to learn the complex features, which are then passed to another 2 × 2 max-pooling to represent the learned features in lower dimensions. The image is flattened to 1 dimension and then passed to a fully connected layer with 128 neurons. The final layer is the softmax classification layer with 2 neurons to distinguish between normal and labored sounds. Rectified Linear Unit (ReLU) activation function is used, and Adam is used as an optimizer.

Ensembled Convolutional Neural Network
We have used a form of ensembling that involves taking an average of the outputs of the models in the ensemble [15]. We have created two small CNNs and each model is trained separately on the training set of images and each is evaluated using the test set. The first CNN model is simple and similar to the one used in the above method. The second CNN model is a little more complex compared to the first. In this, we have used two sets of three convolution layers with 2 × 2 kernel size and filters of 32 and 64, respectively, which are followed by a max-pooling layer. Then, the images are passed to a convolution layer, which generates 2 feature maps followed by a global average pooling layer and a softmax classification. Further, we have put the two models in an ensemble for evaluation. The results depict that the ensemble performs better on a test set than a single model.

Gated Convolutional Recurrent Neural Network
The inspiration for this model comes from the work by [16]. The Gated Convolutional Recurrent Neural Network (Gated CRNN) model has two convolutional layers followed by a Gated Recurrent Unit (GRU). The models use a dropout of 0.1 and 0.3, respectively, and are finally followed by a sigmoid layer. This model requires lesser memory usage and is quite a lot faster than the other models since the GRU has relatively fewer parameters. Categorical cross-entropy is used as a loss function for this model.

Results
To evaluate the models, we have used the macro average of the performance metrics of accuracy, sensitivity/recall, precision, and F1-score on both the classes. These performance metrics are based on confusion matrices.

Breath Detector
The performance metrics of all the models we have used for breath detection are reported in Table 1.

Anomaly Detection Engine
The performance metrics for machine learning-based classifiers in the anomaly detection engine are reported in Table 2.  Figure 3. At the moment, with limited data available, the overall accuracy of the deep learning-based binary-class classifier is 94%. Future work will continue to improve this model as more training data become available.

Discussions
The presented solution can be further extended into a platform to aid the screening of various lung diseases based on breath sounds. A cloud-based implementation will allow the use of AI algorithms that necessitate greater computation. Additional patient data will further improve accuracy and specific detection.

Conclusions
In this paper, we present an AI-based tool for the detection of anomalies in breath sounds acquired via a smartphone with an accuracy of 95% via machine learning and deep learning techniques. This application can serve as an aid and an essential tool for early detection of anomalies in breath sounds ( [17,18]), such as experienced in the recent pandemic situation caused by COVID-19.