Source-linked AI summary
XVAE-WMT: Explainable Wavelet-Temporal Variational Autoencoder for Blind Source Separation of Heart and Lung Sounds
Yasaman Torabi, Shahram Shirani, James P. Reilly
TL;DR
Heart–lung separation from single-channel recordings remains difficult because classical approaches face limitations with overlapping, non-stationary, and temporally structured sources. XVAE-WMT combines an unsupervised explainable VAE with wavelet inputs, output masking, temporal-consistency regularization, and SHAP-based latent analysis. Across the reported evaluations, the method outperforms published baselines, while retaining an interpretable latent representation after reducing it to the top 75% of dimensions.
Problem
Single-channel heart–lung separation is a biomedical signal-processing challenge because overlapping, non-stationary sources limit conventional separation assumptions.
Method
XVAE-WMT combines a VAE with wavelet-based time-frequency inputs, temporal-consistency loss, post-hoc output masking, and SHAP-based latent analysis.
Results
XVAE-WMT outperforms published non-VAE baselines and achieves the best overall composite interpretability score among XVAE variants.
Takeaways & Limitations
Retaining the top 75% of SHAP-ranked latent dimensions yielded a more interpretable structure without degrading separation performance.
Abstract
from arXiv · showhide
The separation of cardiovascular sounds is a critical task in biomedical signal processing. In this paper, we introduce XVAE-WMT1, 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.
I. INTRODUCTION
Heart–lung separation from single-channel recordings is difficult because cardiopulmonary sources overlap and violate assumptions used by classical methods. XVAE-WMT addresses this with wavelet inputs, temporal consistency, output masking, and latent-space explainability.
- Motivation: Single-channel heart–lung separation is challenging because the sources have overlapping acoustic content and correlated temporal patterns.Both signals are non-stationary and cyclic, limiting conventional methods that assume stationarity or statistical independence.
- Motivation: Classical ICA, NMF, PCA, and EMD methods are limited by violated independence assumptions, insufficient temporal coherence, non-orthogonality, nonlinear interactions, or mode mixing.These constraints motivate more adaptive, data-driven approaches for overlapping cardiopulmonary sounds.
- Proposed framework: XVAE-WMT is an unsupervised explainable VAE framework for blind source separation of heart and lung sounds in a single-microphone setting.The framework is designed for settings where clean source recordings are unavailable or restricted.
- Proposed framework: Wavelet-based inputs provide superior time-frequency efficiency over STFT representations for non-stationary signals.The wavelet front-end is paired with the VAE to better represent heart and lung sounds.
- Proposed framework: Temporal consistency loss enforces smooth transitions and preserves the cyclic structure of heart and lung sounds.The loss is introduced directly into the VAE objective.
- Proposed framework: SHAP-based latent analysis enables dimensionality reduction while preserving separation performance.The method also applies a post-hoc output mask to normalize estimated sources relative to the original mixture.
II. RELATED WORK
Cardiopulmonary sound separation has progressed from classical signal decomposition to unsupervised deep generative models, but existing approaches remain limited in nonlinear, non-stationary, and temporally structured settings.
- ICA assumes source independence, which is frequently violated when heart and lung sounds overlap spectrally.
- NMF improves spectral decomposition without strict independence assumptions but struggles to capture temporal dynamics in cyclic physiological signals.
- Autoencoder-based models support unsupervised representation learning for source-specific feature extraction, including periodicity-coded architectures.
- VAEs regularize latent spaces to support reconstruction and generative sampling, but existing VAE-based models have not fully exploited temporal structure.
- The VAE maps inputs to probabilistic latent representations, samples latent variables, and reconstructs inputs using jointly trained encoder and decoder networks.
- VAE training optimizes the ELBO through reconstruction and KL-divergence terms, with the KL term regularizing the latent representation toward a prior.
IV. METHODOLOGY
XVAE-WMT combines wavelet-based inputs, a temporally regularized VAE, and post-hoc SHAP analysis within an unsupervised source-separation procedure.
- XVAE-WMT integrates a wavelet time-frequency front-end, a VAE with temporal consistency regularization, and post-hoc SHAP-based latent analysis.
A. Wavelet Front-End
The wavelet front-end converts each mixture into a non-negative CWT scalogram, providing multi-resolution localization for non-stationary heart and lung sounds.
- Each mixture m ∈R^T becomes a non-negative scalogram x = |CWT(m; ψ, S)| ∈R^F × T using a mother wavelet and F scales.
- CWT offers multi-resolution time-frequency localization suited to the non-stationary and quasi-periodic structure of heart and lung sounds.
- Unlike DWT, CWT scans densely across a scale-time grid, making it the paper’s preferred wavelet representation for signal processing rather than compression.
B. Encoder-Decoder Structure
The encoder-decoder models scalograms through a Gaussian latent representation, while ELBO and temporal-consistency objectives jointly balance reconstruction, latent regularization, and smooth temporal evolution.
- The encoder maps scalograms to Gaussian posterior parameters µ and log σ^2 for a latent variable z ∈R^d, with d = 128 in the implementation.
- The decoder reconstructs a scalogram x̂ ∈R^F × T, and reparameterized latent sampling enables end-to-end gradient-based training.
- Training maximizes the VAE ELBO using reconstruction MSE and a closed-form KL term under standard Gaussian prior and Gaussian likelihood assumptions.
- The temporal-consistency regularizer penalizes abrupt variations between adjacent time frames and encourages smoothly evolving, physiologically plausible reconstructions.
- The coefficients β and λ_TC control latent regularization and the trade-off between temporal smoothness and reconstruction fidelity.
D. Explainable Latent-Space Analysis
The method interprets latent dimensions with SHAP, retains source-associated features, and separates heart and lung sounds using decoded soft masks applied to the mixture scalogram.
- Explainable latent-space analysis: SHAP ranks latent dimensions by source association, producing source-specific latent vectors µH and µL from the most informative features.The analysis first visualizes latent representations with t-SNE, then assigns importance scores to latent dimensions.
- Explainable latent-space analysis: The decoder reconstructs source-specific time–frequency representations from each latent vector, which are converted into soft masks.The mask for each source is formed from its decoded representation relative to the sum of both decoded source representations.
- Explainable latent-space analysis: The masks partition mixture energy at every time–frequency bin, satisfy MH + ML = 1, and are applied element-wise to the mixture scalogram.Each masked scalogram is transformed back to the time domain with the inverse CWT.
- Explainable latent-space analysis: During training, the encoder returns latent distribution parameters, samples z through reparameterization, reconstructs the input, and optimizes reconstruction, KL, and temporal-consistency losses.After training, latent dimensions are ranked by SHAP and the top-K dimensions are selected for source-specific vectors.
- Explainable latent-space analysis: The inference procedure decodes each source-specific latent vector, constructs its mask, and obtains separated estimates through inverse CWT.The algorithm takes a mixture, mother wavelet, scale set, model weights, and top-K setting, and outputs heart and lung estimates.
V. EXPERIMENTAL PROCEDURE
The experiments use two mixed heart–lung datasets and evaluate a convolutional VAE with either STFT- or CWT-based time–frequency inputs.
- Datasets: Two datasets are used: mixtures formed from Kaggle respiratory and CirCor heart recordings, and HLS-CMDS mixtures collected from a clinical manikin.The first dataset combines recordings from two public databases, while the second is collected from a clinical manikin.
- Datasets: The recordings are resampled, normalized, segmented into 1-second frames, and randomly paired to generate mixtures.The first dataset contains 24,383 heart and 18,144 lung segments across training iterations; HLS-CMDS forms 25,000 mixtures.
- Network architecture: The model uses a convolutional encoder–decoder with time–frequency inputs, comparing STFT with 256 frequency bins against CWT with 200 scales.Both front-ends produce magnitude spectrograms for the network.
- Network architecture: The encoder outputs µ and log σ2 for a 128-dimensional latent variable, while the decoder produces a soft time–frequency mask.Convolutional layers use batch normalization and ReLU activations except at the final layer.
C. Evaluation Metrics
Evaluation combines source-separation quality, efficiency, and representation-cost measures for estimates reconstructed from mixed recordings.
- Separation quality: Separation quality is evaluated by decomposing each estimated source into target, interference, noise, and artifact components.The decomposition supports standard blind source separation metrics.
- Separation quality: SDR, SIR, and SAR quantify separation quality from the target, interference, and artifact components.The supplied passages identify these as standard BSS metrics but do not provide their individual formulas.
- Separation quality: Mean Separation Quality summarizes SDR, SIR, and SAR in a single number.It is defined from the three separation metrics.
- Efficiency: Two efficiency measures jointly account for computation and representation cost.TEM denotes the Time-Efficiency Metric and CEM denotes the Compression-Efficiency Metric; spectral resolution is 256 for STFT and 200 for the wavelet front-end.
2) Latent-Space Clustering Metrics:
The latent space is assessed with unsupervised clustering and SHAP-based interpretability measures covering separability, explanation stability, purity, diversity, and an aggregate score.
- Latent-space clustering metrics: Four clustering metrics are applied to posterior means µ: Silhouette score, Davies–Bouldin index, Calinski–Harabasz index, and variance.Silhouette and Calinski–Harabasz are maximized, whereas Davies–Bouldin and variance are minimized.
- Latent-space clustering metrics: Interpretability is measured through accuracy, stability, purity, diversity, and a composite interpretability score.These measures combine clustering agreement with the behavior and distribution of SHAP importance scores.
- Latent-space clustering metrics: KMeans with k = 2 clusters latent vectors and compares assignments against ground-truth labels.Accuracy counts correct assignments relative to the total number of samples.
- Latent-space clustering metrics: Stability measures the consistency of SHAP importance scores across repeated runs and input perturbations.This evaluates whether feature-importance explanations remain consistent under repeated analysis and perturbed inputs.
- Latent-space clustering metrics: The composite score aggregates accuracy, stability, purity, and diversity.Purity evaluates source correspondence within clusters, while diversity uses the entropy of normalized SHAP importances.
VI. RESULTS
The results evaluate XVAE variants through separation, clustering, efficiency, and interpretability analyses. XVAE-WMT achieves competitive or best performance across these evaluations, while the wavelet front-end and selected latent dimensions provide measurable benefits.
- Latent-space analysis: XVAE-WMT shows competitive latent-space clustering performance across metrics and datasets.The results report variation across metrics and datasets while identifying XVAE-WMT as competitive.
- Latent-space analysis: The top 75% of SHAP-ranked latent dimensions provides the most interpretable structure without degrading performance.SHAP ranks latent dimensions by contribution to clustering separability before visualization and quantitative analysis.
- Baseline comparison: XVAE-WMT outperforms published non-VAE baselines with notable margins over prior approaches.The comparison is reported in Table V.
- Interpretability: XVAE-WMT achieves the best overall interpretability composite score, although component gains are not strictly monotonic across variants.Accuracy dips at XVAE-MT before recovering with the wavelet front-end.
VII. CONCLUSION
The conclusion presents XVAE-WMT as an explainable VAE for separating heart and lung sounds when clean source recordings are restricted. Its wavelet inputs, output masking, temporal consistency, and XAI analysis support stable latent representations and dimensionality reduction, while experiments demonstrate improved performance over baselines.
- Conclusion: XVAE-WMT separates mixed heart and lung recordings into low-dimensional latent representations without requiring access to clean source signals.In operation, an unseen mixture is encoded and decoded into time-frequency masks that reconstruct the separated signals without retraining.
- Conclusion: Wavelet inputs, output masking, and temporal consistency regularization promote physiologically meaningful and stable separations.The method combines these components within an explainable variational autoencoder framework.
- Conclusion: XAI-based analysis enables interpretation and dimensionality reduction of the learned latent space.The latent-space visualization compares how VAE variants organize the two separated sources, while the interpretability analysis compares their metrics and composite score.
- Conclusion: Experimental results on real heart and lung sound recordings show that the proposed method outperforms existing baseline approaches.The conclusion reports this outcome without specifying a single benchmark value.
- Conclusion: CWT representations reveal sharper transient structure at fine scales than STFT representations for heart, lung, and mixture signals.The zoomed region highlights the time-frequency representation difference motivating the wavelet front-end.