Manuscript Offprint
arXiv:2609.00238XVAE-WMT: Explainable Wavelet-Temporal Variational Autoencoder for Blind Source Separation of Heart and Lung Sounds
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.
- Corresponding author: torabiy@mcmaster.ca
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.
by their inability to capture the nonlinear and non-stationary characteristics of real cardiopulmonary recordings, motivating the shift toward data-driven approaches. Deep learning has significantly advanced biomedical source separation over the past decade. Autoencoder-based models improved unsupervised representation learning for source-specific feature extraction [14], [15], with Tsai et al. [4] proposing a periodicity-coded deep autoencoder (PC-DAE) that incorporates structural priors about cardiopulmonary periodicity. Supervised architectures such as LSTM networks and U-Net variants achieve strong performance but require large labeled datasets of clean recordings that are difficult to obtain clinically [34]. GAN-based generative models have demonstrated strong audio enhancement performance even under weak supervision [16], motivating the exploration of fully unsupervised generative frameworks that do not depend on paired clean recordings.
VAEs are considered a principled framework for unsupervised source separation, regularizing the latent space to enable both reconstruction and generative sampling [17], [18]. Monaural VAEs have demonstrated effective separation of overlapping speech signals [19], while conditional extensions incorporate class-level priors for source-specific generation [20]. Architectural variants including VQ-VAE [35] and RQ-VAE [36] further extend generative capacity through latent space discretization and hierarchical quantization [21]. However, existing VAE-based models have not fully exploited the temporal structure and non-stationary time-frequency characteristics specific to biomedical audio. Temporal consistency constraints have been applied in sequence modeling to enforce smooth transitions between consecutive predictions [22]. Wavelet-based representations provide multi-resolution time-frequency decomposition better suited to non-stationary signals than STFT [23], [24], and have been shown to improve VAE separation performance for transient biomedical signals [25]. Mask-based post-processing has further been proposed to refine generative model outputs by enforcing consistency with the original mixture [26], [27]. On the interpretability front, latent space clustering metrics and SHAP-based feature attribution have been applied to generative models to quantify source separability and guide dimensionality reduction [29], [30], [31]. Despite these advances, XAI has not been integrated into VAE-based blind source separation for biomedical audio, a gap that the proposed XVAE-WMT framework directly addresses.
III. THEORETICAL BACKGROUND
Autoencoders are unsupervised neural models that learn to reconstruct their input through a latent bottleneck representation, and consist of an encoder and a decoder. Variational Autoencoders (VAEs) are a probabilistic extension of autoencoders. While standard autoencoders learn a deterministic mapping to a latent bottleneck, VAEs learn a distribution over the latent space. Specifically, the encoder maps an input to the parameters of a probability distribution, and the decoder reconstructs the input by sampling from this distribution. This enables VAEs not only to reconstruct inputs but also to generate new data by sampling from the learned latent space.
- VAE Training

- Explainable Latent-Space Analysis

-
Source-specific Decoding
-
Soft-Mask Separation
Fig. 1. XVAE-WMT framework: (1) VAE Training, where the mixture is transformed into a wavelet scalogram and encoded into latent representations; (2) Explainable Latent-Space Analysis, where SHAP identifies the most informative latent dimensions and clustering reveals source-related structure; (3) Source-specific Decoding, where the selected latent dimensions are decoded into heart and lung representations; and (4) Soft-Mask Separation, where source-specific masks are applied to the mixture scalogram and inverse wavelet transformation produces the separated heart and lung signals.

Fig. 2. Schematic overview of the VAE architecture. The encoder maps the input x into a probabilistic latent representation parameterized by the mean and covariance . A latent variable z is sampled from this distribution and passed to the decoder to reconstruct the input signal . Training is performed by minimizing the reconstruction loss together with the Kullback–Leibler divergence(KL). The distributions and are parameterized by neural networks trained jointly via variational inference.
Figure 2 illustrates the overall architecture of a variational autoencoder (VAE).
In a standard autoencoder, the encoder maps an input vector to a latent vector (1), and the decoder reconstructs the input from this latent representation (2). The goal of training is to minimize the reconstruction loss over the data distribution of , as shown in (3). Here, denotes a reconstruction loss function measuring the discrepancy between the input and its reconstruction. is
typically chosen as the mean squared error (MSE).
Here, the latent dimension satisfies , enforcing a compressed representation of the input. The encoder g and decoder f are implemented as parameterized neural networks, where the encoder maps the input signal to a low-dimensional latent space and the decoder reconstructs the input from this latent representation. Although the autoencoder learns a compact latent representation, it cannot generate new data because it learns a deterministic mapping. Variational autoencoders (VAEs) address this limitation through a probabilistic framework that enables both reconstruction and generation. The encoder maps the input x not to a fixed point but to a distribution in the latent space. The decoder reconstructs data by sampling from this distribution. We formulate the optimization problem as a maximum likelihood estimation (MLE) task, where the goal is to maximize the log-likelihood of the observed data under the model parameters:
We start from the marginal data likelihood:
Here, denotes the latent variable associated with the bottleneck of the autoencoder, representing the low-dimensional latent representation of the input signal. Since the integral in (5) is generally intractable, we introduce an approximate posterior and rewrite the expression by multiplying and dividing inside the integral:
(6)
Applying Jensen's inequality yields a lower bound on the log-likelihood:
Expanding the joint distribution in (7) and separating the terms inside the logarithm, we obtain:
For two continuous probability distributions and , the Kullback–Leibler (KL) divergence is defined as
The second expectation term in (8) corresponds to the negative KL divergence between the approximate posterior and the prior :
Substituting (10) into (8) yields the Evidence Lower Bound (ELBO), which serves as the objective function optimized during VAE training:
The ELBO is maximized with respect to the model parameters and , where denotes the parameters of the decoder network and denotes the parameters of the encoder network . Maximizing this bound regularizes the latent space to match the prior in the encoder through the first KL regularization term, and it encourages accurate reconstruction of the input in the decoder through the second likelihood term. Given the assumption that the prior distribution follows a standard multivariate normal , and that the approximate posterior is Gaussian with mean vector and standard deviation vector , the ELBO in (11) simplifies to a closed-form expression. The KL divergence term becomes
which regularizes the latent representation to remain close to the unit Gaussian prior. The closed-form KL expression does not replace the encoder. It uses the and produced by the encoder for each input to evaluate the divergence analytically. In addition, the reconstruction term can be simplified under the same Gaussian assumption and implemented as the mean squared error (MSE) loss between the input mixture and its reconstruction.
IV. METHODOLOGY
The proposed XVAE-WMT method integrates a wavelet-based time-frequency front-end, a variational autoencoder (VAE) with a temporal consistency (TC) regularizer, and a post-hoc SHAP-based latent analysis. An overview of the full procedure is given in Algorithm 1. During training, each mixture is converted to a wavelet scalogram and passed through the encoder to obtain and , from which a latent sample is generated and decoded. The reconstruction, KL, and temporal-consistency losses are then jointly optimized. After training, a new mixture is transformed into a scalogram, encoded into the latent space, and separated by decoding the source-specific latent representations, constructing soft masks, and applying the masks followed by inverse CWT to obtain the heart and lung signals.
A. Wavelet Front-End
Each input mixture is transformed via the Continuous Wavelet Transform (CWT) using a mother wavelet and a scale set of size , producing a non-negative scalogram . Unlike the Short-Time Fourier Transform, the CWT provides multi-resolution time-frequency localization, which is well-suited to the non-stationary and quasi-periodic nature of heart and lung sounds. CWT is also purely real. Recent studies have also demonstrated that physiological responses to external stimulation can exhibit frequency-dependent dynamics, further highlighting the importance of frequency-aware analysis in biomedical signals [37], [38]. It is worth mentioning that the term "Continuous" refers to how the math smoothly scans a signal. Even with digital data, CWT creates a highly detailed 2D frequency map by shifting the wavelet sample-by-sample along a grid. In contrast, the Discrete Wavelet Transform (DWT) skips most frequencies by doubling its steps, making DWT best for data compression and CWT the choice for signal processing.
B. Encoder-Decoder Structure
The VAE consists of an encoder network parameterizing the posterior distribution and a decoder network parameterizing the likelihood distribution . The encoder maps the scalogram to the parameters of a Gaussian posterior over the latent variable , i.e., the mean vector and log-variance . In our implementation, . The encoder comprises three convolutional blocks: (i) 128 filters with a kernel to capture spectral patterns across scales, (ii) 128 filters with a kernel to model short-range temporal dependencies, and (iii) 256 filters with a kernel to extract higher-level spatio-temporal correlations. The resulting feature map is flattened and passed through two fully connected layers that output and . The decoder mirrors this structure with transposed convolutions and reconstructs a scalogram . Latent samples are drawn using the reparameterization trick [17], which expresses the stochastic sampling as a differentiable function of deterministic network outputs, enabling end-to-end gradient-based training.
Here, and are obtained as the outputs of the encoder network for each input x. The reparameterization trick separates the random sampling from the network parameters, allowing gradients to propagate through the stochastic latent representation during training.
C. Training Objective
Training maximizes the Evidence Lower Bound (ELBO) of the VAE with respect to and , augmented by a temporal consistency term. Under a standard Gaussian prior and a Gaussian likelihood, the ELBO reduces to a reconstruction (MSE) term and a closed-form KL term:
To suppress spurious frame-to-frame fluctuations in the reconstructed scalogram, we further introduce a temporal consistency regularizer
which penalizes abrupt variations between adjacent time frames and encourages physiologically plausible, smoothly evolving reconstructions. The total training loss is
where controls the strength of latent regularization and balances temporal smoothness against reconstruction fidelity. Parameters and are updated jointly via stochastic gradient descent.
D. Explainable Latent-Space Analysis
After training, we interpret the learned latent space to identify which dimensions of are most informative for each source. We first visualize the latent representations using t-SNE, then perform a SHAP analysis to assign an importance score to every latent dimension . The top-K dimensions most strongly associated with each source based on the post-hoc SHAP analysis are retained to form the source-specific latent vectors , corresponding to heart, lung sources, respectively. This procedure both explains the model's internal representation and acts as a principled, data-driven dimensionality reduction. Importantly, no heart or lung labels are used during VAE training. The source labels are used only post hoc to interpret the learned latent clusters and associate the two latent groups with heart and lung sources.
E. Post-hoc Soft-Mask Separation
Unlike a conventional classifier that assigns each input to a single class, our method performs source separation by estimating a continuous contribution of each source at every time-frequency bin. The soft mask therefore preserves overlapping heart and lung components rather than making a hard class decision. Separation is performed at inference time by decoding each source-specific latent vector and constructing a soft time-frequency mask. For each source ,
so that the masks partition the mixture energy across sources at every time-frequency bin and satisfy . Each mask is applied element-wise to the mixture scalogram, and the corresponding time-domain source estimate is obtained via the inverse CWT:
Algorithm 1 XVAE-WMT
Input: mixture ; mother wavelet ; scale set ; weights ; top-K
Output: separated sources
1: function
2: Pass x through the encoder NN with weights
3: return
4: end function
5: function
6: Pass z through the decoder NN with weights
7: return
8: end function
9: Initialize parameters
10:
11: for each mini-batch do
12:
13: Sample
14:
15:
16:
17:
18:
19:
20: Update via
21: end for
22: Rank latent dimensions of by SHAP, and select the top-K to obtain
23: for do
24:
25:
26:
27: end for
Notes: NN: Neural Network, iCWT: inverse Continuous Wavelet Transform, SHAP: Shapley Additive exPlanations for feature attribution.
V. EXPERIMENTAL PROCEDURE
A. Dataset
We trained the model on two datasets. We created the first dataset by mixing the Kaggle Respiratory Sound Database, and the CirCor DigiScope Heart Sound Database. All recordings were resampled to 16 kHz, normalized, and segmented into 1-second frames, producing 24,383 heart and 18,144 lung segments across training iterations. Random pairs were combined to generate the mixtures. We collected the second dataset (HLS-CMDS) from a clinical manikin [39]. After resampling, normalization, and segmentation, we randomly paired heart and lung segments, forming 25,000 mixtures. Each sound frame was transformed into a wavelet spectrogram using the Mexican Hat mother wavelet.
B. Network Architecture
The model follows a convolutional encoder–decoder structure operating on time–frequency representations of size , where and denote the time and frequency axes, respectively. Two front-ends are considered: a Short-Time Fourier Transform (STFT) with frequency bins, and a Continuous Wavelet Transform (CWT) with scales. Both produce magnitude spectrograms that serve as inputs to the network. Each convolutional layer is followed by batch normalization and a ReLU activation, except for the final layer. The encoder outputs the posterior mean and log-variance of the latent variable . The decoder terminates with a sigmoid activation to produce a soft time–frequency mask. The encoder architecture is summarized in Table I. The decoder mirrors the encoder using transposed convolutions.
TABLE I
ENCODER NETWORK ARCHITECTURE.
| Layer | Filters | Kernel | Stride |
|---|---|---|---|
| Conv 1 | 128 | ||
| Conv 2 | 128 | ||
| Conv 3 | 256 | ||
| FC | 512 | - | - |
| Output | 128 | - | - |
C. Evaluation Metrics
We evaluate the proposed method using different criteria:
- Separation Quality: For source signals producing a mixture, the goal is to recover an estimate of each . Each estimate can be decomposed as
where is the target contribution, is interference from unwanted sources, is the noise contribution, and accounts for algorithmic artifacts. The standard BSS metrics are:
To summarize separation quality in a single number, we define the Mean Separation Quality:
Two efficiency measures are defined to account for computation and representation cost jointly:
where TEM is the Time-Efficiency Metric and CEM is the Compression-Efficiency Metric. Spectral resolution is 256 for STFT and 200 for the wavelet front-end.
-
Latent-Space Clustering Metrics: We assess the quality of the learned latent space using four unsupervised clustering metrics applied to the posterior means : Silhouette score (Silh., ), Davies–Bouldin index (DB, ), Calinski–Harabasz index (CH, ), and the variance (Var, ).
-
Interpretability Metrics: We quantify the interpretability of the latent representation through four complementary measures. Let , , , , and denote accuracy, stability, purity, diversity, and the composite interpretability score, respectively. Latent vectors are clustered using KMeans (k = 2) and compared to ground-truth labels. Accuracy is the number of correct assignments per total samples, while stability measures the consistency of SHAP-based importance scores across repeated runs and input perturbations.
where denotes the standard deviation of explanation scores. Since , . Purity evaluates whether each latent cluster corresponds to a single source,
where is the k-th cluster, is the ground-truth label set for class , and counts samples in cluster belonging to class . Diversity measures how broadly latent dimensions capture distinct patterns and is computed as the entropy of normalized SHAP importances,
where is the normalized importance of latent dimension i. Finally, the composite interpretability score aggregates all measures as
VI. RESULTS
We compare against two groups of baselines. The first group evaluates the contribution of each proposed component. Wavelet front-end (W), output masking (M), and temporal-consistency regularization (T) contribute a measurable improvement. The second group benchmarks the proposed method against non-VAE separation approaches. Table II reports evaluation metrics across all XVAE variants on both datasets. Table III compares the latent-space clustering performance across XVAE variants. The results show some variation across metrics and datasets, with XVAE-WMT showing competitive clustering performance, particularly on
Dataset One. We applied a SHAP-based explainability analysis on the latent embeddings to estimate feature importance and rank dimensions according to their contribution to clustering separability. We evaluated clustering performance for different top-k% of the latent dimension (Fig. 3). We retained the top 75% of latent dimensions for final visualization and quantitative analysis, which yielded the most interpretable structure without degrading performance.

Fig. 3. Clustering performance across different top-k% subsets of the latent dimensions. Each bar represents the mean score for Silhouette, Davies–Bouldin (DB), Calinski–Harabasz (CH), and variance metrics on datasets D1 and D2. Higher Silhouette and CH, and lower DB and variance values indicate better clustering quality.
TABLE II
COMPARISON OF XVAE-BASED SEPARATION PERFORMANCE.
| Method | Dataset One | Dataset Two | ||||||
|---|---|---|---|---|---|---|---|---|
| SDR | SIR | SAR | Time | SDR | SIR | SAR | Time | |
| XVAE | 8.7 | 7.9 | 17.2 | 66.3 | 6.3 | 6.0 | 21.0 | 44.3 |
| XVAE-M | 10.8 | 9.9 | 18.2 | 68.6 | 12.4 | 12.0 | 24.5 | 45.0 |
| XVAE-T | 15.9 | 14.9 | 20.0 | 68.3 | 8.2 | 8.0 | 22.0 | 44.7 |
| XVAE-W | 18.1 | 14.9 | 19.1 | 44.2 | 11.7 | 11.1 | 23.1 | 43.6 |
| XVAE-MT | 17.1 | 19.2 | 20.3 | 69.8 | 14.0 | 13.5 | 26.2 | 45.1 |
| XVAE-WM | 22.2 | 26.1 | 23.8 | 46.3 | 15.5 | 16.8 | 28.7 | 43.9 |
| XVAE-WT | 25.8 | 30.0 | 28.1 | 45.8 | 16.8 | 17.2 | 30.2 | 44.1 |
| XVAE-WMT | 26.8 | 32.8 | 28.6 | 46.8 | 15.1 | 20.7 | 27.6 | 44.3 |
TABLE III
LATENT-SPACE CLUSTERING PERFORMANCE ACROSS XVAE VARIANTS.
| Algorithm | Dataset One | Dataset Two | ||||||
|---|---|---|---|---|---|---|---|---|
| Silh. | DB | CH | Var | Silh. | DB | CH | Var | |
| XVAE | 0.324 | 4.433 | 114.7 | 0.604 | 0.259 | 4.473 | 126.2 | 0.799 |
| XVAE-M | 0.274 | 4.868 | 107.9 | 0.616 | 0.345 | 4.117 | 128.8 | 0.659 |
| XVAE-T | 0.280 | 4.469 | 127.3 | 0.676 | 0.311 | 4.743 | 116.5 | 0.616 |
| XVAE-W | 0.271 | 4.437 | 122.7 | 0.713 | 0.237 | 3.084 | 229.9 | 1.075 |
| XVAE-MT | 0.310 | 4.511 | 119.2 | 0.649 | 0.322 | 4.257 | 126.1 | 0.648 |
| XVAE-WM | 0.311 | 4.743 | 116.5 | 0.616 | 0.310 | 4.511 | 119.2 | 0.649 |
| XVAE-WT | 0.322 | 4.257 | 126.1 | 0.648 | 0.271 | 4.437 | 127.3 | 0.713 |
| XVAE-WMT | 0.345 | 4.117 | 128.8 | 0.659 | 0.324 | 4.433 | 114.7 | 0.604 |
Figure 4 visualizes the latent spaces of different VAE variants using t-SNE projections. Models incorporating wavelet, mixture, and temporal regularization components yield more compact and separable manifolds, while simpler configurations exhibit diffuse or overlapping structures.
Table IV reports TEM and CEM for the STFT and wavelet front-ends. The wavelet front-end more than doubles TEM and CEM on Dataset One, confirming that it delivers higher separation quality per unit of computation and per spectral
component. Table V compares XVAE-WMT against published non-VAE baselines. The proposed method outperforms other baselines, with notable margins over the prior approaches.
TABLE IV
TIME-EFFICIENCY (TEM) AND COMPRESSION-EFFICIENCY (CEM) METRICS ACROSS DATASETS.
| Front-end | Dataset One | Dataset Two | ||
|---|---|---|---|---|
| TEM | CEM | TEM | CEM | |
| STFT | 0.217 | 0.058 | 0.251 | 0.043 |
| Wavelet | 0.532 | 0.122 | 0.402 | 0.089 |
TABLE V
COMPARISON OF THE PROPOSED METHOD WITH OTHER BASELINES.
| Method | SIR (dB) | SAR (dB) | SDR (dB) |
|---|---|---|---|
| UBSS (HOS + SR) [40] | 13.3 | 14.5 | 9.9 |
| LSTM [41] | 26.7 | 13.9 | 13.3 |
| U-Net [42] | 21.2 | 11.7 | 10.9 |
| ECNet [43] | 31.1 | 15.1 | 14.8 |
| PC-DAE [44] | 14.9 | 16.7 | 12.5 |
| XVAE-WMT | 32.8 | 28.6 | 26.8 |
Note: UBSS (HOS + SR): underdetermined blind source separation using higher-order statistics and sparse representation; LSTM: long short-term memory network; U-Net: U-shaped convolutional neural network; ECNet: embedding centroid network; PC-DAE: periodicity-coded deep autoencoder; XVAE-WMT: explainable variational autoencoder with wavelet transform, output masking, and temporal consistency.
Figure 5 summarizes interpretability metrics across XVAE variants. Adding components generally improves interpretability, though gains are not strictly monotonic — accuracy dips at XVAE-MT before recovering with the wavelet front-end. XVAE-WMT achieves the best overall composite score. Figure 6 compares STFT and CWT representations for heart, lung, and mixture signals. The CWT reveals sharper transient structure at fine scales, as highlighted in the zoomed inset, motivating its use over STFT.
VII. CONCLUSION
We proposed an explainable variational autoencoder for blind source separation in scenarios where access to clean source signals is restricted. By combining deep neural networks with probabilistic latent modelling, the proposed approach separates mixed recordings into low-dimensional latent representations corresponding to heart and lung sounds. The incorporation of wavelet-based inputs, output masking, and temporal consistency regularization promotes physiologically meaningful and stable separations, while XAI-based analysis enables interpretation and dimensionality reduction of the learned latent space. Experimental results on real heart and lung sound recordings demonstrate that the proposed method outperforms existing baseline approaches. In practical operation, an unseen mixture is encoded into latent variables and decoded to produce time-frequency masks that reconstruct the separated heart and lung signals without retraining.

Fig. 4. Latent space visualization of different VAE variants using t-SNE: (a) XVAE-WMT, (b) XVAE-WT, (c) XVAE-WM, (d) XVAE-W, (e) XVAE-MT, (f) XVAE-T, (g) XVAE-M, and (h) XVAE. Each subplot shows the latent embeddings color-coded by cluster assignment. Two color groups (two shades of blue) correspond to the two sources being separated, and the scatter patterns illustrate how each VAE variant organizes these sources in latent space.

Fig. 5. Interpretability performance analysis: (a) radar chart comparing all four metrics across XVAE variants, (b) grouped bar chart of individual metric scores, (c) interpretability evolution showing realistic cross-over patterns, and (d) composite score with percentage improvement over the baseline.



Fig. 6. Comparison of time-frequency representations for separated and mixed signals. Red insets highlight a 1-second zoomed region (t=2–3 s), illustrating how the CWT captures transient cardiac events with superior time-scale resolution compared to the STFT.
REFERENCES
[1] M. Pourazad, Z. Moussavi, F. Farahmand et al., “Heart sounds separation from lung sounds using independent component analysis,” in Annual International Conference of the IEEE Engineering in Medicine and Biology Society, 2005, pp. 2736–2739.
[2] J. Chien, M. Huang, Y. Lin et al., “A study of heart sound and lung sound separation by independent component analysis technique,” in Annual International Conference of the IEEE Engineering in Medicine and Biology Society, 2006, pp. 5708–5711.
[3] F. Ayari, M. Ksouri, and A. Alouani, “Computer based analysis for heart and lung signals separation,” in Computer Medical Applications, International Conference on IEEE, 2013, pp. 1–6.
[4] K. Tsai, W. Wang, C. Cheng, C. Tsai, J. Wang, T. Lin, S. Fang, L. Chen, and Y. Tsao, “Blind monaural source separation on heart and lung sounds based on periodic-coded deep autoencoder,” IEEE Journal of Biomedical and Health Informatics, vol. 24, no. 11, pp. 3203–3214, 2020.
[5] Y. Torabi, “Ai-driven cardiorespiratory signal processing: Separation, clustering, and anomaly detection,” Ph.D. dissertation, McMaster University, 2025. [Online]. Available: https://hdl.handle.net/11375/32805
[6] A. Mirzal, “NMF versus ICA for blind source separation,” Advances in Data Analysis and Classification, pp. 25–48, 2017.
[7] A. Hyvärinen, J. Karhunen, and E. Oja, Independent Component Analysis. John Wiley & Sons, 2001.
[8] P. Comon, “Independent component analysis, a new concept?” Signal Processing, vol. 36, no. 3, pp. 287–314, 1994.
[9] A. Cichocki et al., Nonnegative Matrix and Tensor Factorizations: Applications to Exploratory Multi-Way Data Analysis and Blind Source Separation. Wiley, 2009.
[10] D. Lee and H. Seung, “Algorithms for non-negative matrix factorization,” in Advances in Neural Information Processing Systems, vol. 13, 2001, pp. 556–562.
[11] I. Jolliffe and J. Cadima, “Principal component analysis: A review and recent developments,” Philosophical Transactions of the Royal Society A, vol. 374, no. 2065, p. 20150202, 2016.
[12] Y. Pan, F. Dong, W. Yao, X. Meng, and Y. Xu, “Empirical mode decomposition for deep learning-based epileptic seizure detection in few-shot scenario,” IEEE Access, vol. 12, pp. 86583–86595, 2024.
[13] Y. Torabi, P. Razmara, H. Ajorlou, and B. Baraeinejad, “Neuromamballm: Dynamic graph learning of fmri functional connectivity in autistic brains using mamba and language model reasoning,” 2026. [Online]. Available: https://arxiv.org/abs/2602.13770
[14] P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol, “Extracting and composing robust features with denoising autoencoders,” in Proceedings of the International Conference on Machine Learning (ICML), 2008, pp. 1096–1103.
[15] P. Li, Y. Pei, and J. Li, “A comprehensive survey on design and application of autoencoder in deep learning,” Applied Soft Computing, vol. 138, p. 110176, 2023.
[16] H. Chen, J. Zhang, Y. Fu et al., “TFDense-GAN: A generative adversarial network for single-channel speech enhancement,” EURASIP Journal on Advances in Signal Processing, vol. 2025, no. 10, 2025.
[17] D. Kingma and M. Welling, “Auto-encoding variational Bayes,” arXiv preprint arXiv:1312.6114, 2013.
[18] E. Karamatli, A. Cemgil, and S. Kirbiz, “Audio source separation using variational autoencoders and weak class supervision,” IEEE Signal Processing Letters, vol. 26, no. 9, pp. 1349–1353, 2019.
[19] L. Pandey, A. Kumar, and V. Namboodiri, “Monaural audio source separation using variational autoencoders,” in Proceedings of Interspeech 2018, 2018, pp. 3489–3493.
[20] E. Karamatli, A. Cemgil, and S. Kirbiz, “Audio source separation using variational autoencoders and weak class supervision,” IEEE Signal Processing Letters, vol. 26, no. 9, pp. 1349–1353, 2019.
[21] A. Singh and T. Ogunfunmi, “An overview of variational autoencoders for source separation, finance, and bio-signal applications,” Entropy, vol. 24, no. 1, pp. 1–12, 2022.
[22] S. Varghese et al., “An unsupervised temporal consistency (TC) loss to improve the performance of semantic segmentation networks,” in IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2021, pp. 12–20.
[23] S. Mallat, A Wavelet Tour of Signal Processing: The Sparse Way. Academic Press, 2008.
[24] I. Daubechies, Ten Lectures on Wavelets. SIAM, 1992.
[25] H. Kazemi, A. Homaifar, and M. Rahman, “Wavelet-based multi-resolution analysis for cardiac signal separation,” Biomedical Signal Processing and Control, vol. 33, pp. 122–130, 2017.
[26] Q. Kong, Y. Wang, and T. Li, “Self-supervised audio masked autoencoder for universal sound separation,” arXiv preprint arXiv:2402.01344, 2024.
[27] J. Zhao and Y. Wang, “Source separation in joint communication and radar systems based on unsupervised variational autoencoder,” IEEE Open Journal of Vehicular Technology, 2024.
[28] A. Holzinger, M. Plass, K. Holzinger, H. Kickmeier-Rust, and G. Müller, “Information fusion for explainable AI in biomedicine,” Information Fusion, vol. 89, pp. 21–33, 2023.
[29] C. Molnar, Interpretable Machine Learning: A Guide for Making Black Box Models Explainable, 2nd ed. Lulu Press, 2021.
[30] S. Lundberg and S.-I. Lee, “A unified approach to interpreting model predictions,” in Advances in Neural Information Processing Systems (NeurIPS), 2017, pp. 4765–4774.
[31] M. Zhang, L. Yang, and Z. Chen, “Explainable deep clustering for latent variable models,” Neurocomputing, vol. 490, pp. 13–24, 2022.
[32] Y. Torabi, S. Shirani, and J. P. Reilly, “Chem-nmf: Multi-layer -divergence non-negative matrix factorization for cardiorespiratory disease clustering, with improved convergence inspired by chemical catalysts and rigorous asymptotic analysis,” arXiv preprint arXiv:2510.06632, 2025. [Online]. Available: https://arxiv.org/abs/2510.06632
[33] —, “Lingonmf: Large language model-enhanced nonnegative matrix factorization for cardiorespiratory sound separation,” Biomedical Signal Processing and Control, vol. 123, p. 110534, 2026.
[34] S. Bai, J. Kolter, and V. Koltun, “An empirical evaluation of generic convolutional and recurrent networks for sequence modeling,” arXiv preprint arXiv:1803.01271, 2018.
[35] A. van den Oord, O. Vinyals, and K. Kavukcuoglu, “Neural discrete representation learning,” arXiv preprint arXiv:1711.00937, 2017.
[36] D. Lee, C. Kim, S. Kim, M. Cho, and W.-S. Han, “Autoregressive image generation using residual quantization,” arXiv preprint arXiv:2203.01941, 2022.
[37] O. Sharafi, J. Yang, B. Lin, W. Luk Wahei, N. Householder, G. Lazzi, and K. Gokoffski, “High frequency electric field stimulation reversibly silences retinal activity and downstream cortical responses,” Investigative Ophthalmology & Visual Science, vol. 67, no. 7, pp. 3132–3132, June 2026.
[38] ...., “Population-scale analysis of frequency-dependent calcium dynamics in retinal ganglion cells under electric field stimulation,” Scientific Reports, 2026.
[39] Y. Torabi, S. Shirani, and J. P. Reilly, “Manikin-recorded cardiopulmonary sounds dataset using digital stethoscope,” arXiv, 2024.
[40] Y. Xie, K. Xie, and S. Xie, “Underdetermined blind source separation for heart sound using higher-order statistics and sparse representation,” IEEE Access, vol. 7, pp. 87 606–87 616, 2019.
[41] Z. Lei and J. Chen, “Cardiorespiratory sound separation method based on fully connected long short-time memory network,” Automation and Information Engineering, vol. 39, no. 6, pp. 25–30, 2018.
[42] A. Jansson, R. M. Bittner, S. Ewert, and T. Weyde, “Joint singing voice separation and f0 estimation with deep u-net architectures,” in 2019 27th European Signal Processing Conference (EUSIPCO), 2019, pp. 1–5.
[43] W. Wang et al., “Heart-lung sound separation by nonnegative matrix factorization and deep learning,” Biomedical Signal Processing and Control, vol. 79, p. 104180, 2023.
[44] K.-H. Tsai et al., “Blind monaural source separation on heart and lung sounds based on periodic-coded deep autoencoder,” IEEE Journal of Biomedical and Health Informatics, vol. 24, no. 11, pp. 3203–3214, 2020.