Exploring Self-Supervised Representation Ensembles for COVID-19 Cough Classification

Hao Xue, Flora D. Salim · DOI

Abstract

The usage of smartphone-collected respiratory sound, trained with deep learning models, for detecting and classifying COVID-19 becomes popular recently. It removes the need for in-person testing procedures especially for rural regions where related medical supplies, experienced workers, and equipment are limited. However, existing sound-based diagnostic approaches are trained in a fully supervised manner, which requires large scale well-labelled data. It is critical to discover new methods to leverage unlabelled respiratory data, which can be obtained more easily. In this paper, we propose a novel self-supervised learning enabled framework for COVID-19 cough classification. A contrastive pre-training phase is introduced to train a Transformer-based feature encoder with unlabelled data. Specifically, we design a random masking mechanism to learn robust representations of respiratory sounds. The pre-trained feature encoder is then fine-tuned in the downstream phase to perform cough classification. In addition, different ensembles with varied random masking rates are also explored in the downstream phase. Through extensive evaluations, we demonstrate that the proposed contrastive pre-training, the random masking mechanism, and the ensemble architecture contribute to improving cough classification performance.

Introduction

Smartphone-based COVID-19 screening via cough sounds offers a promising, contactless diagnostic tool. However, it faces a major hurdle: data scarcity. Most existing AI models for this task are fully supervised, requiring thousands of audio clips meticulously labeled by medical experts. Obtaining these labels is expensive, slow, and fraught with privacy concerns. Furthermore, cough sounds are inherently "noisy"—recordings often contain pauses or background sounds that confuse standard models.

This research addresses these challenges by leveraging self-supervised learning (SSL) to utilize vast amounts of unlabeled respiratory data, making models more robust to the messiness of real-world audio.

Methodology

The proposed framework consists of a two-phase approach: a contrastive pre-training phase using unlabeled data and a downstream classification phase using labeled data.

Overview of the proposed two-phase framework: Contrastive Pre-training and Downstream Cough Classification.

Contrastive Pre-training (Self-Supervised)

Instead of learning from "positive/negative" labels, the model learns to distinguish between different speakers. It takes two clips from the same person (a "positive pair") and tries to make their mathematical representations similar, while pushing representations of clips from different people ("negative pairs") apart. This allows the model to learn the fundamental "language" of respiratory sounds without needing medical diagnoses.

Transformer Encoder with Random Masking

The core of the model is a Transformer architecture. To prevent overfitting and improve noise handling, a Random Masking mechanism was introduced. This randomly hides parts of the audio signal during training, forcing the model to learn robust features from the remaining parts.

Detailed architecture of the Contrastive Pre-training phase, featuring the random masking generator and Transformer encoder.

Ensemble Architecture

In the final diagnostic phase, the researchers utilized an ensemble of two encoders. Because each encoder sees a different random "mask" of the same cough, they provide different "perspectives" on the audio, which are then combined for a more accurate final prediction.

Datasets

The study utilized two primary datasets:

  • Coswara Dataset: Used for the pre-training phase. It contains crowdsourced breathing, cough, and voice sounds from over 1,400 participants. This data was used without COVID labels.
  • COVID-19 Sounds (Cambridge): Used for the downstream classification phase. This curated dataset includes 141 COVID-positive and 298 COVID-negative recordings for fine-tuning and testing.

Key Insights and Results

  • Domain-Specific SSL Performance: The model, pre-trained on a relatively small amount of unlabeled cough data, performed comparably to or better than "VGGish" (pre-trained on the massive YouTube-based Audioset). This suggests that for specialized medical tasks, "in-domain" data is more valuable than "general" data.
  • The Power of Masking: Masking 50% of the audio signal during pre-training actually improved performance, acting as a form of data augmentation that makes the model resilient to silence and noise.
  • Bilinear Similarity: A Bilinear Similarity metric outperformed the standard Cosine Similarity during pre-training, likely due to its flexibility in learning complex audio relationships.
  • Classification Accuracy: The best-performing single model (Transformer-CP) achieved a ROC-AUC of 88.83%. The ensemble structure further pushed this to 90.03%.
  • Efficiency: Inference takes only about 0.03 milliseconds per cough instance on a standard GPU, making it highly suitable for real-time mobile applications.

Conclusion

While this framework addresses the training data bottleneck, the model currently requires fine-tuning for specific datasets to avoid domain transfer issues. Future work will explore larger unlabeled datasets and test the model's specificity across other respiratory conditions like asthma or bronchitis to ensure it is specifically detecting COVID-19.

Summary updated

BibTeX
@inproceedings{xue2021exploring,
  author = {Hao Xue and Flora D. Salim},
  title = {{Exploring Self-Supervised Representation Ensembles for COVID-19 Cough Classification}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2021},
  doi = {10.1145/3447548.3467263},
}
Figure