Phase-Locked Bayesian Front Ends for Cross-Device Heart Sound Screening

A neural network that classifies heart sounds from a stethoscope can be accurate on the devices it was trained on and quietly wrong on a new one. Different stethoscopes amplify different frequency bands. A network whose first layer is a learned bank of filters bakes one device's frequency profile into fixed numbers, and it gives no signal when a recording comes from hardware it has never seen. The standard fix for overconfidence is to make the weights uncertain: sample them from a learned distribution, a Bayesian neural network, and read uncertainty from how much predictions disagree across samples. In temporal filters, however, naive weight sampling has a hidden cost. A filter delays every frequency by the same amount only if its taps are mirror-symmetric, a property called linear phase. Independent random taps break that symmetry. Each sample then shifts the heart's sharp sounds by a slightly different, frequency-dependent amount, and the "uncertainty" partly measures timing jitter the model injected itself.

This proposal puts all of the network's Bayesian uncertainty into a first-layer filterbank whose phase is fixed by construction, and keeps the rest of the network deterministic. Every posterior sample has the same constant delay, so samples differ only in how strongly they pass each frequency. The spread of predictions then answers a specific, physically meaningful question: would a plausibly different sensor frequency response change the diagnosis? We test whether this front-end-only, phase-locked posterior flags and survives unseen stethoscopes better than three alternatives: whole-network uncertainty methods, deep ensembles, and randomized-equalizer data augmentation. The test uses the multi-source PhysioNet 2016 heart sound database and the unseen Shenzhen heart sound set.

Core Claim

The symmetry tying itself is not the contribution. Parameterizing a symmetric filter by half its taps and placing a Gaussian over those half-taps resolves the "tension" between sampling and linear phase in one line. The contribution is a claim about where uncertainty should live and what it then means. For a symmetric length-$N$ FIR filter with taps $w[n]=w[N-1-n]$, the frequency response factors as

$$H(e^{j\omega}) = e^{-j\omega (N-1)/2}\, A(\omega; \mathbf{w}),$$

where $\omega$ is angular frequency and $A$ is a real-valued amplitude function that is linear in the half-tap vector. A distribution over $\mathbf{w}$ is therefore exactly a distribution over amplitude responses $A(\omega)$, with group delay pinned at $(N-1)/2$ samples for every draw. Sensor variation between stethoscopes is, to first order, a variation in amplitude response. Our hypothesis is that a posterior confined to this phase-locked front end captures the dominant cross-device epistemic uncertainty. Concretely, we predict three things. It should detect recordings from held-out devices at least as well as whole-network Bayesian methods, at a small fraction of the cost. It should calibrate better than an unconstrained (asymmetric) Bayesian front end, because it does not confuse timing jitter with uncertainty. And its posterior over $A(\omega)$ should be directly inspectable, with wide bands where the training devices disagree.

Relation to Prior Work

The method's starting point is the learnable filterbank work of Humayun et al. They show that a one-dimensional convolution with linear activation and no bias is an FIR filter. They enforce linear phase by tying taps symmetrically, which gives 87.10% modified accuracy on PhysioNet 2016 with FIR initialization (Learning Front-end Filter-bank Parameters using Convolutional Neural Networks for Abnormal Heart Sound Detection; also indexed as art_82528f10; Learning Front-end Filter-bank Parameters using Convolutional Neural Networks for Abnormal Heart Sound Detection). Their follow-up adds domain-balanced training across stethoscope sources and reports 80.91% modified accuracy on their PhysioNet test split. That follow-up also observes that a parametric gammatone front end held up best on the unseen Shenzhen set, though no number is given in the file (Towards Domain Invariant Heart Sound Abnormality Detection Using Learnable Filterbanks). These papers motivate the proposal, because they identify device-specific frequency response as the failure. They also supply the architecture. Their filters are point estimates, however, so the model cannot say when an input's spectral profile is alien.

The closest precedent for "many filters averaged" is Seraj and Sameni. They randomly perturb the poles and zeros of a fixed bandpass prototype, apply each filter forward-backward so it adds no phase shift, and average the resulting EEG phase trajectories. This removes spurious phase jumps in low-amplitude segments and improves noisy motor-imagery classification by 8–12% with a random forest (Robust electroencephalogram phase estimation with applications in brain-computer interface systems). Their ensemble is effectively a hand-set prior that is never conditioned on data. Ours is a posterior learned with the classifier. We treat their method as an ablation, "prior samples only," not as a straw man.

The prior design draws on Fortuin et al. They show that convolutional filters have strongly correlated neighboring weights, and that correlated (Matérn-kernel) Gaussian priors reduce the need for artificially "cold" posteriors (Bayesian Neural Network Priors Revisited). We place a Matérn prior over the half-tap vector, which favors smooth amplitude responses. Fortuin et al. studied 2D vision kernels without phase structure; we transfer the idea to 1D symmetric taps. As a heavier-tailed alternative prior we consider the R2D2 shrinkage prior of Chan et al., which shrinks uninformative weights while keeping salient ones (Feature Preserving Shrinkage on Bayesian Neural Networks via the R2D2 Prior). Because the front end has only a few hundred free parameters, we can also check the variational posterior against blocked MCMC in the style of Papamarkou's node-blocked Gibbs sampler (Approximate blocked Gibbs sampling for Bayesian neural networks), with the back end frozen. That check is infeasible for whole networks.

Yi and Bessa constrain the design. They show that jointly learning a mean and a noise-variance head gives a saddle-shaped, poorly conditioned loss, and that decoupled training is needed to separate data noise from model ignorance (Cooperative Variance Estimation and Bayesian Neural Networks for Disentangling Aleatoric and Epistemic Uncertainties). We therefore do not attempt a joint noise head as a core component. Recording-quality uncertainty is evaluated only through the PhysioNet "Unsure" label, as a secondary analysis.

Research Program

The model keeps the multi-branch CNN of Humayun et al. unchanged. Only the front-end filterbank becomes Bayesian. Each filter is parameterized by its $\lceil N/2 \rceil$ half-taps, and a mean-field-plus-low-rank Gaussian variational posterior is placed on them, under a Matérn prior centered on the FIR bandpass initialization. Training maximizes the usual evidence lower bound, sampling front-end filters per minibatch while the back end receives ordinary gradients. At test time we draw $S$ filterbanks and average predictive probabilities. Uncertainty is read from the mutual information between prediction and front-end sample.

The front end is small, so the method adds roughly $S$ cheap first-layer passes. The back end can even be shared if the first layer's outputs are batched. This cost argument matters against ensembles.

We analyze three things. First, we plot posterior bands of $A(\omega)$ per filter and test whether width correlates with how much the training sources' average spectra disagree in each band. Second, for the unconstrained ablation, we compute the per-sample group-delay spread and check whether it predicts miscalibration on murmur-containing recordings, where transients matter. Third, we compare the variational front-end posterior against blocked MCMC on the frozen back end, to verify that the bands are not an artifact of the variational family.

Baselines

The naive reference is the deterministic linear-phase filterbank CNN of Humayun et al. with domain-balanced training (Towards Domain Invariant Heart Sound Abnormality Detection Using Learnable Filterbanks), using softmax confidence as its uncertainty score. The strongest reported number in the file is 87.10% modified accuracy on PhysioNet 2016 for the linear-phase, FIR-initialized model (art_871fe827; Learning Front-end Filter-bank Parameters using Convolutional Neural Networks for Abnormal Heart Sound Detection). The 2020 paper reports 80.91% on its own test split. We reproduce both under our splits before comparing anything. For historical context, the official challenge winner reached 0.8602 modified accuracy and the sample entry 0.7057 (Classification of Normal/Abnormal Heart Sound Recordings: the PhysioNet/Computing in Cardiology Challenge 2016). On the Shenzhen set, the only figure in the file is the INTERSPEECH 2018 fused baseline of 56.2% unweighted average recall on the three-class task (The INTERSPEECH 2018 Computational Paralinguistics Challenge). For the filterbank models on Shenzhen, no reported result was found on Lacuna.

The strongest uncertainty competitor is a deep ensemble of five deterministic linear-phase models. Ensembles are the default practical answer to overconfidence, and they also capture back-end uncertainty, which our method ignores by design. We also include Monte Carlo dropout over the whole network, as used for domain shift by Wen et al. (Bayesian Uncertainty Matching for Unsupervised Domain Adaptation).

A third baseline is the deterministic model trained with randomized-equalizer augmentation. Each training recording is passed through a random smooth gain curve, which simulates unseen stethoscopes. We also run augmentation combined with our Bayesian front end. All methods share the same splits, back-end architecture, and a fixed hyperparameter search budget, with equal trials per method. The ensemble is compared both at equal parameter count and at equal test-time compute.

Two ablations isolate the key ingredients. The first is an unconstrained Bayesian front end with independent taps, which isolates the phase lock. The second is our front end with samples drawn from the prior rather than the posterior, mimicking Seraj and Sameni's unconditioned perturbation; it isolates learning.

Beating the baselines means two things in the leave-one-source-out and Shenzhen settings. On held-out-device detection, AUROC must be higher than the ensemble's with non-overlapping bootstrap intervals. Calibration error and modified accuracy at 80% coverage must also be at least as good as the ensemble's, while in-domain modified accuracy stays within one point of the deterministic model.

Why not just…?

Why not just use a deep ensemble of linear-phase models? Ensembles keep exact symmetry in every member and are hard to beat. The file's evidence against them is indirect. The voting ensemble of the top 38 challenge entries did not beat the best single entry under train–test shift ( Classification of Normal/Abnormal Heart Sound Recordings: the PhysioNet/Computing in Cardiology Challenge 2016). Deep ensembles scored 71.02% versus 92.85% out-of-distribution AUROC for R2D2-Net on CIFAR-10 versus Fashion-MNIST ( Feature Preserving Shrinkage on Bayesian Neural Networks Via the R2D2 Prior). That evidence comes from vision, though, so it settles nothing here. The equal-compute comparison is the decisive test. If ensembles match us, the conclusion is that front-end Bayesianism buys only interpretability and lower cost, and we will report it that way.

Why not just augment with random frequency responses? This is the most serious threat. If device shift really is amplitude-only, a well-chosen gain distribution could teach invariance directly. The two approaches answer different questions, however. Augmentation makes the classifier ignore spectral variation inside a hand-picked range, and it stays silent outside that range. The posterior learns which bands the data leaves unconstrained and flags inputs that lean on them. We run augmentation alone, posterior alone, and both together. If augmentation alone wins on both accuracy and held-out-device detection, the front-end posterior has no case, and we would drop the claim.

Why not just make the whole network Bayesian, or use dropout? Whole-network methods spread uncertainty everywhere. In the unconstrained case they also jitter timing. The comparison with dropout and the unconstrained ablation measures whether localizing uncertainty to the phase-locked front end loses detection power. It also measures whether per-sample group-delay spread explains the extra miscalibration we predict on murmur recordings.

Why not just perturb a fixed filter as Seraj and Sameni do? Their perturbations are not tuned to the task or the data ( Robust electroencephalogram phase estimation with applications in brain-computer interface systems). The prior-only ablation is exactly this idea transplanted to our model. If it matches the posterior, learning the distribution is unnecessary.

Decisive Checks

The primary experiment is leave-one-source-out training across PhysioNet 2016's eight sources, plus training on all of PhysioNet and testing on the Shenzhen recordings mapped to normal/abnormal. In both settings we report modified accuracy, sensitivity and specificity, expected calibration error, accuracy versus coverage, and AUROC for distinguishing held-out-source recordings. As a secondary analysis, we test whether front-end uncertainty ranks PhysioNet "Unsure" recordings above clean ones.

The claim fails if any of three things happens: the unconstrained Bayesian front end calibrates as well as the phase-locked one, the posterior bands of $A(\omega)$ show no relation to inter-source spectral disagreement, or equal-compute ensembles or equalizer augmentation dominate.

As a phase-tracking side test, we replace Seraj and Sameni's perturbation ensemble with posterior samples of a learned zero-phase bandpass front end on the PhysioNet BCI2000 motor-imagery EEG, using channels C3, C4 and FCz under added noise. We count spurious phase jumps in low-amplitude segments and measure classification against their reported 8–12% noisy-condition gain. This side test checks whether data-conditioned filter uncertainty beats unconditioned perturbation in the setting where averaging over filters was first shown to help.