key: cord-1025250-91zq63yc authors: Sreejyothi, Sankararaman; Renjini, Ammini; Raj, Vimal; Swapna, Mohanachandran Nair Sindhu; Sankararaman, Sankaranarayana Iyer title: Unwrapping the phase portrait features of adventitious crackle for auscultation and classification: a machine learning approach date: 2021-04-27 journal: J Biol Phys DOI: 10.1007/s10867-021-09567-8 sha: 6dbac58a59b774153a0ed8225e2cb7fbdf6f2f5e doc_id: 1025250 cord_uid: 91zq63yc The paper delves into the plausibility of applying fractal, spectral, and nonlinear time series analyses for lung auscultation. The thirty-five sound signals of bronchial (BB) and pulmonary crackle (PC) analysed by fast Fourier transform and wavelet not only give the details of number, nature, and time of occurrence of the frequency components but also throw light onto the embedded air flow during breathing. Fractal dimension, phase portrait, and sample entropy help in divulging the greater randomness, antipersistent nature, and complexity of airflow dynamics in BB than PC. The potential of principal component analysis through the spectral feature extraction categorises BB, fine crackles, and coarse crackles. The phase portrait feature-based supervised classification proves to be better compared to the unsupervised machine learning technique. The present work elucidates phase portrait features as a better choice of classification, as it takes into consideration the temporal correlation between the data points of the time series signal, and thereby suggesting a novel surrogate method for the diagnosis in pulmonology. The study suggests the possible application of the techniques in the auscultation of coronavirus disease 2019 seriously affecting the respiratory system. Excessive exposure to polluted air and unhealthy lifestyle has contributed to several lung and respiratory disorders. Studies reveal that globally, 65 million people suffer from moderate to acute, chronic obstructive (CO) pulmonary disease (PD), out of which thirty lakh die a year, making it a significant cause of mortality [1, 2] . Hence, research in this field is essential to devise novel methods of diagnosis and thereby to improve the public health system. COPD represents a group of respiratory diseases like chronic bronchitis, asthma, and emphysema and is characterised by breathing difficulties [3, 4] . While inflammation and mucus obstruct the airways in chronic bronchitis and asthma, emphysema is a condition in which the lung tissues get damaged, leading to shortness of breath. Although COPD is not a completely curable disease, proper diagnosis and treatment would help to reduce its burden. Auscultation using a stethoscope is an older technique used to understand the pathology and physiology of lungs and airways. It provides primary information on pulmonary functioning from lung sound. Lung sounds are produced when air passes from narrow to broader space of the respiratory tract such as glottis and the opening of bronchioles to alveoli during inspiration or due to turbulent and vorticose airflow through the trachea-bronchial tree [5, 6] . Breath sounds can be classified as normal and abnormal. Based on the acoustic properties and source of origin, a typical lung sound is again categorised as vesicular and bronchial (BB). Vesicular sound arises from lung parenchyma and bronchial sound from the trachea-bronchial tree. While bronchial sounds are high pitched, loud, and heard over the trachea, vesicular sounds are low pitched, soft, and heard at the posterior lung bases [6] . The pitch and the ratio of inspiration time to expiration time vary with the origin of the breath sound. Also, in vesicular sounds, the ratio of the duration of the inspiration to expiration is 3:1, while it is 1:1 in BB. The adventitious abnormal breath sounds indicate acquired lung pathologies like obstruction in large airways, collection of fluid in or around lungs, airway narrowing causing inflation of a part of lungs, inflammation of the pleural layer, and others. Adventitious lung sounds like crackles, wheeze, rhonchi, and pleural rubs can be an implication of its improper pulmonary functioning. Therefore, an investigation for identifying the signature characteristics of normal and abnormal sounds is essential for the proper diagnosis of lung diseases. Of these adventitious lung sounds, crackles are seen in those affected by COPD, pneumonia, or heart diseases [7] . Crackles are discontinuous, non-musical lung sounds heard mostly during inspiration. They are short duration sounds that last for less than 20 ms and lie in the range of 100 to 2000 Hz or even higher [8] . Pulmonary crackles (PC) are categorised as coarse (CC) and fine (FC) depending on the intensity, frequency, timing, and duration of the breath cycle. Medium crackles have also been reported [9] . Fine crackles, which usually start at the basal part of lungs, are associated with high-frequency and are produced within small airways. On the other hand, coarse crackles are associated with lower frequencies and arise from large bronchi [10, 11] . There are different hypothesis on the lung crackling sounds [12, 13] . The abrupt opening of collapsed airways due to pressure gradient of air results in the oscillation of air column and formation of crackles [14] . Each crackling sound indicates the sudden opening of a single airway. Depending on the timing of occurrence, they can be early inspiratory crackles as in COPD (coarse) or late inspiratory crackles as in interstitial pneumonia and asbestosis (fine) or expiratory crackles [13, 15, 16] . Early crackles tend to be gravity independent, heard at the mouth, scanty, and related to chronic obstruction in the airway, whereas late crackles are gravity-dependent, rarely transmitted to lungs, more profuse, and related to restrictive lung diseases [17] . The pathophysiological conditions of tissues surrounding the lung airways can change the characteristics of the crackling sound [12, 18] . Thus, a proper analysis of the breath sound can provide information on pulmonary health. Identification and classification of adventitious and normal lung sound is the primary step in the diagnosis of any disease. The conventional auscultation using stethoscope has several innate flaws like inter-listener variability [19] , which can be overcome by employing various computer-based mathematical and statistical tools like integral transforms (Fourier, wavelet), and nonlinear time series analyses (NTSA) [20] . The stethoscope's time domain signal does not provide sufficient information to distinguish between a crackle and a typical breath sound. Hence, it can be Fourier transformed into the frequency domain, to understand the spectral characteristics. Fourier transform, which decomposes a signal to its constituent frequency component, is a powerful feature extraction method. Though the frequency spectrum gives the magnitude corresponding to a given frequency, the time of occurrence of a particular frequency component existing is unknown. Wavelet analysis, which gives the temporal frequency details in a signal, is based on the translation and dilation of mother wavelet. Wavelet analysis can be used as a feature extraction technique in lung sound analysis, especially when sudden frequency changes are involved as in crackles [21, 22] . The lung is a dynamic system and breath sounds are time-varying signals, produced by the flow of air through the trachea-bronchial tree. NTSA, which finds application in many areas of science and engineering, social science, and finance, is an extremely effective tool in extracting the hidden features of a dynamic system [23, 24] . It unveils the underlying dynamics of a complex self-affine system by reconstructing the phase portrait using (i) time delay and (ii) embedding dimension [25] . Sample entropy (S), Hurst exponent (H), and fractal dimension (D) are measures of the complexity of the system [26, 27] . The complex biological signal, lung sound, exhibits fractality, which can be estimated through the fractal dimension [28] . Of various methods-box counting, walker divider, epsilon bracket, and power spectrum-for the determination of D, the nature of the problem decides the appropriate method. H, which is a measure of the extent to which the data points are correlated, is another important term for classifying complex time series (TS) signals [29] . The sample entropy measures the uncertainty or randomness in a TS signal without previous information of the source. The temporal evolution study of phase portrait and the entropy analyses of lung sound signals helps in unwrapping airflow dynamics in lungs. Classification of pathological signals using machine learning techniques (MLT) has gained wide attention in the field of biomedical engineering as part of disease diagnosis. Basically, there are two main approaches in machine learning (i) supervised MLT, where the models are trained using labelled data, and (ii) unsupervised MLT, in which the model finds a pattern by itself without any labelling. From literature, it can be understood that among various machine learning techniques like k-nearest neighbour, principal component analysis (PCA), support vector machine (SVM), linear discriminant analysis (LDA), and artificial neural network, the latter one offers high accuracy and sensitivity. PCA, which belongs to unsupervised MLT, is used for categorising data that exhibit identical traits. PCA finds the principal component with maximum variation of data and eliminates others. LDA and SVM are supervised MLTs. LDA is a linear transformation tool employed for the grouping of categorical data by maximizing the separability among the classes. Linearly unseparable data are classified using the nonlinear MLT, SVM, which works with the application of various kernel functions depending on the decision functions/support vectors. The present work aims at developing (i) a cost-effective and sensitive method of auscultation for practicing in rural and remote areas opening up the possibility of remote consultation and diagnosis; (ii) novel digital auscultation techniques integrating the principles of mathematics and statistics which will be helpful to the medical practitioners in primary health centres where sophisticated instrumentation facilities are not available; (iii) methods to distinguish a normal breath sound from pulmonary crackle through Fourier transform, wavelet transform, NTSA, and fractal technique to obtain primary information on pulmonary health; (iv) a method of segregating normal, fine crackle, and coarse crackle breath sound signals through the unsupervised MLT-PCA using the features of power spectral density (PSD) data; and (v) a method of classification of the signal using the supervised MLT-LDA and SVM extracting the nonlinear parameters of the phase portrait [30] . Computer-based disease detection has revolutionised the medical field through diagnostic accuracy. In the present work, analyses are carried out on 35 bronchial, fine crackle, and coarse crackle, single-channelled breath sound signals of duration of 1.5-3.5 s at a sampling frequency of 44,100 Hz, from various internationally renowned respiratory sound databases [31-33]. The breath sound represents the variation of sound intensity with time. Fourier transform converts a signal x(t) to a frequency domain signal X(f) and is expressed as Eq. (1), where f is the frequency and time is t. Fast Fourier transform (FFT) is the widely used algorithm to perform a Fourier transform. The PSD, which gives the power distribution over different frequency components of a signal of length N, can be calculated from Fourier transform using Eq. (2). In analysing non-stationary signals, wavelet scalograms are more effective in detailing the frequency components with its intensity and time of occurrence. In this study, the Morse function, φ (mother wavelet), is translated through the continuous signal to generate wavelets [34] . Morse wavelet which belongs to the family of analytic wavelets unifies all the other analytic wavelets in a single domain and is commonly used for analysing modulated signals and localized discontinuities. The wavelet transform of the TS signal (x(t)) is given by Eq. (3), where s denotes the scale parameter and τ denotes the translation parameter. NTSA is a useful technique in extracting dynamic information from a TS data. The study of a TS data is complete only when the phase-phase representation, containing the hidden dynamics of the system, is embedded in multidimensional phase space. 'The method of delays' is a widely used phase portrait reconstruction technique, where the phase portrait is reconstructed using the embedding dimension (m) and delay time (l). When the value of l, obtained from the mutual information function, gives the correlation between the data, the embedding dimension gives the dependent parameters of a system which is estimated by Cao's method [35, 36] . Optimal selection of l and m can bring out correct and accurate information of the system. Using l and m, the vector reconstructed in the phase plane can be represented as given in Eq. (4), Investigation of the complexity of a time-varying system, through the parameters D, H, and S, is inevitable in understanding its dynamics. The box counting fractal dimension (D) quantifies the complexity of the self-similar data. In this method, D is estimated by superimposing grids of varying dimension 'ε' on the signal and calculating the number of boxes N(ε) covered [37] . The value of D can be obtained from the slope of logN(∈) vs log 1 ∈ À Á graph. The value of H, a measure of randomness and long-term dependence in time series data, is given by Eq. (5), Depending on the value of H, a time series can be of 3 types: (i) Brownian (H~0.5) with no correlation between the current and future observations; (ii) antipersistent (H < 0.5), where a decrease follows an increase; and (iii) persistent (H > 0.5), where an increase followed by another increase or decrease followed by another decrease. Sample entropy gives a statistical measure of disorder and predictability of a TS signal. It quantifies the information production of a nonlinear dynamic system and can have a zero or positive value, by definition. If C m+1 (r) and C m (r) are correlation sum of dimensions m + 1 and m, for a given radius r, then sample entropy can be estimated using Eq. (6) [38] , The unsupervised MLT-PCA groups data based on the features like PSD, S, H, and D. Classification using PSD is best suited for grouping TS data. However, due to a large number of data present, direct grouping using PSD becomes tedious, which is overcome through feature extraction from PSD data. The data present in the frequency range 100-1 kHz is segmented into 26 groups, and the average PSD of the group is used as the feature of the respective groups. The linear supervised LDA and nonlinear supervised SVM classifiers are also used for the classification of pathological lung sounds utilising the nonlinear parameters of the phase portrait-S, D, l, and m-making use of the 'Classification Learner' app present in the MATLAB software. The performance of the MLTs are evaluated in terms of accuracy through the confusion matrix (CM). The primary characteristics of normal bronchial breath (BB), fine crackle (FC), and coarse crackle (CC) sounds are studied by analysing 35 time domain signals and representative signals from each category are shown in Fig. 1 . The CC appearing during inspiration (ICC) and expiration (ECC) are given in Fig. 1c and d. From Fig. 1a , it can be seen that the BB sound has distinct inspiratory and expiratory phases of the same duration and intensities. In contrary, PC (FC and CC) as shown in Fig. 1b -d has a longer inspiratory cycle compared to the expiratory cycle. Upon comparing Fig. 1b and c, it can be seen that CC are loud and of longer duration compared to FC. This result agrees well with the literature [10] . Also, a magnified view of a crackle signal, given in the inset of Fig. 1b , shows its characteristic discontinuous nature. Besides the acoustic differences, CC and FC occur under different pathological conditions. Hence, it is essential to differentiate them. Albeit time domain analysis could differentiate bronchial and crackle breath signals, a detailed analysis in the frequency domain is necessary to bring out the differences between CC and FC. The representative PSD plot from each category is shown in Fig. 2a -d. As shown in Fig. 2a , BB has its dominant spectral components lying between 200 and 300 Hz. The laminar flow of air due to the absence of obstructions in the airways could be the reason for the lower number of frequency components and hence can be attributed to excellent pulmonary health. On comparing FC (Fig. 2b) and CC ( Fig. 2c and d) , it can be seen that the spectral spread is more in former than in the latter. PC occurs due to the abrupt opening of airways. When FC is produced in small airways, CC arises from the larger bronchi. In case of FC due to their smaller area of cross-section, air rush in at a higher pressure which increases turbulence and hence spectral spread is more in FC than CC (ICC and ECC). The wavelet scalogram of Fig. 2a -d shown in Fig. 2e -h reflects the finer details of not only the temporal frequency spread but Fig. 1 The breath sound signal a BB and b FC with a portion magnified in the inset c ICC and d ECC also the relative intensity of frequency components. From Fig. 2e , it is evident that the BB signal shows a clear distinction between the two respiratory (inspiration and expiration) phases, with low-frequency spread and the prolonged existence of the intense frequency component almost throughout respiration. As seen in PSD (Fig. 2b) of the FC signal, the wavelet scalogram (Fig. 2f ) also shows several frequency components of lesser intensity up to 1000 Hz. It is good to note that several frequency components are being generated in a shorter interval due to the passage of air at higher pressure through narrow airways resulting in greater turbulence in a shorter time interval. ICC and ECC exhibit large frequency spread of lesser intense and low-frequency components up to 400 Hz, which is vivid from Fig. 2g and h. The longer duration of the low-frequency spread of CC suggests its origin from a broader region in comparison to FC, as mentioned earlier. Lung sound is subjected to NTSA using R software to unveil its hidden dynamics. The phase portrait, which is the geometrical representation of a dynamic system, is obtained using 'timeLag' and 'estimatingEmbeddingDim' function in the R software. A representative phase portrait of the breath signals of BB and PC (FC and CC) is shown in Fig. 3 . On comparing the phase portraits, bronchial breath sound is found to be more complex than crackle, which is due to the greater degree of freedom experienced by air passing through an uninterrupted passage through bronchi and trachea of larger diameter (1. 22 -1.8 cm) . This greater degree of freedom appears in the phase portrait as enhanced complexity. The phase portrait of the pulmonary crackle FC and CC exhibit lesser complexity in the dynamics of airflow for the reasons explained in their spectral analyses. The observed higher degree of randomness in Fig. 3b and c is attributed to the airflow, due to the sudden opening of airways, with a higher velocity. Fractal dimension, which quantifies the complexity of a TS signal, is found from 'fd.estim.boxcount' function ('fractaldim' package of R). The whisker-and-box plot for D, S, and H are given in Fig. 4 . The mean value of D of the BB (1.801) is much greater than that of crackle (1.622) indicating a higher degree of complexity, which supports the analysis from phase portrait. The sample entropy, calculated using the function 'sampleEntropy', detailing the disorder in the airflow is obtained as 1.174 and 0.548 for BB and PC respectively. The sample entropy values also justify the higher complexity of BB, as observed in the fractal and phase portrait studies. The greater complexity of the BB compared to the PC is due to the prolonged existence of intense frequency components during respiration. The Hurst exponent for BB and PC is obtained as 0.198 and 0.377, respectively, indicating their antipersistent nature. In other words, the antipersistent breath sound signal exhibits weak correlation among the data points of the TS. The closer value of H of PC to 0.5 reveals greater randomness as observed in the phase portrait analysis. Classification of data based on the characteristic features is an integral part of data analysis. PCA is a proven powerful statistical tool in sorting the datasets with similar characteristics. For a TS, features obtained from its PSD is capable of reflecting the dataset without any loss of information. The PCA carried out with the breath signals BB and PC is shown in Fig. 5a which reveals 81.1% of the variance of the TS data. The principal components projected onto the orthogonal horizontal and vertical axes gives information about the direction of the uncorrelated data with more significant variance. PCA of PC breath sound signal is highly significant in categorising FC and CC, as shown in Fig. 5b. From Fig. 5b , the distinction between FC and CC breath signals are evident as BB and PC in Fig. 5a . The PCA with the signals BB, FC, and CC can also be classified with clear distinction as shown in Fig. 5c . This distinctiveness Even though PCA could classify BB-PC and FC-CC, a quantification of the accuracy cannot be made through this unsupervised MLT. For this, supervised MLTs are employed utilising the capability and high fidelity showcased by the nonlinear parameters-S, D, m, and l-extracted from the phase portrait through nonlinear time series analysis. Seventy percentage of the signals, BB, FC, and CC, are five-fold cross-validated while training the model and the 30% signals are tested for prediction accuracy. The better the accuracy of training dataset, the better will be the prediction. The classification using LDA shows only 83.8% accuracy and its CM for the trained dataset is displayed in Fig. 6a . But classification using quadratic SVM, having quadratic kernel function, shows a higher percentage of accuracy of about 93.3%, suggesting the superiority of the nonlinear classification MLT than the linear LDA. The CM of the SVM classification is displayed in Fig. 6b . The advantage of the classification based on phase portrait features is that it classifies the data taking into consideration the multidimensional aspects of the breath signal like the temporal correlation between the TS data. The results also points to the merits of supervised MLT, based on phase portrait features, compared to the unsupervised classification based on the features extracted from PSD. Auscultation techniques, evolved through centuries, acquired multidimensionality in its approach towards the diagnosis of lung diseases. Development of novel noninvasive techniques is as important as preventing communicable diseases like severe acute respiratory syndrome (SARS) coronavirus-2 (CoV-2), widely known as coronavirus disease (COVID-19). The paper aims to kindle the minds striving for novel auscultation techniques integrating mathematical and statistical principles. The disease of the lungs appears in the sound signals it produces during respiration. Pulmonary crackles, originating from the basal part of lungs or bronchi, are heard in the auscultation of people affected by COPD, pneumonia, or heart diseases as discontinuous and non-musical sounds. This necessitates a detailed investigation to probe the characteristic features of BB and PC through FFT, wavelet, NTSA, and complexity analyses. The spectral analysis carried out with FFT and wavelet techniques reveals a lower number of frequency components in BB than in PC due to the laminar flow of air indicating sound pulmonary health. FC and CC, which belongs to PC, show lot of frequency components of lesser intensity. The spectral analysis of CC is also carried out during the inspiration and expiration phase of respiration. The study reveals that the spectral spread is more in FC than CC (ICC and ECC) due to the flow of air through airway calibres at a higher pressure producing turbulence. The wavelet scalogram unwraps the finer details of not only the temporal frequency spread but also the relative intensity of frequency components. The wavelet scalogram of FC and CC explains its origin through the time interval over which the frequency components appear. The phase portrait, D, S, and H analyses reveal the higher degree of complexity in the flow dynamics of air during BB than in PC. The value of H lying between 0 and 0.5 indicates the antipersistence nature of the TS data. H = 0.377 suggests a more Brownian nature to PC than BB due to the presence of frequency components of higher intensity during the course of respiration. The PCA by extracting features of PSD is effectively employed in classifying not only BB and PC but also CC and FC. The classification of the data based on supervised MLT-LDA and SVM-using the features of phase portrait-is found to be superior to the unsupervised classification (PCA) with 83.3% and 93.3% accuracy, respectively. The reason for improved accuracy may be due to the consideration of the multidimensional aspects of the breath signal like the temporal correlation among the TS data points. Thus, the study explores the application of spectral, fractal, and NTSA in lung auscultation. Author contribution Equal contribution from all the authors. Conflict of interest The authors declare no competing interests. Ethics approval and consent to participate Not required. Global surveillance, prevention and control of chronic respiratory diseases Europe PMC funders group global and regional trends in chronic obstructive pulmonary disease mortality 1990-2010 Standards for the diagnosis and treatment of patients with COPD: a summary of the ATS/ERS position paper Chronic obstructive pulmonary disease: an overview A treatise on the diseases of the chest and on the mediate auscultation Breath sounds Crackles: recording, analysis and clinical significance Separation of crackles from vesicular sounds using wavelet packet transform Lung crackle characteristics in patients with asbestosis, asbestos-related pleural disease and left ventricular failure using a time-expanded waveform analysis-a comparative study Spectral and waveform characteristics of fine and coarse crackles A brief overview of the analysis of lung sounds Discrete lung sounds: crackles (rales) as stress-relaxation quadrupoles Mechanism of inspiratory and expiratory crackles Crackles and wheezes Crackles in patients with fibrosing alveolitis, bronchiectasis, COPD, and heart failure Crackles (rales) in the interstitial pulmonary diseases Inspiratory crackles-early and late Lung Sounds Breath Sounds Methodology Nonlinear time series and principal component analyses: potential diagnostic tools for COVID-19 auscultation Pulmonary crackle characterization: approaches in the use of discrete wavelet transform regarding border effect, mother-wavelet selection, and subband reduction Time series and fractal analyses of wheezing: a novel approach Applied Nonlinear Time Series Analysis: Applications in Physics Temporal evolution of sample entropy in thermal lens system Practical implementation of nonlinear time series methods: the TISEAN package Fractal and spectroscopic analysis of soot from internal combustion engines Fractal study on Saraswati supercluster Raman spectroscopic and fractal analysis of blood samples of dengue fever patients Different methodologies and uses of the hurst exponent in econophysics Phase portrait for high fidelity feature extraction and classification: a surrogate approach Computerized heart sounds analysis Nonlinear Time Series Aanalysis Dynamics from multivariate time series. Phys. D Nonlinear Phenom Estimators of fractal dimension: assessing the roughness of time series and spatial data A comprehensive comparison and overview of R packages for calculating sample entropy