Lung and heart sound classifiers trained on small clinical datasets tend to learn which stethoscope made a recording instead of what disease it contains, and they fail when moved to a new device or hospital. We propose a model that removes the device from the signal by construction, and that needs only unlabeled recordings from a new device to adapt. The model applies a small bank of learnable band-pass filters directly to the raw audio. It then summarizes each recording by the covariance matrix of the filter outputs: a symmetric positive definite (SPD) matrix recording how much energy each band carries and how the bands move together. These matrices are processed with layers that respect their curved geometry.
The key observation is physical. A stethoscope's frequency response is roughly constant across each narrow band, so it multiplies each band's output by a gain and shifts its phase. For quadrature filter pairs, this acts on the covariance matrix as a congruence: the matrix is multiplied on both sides by one fixed device-specific matrix. Distances under the affine-invariant Riemannian metric do not change under congruences. Re-centering each device's average covariance to the identity cancels the device transform, up to a residual rotation that we measure. The three research directions therefore play distinct roles. Raw-waveform learning builds a representation in which device effects become a known group action. Riemannian geometry cancels that action. The small-sample regime is where cancelling it matters, because a few hundred patients cannot teach a network to ignore hardware.
Core Claim
Write $z(t) \in \mathbb{R}^{2K}$ for the outputs of $K$ learnable quadrature band-pass filter pairs applied to a raw recording, and $C = \frac{1}{T}\sum_t z(t) z(t)^\top + \epsilon I$ for their covariance over $T$ samples with a small shrinkage $\epsilon$. Suppose the recording is passed through a device whose frequency response is smooth relative to each filter's bandwidth. Then each quadrature pair's output is scaled by the device gain $a_k$ at that band and rotated by its phase $\varphi_k$, giving
$$C_{\text{device}} \approx A\, C\, A^\top, \qquad A = \mathrm{blockdiag}\big(a_1 R(\varphi_1), \dots, a_K R(\varphi_K)\big),$$
where $R(\varphi)$ is a $2\times 2$ rotation.
If $M_d$ is the Karcher mean (the geometric average on the SPD manifold) of device $d$'s covariances, the re-centered matrix $M_d^{-1/2} C M_d^{-1/2}$ is the same for all devices, apart from an orthogonal factor.
Our claim is that an end-to-end network combining these pieces generalizes to held-out stethoscopes and sites better than spectrogram CNNs, fine-tuned audio foundation models, and Euclidean per-band normalization. The network has three parts: learnable quadrature filters, covariance pooling, SPD layers, and per-device Riemannian batch normalization. The gain should widen as labeled data shrinks. It should appear without any labels from the target device.
This claim can be falsified in a specific way. The advantage over simple per-band gain normalization should come from the off-diagonal part of $A$: overlapping bands and phase rotations. If the diagonal version performs just as well, the geometry is not earning its place.
Relation to Prior Work
The method builds on SPD deep networks. SPDNet processes SPD matrices with three layer types. A bilinear layer $W X W^\top$ has $W$ constrained to have orthonormal rows. An eigenvalue-clipping nonlinearity keeps matrices positive definite. A matrix-logarithm layer maps the result to a flat space for classification. Riemannian batch normalization re-centers each batch's Karcher mean to the identity by parallel transport. That paper also motivates our small-data focus. When training data were cut to 10% on a radar task, its SPD network fell only from 82.3% to 77.7% accuracy, while a Euclidean fully convolutional network fell from 88.7% to 65.6%. Both works take covariance matrices computed offline from fixed features and never face a hardware shift. We learn the filters that define the matrix, and we use re-centering per device rather than per batch, as a deliberate cancellation of the device transform.
Sabbagh et al. supply the invariance argument. They use affine-invariant tangent-space regression on M/EEG sensor covariances to cancel unknown linear sensor mixing. Their pipeline uses fixed band-pass filters and a shallow ridge regressor. The mixing they cancel is spatial, across simultaneous sensors, whereas ours is spectral, within one microphone. That difference matters for auscultation. Heart valve sites are, as we understand the data collection, recorded one after another rather than simultaneously. Cross-site covariance, which the research file's third gap suggests, would therefore not be meaningful, and we do not pursue it.
Spherical Procrustes Alignment is the closest method on the same benchmarks. It projects foundation-model embeddings onto a hypersphere and aligns class prototypes by Procrustes. This fixes overconfidence: on CirCor, expected calibration error for the BEATs backbone falls from 28.51% to 4.44%. SPA works at the classifier head, on spectrogram-based features, and does not address the input-side device shift that we target. The two could be combined.
Several papers motivate the problem. Tartaglione et al. show that small medical datasets push networks toward acquisition artifacts. RespireNet documents stethoscope heterogeneity on ICBHI and recovers up to 8.6% by fine-tuning on each device with labels. Our method needs no labels from the new device.
On the raw-waveform side, SoundNet and Senior et al. show that learned front-ends discover band-pass filters and can match mel filterbanks. Instabilities in Convnets for Raw Audio warns that unconstrained raw-audio filters train erratically. We therefore follow the parameterized band-pass style of SincNet and learn only each filter's center frequency and bandwidth. This choice also enforces the smoothness that the device model needs.
Research Program
The front-end has $K$ between 16 and 32 learnable quadrature pairs, giving matrices of 32 to 64 dimensions. At that size the eigendecompositions that make SPD networks expensive are cheap.
Covariance pooling discards timing, and murmur timing (systolic versus diastolic) matters clinically. We restore timing in two ways. First, we compute covariances over short windows, which gives a sequence of SPD matrices that we summarize by Karcher mean after the bilinear layers. Second, we stack a few time-lagged copies of $z$ before pooling. The device transform becomes $A \otimes I$ on these lagged copies, so it remains a congruence.
The classifier stacks two bilinear, eigenvalue-clipping, and batch-normalization blocks, followed by a log layer and a linear head. Batch-normalization statistics are kept separately for each recording device, or each site where device labels are missing. At test time on an unseen device, we estimate that device's Karcher mean from its unlabeled recordings and re-center before classification.
The analysis side measures when the approximation $C_{\text{device}} \approx A C A^\top$ holds. The filter bandwidth controls a trade-off. Narrow bands make the device model more accurate but blur transients. We will report how the learned bandwidths settle, and whether a penalty on residual device variance improves transfer.
Baselines
The naive reference is a small Euclidean 1D CNN on raw audio. It has the same parameterized filters, followed by mean and standard-deviation pooling and a dense head, and it is matched to our model's parameter count. This isolates what covariance structure adds over first-order statistics under the same data scarcity.
The strongest in-distribution baseline for murmur detection is the challenge-winning mel-spectrogram two-branch CNN of Lu et al.. It uses SpecAugment and tabular features and reports a murmur score of 0.780 on the hidden CirCor test set. The strongest published accuracy in the file is SPA on an M2D backbone, with 84.23% weighted accuracy on CirCor and an average score of 65.27% on ICBHI. RespireNet reports a 68.5% four-class ICBHI score, but likely under a different split, so we will rerun both baselines under our protocols.
We will also rerun fine-tuned wav2vec 2.0, which reported 0.80 weighted accuracy on CirCor, as the raw-waveform foundation-model competitor.
All baselines use identical patient-level splits and the same hyperparameter search budget, measured in trials per method. Where published training recipes exist, we use them.
Out-of-distribution transfer is the central question, and here the file has no reported result. We found no reported result on Lacuna for leave-one-device-out ICBHI or leave-one-source-out PhysioNet 2016. We therefore construct those numbers ourselves for every baseline.
We run two ablations that isolate the key ingredient. The first replaces Riemannian re-centering with diagonal per-device gain normalization of the covariance. That is, each entry is divided by $\sqrt{\bar c_{kk}\bar c_{ll}}$, where $\bar c_{kk}$ is the device mean energy of band $k$. The second replaces the SPD layers with a Euclidean MLP on the flattened log-covariance.
Our model beats the field if it exceeds the strongest baseline's held-out-device score by a margin larger than the across-seed standard deviation. It must stay within a few points in distribution, and it must beat the diagonal ablation specifically on held-out devices.
Why not just…?
Why not just use mel spectrograms with SpecAugment, as the challenge winners did? On in-distribution test sets this may well win. Lu et al. and RespireNet show strong scores with such pipelines, and we treat them as serious competitors there. Their augmentations do not model device responses, however. Ballas et al. found that the filtering augmentations that help one clinical task hurt another. The leave-one-device-out experiments decide the question directly. If spectrogram CNNs with random-equalization augmentation match us there, our claim fails.
Why not just fine-tune an audio foundation model and add SPA? This is the strongest threat on accuracy: 84.23% weighted accuracy on CirCor. SPA corrects confidence at the head but has no mechanism for input-side hardware shift. We will test SPA on held-out devices, and we will also test SPA stacked on our model. If foundation model plus SPA wins out of distribution, we will report that the geometry belongs at the head and not at the front-end.
Why not just normalize per-band gains per device, or use fixed filters with tangent-space logistic regression in the Sabbagh style? Diagonal normalization cancels the gain part of $A$ but not band overlap or phase rotation. Fixed filters cannot tune their bandwidth to both the task and the validity of the device model. Both are included as ablations. If either matches the full model, the honest conclusion is that learned SPD layers are unnecessary, and we would report that.
Proposed Experiments
The mechanism check comes first. We take clean recordings and apply random smooth FIR filters as synthetic "devices." For each, we measure how much device variance remains in the covariances after Riemannian re-centering versus diagonal normalization, as a function of filter smoothness. We then measure whether classification accuracy under these synthetic devices tracks that residual.
The real-shift tests use two protocols. On ICBHI we train on three of the four stethoscope types and test on the fourth, scoring with the official score. On PhysioNet 2016 we train on seven of the eight sources and test on the held-out one, scoring with modified accuracy. The file reports 0.8602 for the winning entry under the pooled protocol; our results use a different protocol.
The small-sample test trains on 10%, 25%, 50%, and 100% of CirCor training patients. It reports weighted accuracy, murmur score, and expected calibration error, mirroring Brooks et al.'s data-reduction experiment.
The decisive outcome is a held-out-device gap over the diagonal-normalization ablation that grows as training data shrinks. Without that gap, the proposal reduces to per-band gain control and should be written up as such.
References
- A Riemannian Network for SPD Matrix Learning
- Riemannian batch normalization for SPD neural networks
- Manifold-regression to predict from MEG/EEG brain signals without source modeling
- Spherical Procrustes Alignment for Reliable Medical Audio Diagnosis
- Unveiling COVID-19 from CHEST X-Ray with Deep Learning: A Hurdles Race with Small Data
- RespireNet: A Deep Neural Network for Accurately Detecting Abnormal Lung Sounds in Limited Data Setting
- SoundNet: Learning Sound Representations from Unlabeled Video
- Learning the speech front-end with raw waveform CLDNNs
- Instabilities in Convnets for Raw Audio
- Speaker Recognition from raw waveform with SincNet
- A Lightweight Robust Approach for Automatic Heart Murmurs and Clinical Outcomes Classification from Phonocardiogram Recordings
- Exploring Wav2vec 2.0 Model for Heart Murmur Detection
- Listen to your heart: A self-supervised approach for detecting murmur in heart-beat sounds for the Physionet 2022 challenge