# Automated Analysis of Crackles in Patients with Interstitial Pulmonary Fibrosis

Authors: B. Flietstra; N. Markuzon; A. Vyshedskiy; R. Murphy
Journal: Pulmonary Medicine
 (2011)

---

## Abstract

Background. The crackles in patients with interstitial pulmonary fibrosis (IPF) can be difficult to distinguish from those heard in patients with congestive heart failure (CHF) and pneumonia (PN). Misinterpretation of these crackles can lead to inappropriate therapy. The purpose of this study was to determine whether the crackles in patients with IPF differ from those in patients with CHF and PN. Methods. We studied 39 patients with IPF, 95 with CHF and 123 with PN using a 16-channel lung sound analyzer. Crackle features were analyzed using machine learning methods including neural networks and support vector machines. Results. The IPF crackles had distinctive features that allowed them to be separated from those in patients with PN with a sensitivity of 0.82, a specificity of 0.88 and an accuracy of 0.86. They were separated from those of CHF patients with a sensitivity of 0.77, a specificity of 0.85 and an accuracy of 0.82. Conclusion. Distinctive features are present in the crackles of IPF that help separate them from the crackles of CHF and PN. Computer analysis of crackles at the bedside has the potential of aiding clinicians in diagnosing IPF more easily and thus helping to avoid medication errors.


---

## Body

## 1. Introduction

Crackles are a common finding in patients with interstitial pulmonary fibrosis (IPF). Their presence in a patient is often the first clue that the disease is present. Unfortunately, they can be misinterpreted as being due to congestive heart failure (CHF) or pneumonia (PN), and as a consequence patients may receive inappropriate therapy. On occasion, this can lead to serious, unwanted side effects such as dehydration due to the inappropriate administration of diuretics or an adverse reaction to an antibiotic that was not indicated in the first place. In an attempt to reduce these complications, we studied the sound patterns of patients with these diseases using a multichannel lung sound analyzer (STG16) to determine if such analysis could help differentiate IPF from CHF and PN.Using advanced statistical techniques we compared features of IPF crackles to those in patients with CHF and PN. Our goal was to determine if there are features of the lung sounds in IPF patients that would help to distinguish them from the lung sounds of patients with CHF and PN.


## 2. Materials and Methods

Patients were selected for this study from a pool of patients who had undergone lung sound analysis as a part of a broader study of the correlation of disease processes with lung sounds patterns. To acquire patients into this study, we identified hospitalized patients and outpatients of a community teaching hospital who were diagnosed as having a specific cardiopulmonary disease or were considered to be normal by their caregivers. The studies were not made on consecutive patients; this is a convenience sample and we currently have over 1,000 patients for whom we have both the diagnosis and the lung sound analysis. The diagnostic category of each of the patients was that of the clinicians caring for these patients. The CHF and PN patients were inpatients in a teaching hospital, and diagnoses were confirmed by board certified specialists. The IPF patients were outpatients and were all seen by pulmonary specialists. There were 39 patients with IPF, 95 with CHF, and 123 with PN. All patients were examined using a multichannel lung sound analyzer (STG16). The details of this device have been described [1]. In brief, patients are asked to lie on a soft foam pad, which has stethoscope chest pieces embedded in it. Each of these chest pieces contains a microphone. The sounds detected by these microphones are amplified, filtered, and input into a computer for analysis. In our usual practice, patients are asked to perform several breathing maneuvers: normal breathing, deeper than normal breathing, coughing, and a vital capacity maneuver. In this study, we chose the data obtained during the deeper than normal breathing maneuver.Crackles were defined in accordance with accepted criteria [2, 3]. The STG software automatically identified crackles in all full breaths. The validation of the use of the device as a crackle counter has been reported [4]. A single recording lasted 20 seconds and typically contains a minimum of 3 breaths. To develop algorithms for testing, the crackle features shown in Table 1 were assessed.Table 1Individual crackle featuresDefinitionNumber of zero line crossings (ZXS)The number of times the crackle waveform crossed the baselineT1First half-period, Figure1(a)Crackle pitchCrackle pitch (spectral frequency) calculated from 4 half-periods:T1, T2, T3, and T4, Figure 1(a)T2/T1Ratio of the 2nd and 1st half periodsHalf-period duration variability (%)(Standard deviation{T1,T2,T3,…,Tn}×100%)/(mean {T1,T2,T3,…,Tn})Crackle timing (timing)Crackle timing is defined as follows: 1 for early inspiration, 2 for mid-inspiration, 3 for late inspiration, 4 for early expiration, 5 for mid-expiration, 6 for late expirationCrackle transmission coefficient (CTC)The degree of crackling sound transmission through the ipsilateral chest, as calculated from crackle family observation by multiple microphones. The CTC has a value of 0% in the absence of any transmission and 100% when there is equal transmission to all ipsilateral channels see [7] for detailed description and discussion.AmplitudeAmplitude of the highest peak (arbitrary units)A2/A1See Figure1(a)A3/A1See Figure1(a)Half period amplitude variability (%)(Standard deviation{A1,A2,A3,…,An}×100%)/(Mean {A1,A2,A3,…,An})Crackle polarity (polarity)Direction of the highest peak, Figures1(b) and 1(c) see [8] for detailed description and discussionCrackle features were calculated separately for inspiratory crackles and for expiratory crackles. Figure1 demonstrates the process of calculating features of the crackle. In addition to these features, we combined the individual crackle features in the form of a median (median T1, median pitch, etc.)The waveform of a typical crackle (a). The crackle analysis starts by identification of the crackle’s highest deflection highest peak. The half-period to the left of the highest peak is marked asT1. The half-period to the right of the highest peak is marked as T2. Crackle pitch is calculated from 4 consecutive half-periods, with T1 as a 1st half-period. The amplitude is determined separately for each half-period and marked as A1, A2, and A3. Crackle polarity (b) crackle polarity is defined positive if the highest peak is upward (c). Crackle polarity is defined negative if the highest peak is downward.
(a)(b)(c)In addition to features based on individual crackle properties we captured information reflecting the distribution of the patient’s crackles. Diseases differ in the pattern of crackles distribution over the chest. Distribution information required aggregation of data on a per-breath level and led to the development of aggregate crackle features shown in Table2.Table 2Aggregate crackle featuresDefinitionNumber of crackles per breath (Cr/breath)The total number of crackles per breath as detected by the computerNumber of crackles per breath per quadrant (top left, top right, bottom left, bottom right)These 4 features count the total number of crackles observed in each quadrant of the chest. Together they add up to the total number of crackles per breathPercentage differences between crackle quadrants (6 total)Calculated from the 4 features described above, these features represent a comparison between quadrants. Each percentage is a pairwise comparison of all 6 possible combinations of quadrantsMaximum distances (x,y,z)Distances between crackles in 3-dimensional space. There are separate features forx, y, and z planes. One feature also records a maximum distance across all 3 dimensionsChannel distancesThese features are similar to those described above, except that they are defined based upon which channel microphone picked up the crackle. Distances are defined accordinglyTo perform classification and prediction we utilized supervised learning nonparametric classifiers: neural networks and support vector machines [5, 6]. Supervised learning can teach the system to nonlinearly map the input features to the associated label of disease. We divided the data into a training set, used for feature extraction and model building, and a validation set, used for evaluation of the results. Validation data set performance indicates how well the features generalize to the unseen data. We used a fivefold cross-validation to increase the pool of validated data.We used individual crackle features to distinguish crackles of IPF from CHF crackles and PN crackles. Once individual crackles were classified as IPF, CHF, or PN, majority voting was used to classify the patient into one of the three disorders. To incorporate features of crackle distribution, we performed majority voting among individual breaths during the single recording; for example, if a patient had 6 breaths, and 3 of them were classified as IPF, 2 as CHF, and 1 as PN, then the patient would be classified as having IPF. The final classification of IPF versus CHF and IPF versus PN was performed using this breath majority voting.The study was approved by the Institutional Review Board of the Brigham and Women’s/Faulkner Hospitals.


## 3. Results

Figure2 shows crackle analysis in the three representative patients with IPF, CHF, and PN. The left panels show three-dimensional models of the thorax with crackles overlaid on the three-dimensional display. Crackles are displayed as cubes. The size of each cube is proportional to the crackle density. The patient with IPF had over 100 crackles recorded over 20 seconds, panel (a). The crackles localized in three-dimensional space are distributed uniformly. The patient with CHF had over 50 crackles distributed with accentuation toward lung bases, panel (c). The patient with PN had over 70 crackles localized to the left lower lobe where radiography revealed opacifications, panel (e).Figure 2
Examples of lung sound analysis in three individual patients. Left panel: based on arrival time differences at the microphones all crackles were localized inside the chest. Crackles are displayed as cubes overlaid on the three-dimensional display. The size of each cube is proportional to the crackle density. Crackle pitch is color coded: the insert shows the legend. Right panel: to illustrate the difference in crackle transmission, an individual crackle is shown in the right panel. Sound waveforms are shown as detected in the microphones arrayed over the posterior chest. The IPF crackle is only detected by one microphone, while the CHF and PN crackles are detected by several microphones. The insert shows the crackle waveforms in stacked mode to facilitate examination of arrival times at the various microphones.The display of a single crackling event reveals that the crackling sound is transmitted differently in the three diseases. The right panels in Figure2 show time-expanded sound waveforms that were recorded by the 14 microphones positioned over the posterior chest. The waveforms are superimposed on a body plot. Each waveform is positioned on the part of the body where the sound was recorded.In the patient with CHF, panel (d), a prominent crackle is seen on the tracing from channel 6 (indicated by a large triangle). At the same time the crackling sound was also detected in all ipsilateral microphones 1, 2, 3, 4, 5, and 7 (marked by triangles). The set of crackles generated by a single event and recorded by multiple microphones is referred to as a crackle family [7, 8]. The crackle waveforms corresponding to the crackle family are shown in the stack mode in the insert in the upper-right corner. Notice that the crackle recorded by microphone 6 (the most prominent crackle or mother crackle) occurs earlier than the other crackles.The crackle transmission coefficient was calculated for each crackle family. In the crackle family shown in the CHF patient (Figure2(d)), the CTC was 50%. (The CTC has a value of 0% in the absence of any transmission and 100% when there is equal transmission to all ipsilateral channels.) In the crackle family shown in the PN patient, Figure  2(f), the CTC was 16%. In contrast, the crackle in the IPF patient was detected at only a single microphone (Figure  2(b)). The CTC of this crackle family was 1%. The low CTC is typical in IPF patients.In addition to the CTC, note the difference in the pitch of the crackles shown in Figure2, right panels: 588 Hz in IPF versus 218 Hz in CHF and 364 Hz in PN. Also note the difference in the number of zero crossings: 15 in IPF versus 5 in CHF and 5 in PN.The observations in single patients shown in Figure2 are supported by statistical analysis of all available data. Table 3 shows crackle rate and individual crackle features in IPF, CHF, and PN. Note that multiple individual crackle features are significantly different between IPF and the other two diseases.Table 3
Crackle rate and individual crackle features in IPF, CHF, and PN. The results are presented as means ± SD. Student’st-test was used to compare the variables between the groups. Values of P that are less than.05 are shown in bold.
Crackle FeaturesIPF (n=39)CHF (n=95)PN (n=123)IPF versus CHFIPF versus PNInspirationCrackle rate (crackles per breath)18±147±57±4P<.0001P<.0001Crackle pitch (Hz)416±88302±64284±60P<.0000001P<.0000001T1 (s)1.2±0.21.4±0.21.5±0.3P<.0000001P<.0000001Number of zero line crossings (ZXS)9±26±16±1P<.0000001P<.0000001T2/T11.2±0.11.5±0.31.5±0.2P<.00001P<.00001Half-period duration variability (%)38±837±937±7P=.57P=.57Crackle timing (Timing)2.1±0.32.1±0.32.0±0.4P=.98P=.29Crackle transmission coefficient (CTC)16±523±623±7P<.0000001P<.0000001Amplitude9±96±57±7P=.06P=.34A2/A11±0.11±0.11±0.1P=.24P=.02A3/A10.5±0.10.4±0.10.4±0.1P<.0000001P<.0000001Half-period amplitude variability (%)68±1153±1248±12P<.0000001P<.0000001Crackles with positive polarity (%)74±1367±2070±19P=.02P=.18ExpirationCrackle rate (crackles per breath)9±75±35±5P=.01P=.07Crackle pitch (Hz)411±71289±65264±77P<.000001P<.000001T1 (s)1.2±0.31.6±0.31.8±0.3P<.000001P<.000001Number of zero line crossings (ZXS)10±27±17±2P<.000001P<.000001T2/T11.3±0.11.4±0.21.4±0.3P=.001P=.002Half-period duration variability (%)43±1439±837±9P=.17P=.05Crackle timing (Timing)5.2±0.35.1±0.45.0±0.3P=.25P=.13Crackle transmission coefficient (CTC)18±725±927±9P<.001P<.00001Amplitude5±75±46±5P=.72P=.44A2/A11.0±0.11.1±0.11.1±0.1P=.11P=.01A3/A10.5±0.10.4±0.10.4±0.2P=.006P=.002Half-period amplitude variability (%)70±1449±1446±13P<.00001P<.0000001Crackles with positive polarity (%)34±1744±2533±24P=.10P=.80In order to perform classification of patients into one of the three diseases we utilized two statistical methods: neural networks and support vector machines. Table4 presents the results of binary comparisons of individual crackles in IPF versus CHF and IPF versus PN. As seen in Table 4, the sensitivity, specificity, and overall accuracy are over 70%, consistent with the conclusion that individual IPF crackles have features that differ from those of patients with PN and CHF.Table 4
Crackle classification for IPF versus PN and IPF versus CHF using individual crackle features.
SVMNeural networksSensitivitySpecificityAccuracySensitivitySpecificityAccuracyPN0.800.710.740.740.780.75CHF0.790.730.780.780.770.78The accuracy increased to 83% (Table5) on the application of majority voting to the classification of individual breaths based on crackle features. The addition of aggregate crackle features improved the accuracy to 86% (Table 6). Finally, we used majority voting to classify patients based on crackle features (Table 7). The performance of per-breath and that of per-patient classification are quite similar suggesting that most breaths of the same patients are classified in a similar manner.Table 5
Breath classification for IPF versus PN and IPF versus CHF using individual crackle features. The model was created using NNs and voting over classifications of individual crackles in a breath.
Crackle onlySensitivitySpecificityAccuracyPN0.760.840.83CHF0.780.840.83Table 6
Breath classification for IPF versus PN and IPF versus CHF using individual and aggregate crackle features. The model was created using NNs and voting over classifications of individual crackles in a breath.
Crackle and distributionSensitivitySpecificityAccuracyPN0.760.870.86CHF0.780.890.88Table 7
Patient classification for IPF versus PN and IPF versus CHF using individual and aggregate crackle features and majority voting.
SVM votingNeural networks votingSensitivitySpecificityAccuracySensitivitySpecificityAccuracyPN0.820.880.860.770.910.88CHF0.770.850.820.780.880.85


## 4. Discussion

This study shows that the crackles of IPF have features that help distinguish them from the crackles of patients with CHF and PN. As noted, we believe that the crackles of IPF are not infrequently misinterpreted. They are most commonly considered to be due to CHF, and diuretics are administered inappropriately. There is not much literature to support this observation, but it is our personal experience and an informal survey of clinicians confirmed this opinion. In addition to providing evidence that helps in accurately identifying IPF crackles, computerized lung sounds analysis also quantifies them. It has long been noted that crackles of IPF become more widespread when the disease progresses. Thus crackle quantification can be important in assessing the severity of IPF, and this could be useful in providing evidence of response to therapy.We focused on the difference between crackles of IPF and those of CHF and PN. Baughman et al. took a different approach. They showed that the presence of crackles could help clinicians in distinguishing sarcoidosis from IPF [9]. Crackles were much less numerous in patients with sarcoidosis than in those with roentgenologically equivalent severity of changes due to IPF.Among features that are significantly different between IPF and CHF/PN is the crackle pitch (P<.0000001). This is consistent with the commonly held believe that the crackles of IPF are generated in smaller airways than those of CHF and PN. The distinctive features of crackles of IPF have been long recognized. For example, the crackles of pulmonary fibrosis caused by asbestos, described in early as 1930 by Wood and Gloyne to be a prominent feature of this industrial disease, were described by Smither as “characteristic in their sound and distribution” [10, 11]. He also pointed out that they are present first at the bases in the midaxillary line and then tend to spread to the posterior bases. As the disease progresses, crackles become audible higher on the chest. In one study a technician was able to screen workers for asbestosis by detecting crackles. The technician correctly identified all workers in whom the diagnosis was most certain, that is, those with all the clinical, physiological, and roentgenologic criteria used in the study [12]. Using time-expanded waveform analysis, Kawamura et al. studied 18 patients with IPF and 23 patients with crackles who did not have this disease. Two crackle parameters (initial deflection width and two cycle duration) were shorter in the IPF patients. This finding correlated with HRCT findings in these patients [13]. British investigators have reported that detecting crackles on time-expanded waveform analysis was equivalent to CT scans in detecting asbestosis [14]. Finnish investigators also showed a significant positive correlation with frequencies of lung sounds and pulmonary fibrosis detected on HRCT [15]. Of course in industrial settings, in contrast to ER’s and ICU’s, neither CHF nor PN crackles are likely to be confounding variables.To perform classification and prediction, we utilized well-established supervised learning nonparametric classifiers: neural networks and support vector machines [5, 6]. Neural networks (NNs) are the name for non-linear statistical data modeling tools. They are used to model complex relationships between inputs and outputs and are an attempt to build an architecture similar to the one of the human brain. NNs consist of an interconnected group of artificial neurons that learns and updates its internal structure using a connectionist approach to computation. NNs utilize a data-driven approach where changes in internal structure are based on external or internal information that flows through the network during the learning phase. In this study, we used a back propagation neural network. Support Vector Machines (SVM) are one of the newest methods in the supervised learning field. Generally speaking, a support vector machine seeks to create a hyperplane in a high-dimensional space that separates the two data classes. Not only does the hyperplane separate the data, but also it is oriented in such a fashion that creates the maximum “margin” on both sides of it ensuring the largest possible separation between the two classes. The algorithm proved to be fast and very efficient. We note here that both NN and SVM classification achieved similar results.The technology for this study came about in part because there has been resurgence in interest in lung sounds. This has been stimulated by the development of computerized techniques. A number of investigations demonstrating the usefulness of computerized lung sound analysis have been reported [16–21]. While crackle pitch can be assessed by a clinician using an acoustic stethoscope, other crackle features that are significantly different between IPF and CHF/PN can only be gained with the use of a computerized stethoscope. And some crackle features such as crackle transmission coefficient can only be calculated with the use of a multichannel lung sound analyzer.Computerized lung sound analysis can now be done at the bedside. The examinations are easy to do and can be performed in a few minutes. They have been shown to help in the detection of pneumonia [22]. Unfortunately, devices capable of doing this are not currently widely available. However, it is likely that this will change as the advantages of this technology become more widely known. Used in the context of a complete medical evaluation, we believe that this information could help avoid misinterpretation of IPF crackles and thus potentially decrease the occurrence of inappropriate treatment.



---

*Source: 590506-2010-12-21.xml*