---
title: Self-Supervised Spirogram Embedding for RHF
url: https://www.emergentmind.com/topics/self-supervised-representation-learning-based-spirogram-embedding-slse
type: topic
---

# Self-Supervised Spirogram Embedding for RHF

Self-Supervised Representation Learning-Based Spirogram Embedding (SLSE) is a self-supervised pretraining framework for learning a robust, low-dimensional embedding of spirogram time series from unlabeled augmented data and reusing that embedding for downstream prediction of right heart failure (RHF) [2511.13457]. In the reported formulation, SLSE constitutes the first stage of a two-stage pipeline for early RHF detection in patients with cor pulmonale or chronic lung disease, with the second stage combining the learned spirogram embedding with demographic variables and passing the fused representation to a CatBoost classifier [2511.13457]. The method is motivated by the clinical observation that spirometry is routine in pulmonary care whereas RHF screening tools such as echocardiography, cardiac MRI, and pulmonary artery catheterization are not routinely deployed as screening tools in the lung-disease population; SLSE therefore aims to extract RHF-related information from raw or high-dimensional spirogram signals that may not be captured by conventional spirometric summary measures alone [2511.13457].

## 1. Clinical problem setting and prediction target

SLSE was introduced in the context of early detection of RHF from spirometry-derived spirograms in a population with pulmonary disease burden, particularly patients with cor pulmonale or chronic pulmonary disease [2511.13457]. The stated clinical rationale is that many lung diseases increase right ventricular afterload and can eventually lead to RHF, while subtle right ventricular dysfunction is often not routinely evaluated with advanced cardiac imaging in these patients [2511.13457]. By contrast, spirometry is already common in patients with lung disease, creating the possibility that RHF-related signal could be extracted from routine pulmonary testing [2511.13457].

The prediction target is binary RHF status defined from right ventricular ejection fraction (RVEF) measured by MRI in the UK Biobank [2511.13457]. The paper defines RHF label \(=1\) if \( \mathrm{RVEF} < 45\% \) and non-RHF label \(=0\) if \( \mathrm{RVEF} \ge 45\% \), but the actual modeling cohort excludes borderline cases to reduce label ambiguity caused by measurement noise around the threshold [2511.13457]. The retained cohort therefore uses included positives with \( \mathrm{RVEF} < 40\% \) and included negatives with \( \mathrm{RVEF} > 50\% \) [2511.13457].

All data come from the UK Biobank, specifically spirometry from UKB field 3066 and RVEF by MRI from UKB field 24109, Instance 2 [2511.13457]. After filtering and alignment, the final study cohort contains 26,617 individuals, comprising 244 RHF cases and 26,373 non-RHF cases [2511.13457]. The cohort is therefore highly imbalanced, and the paper correspondingly emphasizes AUROC as the primary evaluation metric [2511.13457].

The stated justification for self-supervised learning is threefold: spirograms are noisy and variable because of differences in devices, sampling frequency, patient effort, operation errors, and signal transformation artifacts; label quality is imperfect because MRI-derived RVEF is not noise-free; and useful structure exists in unlabeled spirograms [2511.13457]. This motivates learning invariant signal representations before supervised RHF prediction [2511.13457].

## 2. Two-stage pipeline and core architecture

The full method has two stages [2511.13457]. In Stage 1, SLSE performs self-supervised pretraining on unlabeled spirograms using a BYOL-style online/target dual-network architecture [2511.13457]. In Stage 2, the pretrained encoder extracts a spirogram embedding from the original signal, the embedding is transformed by an MLP, concatenated with demographic variables, and the fused features are passed to a CatBoost classifier for RHF prediction [2511.13457].

SLSE uses what the paper describes as “the same deep learning framework as BYOL” while using the same VAE-encoder as in Yun et al. as the encoder backbone [2511.13457]. The online network with weights \( \theta \) contains encoder \( f_{\theta} \), projector \( g_{\theta} \), and predictor \( q_{\theta} \), while the target network with weights \( \xi \) contains encoder \( f_{\xi} \) and projector \( g_{\xi} \) but no predictor [2511.13457]. The target parameters are updated as an exponential moving average of the online parameters [2511.13457].

The paper explicitly reports the following model components: a VAE-encoder as encoder backbone, an MLP projector, an MLP predictor, and latent embedding dimension 8 [2511.13457]. A critical methodological caveat is that although the encoder is called a VAE-encoder, the reported SLSE formulation does not provide a VAE reconstruction loss, KL term, ELBO, decoder equations, or reparameterization equations [2511.13457]. The only explicit SLSE training objective reported in the method section is a BYOL-style normalized mean squared error loss [2511.13457]. Accordingly, SLSE is explicitly defined in the paper by a BYOL-style self-supervised objective implemented with a VAE-derived encoder architecture, rather than by a fully specified VAE objective [2511.13457].

After SLSE training, the model keeps only encoder \(f_{\theta}\), which maps the input spirogram to an 8-dimensional latent feature vector [2511.13457]. The downstream stage is defined by
\[
f'_{embed} = \mathrm{MLP}(f_{embed})
\]
and
\[
\hat{y} = \mathrm{CatBoost}(f'_{embed} \oplus f_{demo}),
\]
where \(f_{embed}\) is the spirogram embedding from the pretrained encoder, \(f'_{embed}\) is the transformed embedding, \(f_{demo}\) denotes demographic variables, and \(\oplus\) denotes feature concatenation [2511.13457].

## 3. Signal representation, preprocessing, and augmentation design

The input originates from spirometry exhaled volume measured every 10 ms [2511.13457]. The preprocessing pipeline begins from raw volume-time spirometry recordings in milliliters, converts volume from milliliters to liters, converts volume-time to flow-time using a finite-difference approximation of the first derivative with respect to time, generates flow-volume curves from the volume-time and flow-time curves, and pads each curve with zeros to a fixed length of 1000 [2511.13457]. The resulting signal is referred to as a capacity-flow curve or volume-flow curve, and this is the signal used in SLSE [2511.13457].

The study reports limited quality-control filtering, specifically retaining only European individuals and only the first valid puff result [2511.13457]. No further spirometry quality-control thresholds are reported beyond “first valid puff” [2511.13457]. This limited reporting is important because it constrains reproducibility and leaves unresolved how much of the learned representation reflects pulmonary physiology versus acquisition heterogeneity.

In Stage 1, SLSE uses unlabeled spirograms augmented to simulate realistic spirometry noise and user or machine artifacts [2511.13457]. For each original spirogram \(x\), two independently augmented views are created:
\[
x_{t1} \stackrel{\mathrm{def}}{=} t_1(x), \qquad x_{t2} \stackrel{\mathrm{def}}{=} t_2(x).
\]
The five augmentations defined in the paper are Gaussian noise, amplification of a section after the peak, horizontal stretching, vertical stretching, and downsampling [2511.13457]. These are designed to simulate curve instability from signal generation, patient inhaling after peak, altered effective exhaled volume, insufficient expiratory force, and low sampling frequency devices [2511.13457].

The formal augmentation definitions are reported explicitly. For a flow-volume curve
\[
S(v), \quad \{v = v_1, v_2, v_3, \dots, v_L\}, \quad L=1000,
\]
Gaussian noise is defined as
\[
S'(v) = S(v) + N(v), \qquad N(v) \sim \operatorname{Gaussian}(\mu, \sigma^2).
\]
Amplification of a section after the peak uses a cosine-smoothed mask
\[
M(v)=0.5 - 0.5 \cdot \cos\left(\frac{\pi \cdot (v - v_p - d)}{W-1}\right), \quad v_p + d \leq v < v_p + d + W
\]
and
\[
S'(v)=S(v)\cdot \left[1 + M(v)\cdot(\gamma-1)\right].
\]
Horizontal stretching is given by
\[
S'(v)=S(\beta \cdot t),
\]
with stretch factor
\[
\beta=\frac{L_{valid}}{L}.
\]
Vertical stretching is given by
\[
S'(v)=S(t)\cdot \alpha, \qquad \alpha \in (0,1).
\]
Downsampling first applies a Butterworth low-pass filter,
\[
S_f(v)= \mathcal{B}\left(S(v), \frac{\alpha}{2}\right),
\]
then interpolates and resamples back to fixed length:
\[
S_m(v') = \operatorname{interp}(S_f(v)), \qquad S'(v)=\operatorname{interp}(S_m(v')).
\]
The notation in the paper mixes \(v\) and \(t\) in several augmentation equations; this inconsistency appears in the original presentation and is part of the reported method [2511.13457].

The augmentation strategy is central to SLSE’s notion of invariance. At the same time, recent work on augmentation-free time-series SSL argues that handcrafted augmentations may impose inappropriate invariances when signal-specific characteristics make augmentation design particularly challenging [2510.22655]. This is especially relevant for spirograms, where clinically meaningful variables such as peak expiratory flow, early expiratory slope, forced expiratory volume timing, end-of-test plateau behavior, cough artifacts, hesitation, or truncated exhalation may be altered by generic time-series augmentations [2510.22655]. This suggests that SLSE’s augmentation design should be interpreted as clinically motivated but not uncontroversial.

## 4. Mathematical formulation of SLSE

The target-network parameters are updated by exponential moving average:
\[
\xi \leftarrow \tau \xi + (1-\tau)\theta \tag{1}
\]
where \( \tau \in [0,1] \) is the target decay rate [2511.13457]. This keeps the target network as a slowly moving version of the online network [2511.13457].

For a sampled signal \(x \sim \mathbf{X}\) and augmentations \(t_1, t_2\), the forward path is
\[
x_{t1} = t_1(x), \qquad x_{t2} = t_2(x),
\]
\[
y_{\theta} = f_{\theta}(x_{t1}), \qquad z_{\theta} = g_{\theta}(y_{\theta}), \qquad q_{\theta}(z_{\theta}),
\]
\[
y_{\xi} = f_{\xi}(x_{t2}), \qquad z_{\xi} = g_{\xi}(y_{\xi}).
\]
The normalized vectors are
\[
\bar{q}_{\theta}(z_{\theta}) \stackrel{\mathrm{def}}{=} \frac{q_{\theta}(z_{\theta})}{\|q_{\theta}(z_{\theta})\|_2}
\]
and
\[
\bar{z}_{\xi} \stackrel{\mathrm{def}}{=} \frac{z_{\xi}}{\|z_{\xi}\|_2}.
\]
The SLSE loss is defined as
\[
\mathcal{L}_{\theta,\xi} \stackrel{\mathrm{def}}{=} \left\| \bar{q}_{\theta}(z_{\theta})-\bar{z}_{\xi} \right\|_2^2
= 2-2\cdot \frac{\langle q_{\theta}(z_{\theta}), z_{\xi}\rangle} {\|q_{\theta}(z_{\theta})\|_2 \cdot \|z_{\xi}\|_2}. \tag{2}
\]
This is the only explicit self-supervised training objective reported for SLSE [2511.13457]. The optimization step is
\[
\theta \leftarrow \mathrm{Optimizer}\left(\theta, \Delta_{\theta}\mathcal{L}^{SLSE}_{\theta,\xi}, \eta\right), \tag{3}
\]
with Adam as optimizer, while gradients are stopped on the target network [2511.13457].

The paper interprets the learned 8-dimensional vector as a robust low-dimensional representation because it compresses a 1000-point signal into a small latent space, is trained to be invariant to clinically realistic perturbations, and is intended to capture RHF-related structure beyond conventional spirometry summary features [2511.13457]. However, the paper does not provide PCA, t-SNE, UMAP, clustering, or latent-dimension semantic analysis of the learned space [2511.13457]. Consequently, the representation is operationally defined by its downstream utility rather than by a direct latent-space characterization.

A recurring misconception is to treat SLSE as a conventional VAE formulation. That reading is not supported by the reported equations. The paper explicitly identifies the backbone as a VAE-encoder, but it does not provide \(q_\phi(z\mid x)\), \(p_\psi(x\mid z)\), reparameterization, ELBO, reconstruction loss, or KL divergence terms [2511.13457]. It would therefore be inaccurate to describe SLSE as a fully specified VAE objective; the paper instead reports a BYOL-style self-supervised objective implemented with a VAE-derived encoder architecture [2511.13457].

## 5. Downstream prediction, experimental protocol, and reported performance

After Stage 1 pretraining, the original non-augmented spirogram is passed through the pretrained encoder to obtain \(f_{embed}\), which is transformed by an MLP and concatenated with demographic information before CatBoost classification [2511.13457]. The demographic variables used for training are age, sex, smoking status, and COPD status; age is integer-valued and the others are binary [2511.13457]. The classifier is CatBoost, chosen because it handles structured demographic information well, although tree depth, learning rate, number of boosting rounds, loss function, class weights, and early stopping criterion are not reported [2511.13457].

The dataset split is 70% training and 30% test, with 20% of the training set further used as a validation set during model development [2511.13457]. The paper states that the training set is used to train the SLSE network and then the downstream classifier is trained on labeled RHF prediction data [2511.13457]. It does not explicitly state whether the encoder is frozen or fine-tuned during downstream training; the wording suggests feature extraction with a pretrained encoder, but the paper does not state this unambiguously [2511.13457].

To improve stability, the authors use an ensemble strategy: they select the top 3 models with best validation AUROC, evaluate all 3 on the test set, and average their predicted probabilities [2511.13457]. The primary reported evaluation metric is AUROC; the paper does not report AUPRC, sensitivity, specificity, F1, PPV, or NPV [2511.13457].

On the full test set, the final method achieves
\[
\mathrm{AUROC} = 0.7501
\]
for RHF detection [2511.13457]. The paper also reports subgroup performance on elevated-risk clinical subsets, with AUROC \(=0.8194\) on a test set of 74 patients with chronic kidney disease (CKD) and AUROC \(=0.8413\) on a set of 64 patients with valvular heart disease (VHD) [2511.13457]. These subgroup results are numerically higher than the overall test-set AUROC, although the subgroup sample sizes are small [2511.13457].

The main evidence attributable specifically to SLSE comes from internal ablations [2511.13457]. Without ensemble, AUROC is 0.7322. Without the VAE-encoder, AUROC is 0.7303. Without signal augmentation during SLSE training, AUROC is 0.7415. Without demographic information, using only spirogram embedding and a binary classification head, AUROC falls to 0.6175 [2511.13457]. These results indicate that the reported performance depends jointly on augmentation-based self-supervised pretraining, the VAE-based encoder backbone, demographic fusion, and ensembling [2511.13457].

The paper does not provide a direct head-to-head quantitative comparison against conventional summary spirometry measures such as FEV1, FVC, or FEV1/FVC for the RHF task, nor against transformer-based spirogram encoders, direct end-to-end supervised deep learning, or handcrafted-feature classifiers [2511.13457]. Thus, the empirical case for SLSE rests primarily on ablation evidence rather than broad baseline comparisons [2511.13457].

## 6. Interpretation, related spirogram representation learning, and methodological context

The paper does not directly analyze what each of the 8 latent dimensions represents physiologically, but it does include interpretability analyses around the predictive model [2511.13457]. SHAP identifies influential features including higher RHF risk score or embedding-related signal, older age, male sex, obesity, COPD, diabetes, CKD, left heart failure, hypertension, and VHD [2511.13457]. SHAP dependence plots show RHF risk increasing with age and being higher in males [2511.13457]. The paper also adds an attention mechanism based on the VAE-encoder for interpretability analysis, which appears to be auxiliary rather than part of the core training model [2511.13457].

That attention-based case analysis suggests the model focuses on the segment before peak expiratory flow (PEF), the segment between \( \mathrm{FEF}_{25} \) and \( \mathrm{FEF}_{50} \), the segment between \( \mathrm{FEF}_{50} \) and \( \mathrm{FEF}_{75} \), and sometimes the segment after \( \mathrm{FEF}_{75} \) [2511.13457]. The authors interpret this as evidence that RHF-related pulmonary dysfunction may alter pre-PEF forced exhalation dynamics and the mid-expiratory portion of the curve, particularly around the \( \mathrm{FEF}_{25}\)–\(\mathrm{FEF}_{50} \) interval [2511.13457]. They further suggest a pattern in which the model’s second key focus tends to occur before \( \mathrm{FEF}_{50} \) in RHF and after \( \mathrm{FEF}_{50} \) in non-RHF [2511.13457]. This is not a formal latent-space analysis, but it is the main physiological interpretation offered in the paper [2511.13457].

Within the broader literature on spirogram representation learning, SLSE belongs to a class of methods that treat the waveform itself, rather than only derived pulmonary function indices, as the primary representation-learning substrate. A nearby but methodologically distinct example is SpiroLLM, which uses a CNN-BiLSTM SpiroEncoder to extract morphology-aware temporal features from raw pulmonary function time series and a SpiroProjector to align those features with the embedding space of a pretrained LLM [2507.16145]. SpiroLLM demonstrates that learned spirogram representations can carry clinically useful information independent of textualized PFT values, but it is not a self-supervised spirogram embedding method in the canonical sense because it does not define unlabeled pretraining of the spirogram encoder with contrastive learning, masked modeling, or predictive coding [2507.16145]. In that respect, SpiroLLM is best understood as an adjacent multimodal embedding-alignment framework rather than an instance of SLSE proper [2507.16145].

A second relevant methodological context comes from augmentation-free time-series SSL. “Learning Without Augmenting: Unsupervised Time Series Representation Learning via Frame Projections” proposes replacing handcrafted augmentations with views generated from the original time domain, a Fourier domain, and a wavelet or frame domain, with NT-Xent across ordered domain pairs and additional latent-space mapping losses [2510.22655]. For spirograms, this line of work is unusually pertinent because forced expiratory maneuvers are medically delicate signals in which time scaling, amplitude scaling, cropping, or heavy jitter may change clinically meaningful structure [2510.22655]. This suggests a live methodological tension in SLSE-style research: augmentation-based invariance can improve robustness, as reported in the RHF study, but transform-based view generation may better preserve waveform semantics when nuisance and task-relevant variability are difficult to separate [2510.22655].

## 7. Practical significance, limitations, and open directions

SLSE is positioned as a way to turn routine spirometry into an AI-enabled screening tool for RHF, especially for patients with lung disease who may not otherwise receive early right-heart evaluation [2511.13457]. The practical advantages claimed in the paper are that the method uses a widely available noninvasive test, does not require expert manual feature engineering, may improve early identification of RHF among patients already undergoing pulmonary testing, and may be particularly useful in high-risk groups such as CKD and VHD [2511.13457].

The limitations are substantial and are central to any technical appraisal. All experiments are performed in UK Biobank only, so generalizability to other healthcare systems, devices, or sicker clinical populations is unknown [2511.13457]. UK Biobank is a selected volunteer cohort and may not represent real-world hospital populations with advanced cardiopulmonary disease [2511.13457]. Labels are derived from MRI-based RVEF thresholds, and the paper explicitly notes measurement errors in RVEF assessment, introducing label noise [2511.13457]. Borderline cases were excluded by keeping only \( \mathrm{RVEF}<40\% \) and \( \mathrm{RVEF}>50\% \), which likely improves separability but may limit applicability to borderline or early real-world RHF [2511.13457].

Methodological reporting is also incomplete. The paper does not provide the exact VAE encoder or decoder architecture, whether the encoder is frozen or fine-tuned in Stage 2, CatBoost hyperparameters, augmentation parameter values, batch size, learning-rate schedule, or number of epochs [2511.13457]. It also does not compare SLSE against a broad range of competing methods or conventional spirometry-based RHF predictors [2511.13457]. Finally, the realism and completeness of the simulated perturbations used as augmentations are not externally validated [2511.13457].

These limitations frame several natural future directions. The paper implies the need for external validation, larger disease-specific high-risk cohorts, further refinement of spirogram embeddings, improved understanding of how RHF manifests in flow-volume curves, and extension of spirogram-based embedding approaches to other diseases [2511.13457]. A plausible implication is that future SLSE variants may need to resolve the tension between augmentation-based robustness and preservation of clinically meaningful waveform morphology, potentially by incorporating augmentation-free multi-view schemes based on fixed signal projections rather than synthetic perturbations [2510.22655]. Another plausible implication is that learned spirogram embeddings may become more valuable when treated as reusable cross-task representations, including in multimodal systems that align pulmonary physiology with textual reasoning or reporting pipelines [2507.16145].

In summary, SLSE denotes a BYOL-style self-supervised framework for spirogram embedding in which a VAE-based encoder backbone learns an 8-dimensional latent representation from augmented unlabeled flow-volume curves of length 1000, and the resulting embedding is fused with demographic variables for downstream RHF prediction [2511.13457]. Its significance lies in establishing a concrete representation-learning pathway from routine spirometry to RHF risk modeling, while its main unresolved issues concern reproducibility, generalization, augmentation validity, and the absence of a direct physiological or geometric characterization of the learned latent space [2511.13457].

Source: https://www.emergentmind.com/topics/self-supervised-representation-learning-based-spirogram-embedding-slse