Cough sound spectro-temporal analysis and automated detection using Vision Transformers.
Keming Tan1, Jacky Smith2,3, Patrick Gaydecki1
1Department of Electrical and Electronic Engineering, The University of Manchester, Manchester, UK.
Digital Health
|December 5, 2025
Summary
This study developed an automated cough detection system using Vision Transformers (ViT) and spectro-temporal analysis. The system achieved high accuracy across diverse respiratory conditions, offering a scalable solution for objective cough monitoring.
Area of Science:
- Respiratory Medicine
- Artificial Intelligence
- Signal Processing
Background:
- Clinical cough assessment is subjective and inefficient.
- Existing automated cough detection lacks generalizability.
- Need for objective, scalable cough monitoring systems.
Purpose of the Study:
- Develop and evaluate an automated cough detection system.
- Utilize spectro-temporal analysis and Vision Transformer (ViT) model.
- Validate performance on a large, diverse dataset.
Main Methods:
- Analyzed 231 annotated 24-hour cough recordings from the RaDAR database.
- Segmented recordings and converted to spectrograms with optimized Short-Time Fourier Transform (STFT) settings.
- Fine-tuned a ViT model in two stages: pilot and full-scale training.
Main Results:
- Optimal spectrogram parameters identified: 750ms segment, 128-point frame, 32-point hop.
- Achieved high performance: F1 score 85.02%, sensitivity 83.64%, precision 86.44%, specificity 99.67%.
- Demonstrated strong performance across various diagnostic categories like ILD, COPD, asthma, and chronic cough.
Conclusions:
- Vision Transformers enable accurate, scalable cough detection.
- ViT-based systems offer objective, automated cough monitoring.
- Performance comparable to CNNs on a larger, diverse dataset.


