Cough activity detection for automatic tuberculosis screening
Authors: Joshua Jansen van Vüren, Devendra Singh Parihar, Daphne Naidoo, Kimsey Zajac, Willy Ssengooba, Grant Theron, Thomas Niesler
Organizations: Department of Electrical and Electronic Engineering, Stellenbosch University, Stellenbosch, South Africa · DSI-NRF Centre of Excellence for Biomedical Tuberculosis Research, South African Medical Research Council Centre for Tuberculosis Research, Division of Molecular Biology and Human Genetics, Faculty of Medicine and Health Sciences, Stellenbosch University, Cape Town, South Africa · Faculty of Business and Economics, University of Göttingen, Göttingen, Germany · Department of Medical Microbiology, College of Health Sciences, Makerere University, Biomedical Research Center (MAKBRC), Kampala, Uganda
The automatic identification of cough segments in audio through the determination of start and end points is pivotal to building scalable screening tools in health technologies for pulmonary related diseases. We propose the application of two current pre-trained architectures to the task of cough activity detection. A dataset of recordings containing cough from patients symptomatic for tuberculosis (TB) who self-present at community-level care centres in South Africa and Uganda is employed. When automatic start and end points are determined using XLS-R, an average precision of 0.96 and an area under the receiver-operating characteristic of 0.99 are achieved for the test set. We show that best average precision is achieved by utilising only the first three layers of the network, which has the dual benefits of reduced computational and memory requirements, pivotal for smartphone-based applications. This XLS-R configuration is shown to outperform an audio spectrogram transformer (AST) as well as a logistic regression baseline by 9% and 27% absolute in test set average precision respectively. Furthermore, a downstream TB classification model trained using the coughs automatically isolated by XLS-R comfortably outperforms a model trained on the coughs isolated by AST, and is only narrowly outperformed by a classifier trained on the ground truth coughs. We conclude that the application of large pre-trained transformer models is an effective approach to identifying cough end-points and that the integration of such a model into a screening tool is feasible.
Figures & tables
Figure 1: Power (dB) versus frequency (Hz) for all cough (blue) and non-cough (orange) audio, shaded regions indicate standard deviation over corpus.
Part
Number
Duration
Number
Duration
recordings
recordings
coughs
coughs
Train
583
13.20
11890
1.37
Dev
146
3.31
3015
0.36
Test
464
7.20
6874
0.79
Total
1193
23.71
21791
2.52
Table 1: Dataset training, development and test partition statistics. The training and development sets comprise only data collected in Uganda, while the testing data comprises only recordings collected in South Africa.
Figure 2: Cough activity detection model architecture and overview of the determination strategy for cough start and end points. TP: True positive, FP: False positive, TN: True negative.
Figure 3: Top level diagram of automatic cough isolation from raw audio to downstream TB classification.
Figure 4: Receiver-operator characteristic and coverage (sensitivity) and purity (precision) curves for the development set for each of the three (XLS-R, AST, LR) cough detectors and the three respective operating points, × : 97% coverage, ⋆ : 90% purity, and + : equal error rate.
Model
Batch
LR
Layer
Parameter count
Full
Optimal
LR
8
0.01
-
2k
-
AST
8
0.0001
1
87M
9.5M
XLS-R
8
0.0001
3
316M
51M
Table 2: Best performing hyperparameters for the three models (LR, AST, XLS-R).
Model
Development
Test
AUC
AP
AUC
AP
LR
0.95
0.79
0.91
0.69
AST
0.97
0.82
0.98
0.87
XLS-R
0.99
0.90
0.99
0.96
Table 3: Average development and test set performance (AUC, AP) for all three considered models (LR, AST, XLS-R).
Figure 5: Histogram of test set cough durations for three cough activity detection models (AST, XLS-R, LR) at three different operating points (purity, coverage, equal error rate).
Operating
Model
Number
Average cough
Total dur.
point
coughs
dur. (ms)
(min)
Ground truth
6886
413 ± 148
47.36
LR
22322
461 ± 1623
171.58
C
AST
9431
561 ± 564
88.16
XLS-R
6682
538 ± 417
59.97
C †
AST
5703
903 ± 738
85.82
Table 4: Statistics of the South African test set for each of the cough datasets obtained using the cough detection models as well as the manually annotated (ground truth) statistics. Each of the three cough detection models are used to isolate coughs at three operating points (C: coverage, EE: equal error rate, P: purity) †: After application of median filter.
Model
Median filter
Approx.
Development
size
duration (ms)
AUC
AP
AST
None
-
0.9732
0.8234
3
300
0.9735
0.8223
5
500
0.9716
0.8009
7
700
0.9675
0.7635
9
900
0.9612
0.7279
Table 5: Development set average precision for AST and XLS-R with best hyperparameters (Table 2 ) after further application of a median filter with various sizes.
Operating
Model
Development
Test
point
AUC
AUC
Manual
0.66±0.01
0.65±0.07
C
AST
0.58±0.02
0.59±0.09
XLS-R
0.64±0.02
0.63±0.10
C †
AST
0.59±0.02
0.57±0.09
XLS-R
0.63±0.02
0.62±0.09
Table 6: Ten fold nested cross-validation results for a downstream bidirectional LSTM TB classification model when trained using one of the nine automatically extracted cough datasets. C: coverage, EE: equal error rate, P: purity, †: After application of median filter. Manual: Classification performance when training on manual (ground truth) coughs.
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.
Department of Electrical and Electronic Engineering, University of Stellenbosch, Stellenbosch, South Africa · Laboratory for intelligent Global Health and Humanitarian Response Technologies (LiGHT) Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland · National Teaching Hospital for Tuberculosis and Pulmonary Diseases (CNHU-PPC), Cotonou, Benin +1