cs.SDNov 2, 2026

Metadata-Conditioned Audio Transformers for Adaptive Respiratory Sound Classification

Authors: George Kontogiannis, Pantelis Tzamalis, Sotiris Nikoletseas

Organizations: Computer Engineering and Informatics Department, University of Patras, Patras, Greece

Abstract

Respiratory sound classification from auscultation recordings is confounded by heterogeneous acquisition conditions, including recording device, auscultation site, and patient characteristics, that introduce systematic variability unrelated to the underlying pathology. Although such metadata is often available, existing approaches either ignore it or rely on naïve fusion strategies that do not model how distinct metadata sources influence different components of the acoustic representation. We propose a family of metadata-conditioning mechanisms for the Audio Spectrogram Transformer (AST), progressing from gated residual fusion to Feature-wise Linear Modulation (FiLM) adapted to the Transformer architecture. We further introduce two novel variants: Token-Aware FiLM (TAFiLM), which applies distinct modulation to classification and patch tokens, and Soft-Factorized FiLM (SoftFiLM), which learns soft masks to align metadata factors with disentangled feature subspaces. Experiments on the ICBHI benchmark demonstrate consistent gains across all conditioning strategies. SoftFiLM achieves 64.11% on the official 4-class task (+3.94% over the baseline) and 72.40% on the 2-class task, establishing a new state-of-the-art on the 2-class task and competitive performance on the 4-class benchmark.

Figures & tables

Explore similar work

Jun 10, 2026

Lung-SRAD: Spectral-Aware Regularized Audio DASS with Dual-Axis Patch-Mix Contrastive Learning for Respiratory Sound Classification

Recent respiratory sound classification (RSC) studies largely rely on CLS-token driven self-attention architectures such as the Audio Spectrogram Transformer (AST). While effective at modeling global context, recent analyses suggest a low-pass filtering behavior that may reduce sensitivity to localized abnormal patterns. In this work, we investigate State Space Models (SSMs) as an alternative backbone for RSC. Using the Distilled Audio State Space model, we analyze intermediate representations through spectral response curves and observe stronger preservation of mid-to-high spatial-frequency components. Based on these observations, we introduce spectral-aware layer regularization using Gaussian convolution applied to selected layers. We further propose Dual-Axis Patch-Mix contrastive learning tailored to SSM-based audio models for robust representation learning. Experiments on the ICBHI benchmark show that our approach achieves 64.48% score, outperforming the AST baseline by 5%. Code is available at https://github.com/RSC-Toolkit/Lung-SRAD.
Oct 16, 2026

Clinically Informed Acoustic-Aware Attribute Modeling for Respiratory Sound Classification

Automated respiratory sound classification (RSC) aims to identify normal and adventitious respiratory sounds, such as crackles and wheezes. Most existing methods formulate RSC as a flat four-class classification problem over norma, crackle, wheeze and both. However, unlike conventional classification tasks with semantically independent and mutually exclusive categories, the commonly used four-class RSC labels have a compositional structure and can be represented by two clinically meaningful sound attributes: crackle presence and wheeze presence. Existing flat classifiers do not explicitly exploit this structure, which may increase the learning burden by treating the four labels as independent targets. Meanwhile, crackles and wheezes exhibit distinct temporal characteristics, with sparse transient crackle events and sustained continuous wheeze patterns, making a single temporal aggregation strategy less suitable for modeling different adventitious sound evidence. To address these limitations, we propose an Acoustic-Aware Asymmetric Framework (AAAF) for RSC. AAAF reformulates four-class recognition as two sound-attribute detection tasks and recovers the final category through logical composition during inference. Built upon a pretrained BEATs encoder, AAAF employs branch-specific multi-layer fusion and asymmetric temporal aggregation to capture localized crackle evidence and sustained wheeze patterns. Auxiliary normal--abnormal supervision and a batch-adaptive dynamic loss are further introduced to improve global discrimination and robustness under imbalanced labels. Experiments on ICBHI and SPRSound demonstrate that AAAF improves overall RSC performance and generalizes across datasets, achieving a state-of-the-art four-class Score of 65.30% on ICBHI.
May 28, 2026

Mitigating Stethoscope-Induced Shortcuts in Respiratory Sound Classification under Federated Domain Generalization with Causality-Inspired Interventions

AI-driven respiratory sound classification (RSC) is promising for automated pulmonary disease detection, yet multi-site deployment is hindered by inter-stethoscope variability. We introduce a federated domain generalization (FedDG) formulation for RSC in which clients hold recordings from different stethoscopes and the model is evaluated on an unseen device. Our empirical analysis shows that stethoscope-induced style and disease-relevant content are partially entangled, making deterministic style removal unreliable. In response, we propose BTS-CAFE, a framework combining (i) causality-inspired device-style interventions with constraints designed to limit content distortion, (ii) counterfactual metadata augmentation to relieve device and demographic shortcuts, and (iii) gradient alignment to promote device-invariant decision boundaries across clients. Built on BTS with CLAP, a multimodal language-audio pretraining model, BTS-CAFE improves the out-of-distribution ICBHI Score by 3.69 points on average over five held-out devices relative to its backbone, and outperforms conventional data augmentation and federated learning baselines in simulated device leave-out evaluations on the ICBHI and SPRSound datasets.