Manuscript Offprint

arXiv:2609.00238

XVAE-WMT: Explainable Wavelet-Temporal Variational Autoencoder for Blind Source Separation of Heart and Lung Sounds

Yasaman Torabi, Shahram Shirani, James P. Reilly

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yasaman Torabi¹,*, Shahram Shirani¹,², James P. Reilly¹

¹ Department of Electrical and Computer Engineering, McMaster University, Hamilton, ON L8S 4K1, Canada. ² L.R. Wilson/Bell Canada Chair in Data Communications, Hamilton, ON L8S 4L7, Canada.

Abstract—The separation of cardiovascular sounds is a critical task in biomedical signal processing. In this paper, we introduce XVAE-WMT¹, an unsupervised explainable generative AI algorithm combining a variational autoencoder (VAE) with explainable AI (XAI), wavelet-based inputs, a post-hoc output mask, and temporal consistency (TC) loss. Unlike existing supervised and VAE-based methods that rely on Short-Time Fourier Transform (STFT) and ignore latent interpretability, XVAE-WMT requires no paired clean recordings and integrates a Continuous Wavelet Transform (CWT) front-end for superior time-frequency localization. We assessed the latent space interpretability via different metrics, with SHAP (SHapley Additive exPlanations) enabling dimensionality reduction to the top 75% of latent features while preserving separation quality. Evaluated across two datasets using Signal-to-Distortion Ratio (SDR), Signal-to-Interference Ratio (SIR), and Signal-to-Artifacts Ratio (SAR), XVAE-WMT attains 26.8 dB SDR, 32.8 dB SIR, and 28.6 dB SAR.

Index Terms—Blind Source Separation; Variational Autoencoder (VAE); Explainable AI (XAI); Latent Space Analysis; Audio Signal Processing

I. INTRODUCTION

The separation of heart and lung sounds from single-channel recordings is a fundamental challenge in biomedical acoustic signal processing, with direct implications for clinical diagnosis and patient monitoring [1], [2]. In practice, cardiopulmonary sounds are inevitably mixed during auscultation, as the mechanical activity of the heart and the airflow dynamics of the lungs produce overlapping acoustic signatures that are difficult to disentangle [3]. Accurate separation of these sources enables clinicians to assess cardiac and respiratory conditions independently [4]. The challenge is further compounded by the non-stationary and cyclic nature of both signals, which limits the applicability of conventional signal processing approaches that assume stationarity or statistical independence among sources. Traditional blind source separation (BSS) methods such as Independent Component Analysis (ICA) and Non-Negative Matrix Factorization (NMF) have been widely applied to cardiopulmonary sound separation [5], [6]. ICA assumes statistical independence among sources, a condition that is frequently violated in real-world recordings where heart and lung sounds exhibit overlapping frequency

content and correlated temporal patterns [7], [8]. NMF relies on non-negativity constraints and performs well on spectral data, but struggles to capture the temporal coherence inherent in cyclic physiological signals [9], [10]. Principal Component Analysis (PCA) seeks uncorrelated linear projections of the data but fails to achieve meaningful separation when source signals are non-orthogonal or exhibit nonlinear interactions [11]. Empirical Mode Decomposition (EMD) decomposes signals into intrinsic mode functions but suffers from mode mixing and lacks robustness in noisy environments where heart and lung components overlap [12]. These fundamental limitations have motivated the development of more adaptive, data-driven approaches that do not rely on strict assumptions about source characteristics or require multiple microphones for spatial diversity.

Recent advances in deep learning and generative modeling have opened new avenues for single-channel source separation that overcome many of the limitations of classical methods [13]. Autoencoders (AEs) have been widely adopted for biomedical signal denoising and compression, leveraging their ability to learn compact latent representations in an unsupervised manner [14], [4], [15]. The broader class of generative AI (GenAI) models, including Generative Adversarial Networks (GANs) and diffusion models, has demonstrated strong performance in audio synthesis and enhancement even under limited supervision [16]. Among these, Variational Autoencoders (VAEs) are well-suited for source separation tasks, as they learn structured probabilistic latent spaces that enable effective modeling of complex signal mixtures [17], [18]. Compared with a standard AE, the VAE learns a regularized probabilistic latent space rather than a deterministic representation, which facilitates smooth and structured latent representations for source-specific analysis. The stochastic sampling also enables the model to capture uncertainty in the latent representation while maintaining differentiable training through the reparameterization trick. VAE-based models have been successfully applied to blind source separation in speech, music, and biomedical signals, demonstrating improvements over classical baselines [19], [20], [21]. Despite these advances, existing VAE-based separation models do not fully exploit the temporal structure of cardiopulmonary signals, nor do they incorporate time-frequency representations suited to

¹The python scripts are available on: https://github.com/Torabiy/XVAE non-stationary biomedical data.

Temporal consistency (TC) loss, which penalizes abrupt transitions between consecutive time steps, has been shown to improve sequence coherence in models applied to cyclic physiological data [22]. Wavelet transforms provide a compact and multi-resolution time-frequency representation that outperforms the Short-Time Fourier Transform (STFT) for non-stationary signals such as heartbeats and breath sounds, offering superior localization in both time and frequency domains [23], [24], [25]. Furthermore, mask-based post-processing has been introduced in generative separation models to improve output fidelity by applying an element-wise ratio between the original mixture and the reconstructed signal, enforcing consistency while preserving fine spectral detail [26], [27].

As deep learning models grow in complexity, interpretability has become an equally important concern, particularly in biomedical applications where transparency is essential for clinical trust and regulatory compliance [28]. Explainable AI (XAI) methods have been applied to analyze latent space structure in generative models [29]. SHAP (Shapley Additive exPlanations) has emerged as a particularly reliable approach for quantifying the contribution of individual features to model outputs [30], [31].

In this paper, we propose XVAE-WMT, a novel explainable generative framework for unsupervised blind source separation of heart and lung sounds. The model operates in a single-microphone setting and integrates three key components into the VAE framework: wavelet-based time-frequency inputs (W), a post-hoc output mask (M), and temporal consistency loss (T). The main contributions of this work are as follows:

• We propose XVAE-WMT, a VAE-based model integrating XAI designed for blind source separation of cardiopulmonary sounds.

• We incorporate wavelet-based inputs into the VAE framework, demonstrating superior time-frequency efficiency over STFT representations for non-stationary signals.

• We introduce temporal consistency loss into the VAE objective to enforce smooth transitions and preserve the cyclic structure of heart and lung sounds.

• We apply a post-hoc output mask to normalize estimated sources relative to the original mixture.

  • We provide a latent space interpretability analysis using clustering metrics and SHAP, enabling dimensionality reduction without sacrificing separation performance.

References (42)