[Paper Review] Pretraining Respiratory Sound Representations using Metadata and Contrastive Learning
This paper proposes a supervised contrastive learning framework that leverages demographic metadata (sex and age) alongside respiratory sound data to improve representation learning for anomaly classification. By training a model using both class labels and metadata in a multi-head contrastive setup, it achieves state-of-the-art performance on ICBHI and SPRSound datasets, outperforming cross-entropy training in sensitivity and overall classification accuracy, especially in low-data and imbalanced settings.
Methods based on supervised learning using annotations in an end-to-end fashion have been the state-of-the-art for classification problems. However, they may be limited in their generalization capability, especially in the low data regime. In this study, we address this issue using supervised contrastive learning combined with available metadata to solve multiple pretext tasks that learn a good representation of data. We apply our approach on respiratory sound classification. This task is suited for this setting as demographic information such as sex and age are correlated with presence of lung diseases, and learning a system that implicitly encode this information may better detect anomalies. Supervised contrastive learning is a paradigm that learns similar representations to samples sharing the same class labels and dissimilar representations to samples with different class labels. The feature extractor learned using this paradigm extract useful features from the data, and we show that it outperforms cross-entropy in classifying respiratory anomalies in two different datasets. We also show that learning representations using only metadata, without class labels, obtains similar performance as using cross entropy with those labels only. In addition, when combining class labels with metadata using multiple supervised contrastive learning, an extension of supervised contrastive learning solving an additional task of grouping patients within the same sex and age group, more informative features are learned. This work suggests the potential of using multiple metadata sources in supervised contrastive settings, in particular in settings with class imbalance and few data. Our code is released at https://github.com/ilyassmoummad/scl_icbhi2017
Motivation & Objective
- To address the challenge of limited generalization in supervised deep learning for respiratory sound classification, particularly under data scarcity and class imbalance.
- To explore whether metadata such as sex and age can improve representation learning when used as auxiliary supervisory signals in contrastive learning.
- To develop and evaluate a multi-head supervised contrastive learning framework that jointly optimizes for both diagnostic class labels and demographic metadata.
- To compare the performance of contrastive learning with cross-entropy training and assess the impact of combining metadata with class labels on model generalization.
- To demonstrate the effectiveness of this approach on two public respiratory sound datasets: ICBHI and SPRSound, under standard evaluation protocols.
Proposed method
- The method employs a supervised contrastive learning (SCL) framework where positive pairs are formed based on shared class labels, and the model is trained to embed similar samples closer in the latent space.
- A multi-head SCL variant (M-SCL) is introduced, where one head processes diagnostic class labels and another processes metadata (sex and age group), enabling disentangled representation learning.
- The model is pre-trained on AudioSet and fine-tuned on ICBHI and SPRSound using a contrastive loss that encourages clustering of positive pairs and separation of negatives.
- Metadata is encoded as discrete groups (e.g., male/young, female/elderly), and used to form positive pairs independently from class labels to create additional supervisory signals.
- The approach combines SCL with cross-entropy loss in a hybrid training strategy to further improve performance on downstream classification.
- Data augmentation is applied during pre-training to generate diverse views of the same respiratory sound, enhancing robustness.
Experimental results
Research questions
- RQ1Can supervised contrastive learning with metadata improve representation learning for respiratory sound classification compared to standard cross-entropy training?
- RQ2Does using metadata as an auxiliary supervisory signal in contrastive learning lead to better generalization, especially in low-data and imbalanced settings?
- RQ3How does multi-head contrastive learning (M-SCL), which jointly optimizes for class labels and metadata, compare to single-head SCL or cross-entropy in terms of classification performance?
- RQ4Can representations learned using only metadata (without class labels) achieve performance comparable to those learned with class labels?
- RQ5What is the impact of combining metadata with class labels in a contrastive framework on sensitivity and specificity in detecting respiratory anomalies?
Key findings
- On the ICBHI dataset, the proposed M-SCL method achieved a harmonic score of 58.04 ± 0.94, outperforming the best cross-entropy result (57.55 ± 0.81) and surpassing the SimCLR baseline (48.34 ± 0.87).
- On SPRSound, M-SCL achieved a harmonic score of 85.27 ± 0.88, outperforming both cross-entropy (83.90 ± 0.25) and SCL (85.29 ± 0.56), with higher sensitivity (82.24 ± 2.24 vs. 76.89 ± 0.80).
- Using only metadata in SCL (without class labels) achieved a score of 55.29 ± 0.80 on ICBHI, comparable to cross-entropy training and significantly better than the SimCLR baseline.
- The multi-head SCL framework (M-SCL) outperformed single-head SCL (55.81 ± 0.88) when both used metadata and class labels, indicating that disentangled learning of metadata and class information improves feature quality.
- Contrastive learning methods consistently improved sensitivity compared to cross-entropy, suggesting better clustering of abnormal breath sounds in the latent space.
- The method demonstrated robustness to class imbalance, with M-SCL showing particular gains in detecting rare anomalies, especially when combined with metadata.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.