Abstract
Deep neural networks have been applied to audio spectrograms for respiratory sound classification. Existing models often treat the spectrogram as a synthetic image while overlooking its physical characteristics. In this paper, a Multi-View Spectrogram Transformer (MVST) is proposed to embed different views of time-frequency characteristics into the vision transformer. Specifically, the proposed MVST splits the mel-spectrogram into different sized patches, representing the multi-view acoustic elements of a respiratory sound. These patches and positional embeddings are then fed into transformer encoders to extract the attentional information among patches through a self-attention mechanism. Finally, a gated fusion scheme is designed to automatically weigh the multi-view features to highlight the best one in a specific scenario. Experimental results on the ICBHI dataset demonstrate that the proposed MVST significantly outperforms state-of-the-art methods for classifying respiratory sounds.
Introduction: Rethinking Spectrograms as Physical Signals
Automated auscultation—the use of algorithms to listen to lung sounds—is a critical tool for diagnosing respiratory diseases. However, it remains a challenging task for computer vision. Most current models treat mel-spectrograms as standard photographs, applying architectures like ResNet or Vision Transformers (ViT) that were originally designed for natural images.
This approach overlooks a fundamental truth: spectrogram axes have distinct physical meanings. The x-axis represents time, while the y-axis represents frequency. Standard ViTs typically use square patches (e.g., 16x16), which can lead to two major issues in audio analysis:
- Frequency Misalignment: Respiratory sounds like wheezes can shift in frequency between breathing cycles. Small square patches struggle to maintain consistency across these shifts.
- Resolution Trade-offs: Square patches often provide insufficient spectral information for high-frequency components or lose critical temporal data if the patch is too large.
The Multi-View Spectrogram Transformer (MVST)
To address these limitations, the authors developed the Multi-View Spectrogram Transformer (MVST). This architecture is designed to capture the unique "acoustic elements" of lung sounds by processing the signal through multiple perspectives simultaneously.
Multi-View Patch Splitting
Instead of a uniform grid, the MVST splits the input mel-spectrogram (256x1024) into five distinct groups of patches:
- 256 × 1: Captures the full frequency response at a single time instance, offering high tolerance to frequency shifts.
- 128 × 2, 64 × 4, 32 × 8: Intermediate views balancing time and frequency resolution.
- 16 × 16: The standard square patch used in traditional ViTs.
Transformer Encoders and Gated Fusion
Each patch group is processed by its own dedicated Transformer encoder. These encoders use Multi-Head Self-Attention (MSA) to learn global relationships between patches within that specific view.
Because different sounds (e.g., a crackle vs. a wheeze) might be better represented by different patch shapes, the model employs a Gated Fusion mechanism. This scheme learns to automatically weigh the features from the five encoders, dynamically highlighting the most discriminative view for a given audio snippet.
Experimental Results
The MVST was evaluated on the ICBHI dataset, the largest public benchmark for respiratory sounds, containing 6,898 cycles across four classes: Normal, Crackle, Wheeze, and Both.
The model achieved state-of-the-art (SOTA) performance across all primary metrics: Specificity (SP), Sensitivity (SE), and Average Score (AS).
As shown in the results, the MVST achieved a 66.55% Average Score, a significant 4.18% improvement over the previous SOTA (AST + patch-mix CL). Notably, the model showed a massive jump in Sensitivity (51.10%), indicating a much higher accuracy in correctly identifying abnormal respiratory sounds.
Discussion and Conclusion
The core innovation of MVST lies in the recognition that time and frequency axes should be treated differently. By utilizing "slim and long" patches that encompass wider bandwidths, the model becomes robust to the natural pitch variations in human breathing. Ablation studies confirmed this, showing that views like 128x2 often outperform the standard 16x16 square patch baseline.
While the parallel processing of five encoders increases computational complexity, the gains in diagnostic accuracy are substantial. Future work may explore adaptive or learned patch shapes to further refine the model's ability to extract features from complex acoustic signals. The success of this multi-view approach suggests broad applicability to other audio classification tasks beyond medical auscultation.
Summary updated