Introduction
Audio classification has traditionally been the stronghold of Convolutional Neural Networks (CNNs), which are adept at identifying local features in spectrograms. However, CNNs often struggle with long-range temporal dependencies. This research, presented at INTERSPEECH 2021, explores the application of Vision Transformers (ViT) to audio by treating mel-spectrograms as single-channel images. The study focuses on two challenging domains: primate species identification and COVID-19 detection from cough sounds.
Methodology: Adapting ViT for Audio
The core approach involves converting raw audio into mel-spectrograms and processing them using a Transformer architecture. A key innovation introduced is the Vertical Vision Transformer (VViT). Unlike the standard ViT, which uses square patches, VViT employs overlapping, full-height vertical patches. This design allows the model to capture the entire frequency spectrum at specific time intervals, aligning more closely with the sequential nature of audio signals.
To mitigate the risks of overfitting on small datasets, the authors utilized extensive data augmentation techniques, including SpecAugment (masking frequency/time strips), Gaussian noise, and loudness adjustments.
Dataset Challenges and Imbalance
The models were tested on two datasets from the ComParE 2021 challenge:
- Primates Sub-Challenge (PRS): A multi-class dataset of vocalizations from Central Africa.
- COVID-19 Cough Sub-Challenge (CCS): A binary classification task using crowdsourced cough recordings.
Both datasets present significant hurdles, particularly extreme class imbalance and limited sample sizes.
The authors found that equalized sampling was critical; without it, the attention mechanism failed to learn distinguishing features for minority classes.
Results and Performance
Performance was measured using Unweighted Average Recall (UAR). The ViT-based models demonstrated strong competitiveness against established baselines.
| Task | Model | Devel (UAR) | Test (UAR) |
|---|---|---|---|
| Primates (PRS) | ViT (Ours) | 91.5% | 88.3% |
| Baseline (AuDeep) | 84.6% | 86.1% | |
| Coughing (CCS) | ViT (Ours) | 72.0% | 69.9% |
| Baseline (OpenXBOW) | 64.7% | 72.9% |
In the PRS task, the ViT significantly outperformed the baseline. For the CCS task, while the ViT achieved the best development score, it showed some generalization issues on the final test set, likely due to the extremely small training size (286 samples).
Conclusion
This work demonstrates that Vision Transformers are not exclusively "big data" models. With robust augmentation and strategic sampling, they can outperform CNNs even on small, imbalanced bioacoustic and medical audio datasets. The success of the "Vertical" patching strategy suggests that incorporating domain-specific priors into Transformer architectures can further enhance their effectiveness for non-image data.
Summary updated