Why ML-based cough models do not generalize: a systematic cross-dataset evaluation for tuberculosis screening
Organizations: Embedded Systems Laboratory, École Polytechnique Fédérale de Lausanne, Lausanne, Switzerland. · Basque Center for Applied Mathematics (BCAM), Bilbao, Spain. · University of the Basque Country (EHU), Leioa, Spain.
Abstract
Cough acoustics are promising for non-invasive tuberculosis (TB) screening, yet whether machine learning (ML) models capture disease-related acoustics or artifacts of data collection remains unresolved. We evaluated the cross-dataset generalizability of classical ML and deep learning (DL) cough-based TB classifiers across three independent datasets. Despite moderate within-dataset performance (ROC-AUC up to ), both pipelines fail to generalize, with external performance frequently below 0.6, indicating a possible limitation of the data. We further observed audio representations are organized by recording device and dataset rather than TB status, predicted TB probability tracks country-level prevalence in CODA, and device mismatch degrades transfer while device-diverse training improves it. Additionally, a clinical-variable baseline generalizes more consistently (ROC-AUC ), indicating acquisition-specific variability is a stronger driver of poor generalizability than population shift. High within-dataset performance is not enough. External validation is essential before cough-based TB models are clinically ready.
Figures & tables
| Classical machine learning | Deep learning | |
|---|---|---|
| Filtering | Bandpass: lower cut-off 10–500 Hz, upper cut-off 4,000–8,000 Hz. | |
| Augmentation | Crop-and-pad, additive Gaussian noise, Brownian noise, tape-speed perturbation, amplitude scaling, pitch shifting, time stretching, circular time shifting Blankemeier et al. (2023) . | |
| • Additionally: SpecAugment (frequency and time masking) | ||
| Features | Feature selection via recursive backward elimination. • CLAP embeddings • Time-frequency domain features (Supplementary F) | • Spectrogram • Mel-spectrogram • Scalogram (continuous wavelet transform) |
| Models | • Random forest • Logistic regression • Gradient boosting | • ResNet-18, ResNet-34 • VGGish • OPERA • CLAP |
| Dataset | Subgroup | Device | Number of subjects | Number of cough events | TB+ rate (%) | Usage |
|---|---|---|---|---|---|---|
| CODA | Vietnam | OPPOA54 | 161 | 1791 | 40 | Train / Vali |
| CODA | Madagascar | Motorola G9 play | 157 | 1293 | 48 | Train / Vali |
| CODA | Tanzania | Nokia 3.4 Ta-1288 | 87 | 1004 | 16 | Train / Vali |
| TBscreen | Passive cough | Pixel | 118 | 3762 | 70 | Train / Vali |
| TBscreen | Passive cough | Boundary microphone | 114 | 3370 | 72 | Train / Vali |
| TBscreen | Passive cough | Condenser microphone | 106 | 2606 | 74 | Train / Vali |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.