Abnormal Respiratory Sound Identification Using Audio-Spectrogram Vision Transformer

Whenty Ariyanti, Kai-Chun Liu, Kuan-Yu Chen, Yu TsaoarXiv 2024 · DOI

TL;DR

This paper introduces the Audio-Spectrogram Vision Transformer (AS-ViT), a novel deep learning approach for identifying abnormal lung sounds like crackles and wheezes. By converting audio into visual spectrograms and applying a transformer architecture, the authors achieved state-of-the-art performance on the ICBHI 2017 dataset, significantly improving recall and overall diagnostic scores compared to traditional convolutional neural networks (CNNs).

What Problem Does This Paper Address?

Respiratory diseases are a leading cause of global mortality, making early and accurate diagnosis critical. While pulmonary auscultation (listening to lung sounds with a stethoscope) is a standard medical practice, it is highly subjective and depends heavily on a clinician's experience and hearing acuity.

Automating this process is challenging because lung sounds are highly variable, influenced by factors like patient posture, age, and airflow intensity. Furthermore, background noise often masks subtle pathological sounds. Previous AI attempts primarily used CNNs, which are excellent at capturing local patterns but can struggle with the long-range temporal and spectral dependencies necessary to distinguish complex respiratory anomalies.

Methods

The authors propose a pipeline that treats audio analysis as a computer vision task:

  1. Spectrogram Generation: Raw audio waveforms are converted into log-mel spectrograms using a Short-Time Fourier Transform (STFT). This transforms the 1D audio signal into a 2D "image" representing frequency over time.
  2. Patching and Embedding: Following the standard Vision Transformer (ViT) design, the spectrogram is divided into small, non-overlapping patches (16x16 pixels). These patches are flattened and projected into a linear embedding space.
  3. Transformer Encoder: The sequence of patch embeddings, along with positional information, is fed into a Transformer encoder. This module uses Multi-Head Self-Attention (MSA) to allow the model to focus on different parts of the spectrogram simultaneously, capturing global context that CNNs might miss.
  4. Classification: The final representation is processed through a SoftMax layer to categorize the sound into one of four classes: Normal, Crackle, Wheeze, or Both (Crackle and Wheeze).
Fig. 1. The proposed Audio Spectrogram Vision Transformer (AS-ViT) architecture: (a) the primary architecture of the proposed model; (b) the Transformer encoder module; (c) the Multiscale-self attention (MSA) head, and (d) the self-attention (SA) head.

The model used is a ViT-Base variant, pre-trained on the massive ImageNet-21k dataset and fine-tuned for this specific medical task.

Datasets

The study utilizes the ICBHI 2017 Respiratory Sound Database, a benchmark in the field.

  • Scale: 920 recordings from 126 patients, totaling 5.5 hours of audio.
  • Diversity: Recordings were collected using four different types of equipment (microphones and digital stethoscopes) in various clinical environments.
  • Characteristics: Respiratory cycles vary significantly in length, ranging from 0.2s to 16.2s, with a mean of 2.7s.
Fig. 2. Respiratory Cycles Duration

Key Insights and Ideas

  • Audio as Vision: The core "aha moment" is that spectrograms contain abundant low-level acoustic information that resembles textures in images. This makes them highly suitable for Vision Transformers, which have recently surpassed CNNs in many image recognition benchmarks.
  • Global Context Matters: Unlike CNNs, which have a localized "receptive field," the self-attention mechanism in AS-ViT allows the model to capture long-range connections between different time-frequency regions. This is particularly useful for identifying wheezes, which are continuous musical sounds that span across time.
  • Transfer Learning Efficacy: Even though the model was pre-trained on natural images (like cats and cars), the learned features for edge and pattern detection transferred remarkably well to the abstract patterns found in medical spectrograms.

Key Results

The AS-ViT model was evaluated using two common data split ratios (60:40 and 80:20) and compared against several state-of-the-art (SOTA) models.

TABLE I
  • Recall (Sensitivity): AS-ViT achieved a recall of 79.1% (60:40 split) and 86.4% (80:20 split), significantly outperforming previous models like RespireNet and LungBRN.
  • Overall Score: The model achieved an overall score of 59.8% and 69.3% for the respective splits, setting a new performance ceiling for the ICBHI challenge.
  • Precision Trade-off: While AS-ViT led in recall and overall score, the ARSCNet model maintained a higher precision (46.4% vs 40.6%), suggesting that while AS-ViT is better at catching anomalies, there is still room to reduce false positives.

Limitations and Future Work

The authors acknowledge a few areas for improvement:

  • Model Complexity: The ViT-Base architecture is computationally heavy. Future work will focus on transformer compression and creating lightweight versions suitable for real-time deployment on mobile devices or IoT-enabled digital stethoscopes.
  • Data Imbalance: The ICBHI dataset has an uneven distribution of classes and patient types, which can distort model performance.
  • Precision: Improving the precision of the model to match its high recall will be a priority to ensure the tool is reliable for clinical decision support.

Summary updated

BibTeX
@misc{ariyanti2024abnormal,
  author = {Whenty Ariyanti and Kai-Chun Liu and Kuan-Yu Chen and Yu Tsao},
  title = {{Abnormal Respiratory Sound Identification Using Audio-Spectrogram Vision Transformer}},
  year = {2024},
  eprint = {2405.08342},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.08342},
}
Figure