Abstract
Respiratory sound contains crucial information for the early diagnosis of fatal lung diseases. Since the COVID-19 pandemic, there has been a growing interest in contact-free medical care based on electronic stethoscopes. To this end, cutting-edge deep learning models have been developed to diagnose lung diseases; however, it is still challenging due to the scarcity of medical data. In this study, we demonstrate that the pretrained model on large-scale visual and audio datasets can be generalized to the respiratory sound classification task. In addition, we introduce a straightforward Patch-Mix augmentation, which randomly mixes patches between different samples, with Audio Spectrogram Transformer (AST). We further propose a novel and effective Patch-Mix Contrastive Learning to distinguish the mixed representations in the latent space. Our method achieves state-of-the-art performance on the ICBHI dataset, outperforming the prior leading score by an improvement of 4.08%.
Introduction
Diagnosing respiratory conditions like pneumonia or COPD traditionally relies on clinical auscultation. While electronic stethoscopes and deep learning offer a path toward automated diagnosis, two major hurdles remain: data scarcity and label ambiguity. Medical audio data is difficult to collect and annotate, and standard data augmentation techniques like Mixup (linearly blending two sounds) often fail in a medical context. For instance, mixing a "normal" lung sound with a "crackle" does not result in a "50% crackle" sound; clinically, the presence of any crackle makes the sound abnormal. This inherent label hierarchy makes traditional supervised learning on mixed samples problematic.
Methodology
The proposed framework utilizes the Audio Spectrogram Transformer (AST), a model that treats audio spectrograms as sequences of patches, similar to Vision Transformers. This architecture is particularly effective at capturing long-range dependencies in both time and frequency, which is vital for identifying intermittent pathological sounds.
Patch-Mix Augmentation
Instead of mixing entire spectrograms, the authors introduce Patch-Mix Augmentation. This technique randomly swaps small "patches" (tokens) between two different audio samples. This creates a composite representation in the latent space that contains distinct features from both source samples, providing a more robust form of data augmentation than simple interpolation.
Patch-Mix Contrastive Learning (MixCL)
To address label ambiguity, the authors proposed MixCL. Rather than forcing the model to predict a mathematically blended label, MixCL trains the model to recognize the degree to which a mixed representation resembles its original components. A critical component of this method is the stop-gradient operation on target representations, which prevents the model from collapsing into trivial solutions and ensures it focuses on the relationship between the mixed patches and the original sounds.
Datasets and Pretraining
The model was evaluated on the ICBHI 2017 Challenge Dataset, which contains 6,898 respiratory cycles. To overcome the scarcity of medical data, the AST model was sequentially pretrained on ImageNet (visual data) and AudioSet (general audio data) before being fine-tuned on the specific respiratory sounds. This cross-domain generalization demonstrates that features learned from general audio and images can be effectively transferred to the niche task of lung sound classification.
Key Results
The proposed method achieved a new state-of-the-art on the ICBHI benchmark, significantly outperforming previous leading models.
As shown in the results table, the MixCL method with Patch-Mix augmentation achieved a 4-class classification score of 62.37%, an improvement of 4.08% over the previous state-of-the-art. In 2-class (Normal vs. Abnormal) tasks, the model reached a record 68.71%. Ablation studies confirm that while the AST model alone is a strong baseline, the addition of Patch-Mix Contrastive Learning provides an additional performance boost of approximately 2.8%.
Key Insights
- Transformers for Audio: The AST’s attention mechanism is superior to traditional CNNs for respiratory sounds because it can better capture the temporal and spectral context of intermittent crackles and wheezes.
- Representation over Interpolation: In medical contexts, learning the representation of what is in a mixture is more effective than trying to average labels. The contrastive loss allows the model to learn similarity to original components without needing perfect ground-truth labels for mixed samples.
Limitations and Future Work
Despite these gains, challenges remain. The hierarchy of medical labels is complex and may require even more specialized loss functions. Additionally, the memory requirements of Transformers limited the study to small batch sizes; larger batches might further enhance contrastive learning performance. Future research will also need to evaluate the model's robustness in the noisy, uncontrolled environments of real-world clinical settings.
Summary updated