arXiv is now an independent nonprofit! Learn more
License: CC BY 4.0
arXiv:2607.01145v3 [cs.LG] 23 Jul 2026

Hierarchical Self-Supervised Representation Learning Framework for Multivariate Time Series Grounded in ECG Analysis

Siwon Kim
Abstract

Data analysis in the medical domain often encounters scenarios involving a limited target dataset and a large, unannotated dataset with a general distribution. Under such circumstances, self-supervised learning (SSL) methods are highly effective for utilizing large datasets, making them a popular choice for electrocardiogram (ECG) analysis. This work presents the Event Reconstruction Joint-Embedding Predictive Architecture (ER-JEPA), a lightweight SSL framework for multivariate time series, whose name and two-fold hierarchical structure are inspired by the diagnostic approach of cardiologists. At its core, ER-JEPA features: (1) a two-stage structure that constructs representations for each time interval and subsequently processes these representations as a univariate time series, (2) the hierarchical integration of two Joint-Embedding Predictive Architectures (JEPAs), and (3) a Vision Transformer (ViT) backbone. The structural concatenation of two JEPAs categorizes the model as a Hierarchical JEPA (H-JEPA), designed to encode multiple levels of abstract representations for enhanced prediction on complex tasks. This study reports a successful application of H-JEPA to 12-lead ECG data as a multivariate time series, alongside an analysis of the sensitivity of hierarchical representation during the pretraining stage. Furthermore, this study provides a qualitative demonstration that the intermediate representations produced by the first module of ER-JEPA excel at local feature extraction, as they are structurally free from over-smoothing. Pretrained on approximately 180,000 10-second recordings, the model achieves state-of-the-art downstream performance on the ST-MEM benchmark, with rapid computation and minimal resource usage.

1 Introduction

While data is the essence of any analysis, from fundamental statistics to deep learning, the volume of annotated data has rarely scaled to match modern computational demands. This led to the advent of self-supervised learning (SSL), utilizing learning based on the inherent structure of data, as seen with invariance-based methods [4, 10, 13] and generative methods [12, 3, 35]. By learning the essence of data through pretraining on large-scale datasets without explicit labels, SSL frameworks establish a robust foundation for learning a specific task of interest in the downstream fine-tuning step. Hence, SSL has been extensively utilized in domains with high data availability, such as electrocardiogram (ECG) analysis.

The ECG is a recording of the heart’s electrical signals, a non-invasive test measuring voltage from electrodes attached to the skin [30]. Measured from diverse locations, the ECG is a multivariate time series, with 1212 channels in modern standards. As one of the most prevalent tests in the clinical field, the ECG yields large-scale datasets within the medical domain. However, as with most medical data, the ECG requires annotation by professional technicians for precise classification. Furthermore, due to an abundant number of samples from healthy individuals and typical conditions, the general distribution of ECG data is heavily skewed, requiring rigorous curation to collect targeted clinical data. Turning these constraints into an advantage, various studies have explored the application of SSL frameworks for ECG analysis [25, 31, 24, 34, 17].

Recent research involving SSL frameworks often utilizes the transformer architecture [32] to learn general representations of the input data type, as demonstrated in [6]. Frameworks such as Masked Autoencoders (MAE) [12], which generate masked data, and Joint-Embedding Predictive Architectures (JEPA) [19, 1], which predict embeddings in the representation space, are standard building blocks in recent studies. This trend is also prominent in ECG analysis; however, unlike standard applications in the domains of natural language processing or computer vision, adaptation for ECG data has not been optimal because it does not share identical dimensional characteristics with either domain. Following implementations from computer vision, structures designed for two-dimensional data are not optimal in terms of resource usage. Some frameworks designed for data types with a linear sequential order are more efficient at processing multichannel time series, but they do not examine the full potential of each architecture with respect to multichannel processing, since the multichannel analysis is often handled during the tokenization process.

In recent trends concerning general representation processing, architectures utilizing hierarchical representations are rising in prominence, particularly in the context of world models [11], which require architectures capable of making inferences based on both fine and coarse semantic understanding [19]. Incorporating diverse levels of representation is not only crucial for world model learning but is also required for the diagnostic procedure of a cardiologist during ECG analysis.

In this work, we explore the potential of hierarchical representation learning with JEPA on ECG data. Motivated by the approach of cardiologists in ECG analysis, this study introduces the Event Reconstruction Joint-Embedding Predictive Architecture (ER-JEPA), a hierarchical JEPA (H-JEPA) featuring a two-stage structure. This structural separation allows each module to focus on a designated analytical task, where the first part concentrates on multichannel processing and the latter part is dedicated exclusively to temporal analysis. Moreover, the essence of the structure lies in the concept that the channel module encodes multichannel sequences into univariate sequences, and the temporal module processes these encodings as a univariate sequence rather than a multivariate sequential input. By reducing the analysis of multivariate time series into a univariate case, the model gains significant advantages with respect to efficiency.

Compared to prior studies on the general representation of ECG data using transformer-based SSL frameworks, ER-JEPA achieves computational efficiency without sacrificing multichannel analysis by restricting it to a dedicated module. Another core design choice is the adoption of two separate JEPAs for each part of the model. While the concatenation of two JEPAs is a double-edged design due to the risk of representation collapse, empirical results demonstrate that it successfully facilitates richer semantic representation learning.

This report demonstrates the following:

  • ER-JEPA presents a highly efficient, lightweight solution among ViT models with multichannel processing, achieving a substantial reduction in both memory usage and inference time.

  • ER-JEPA succeeds in learning hierarchical representations on ECG data without representation collapse, despite utilizing a concatenated JEPA structure that is inherently susceptible to the phenomenon.

  • To mitigate variance in model performance across pretraining, multiple encoders were pretrained to assess optimal strategies and hyperparameters for ER-JEPA on ECG data.

  • ER-JEPA consistently achieves competitive performance with transformer-based SSL models on ECG datasets. Specifically, it matches state-of-the-art performance on the ST-MEM [25] benchmark using PTB-XL [33] and CPSC2018 [21], and it surpasses state-of-the-art performance on the PTB-XL fine-tuning downstream task with an AUC of 0.9360.936 and 0.9430.943 for multi-label and multi-class evaluation, respectively.

  • The intermediate representations produced by the channel encoder excel at local feature extraction, as they remain structurally free from token uniformity.

2 Background

In the field of representation learning, self-supervised learning (SSL) is a highly advantageous framework when large, unlabeled datasets are available. In the absence of explicit annotations, SSL methods derive supervisory signals directly from the inherent structure of the data, for instance, by predicting a hidden portion from a given context or enforcing similarity across data augmentations. In particular, SSL frameworks utilizing transformer architectures to extract generalized representations have become increasingly prevalent.

2.1 Self-Attention and Vision Transformer

Introduced by Vaswani et al. [32], self-attention is a token-wise operation that computes mutual correlations among tokens within an input sequence to generate context-aware outputs. Although initially designed for natural language processing, attention mechanisms are now ubiquitous across various domains, including computer vision. The Vision Transformer (ViT) [8] adapts this architecture for image data by processing non-overlapping image patches as an input sequence. To retain spatial information, it incorporates two-dimensional positional embeddings, which are vectors added to the tokens to encode their relative positions. Because the attention operation inherently requires discrete tokens, continuous input data must be discretized prior to processing.

While self-attention can be integrated into broader, more complex structures, its core mechanism relies on the following fundamental operation. Given NN input tokens {Xi1iN}\{X_{i}\mid 1\leq i\leq N\} with an embedding dimension of dembd_{\text{emb}}, we define the query (QQ), key (KK), and value (VV) matrices in N×demb\mathbb{R}^{N\times d_{\text{emb}}} as learnable linear transformations of the input tokens. Written in matrix form, the output is:

softmax(QKdemb)V,\operatorname{softmax}\left(\frac{QK^{\intercal}}{\sqrt{d_{\text{emb}}}}\right)V,

where each output row can be interpreted as a linear combination of value vectors weighted by their mutual correlations:

αi,1v1++αi,NvN,1iN.\alpha_{i,1}v_{1}+\cdots+\alpha_{i,N}v_{N},\quad 1\leq i\leq N.

Here, qi,ki,viq_{i},k_{i},v_{i} are the rows of the Q,K,VQ,K,V matrices, respectively, and the attention weight αi,j\alpha_{i,j} is derived from the scaled dot-product such that αi,jexp(qi,kj/demb)\alpha_{i,j}\propto\exp(\langle q_{i},k_{j}\rangle/\sqrt{d_{\text{emb}}}).

Notation.

We refer to the input tokens processed within a single attention operation as a sequence, and the number of input tokens NN as the sequence length. With a slight abuse of notation, we denote the attention operation over a token sequence indexed by II as:

{Xi(k)iI}=AttnBlock({Xi(k1)iI}),k.\{X_{i}^{(k)}\mid i\in I\}=\operatorname{AttnBlock}(\{X_{i}^{(k-1)}\mid i\in I\}),\quad k\in\mathbb{N}.

This notation accommodates flexible sequence lengths but abstracts away the explicit sequential order of the tokens. To resolve this, we implicitly assume that positional embeddings have already been added to the input patches to preserve their correct order prior to the operation. Note that the tokens {Xi}\{X_{i}\} are treated as algebraic objects to facilitate the understanding of the operations; however, each corresponds to a vector of size equal to the embedding dimension dembd_{\text{emb}}.

2.2 Image-Based Joint-Embedding Predictive Architectures

Energy-Based Models (EBMs) [18] provide an SSL framework that captures dependencies between variables by learning to assign lower energy to compatible configurations. The Joint-Embedding Predictive Architecture (JEPA) [19] extends this concept using two encoders to generate representations, followed by a predictor network joining two representations. Given a pair of intrinsically linked inputs, JEPA learns their representations by predicting the output embedding of one encoder from the output embedding of the other encoder, guided by a latent variable (see Figure 1(a)).

Refer to caption
(a) JEPA
Refer to caption
(b) Hierarchical JEPA
Figure 1: Overview of Joint-Embedding Predictive Architecture. (a) The objective of the learning process is the prediction of an embedding from a compatible signal utilizing a predictor network, guided by a (possibly latent) variable. (b) A basic example of a two-level Hierarchical JEPA. The latent-space learning process of JEPA is intrinsically suited for hierarchical composition.

The Image-based Joint-Embedding Predictive Architecture (I-JEPA) [1] adapts this framework for image data utilizing a context and target encoder pair. It learns the representation of image patches by predicting the embeddings of target patches sampled in a block from a sparse collection of context patches. Unlike generative architectures such as MAE [12], which reconstruct targets in the raw pixel space, I-JEPA predicts targets exclusively in the abstract representation space. This design choice is widely cited as a key factor in its enhanced semantic performance. Consequently, I-JEPA has been successfully adapted for various modalities beyond vision, serving as a core building block for the proposed architecture.

2.3 Hierarchical JEPA

Each encoder in a JEPA is constrained to designated input specifications, such as a fixed scope and resolution. For instance, two identical encoders can have distinct input resolutions (e.g., varying sampling frequencies) or scopes (e.g., different patch sizes) depending on an associated tokenization. Furthermore, for multimodal inputs such as an image-text pair, separate encoders can be assigned to process each distinct modality.

To capture complex data structures, representation learning literature frequently emphasizes the importance of hierarchical processing. In this context, a Hierarchical JEPA (H-JEPA) [19] comprises multiple interconnected JEPAs, where the hierarchy is induced by the varying scopes and resolutions of the sub-encoders. For instance, a JEPA processing fine representations corresponding to short time intervals can be chained to another JEPA processing coarser representations corresponding to longer time intervals (see Figure 1(b)). This aligns with the theoretical premise that complex tasks require multiple levels of abstraction, ranging from fine-grained details to coarse semantic concepts, to effectively interpret the input data.

3 Method

Given the provided background, the most straightforward interpretation of ER-JEPA is a concatenation of two ViT-based I-JEPAs operating over different data scopes. Specifically, the first JEPA, which we refer to as the channel JEPA, concentrates on learning inter-channel relationships, processing tokens by groups of concurrent patches across different channels. The latter, the temporal JEPA, focuses on learning intertemporal dependencies across time intervals. Functionally, the first module (containing the channel JEPA) summarizes each time interval of a multivariate time series into a single comprehensive representation. The second module (containing the temporal JEPA) then processes these constructed representations, focusing exclusively on temporal relations. We refer to Figure 2 for the schematic of the model.

Throughout the discussion, we will consider a multivariate time series as a collection of patches where each patch is a vector representing a specific time interval of some channel, utilizing a natural two-dimensional index (channel, time).

Refer to caption
Figure 2: Schematic of ER-JEPA. For a multivariate time series with CC channels, the pre-embedding layer first tokenizes the recording into C×NC\times N patches indexed by (channel, interval). Next, the event reconstruction module, which consists of a channel encoder and an aggregation layer, produces a sequence of tokens representing each time interval. The event analysis module then processes the resulting sequence to capture temporal relationships across tokens. An additional aggregation layer summarizes the interval tokens into a single token, which corresponds to a summary of the entire recording. The depicted predictors indicate their locations as part of the corresponding JEPAs and do not contribute to inference.

The Challenge of Multivariate Time Series in Transformer Frameworks

The two most direct adaptations of I-JEPA for multivariate time series involve adjusting image-handling techniques for temporal data. The first treats multichannel temporal tokens analogously to image patches, utilizing the (channel, time) indices as the 2D coordinates of each image patch. The second converts the multivariate time series into a univariate sequence during the preprocessing step, e.g., by configuring a 1D convolutional layer to accept multiple input channels in the tokenization step. Both methods tokenize the input sample into either 2D or 1D patches, which are subsequently processed by the attention layers as a unified sequence across all intervals and channels.

While these implementations are straightforward, both present significant drawbacks. The first method requires a rather long sequence length for time series processing, as the structure is adapted directly from the image domain. Hence, each additional temporal step adds NchN_{\text{ch}} tokens to the sequence for a NchN_{\text{ch}}-channel time series, resulting in a total sequence length of N=Nch×NtN=N_{\text{ch}}\times N_{\text{t}}. Because the time and memory complexity of the standard self-attention algorithm scales quadratically with the sequence length NN, this NchN_{\text{ch}}-fold increase renders rapid analysis computationally infeasible. Conversely, fusing multichannel information during the preprocessing step circumvents this quadratic bottleneck, as the embedding dimension dembd_{\text{emb}} scales at most linearly in both time and memory complexity. However, because this method processes multichannel data prior to the attention mechanism, it deprives the attention layers of the opportunity to capture inter-channel relationships, failing to fully utilize the model’s capabilities.

Refer to caption
Figure 3: Forward Pass of a Unit Channel Sequence. Given tokens of a multivariate time series indexed by (channel, time interval), the channel attention layers process the input by time interval, taking the concurrent tokens of every channel as a unit sequence. Next, an aggregation layer summarizes the NchN_{\text{ch}} tokens of each time interval into a single comprehensive token. These summarized tokens then form the input sequence for the temporal attention layer, resulting in a sequence length equal to the total number of time intervals.

3.1 Event Reconstruction

Motivated by the diagnostic approach of cardiologists, ER-JEPA is divided into two modules: (1) the event reconstruction module, and (2) the event analysis module. A 12-lead ECG records the electrical activity of the heart projected across 12 spatial axes [30]. While these projections yield diverse signals, crucially, every projection originates from the same underlying cardiac event. Therefore, the diagnostic essence does not lie in the impulses of a specific channel, but rather in the holistic inference of the heart’s activity derived from all concurrent projections. This observation suggests that, instead of analyzing patches from every channel, analyzing a unified representation of the reconstructed cardiac event is a highly efficient strategy in a situation where multivariate processing can be cumbersome. Throughout this section, we refer to Figure 3 as a visual guide to facilitate the understanding of this two-stage token processing.

Event Representation Construction

Given patches of a multichannel time series

{Xij1iNch,1jNt}\{X_{ij}\mid 1\leq i\leq N_{\text{ch}},1\leq j\leq N_{\text{t}}\}

as an input, the objective of the event reconstruction module is to construct a unified representation for each time interval:

{Yj1jNt}.\{Y_{j}\mid 1\leq j\leq N_{\text{t}}\}.

To yield an informative representation of each time interval, the module must first learn the inter-channel relationships of the given data. The module achieves this by pairing a channel JEPA with an aggregation layer. The channel JEPA is a modified I-JEPA dedicated to learning inter-channel relations by focusing exclusively on the mutual correspondence among concurrent patches across different channels. Details regarding the channel JEPA are discussed in Section 3.2. Through the encoder of the channel JEPA, the input patches are transformed into refined representations of their corresponding channel and interval:

{X~ij}=ChEnc({Xij}).\{\tilde{X}_{ij}\}=\operatorname{ChEnc}(\{X_{ij}\}).

Subsequently, an aggregation layer, such as average pooling, summarizes these concurrent representations into a single, unified representation for that specific interval:

{Yj}=Aggi({X~ij}).\{Y_{j}\}=\operatorname{Agg}_{i}(\{\tilde{X}_{ij}\}).
Event Analysis

With the constructed representations {Yj}\{Y_{j}\}, the input format for the event analysis module is effectively reduced from multichannel patches to single-channel time patches. Consequently, the event analysis module is simply a modified I-JEPA model tailored for a univariate time series. Through the encoder of the temporal JEPA, the constructed representations {Yj}\{Y_{j}\} are transformed into a contextually refined embedding of the corresponding time interval:

{Y~j}=TEnc({Yj}).\{\tilde{Y}_{j}\}=\operatorname{TEnc}(\{Y_{j}\}).

This transition from a multivariate time series to a univariate temporal representation is the core driver of the model’s efficiency, reducing the required sequence length for the temporal attention layers. For downstream tasks requiring a summary of the entire recording, the final temporal outputs are passed through an additional aggregation layer (e.g., average pooling):

Z=Aggj({Y~j})Z=\operatorname{Agg}_{j}(\{\tilde{Y}_{j}\})

3.2 H-JEPA with Channel and Temporal JEPA

Because the channel JEPA and temporal JEPA are both derived from I-JEPA, their core mechanisms are identical: modules with a ViT backbone; a context encoder, a target encoder, and a predictor for learning joint-embeddings; and updates of the target encoder via an exponential moving average. For detailed information on I-JEPA, we refer to [1].

Channel JEPA

As with the I-JEPA structure, the channel JEPA comprises a context-target encoder pair and a predictor network, each with a ViT backbone. And the attention layers inside the channel JEPA receive tokens with two-dimensional indices as input and return processed representations retaining the same index structure. However, because the primary objective of the channel JEPA is to capture inter-channel relationships, the self-attention operation is applied in a different manner. Rather than treating all patches across every channel and interval as a massive single sequence, a unit sequence of the channel JEPA consists of concurrent patches across different channels:

{Xij(k)}=j=1NtAttnBlock({Xij(k1)1iNch})\{X_{ij}^{(k)}\}=\bigcup_{j=1}^{N_{\text{t}}}\operatorname{AttnBlock}(\{X_{ij}^{(k-1)}\mid 1\leq i\leq N_{\text{ch}}\})

Processing concurrent patches by each time interval, the model exclusively captures the mutual correlations among different channels. This structural choice reduces the attention sequence length from Nch×NtN_{\text{ch}}\times N_{\text{t}} to just NchN_{\text{ch}}, shifting the factor of NtN_{\text{t}} to the total number of self-attention executions. Accordingly, the context and target masks for the channel JEPA are generated from collections of concurrent channel patches. For any given time interval, the channel JEPA learns by predicting the representations of target channels based on the representations of the provided context channels.

Temporal JEPA

As outlined previously, the temporal JEPA is a direct adaptation of I-JEPA for a single-index sequence, modifying the image-based framework for a univariate time series. It utilizes the same encoder pair and predictor composition, differing only in its use of 1D positional encoding and its input—which is not derived directly from raw data, but rather from the hierarchical representations constructed by the channel JEPA module:

{Yj(k)}=AttnBlock({Yj(k1)1jNt})\{Y_{j}^{(k)}\}=\operatorname{AttnBlock}(\{Y_{j}^{(k-1)}\mid 1\leq j\leq N_{\text{t}}\})

Adjusted for a univariate time series, the context and target masks for the temporal JEPA are sampled from the time intervals. Hence, the temporal JEPA learns embeddings by predicting representations of target intervals from the provided embeddings of context intervals.

Dual JEPA

Note that the predictive learning process of the channel JEPA is not strictly necessary to form an identical feed-forward structure to ER-JEPA (see Figure 2). Since the temporal prediction process occurs at the end of the processing pipeline, and the ViTs of the channel JEPA (other than the channel encoder) do not participate in the feed-forward process, it is possible to design an identical model without the channel JEPA. Omitting the joint-embedding predictive process prior to the temporal encoder theoretically reduces the risk of representation collapse. However, as detailed in Section 5.2, empirical evidence suggests the necessity of the channel JEPA.

3.3 Adaptation for ECG Data

Twelve-Lead ECG as a Multivariate Time Series

In standard clinical practice, a 10-second 12-lead ECG recording comprises eight measured leads (I, II, V1, …, V6), while the remaining four leads (III, aVL, aVR, aVF) are analytically derived via standard formulas. Consequently, the adaptation design formulates the 12-lead ECG as an eight-channel time series. Henceforth, the number of channels is set to Nch=8N_{\text{ch}}=8; and by fixing the 250 Hz250\text{\,}\mathrm{H}\mathrm{z} sampling rate for a 1010-second recording, the length of the time series is set to T=2500T=2500. Formally, the input ECG is represented as a matrix S8×2500S\in\mathbb{R}^{8\times 2500} with entries si,js_{i,j}.

Tokenization

Due to the structural differences between image data and time series data, the patch embedding step is modified for a multivariate time series. Given a multivariate time series SNch×TS\in\mathbb{R}^{N_{\text{ch}}\times T} and a fixed patch length pp, a single patch corresponds to the jj-th non-overlapping temporal segment of the ii-th channel, formally denoted as

Sij=(si,p(j1)+1,,si,p(j1)+p)p.S_{ij}=(s_{i,p(j-1)+1},\ldots,s_{i,p(j-1)+p})\in\mathbb{R}^{p}.

Consequently, analogous to the image domain, a 1D convolutional layer with both the kernel size and stride set to pp, a single input channel, and an output channel equal to the embedding dimension dembd_{\text{emb}} yields the tokenized patch XijX_{ij} from the time interval SijS_{ij}.

Masking Strategy

Inherited from I-JEPA, the two JEPAs require context and target selections for the pretraining process, which are generally referred to as ‘masks’ in the literature. For each batch, the size of the mask is randomly sampled from a provided range, and for each sample within the batch, the mask is generated according to the corresponding strategy. The choice of the selection method depends on the characteristics of the data and the desired effect on representation learning.

Channel Mask

Because the pool size for sampling contexts and targets from the 12 leads is small, a simple random selection is typically preferable. However, the 12-lead ECG presents an additional constraint that requires a slight modification. The leads of a 12-lead ECG cover diverse spatial directions: limb leads (I, II, III, aVL, aVR, aVF) project across vertical directions, and precordial leads (V1, …, V6) project across horizontal directions [30]. Because only the eight measured leads are utilized in this adaptation, a uniform random selection would introduce a bias toward the horizontal projections. To mitigate this bias, the adaptation employs weighted sampling for mask selection. Assigning higher sampling weights to leads I and II effectively compensates for the omitted limb leads, ensuring a balanced selection between the horizontal and vertical spatial directions.

Temporal Mask

Similar to the image domain, target selections are sampled as contiguous blocks to facilitate semantic representation learning. In this adaptation, two context sampling strategies are evaluated: (1) a block context strategy, and (2) a random context strategy. Both strategies sample context patches only after excluding the selected target patches from the available pool. The block strategy aggregates consecutive patches, occasionally fragmented by the excluded target regions, whereas the random strategy uniformly samples individual patches across the remaining sequence. Figure 4 provides visual examples of each scheme. For a performance comparison of the two strategies, refer to Section 6.1 and Table 3.

Refer to caption
(a) Block Mask
Refer to caption
(b) Random Mask
Refer to caption
Refer to caption
Refer to caption
(c) Block Masks
Refer to caption
(d) Random Masks
Figure 4: Example of Temporal Masks. Context and target masks for each sample are randomly generated based on a predetermined configuration. For each sample within a batch, target masks are sampled as contiguous blocks, with a fixed size across the batch. Next, the context mask is sampled from the remaining pool after excluding the target selection; the volume of context selection remains constant across the batch, while the sampling pattern depends on the chosen scheme. The block mask scheme samples contexts as contiguous blocks (with occasional fragments), the random scheme samples uniformly across the sequence, and the mixed scheme applies the block strategy to half of the batch and the random strategy to the remainder. For each batch, the context mask size is sampled from the range of 1.41.43.6 seconds3.6\text{\,}\mathrm{s}\mathrm{e}\mathrm{c}\mathrm{o}\mathrm{n}\mathrm{d}\mathrm{s}, and the target mask size is sampled from the range of 0.80.81.4 seconds1.4\text{\,}\mathrm{s}\mathrm{e}\mathrm{c}\mathrm{o}\mathrm{n}\mathrm{d}\mathrm{s}.

4 Related Work

Given the high availability of ECG data, various studies have explored general representation learning for ECG data using SSL. The work on Spatio-Temporal Masked Electrocardiogram Modeling (ST-MEM) is one of the pioneering works based on the Masked Autoencoder (MAE), which emphasized the importance of multichannel token processing, referring to patchification with a two-dimensional index as ‘spatio-temporal patchifying’. The benchmark methodology presented in their work featured downstream classification tasks on the PTB-XL [33] and CPSC2018 [21] datasets, and it has since been widely adopted in the SSL-based analysis of ECG data.

Additionally, several studies have investigated the application of JEPA to the ECG domain. For instance, Weimann and Conrad [34] explored the large-scale pretraining of I-JEPA, incorporating several image-to-time modifications specifically designed for ECG data. By utilizing a convolutional layer to tokenize the 12-lead ECG into 1D patches, their model focuses primarily on processing temporal tokens.

Similarly derived from I-JEPA, ECG-JEPA [17] is another predictive framework designed for 12-lead ECGs. As with ST-MEM, the design of ECG-JEPA accounts for inter-channel relationships through an attention mechanism. It adopts a structure similar to standard I-JEPA, processing multichannel tokens utilizing a two-dimensional (channel, time) index; however, it differs by explicitly restricting mutual token influences during the attention operation. Its Cross-Pattern Attention layer is based on the standard ViT attention layer for image data, but for any given target patch, it restricts attention exclusively to patches within the same channel (horizontal) and concurrent patches across different channels (vertical), effectively forming a spatial-temporal cross that intersects at the target patch.

Furthermore, the evaluation benchmark of ECG-JEPA follows the methodology established by ST-MEM, incorporating comprehensive experimental results for baseline models alongside configuration details for reproducibility. To facilitate a rigorous and direct comparison, the evaluation in this study follows the benchmarking methodology of ECG-JEPA.

5 Experiments

5.1 Pretraining

The paradigm of two-stage training, which first learns the underlying structure of the data using a large unlabeled dataset, is the essence of SSL. Following the methodology of I-JEPA [1], ER-JEPA learns by predicting the encoding of target patches from context patches during the pretraining process. Learning robust semantic representations from the inherent structure of the data fundamentally requires a large-scale dataset.

Pretraining Dataset

Due to the high availability of ECG data, there are various large-scale 12-lead ECG datasets, notably the Chapman-Shaoxing dataset [36], comprising 45 15245\,152 recordings, and the CODE-15 dataset [26], comprising 345 779345\,779 recordings. Aimed at promoting the analysis of arrhythmias and cardiovascular diseases, the Shaoxing dataset features diverse arrhythmias with labels provided by professional experts, comprising recordings collected from Shaoxing People’s Hospital and Ningbo First Hospital. As a subcollection of the comprehensive CODE dataset [27], the CODE-15 dataset represents a 15 %15\text{\,}\mathrm{\char 37\relax} stratified sample of the entire dataset. Collected by the Telehealth Network of Minas Gerais, this dataset covers a broad patient demographic across Brazil.

Filtering and Preprocessing

Restricting the scope to 1010-second recordings reduces the number of usable recordings to 143 328143\,328 for the CODE-15 dataset. Additionally, recordings containing NaN values or missing leads were removed, yielding a total pretraining dataset of 174 461174\,461 recordings (43 56143\,561 from the Shaoxing dataset and 130 900130\,900 from the CODE-15 dataset). All recordings were resampled to 250 Hz250\text{\,}\mathrm{H}\mathrm{z}. No further preprocessing was applied, except for data augmentations utilized to prevent overfitting across repeated epochs and to enhance the robustness of the learned encodings.

Training

During pretraining, the model was trained over 300300 epochs with a batch size of 6464. The AdamW optimizer [23] was utilized, adjusted by a Stochastic Gradient Descent with Warm Restarts (SGDR) scheduler [22], featuring a base learning rate of 2×1042\text{\times}{10}^{-4}, a minimum learning rate of 5×1055\text{\times}{10}^{-5}, eight restarts, and 10 %10\text{\,}\mathrm{\char 37\relax} warmup epochs. The target encoder was updated via an exponential moving average with a linearly increasing momentum value from 0.9960.996 to 11, following the configuration of I-JEPA [1]. Training on a workstation equipped with an NVIDIA GeForce RTX 3090 GPU (24 GB24\text{\,}\mathrm{G}\mathrm{B} VRAM) takes approximately 3434 hours and requires 6 GB6\text{\,}\mathrm{G}\mathrm{B} of VRAM, or 4040 hours and 3 GB3\text{\,}\mathrm{G}\mathrm{B} without Just-In-Time (JIT) compilation.

5.2 Sensitivity of Hierarchical Representation

Because the learning process of JEPA operates in the representation space, the architecture is prone to representation collapse, a phenomenon where the model trivially solves the prediction task by collapsing all encodings into a constant embedding. This can be largely mitigated by design choices, such as utilizing asymmetric encoders [2, 5, 10], as seen in many Joint-Embedding Architecture (JEA) models and I-JEPA; however, an inherent susceptibility remains prevalent across joint-embedding architectures.

Representation collapse is an especially serious issue for ER-JEPA, since the input to the temporal JEPA is not a token derived directly from the raw data, but rather a representation constructed by the preceding channel JEPA, which is itself inherently prone to representation collapse. Indeed, as depicted in Figure 5(a), the loss of each JEPA drastically drops in the early stages, then recovers within a few epochs, a recovery pattern typical for models utilizing the JEPA framework.

To further investigate this behavior, the evolution of the temporal loss can be compared against baseline models that lack a concatenated JEPA structure, as shown in Figure 5(b). Under an identical pretraining environment, both an ablation model omitting the channel JEPA (detailed below) and a standard 1D I-JEPA adaptation for ECG (see Section 5.3.1) exhibit a significantly shallower initial drop in loss during the early epochs. This distinction highlights that the compound hierarchical stacking in the complete ER-JEPA model amplifies early-stage vulnerability prior to its recovery.

Refer to caption
(a)
Refer to caption
(b)
Figure 5: Pretraining Loss of the Channel and Temporal JEPA. (a) Evolution of channel and temporal loss during pretraining. Both JEPAs exhibit an early-stage drop in loss, with the temporal loss reaching a lower minimum loss of 7×1047\text{\times}{10}^{-4}. (b) Impact of the channel JEPA on temporal loss. The plot compares the temporal loss of the complete model against baseline architectures without a concatenated JEPA structure, including an identical model omitting the channel JEPA and a standard 1D I-JEPA adaptation for ECG. The reported loss value is the mean of an element-wise comparison.

While the complete model ultimately stabilizes, an unrecovered loss during pretraining serves as typical evidence of representation collapse. Building on this observation, the following paragraphs detail specific phenomena regarding the sensitive nature of hierarchical representation learning within ER-JEPA.

Loss Drop

Because unsuccessful JEPA designs often do not recover from an infinitesimal loss in the early stages, a very small initial loss value is typically considered a harbinger of failure. However, empirical results indicated otherwise for ER-JEPA under specific conditions. With the current pretraining data and a batch size of 6464, repeated trials occasionally produced anomalous pretraining results, yielding inferior downstream performance that significantly deviated from the norm (see Table 8). While a definitive explanation remains elusive, the degree of the initial loss drop for these anomalous trials was notably less severe than in standard, successful trials. To provide a clearer view of this phenomenon, the first two epochs of pretraining were sampled across numerous trials without continuing to the final epoch (see Figure 6). Approximately 1 %1\text{\,}\mathrm{\char 37\relax} of the 500500 trials exhibited significant deviations in the minimum loss value, observable in both the channel and temporal loss.

Refer to caption
(a) Total Loss
Refer to caption
(b) Temporal Loss
Figure 6: Histograms of Loss Value at Epoch 2. Under fixed pretraining configurations, 500500 repeated trials yielded approximately 1 %1\text{\,}\mathrm{\char 37\relax} anomalous cases, characterized by relatively high loss values at Epoch 2. This phenomenon was also consistently observed in the rare full trials that produced inferior downstream performance. The five trials with the highest total loss corresponded to cases of highest loss in both the channel and temporal modules.
Comparison Without Channel JEPA

An encoder with an identical structure can be trained without the channel JEPA by omitting the predictive process for the channel module. Because the temporal JEPA remains at the end of the encoding layers, the pretraining process is still valid, and the risk of representation collapse is theoretically reduced to the level of a single JEPA. Figure 5(b) compares the temporal loss between the ablation model without the channel JEPA and the complete model. Even under identical training settings, the removal of the channel JEPA prevents the drastic drop in loss during the early stages. However, this structural absence results in noticeable degradation in downstream task performance compared to the complete model (see Table 8).

Dropout Layer

In conjunction with the hypothesis regarding early-stage loss drops and the predictive nature of pretraining, the performance increase observed from utilizing a dropout layer [14] demonstrates a potential relationship with sensitive representation learning. As presented in Table 8, ablating the dropout layer results in a notable decline in downstream task performance, suggesting that enforcing representational robustness is critical in hierarchical JEPA frameworks.

5.3 Downstream Tasks

The evaluation of representation learning assesses the encoder’s performance on specific tasks, both with and without further altering the model’s weights. To evaluate the static embeddings produced by the pretrained encoder, linear probing measures the performance of a basic linear classifier using the frozen encoder’s output as features. To evaluate the full capacity of the model, fine-tuning trains the entire model end-to-end after appending a classification layer.

Following I-JEPA [1], the target encoder of the JEPA framework, which is updated via an exponential moving average, is the standard choice for the representing encoder in downstream applications. For ER-JEPA, the concatenation of the channel and temporal JEPA encoders, joined by an average pooling layer, serves as the primary encoder for these tasks. For the classification of an entire 1010-second 1212-lead ECG, an additional average pooling layer is appended to summarize the sequence of interval representations into a single global representation (see Figure 2).

Downstream Dataset: Classification

Following the benchmarking methodology established by ST-MEM [25], the PTB-XL [33] and CPSC2018 [21] datasets were utilized for the downstream classification tasks. For direct comparison across literature, the macro area under the receiver operating characteristic curve (macro AUC) was utilized as the primary metric for all classification tasks.

PTB-XL

Structured by the Physikalisch-Technische Bundesanstalt (PTB) in Germany, the dataset [33] comprises 21 79921\,799 clinical 1010-second 1212-lead ECG recordings collected from 18 86918\,869 patients. The annotations, provided by two cardiologists, cover 7171 different ECG statements conforming to the SCP-ECG standard which are categorized into diagnostic, form, and rhythm statements. The dataset provides recommended splits for training and testing, alongside two types of diagnostic labels based on 4141 diagnostic statements, aggregated into 2424 subclasses and 5 coarser superclasses.

CPSC 2018

The China Physiological Signal Challenge (CPSC) 2018 dataset [21] comprises a collection of ECG recordings donated by 1111 hospitals for the 2018 competition. The dataset features eight arrhythmia classes across 68776877 1212-lead ECG recordings for training and 29542954 withheld recordings for testing.

Labels, Training, and Test Sets

For PTB-XL, due to its ubiquitous use in related works, the superclass was utilized as the target label for classification. Following the provided stratified splits, folds 11 through 88 were used as the training set, while fold 99 and fold 1010 served as the validation and test sets, respectively.

For CPSC2018, all 99 labels, including the normal sinus rhythm (healthy individual), were used as target classes. Split by the thousands digit of the record ID, the dataset was divided into 77 batches, with 878878 recordings in the final batch. After excluding records with NaN values or missing leads, the first five batches were used as the training set, the sixth as the validation set, and the final batch as the test set. These specific splits for both datasets follow the ECG-JEPA [17] methodology to ensure direct comparability.

Multi-Label and Multi-Class Tasks

Depending on the label structure, the evaluations were further divided into two downstream configurations: multi-label classification and multi-class classification. In the multi-label classification task, multiple labels for a single sample are permitted, and the dataset is used without filtering. Conversely, in the multi-class setting, samples with multiple labels are filtered out, retaining only those with a single definitive label.

5.3.1 Benchmark Methodology

Table 1 and Table 2 present the corresponding benchmark results of SSL models on ECG data. The reported scores of SSL models from the original ST-MEM [25] paper are listed as a baseline, along with the test results of the JEPA model from Weimann and Conrad [34], noting possible differences in their splitting of the CPSC2018 dataset. The scores for SimCLR [4], ECG-FM [24], KED [31], and ECG-JEPA are derived from the comparative tests in the work introducing ECG-JEPA [17]. To utilize this extensive evaluation, the assessment of ER-JEPA strictly follows the ECG-JEPA setup for direct comparison.

As an additional baseline, a simple 1D-JEPA was trained within an identical pretraining environment to ER-JEPA. The structure of this 1D-JEPA follows the framework described in Section 3, where multichannel processing is handled entirely by a convolutional pre-embedding step. This baseline is conceptually identical to the JEPA framework of Weimann and Conrad, though specific architectural details may differ. Furthermore, the Weimann and Conrad JEPA operates on a higher-resolution signal input (patch size 2525, 500 Hz500\text{\,}\mathrm{H}\mathrm{z} sampling rate) and utilizes a vastly different data-intensive pretraining regime (sampling 1 M1\text{\,}\mathrm{M} recordings from 1010 public datasets, batch size 20482048, training for up to 100100K epochs, with downstream evaluations starting from a minimum of 1010K epochs). Therefore, considering these differences in data resolution and pretraining scale, the locally trained 1D-JEPA serves as a more controlled surrogate for evaluating the architectural benefits of ER-JEPA.

Downstream Training

The downstream evaluation procedures are outlined below. For the classification task, a linear layer, prepended with batch normalization, is appended to serve as the classification head. Taking the pooled representation of the entire recording as input (see Figure 2), the classification layer predicts the diagnostic label. Each evaluation process trains the model on the training set, utilizes early stopping based on the validation set, and reports the final metrics from the test set. Unless otherwise specified, every repeated experiment features a distinctly pretrained encoder and experiments were repeated ten times for the benchmark comparison and five times for ablation studies.

5.3.2 Linear Evaluation

The encoder of an SSL model learns embeddings that capture the essence of the data by learning inherent data structures during pretraining. Linear probing evaluates the quality of these embeddings by freezing the encoder’s weights and only training the appended linear classifier. For details regarding the linear classifier and the evaluation process, refer to the Downstream Training paragraph above. The linear classifier was trained over 7070 epochs using a decreasing learning rate starting from 5×1035\text{\times}{10}^{-3}, a batch size of 1616, and the AdamW optimizer [23].

Table 1: Linear Evaluation Benchmark Results. Performance (macro AUC) of SSL models on downstream datasets with linear evaluation. Entries with multiple trials are accompanied by the standard deviation in parentheses (0.0xx), and the reported value is the average macro AUC over trials. The Source column indicates the literature from which the benchmark scores were retrieved.
Model Pretrain Dataset Records Multi-Label Multi-Class Source
PTB-XL CPSC2018 PTB-XL CPSC2018
MoCo v3 CS + CODE-15 180 K180\text{\,}\mathrm{K} - - 0.739 0.712 [25]
MTAE - - 0.807 0.818
MLAE - - 0.779 0.794
ST-MEM CS + CODE-15 180 K180\text{\,}\mathrm{K} 0.882 0.955 0.879 0.964 [17]
SimCLR 0.875 0.915 0.830 0.925
ECG-FM UHN-ECG4 622 K622\text{\,}\mathrm{K} 0.878 0.916 0.856 0.931
KED MIMIC-IV-ECG 800 K800\text{\,}\mathrm{K} 0.885 0.883 0.888 0.906
ECG-JEPA CS + CODE-15 180 K180\text{\,}\mathrm{K} 0.912 0.966 0.903 0.973
JEPA1 1010 datasets3 1 M1\text{\,}\mathrm{M} - - 0.928(03) - [34]
JEPA1 MIMIC-IV-ECG 800 K800\text{\,}\mathrm{K} - - 0.920(02) 0.976(01)
1D-JEPA2 CS + CODE-15 180 K180\text{\,}\mathrm{K} 0.901(01) 0.960(02) 0.888(04) 0.969(02) -
ER-JEPA 0.913(01) 0.964(02) 0.911(03) 0.969(04)
ER-JEPA1 0.913(00) 0.967(01) 0.916(02) 0.973(01)
  • *

    CS denotes the Chapman-Shaoxing dataset.

  • 1

    1010 trials of downstream training.

  • 2

    Baseline 1D-JEPA model with 55 pretrained encoders.

  • 3

    1 M1\text{\,}\mathrm{M} recordings sampled from 1010 public datasets including CODE-15, MIMIC-IV-ECG [9], and CS.

  • 4

    Private dataset from University Health Network (UHN), Toronto, Canada [24].

The experimental results in Table 1 indicate that ER-JEPA demonstrates performance improvements on the PTB-XL dataset across the board, with the sole exception of the highly scaled JEPA from Weimann and Conrad. The arrhythmia classification capability of the model on the CPSC2018 dataset is highly competitive with state-of-the-art models. It is worth noting that performance differences among baseline models, including ablation studies, are comparatively marginal on the CPSC2018 dataset, where macro AUCs heavily saturate around 0.9690.969.

5.3.3 Fine-Tuning

In contrast to linear evaluation, the entire encoder is trained alongside the appended classification layer during the fine-tuning process. For details regarding the classifier and evaluation process, refer to the Downstream Training paragraph above. The entire model was trained over 66 epochs using a decreasing learning rate with cosine decay and linear warmup [12] based on a learning rate of 1.8×1041.8\text{\times}{10}^{-4}, a batch size of 1616, and the AdamW optimizer [23]. Furthermore, data augmentations and both high- and low-pass filtering were applied, following the training procedures of ST-MEM [25].

Table 2: Fine-Tuning Evaluation Benchmark Results. Performance (macro AUC) of SSL models on downstream datasets with fine-tuning. Entries with multiple trials are accompanied by the standard deviation in parentheses (0.0xx), and the reported value is the average macro AUC over trials. The Source column indicates the literature from which the benchmark scores were retrieved.
Model Pretrain Dataset Records Multi-Label Multi-Class Source
PTB-XL CPSC2018 PTB-XL CPSC2018
MoCo v3 CS + CODE-15 180 K180\text{\,}\mathrm{K} - - 0.913 0.967 [25]
MTAE - - 0.910 0.961
MLAE - - 0.915 0.973
ST-MEM CS + CODE-15 180 K180\text{\,}\mathrm{K} 0.929 0.973 0.910 0.977 [17]
SimCLR 0.918 0.936 0.928 0.955
ECG-FM UHN-ECG4 622 K622\text{\,}\mathrm{K} 0.899 0.922 0.895 0.947
KED MIMIC-IV-ECG 800 K800\text{\,}\mathrm{K} 0.901 0.891 0.906 0.923
ECG-JEPA CS + CODE-15 180 K180\text{\,}\mathrm{K} 0.931 0.973 0.928 0.976
JEPA1 1010 datasets3 1 M1\text{\,}\mathrm{M} - - 0.935(02) - [34]
JEPA1 MIMIC-IV-ECG 800 K800\text{\,}\mathrm{K} - - 0.928(02) 0.983(00)
1D-JEPA2 CS + CODE-15 180 K180\text{\,}\mathrm{K} 0.923(03) 0.973(02) 0.923(05) 0.979(01) -
ER-JEPA 0.936(01) 0.974(01) 0.943(02) 0.981(01)
ER-JEPA1 0.935(01) 0.973(01) 0.943(03) 0.980(01)
  • *

    CS denotes the Chapman-Shaoxing dataset.

  • 1

    1010 trials of downstream training.

  • 2

    Baseline 1D-JEPA model with 55 pretrained encoders.

  • 3

    1 M1\text{\,}\mathrm{M} recordings sampled from 1010 public datasets including CODE-15, MIMIC-IV-ECG [9], and CS.

  • 4

    Private dataset from University Health Network (UHN), Toronto, Canada [24].

Table 2 presents the benchmark results for the fine-tuning evaluation. As with the linear evaluation, ER-JEPA excels on the PTB-XL dataset, outperforming the previous state-of-the-art, and attains highly competitive state-of-the-art performance for arrhythmia classification on CPSC2018.

Notably, there is a significant increase in the macro AUC scores compared to the linear evaluation, in contrast to the modest 0.0070.0070.0080.008 AUC increase reported for the JEPA from Weimann and Conrad [34]. This substantial increase following fine-tuning suggests that while the pretraining process may not inherently force the encoder to learn features perfectly aligned for a specific downstream task, the resulting hierarchical embeddings are highly adaptable, allowing the encoder to rapidly tailor its representations during the fine-tuning phase.

5.4 Computational Efficiency

Most ViT-based SSL models in the benchmark, such as the encoders proposed by Weimann and Conrad [34], ST-MEM [25], and ECG-JEPA, share common hyperparameter standards. Following the configuration of the original ViT [8] or the foundational Transformer [32], an embedding dimension equal to a multiple of 768768 and an encoder depth of 1212 are prevalent baseline choices. ER-JEPA also follows this general convention, utilizing an embedding dimension of demb=384d_{\text{emb}}=$384$, but splits the network depth, equally distributing six attention layers to the channel encoder and six to the temporal encoder.

While sections 5.3.2 and 5.3.3 prove that this configuration, demb=384d_{\text{emb}}=$384$ with depths (6,6)(6,6), is highly effective, the ER-JEPA encoder also gains a significant advantage with respect to resource usage, as half of its attention layers (the temporal encoder) process purely temporal tokens without requiring expensive multichannel operations. The multichannel processing is dedicated entirely to the channel encoder, which itself achieves efficiency through a strictly focused scope. Compared to the temporal encoder, the channel encoder processes a much smaller sequence length of N=NchN=N_{\text{ch}}, at the expense of increasing the effective batch size by a factor of NtN_{\text{t}}. However, in the current implementation (Nch=8N_{\text{ch}}=8 and Nt=50N_{\text{t}}=50), this increase in effective batch size dominates the computational cost over the reduced sequence length, despite the 𝒪(N2)\mathcal{O}(N^{2}) reduction in attention complexity. Furthermore, computational overhead caused by tensor handling in the PyTorch implementation widens the execution time gap between the temporal and channel encoders, regardless of the configuration.

Refer to caption
(a) Classification Benchmark Encoders
Refer to caption
(b) Encoders under Unified Embedding Dimension
Figure 7: Computational Efficiency Comparison. The ViT-based encoders are evaluated based on batch latency and peak GPU memory usage. (a) Performance utilizing the native hyperparameter settings from the downstream classification benchmark. (b) A controlled comparison where all encoders are standardized to a unified embedding dimension of demb=768d_{\text{emb}}=768.

Figure 7 presents an efficiency comparison among the ViT encoders of various SSL models. The ER-JEPA encoder is compared in two settings: (a) under the native settings used in the downstream classification benchmark, and (b) under a unified embedding dimension of demb=768d_{\text{emb}}=768. The compared models include a 1D ViT-S; a 2D ViT-B, representing the encoder of ST-MEM; and the Cross-Pattern ViT from ECG-JEPA [17]. Furthermore, ViT-1D-S-F, a closer surrogate for the encoder in Weimann and Conrad, is included in the native setting benchmark to account for their specific data resolution (500 Hz500\text{\,}\mathrm{H}\mathrm{z} data with a smaller patch size of p=25p=25).

With the hyperparameters used in the classification benchmark, the ER-JEPA encoder is the fastest among the architectures that explicitly process multichannel tokens, achieving speeds relatively close to the baseline ViT-1D encoder (which entirely bypasses multichannel attention). The ER-JEPA encoder achieves up to a 7.87.8×\times speedup under benchmark conditions, and maintains a maximum 2.62.6×\times speedup even under the unified embedding dimension of demb=768d_{\text{emb}}=768.

The memory allocation exhibits a trend similar to the speed efficiency. Compared to the other multichannel ViT encoders in the benchmark, ER-JEPA requires less than one-third of the memory for small batch sizes, and less than one-fourth for larger batch sizes. When all models are scaled to an embedding dimension of demb=768d_{\text{emb}}=768, memory usage is similar for a unit batch size, but the baseline multichannel encoders scale to consume between 1.51.5 and 22 times as much memory as ER-JEPA for larger batch sizes.

While the basic 1D ViT achieves the lightest computational footprint by delegating multichannel analysis entirely to the tokenization step, the finer-resolution surrogate (ViT-1D-S-F) demands significantly heavier processing. As a result, the efficiency gap between ViT-1D-S-F and the ER-JEPA encoder narrows, with ER-JEPA requiring only a 25 %25\text{\,}\mathrm{\char 37\relax} increase in operation time and 42 %42\text{\,}\mathrm{\char 37\relax} more memory despite multichannel processing.

Hardware and Software Specifications

The computational benchmark was executed on a workstation equipped with an Intel® Core™ i9-10940X processor and an NVIDIA GeForce RTX 3090 GPU (24 GB24\text{\,}\mathrm{G}\mathrm{B} VRAM), utilizing Python 3.12.3, PyTorch 2.10.0, and CUDA 12.8 running on Ubuntu 20.04.6 LTS.

Computation Benchmark Setup

In the experimental script, a random tensor of shape (B,8,2500)(B,8,2500) was utilized as a single batch of recordings. This was partitioned into a shape of (B,8,50,50)(B,8,50,50), or (B,50,50)(B,50,50) for the 1D-JEPA, using a unified patch size of p=50p=50. For the ViT-1D-S-F model, which operates on a different data resolution, an input tensor of shape (B,8,5000)(B,8,5000) was used with a patch size of p=25p=25, yielding an initial patch tensor of shape (B,200,25)(B,200,25). The latency per batch was averaged over 100100 iterations, preceded by a warmup phase of the same number of iterations. After the warmup phase, memory usage was cleared utilizing torch.cuda.reset_peak_memory_stats, and both phases were followed by a torch.cuda.synchronize call. For latency measurement, time.perf_counter recorded execution times with high precision. Just-In-Time (JIT) compilation using torch.compile was disabled during the experiment. Each timing experiment was repeated five times; the standard deviations reached a maximum of 1 %1\text{\,}\mathrm{\char 37\relax} for small batch sizes (under four), while the majority remained well below 1 %1\text{\,}\mathrm{\char 37\relax}.

5.5 Qualitative Assessment of Intermediate Representations

In this section, we qualitatively assess the characteristics of the representations produced by the channel encoder. Because the representation from the channel encoder corresponds to a specific time interval, as with the output tokens of the temporal encoder, both representations can be utilized in downstream applications involving time-interval analysis. To this end, we compare the efficacy of each representation in an ECG segmentation task. We restrict this analysis strictly to a qualitative proof-of-concept, reserving comprehensive quantitative evaluation for future studies.

5.5.1 Delineation of Key ECG Waveforms

The three primary waveforms of an ECG correspond to distinct events in the cardiac cycle: the P-wave represents atrial depolarization, the QRS complex indicates ventricular depolarization, and the T-wave signifies ventricular repolarization. Because each waveform is a projection of a corresponding cardiac event, any functional deviation of the heart is directly reflected in its morphology. While the accurate delineation of these key waveforms is a crucial step in clinical diagnosis, it is also an absolute prerequisite for automated ECG analysis such as large-scale statistical filtering.

Difficulty of Delineation

Despite its importance, the scarcity of comprehensively annotated datasets and the morphological variance across different arrhythmias intensify the difficulty of the delineation task [16]. For instance, an obstruction or delay in electrical conduction between the sinus node and the Purkinje fibers is referred to as an Atrioventricular (AV) block, a condition with varying degrees of severity [30]. AV blocks pose significant challenges for automated delineation due to the potential overlap between delayed P-waves and other waveforms, the complete absence of a subsequent ventricular response, or the disassociation of atrial and ventricular activity.

5.5.2 ECG Segmentation

Building on the U-Net architecture [28] and its variants [37, 15], the work of Joung et al. [16] demonstrated the successful application of deep learning frameworks for ECG delineation across diverse arrhythmias. The essence of U-Net-based architectures is a symmetric encoding-decoding structure, where each module forms half of the ‘U’ shape. The layers in the encoding path progressively compress the preceding signal into a condensed form, reaching maximum compression at the bottleneck, where each temporal step encompasses a broad receptive field of the input time series.

The intermediate representations of the ER-JEPA channel encoder act as representative tokens for corresponding time intervals, capturing the mutual correlation between concurrent patches across different leads. Subsequently, the output tokens of the temporal encoder are derived by applying self-attention to these intermediate representations. Hence, the sequence of either representation across all time intervals can be interpreted as an encoded signal, compressed by a factor of the patch size pp, with the embedding dimension acting as the feature map depth. Based on this interpretation, either encoder of ER-JEPA can replace the standard encoding path of a U-Net-style segmentation network. The following demonstration utilizes a segmentation network designed from this premise. Based on UNet 3+ [15, 16], the modified model retains only the full-scale skip connections of the decoding layers, as the standard encoding path is replaced by the ER-JEPA encoder. This design serves merely as a proof-of-concept; architectural exploration and further hyperparameter optimization are reserved for future work.

5.5.3 Over-Smoothing

While the integration of attention mechanisms with SSL has significantly advanced representation learning, structural designs must be carefully calibrated depending on the target task. Whether due to the inherent nature of the self-attention algorithm [7] or specific structural learning designs [29], transformer architectures are prone to the convergence of every token in a sequence into a uniform vector, a phenomenon referred to as over-smoothing, token uniformity, or rank collapse. Although standard transformer implementations include measures to mitigate this over-smoothing [7], tasks requiring fine-grained, localized inference, such as segmentation, demand extra structural care. Along with various architectural solutions, utilizing tokens from intermediate layers is known to facilitate token diversity and prevent the degradation of high-frequency signals [20].

In ER-JEPA, because the representation of the channel encoder exclusively captures mutual relations within concurrent patches, the reconstructed representations of time intervals remain mutually independent prior to temporal processing. From this perspective, the channel encoder representations feature fine-grained, distinctive signals free from global influence. Despite the absence of global inference, it is theoretically advantageous for facilitating localized inference in segmentation tasks.

5.5.4 Case Study: P-Wave Delineation in Complex Arrhythmias

Restricting our focus strictly to qualitative evaluation, we note the potential capability of ER-JEPA in the ECG segmentation task and provide a selected example illustrating the theoretical advantage of the channel encoder representation for local feature extraction. Each segmentation model was fine-tuned under an identical environment utilizing a filtered subset of the Shaoxing dataset. The segmentation labels were primarily generated by the segmentation model of Joung et al. [16]. Labels for 4242 second-degree AV block samples and 2424 third-degree AV block samples in the Shaoxing dataset were manually annotated. Approximately 10001000 recordings, including 6666 high-degree AV block samples, were used in total for the segmentation fine-tuning.

Figure 8 presents the segmentation result of a selected example delineated by two segmentation models, each featuring either the isolated channel encoder or the entire ER-JEPA encoder, paired with a UNet 3+-based decoder add-on. For a qualitative evaluation of the differences between the representations at different stages, the first model utilized only the channel encoder, while the second model utilized the final encoding of the entire ER-JEPA encoder as the input to the decoder. Although this selected case is illustrative rather than exhaustive (especially without an intensive study, which is reserved for future work), it provides a clear visualization of the hypothesis discussed in Section 5.5.3.

Refer to caption
Figure 8: Qualitative Comparison of P-Wave Delineation. A selected recording (Shaoxing dataset record ID JS04915) with a 2nd-degree Atrioventricular Block (AVB2) serves as an exemplary sample to illustrate the comparison of local feature extraction performance between intermediate (Channel) and final (Temporal) representations. The delineations of each segmentation model are depicted on the recording (Lead V1). Despite absence of subsequent QRS complexes and the overlapping of P-waves and T-waves due to conduction delay, the channel encoder segmentation model successfully delineates every P-wave in the recording. The full model detects the presence of the buried P-waves, but the signal is not strong enough.

The visualization features a successful case of P-wave delineation by the channel encoder segmentation model on a sample with a 2nd-degree AV block. Here, the channel encoder segmentation model locates every non-conducted P-wave that is overlapped with a T-wave. The full model detects the presence of buried P-waves in a few cases, but the signal strength is insufficient in this specific sample. While the full model successfully detected buried P-waves in some other samples, this example illustrates the potential signal suppression caused by a heavy reliance on the global rhythm acquired through temporal inference.

In summary, we have explored the potential capability of ER-JEPA in ECG segmentation and provided an exemplary sample that illustrates our hypothesis regarding the characteristics of intermediate representations, specifically in relation to the over-smoothing of self-attention operations. This targeted demonstration was successful even without extensive structural design and optimization of the segmentation network; however, a comprehensive quantitative evaluation and an examination of optimized architectures are reserved for future work.

6 Ablations

The assessment for the ablation studies follows the same downstream evaluation procedure outlined in Section 5.3.1. The subsequent sections feature ablation studies evaluating various hyperparameters based on linear probing and fine-tuning performance. While each analysis demonstrates that the default hyperparameter configuration is optimal, fine-tuning evaluations exhibit significantly narrower performance margins, demonstrating highly stable performance across diverse configurations.

6.1 Linear Evaluation Across Ablations

Masking Strategy

As discussed in Section 3.3, two masking strategies for the temporal pretraining process are compared in Table 3. To leverage the effects of both strategies, a ‘mixed’ scheme was also tested, which applies a block mask to half of the batch and a sparse mask to the remainder. Table 3 indicates that while every mask scheme demonstrates strong performance, the block mask scheme outperforms the others on the PTB-XL classification tasks.

Table 3: Linear Evaluation Across Masking Strategy.
Strategy Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
Sparse 0.909(02) 0.962(03) 0.903(05) 0.968(01)
Mix 0.909(02) 0.965(02) 0.903(04) 0.970(03)
Block 0.913(01) 0.964(02) 0.911(03) 0.969(04)
Mask Size

Considering the semantic learning objectives of JEPA pretraining, the size of the context interval is a crucial factor. If the context is too wide, the prediction task becomes comparatively trivial, whereas a critically small context may hinder learning by making the task excessively difficult. A training strategy utilizing smaller masks sampled from the range of 1.41.42.0 seconds2.0\text{\,}\mathrm{s}\mathrm{e}\mathrm{c}\mathrm{o}\mathrm{n}\mathrm{d}\mathrm{s} outperformed a larger mask scheme sampled from the range of 2.82.83.6 seconds3.6\text{\,}\mathrm{s}\mathrm{e}\mathrm{c}\mathrm{o}\mathrm{n}\mathrm{d}\mathrm{s}. However, the broader range of 1.41.43.6 seconds3.6\text{\,}\mathrm{s}\mathrm{e}\mathrm{c}\mathrm{o}\mathrm{n}\mathrm{d}\mathrm{s}, which encompasses both, proved optimal by preventing the model from overfitting to a fixed trend in size sampling.

Table 4: Linear Evaluation Across Mask Size.
Mask Size Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
Large 0.910(01) 0.961(03) 0.903(03) 0.965(03)
Small 0.911(01) 0.963(03) 0.907(04) 0.968(03)
Both 0.913(01) 0.964(02) 0.911(03) 0.969(04)
Batch Size

For the current pretraining dataset, varying the batch size yielded the linear evaluation performances detailed in Table 5. The variation in benchmark performance across these batch sizes is the least significant among all the ablation studies. A batch size of 6464 is marginally optimal from an overall perspective; however, optimal performance is not guaranteed under different data resolutions, pretraining dataset sizes, embedding dimensions, or layer compositions.

Table 5: Linear Evaluation Across Batch Size.
Batch Size Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
32 0.913(02) 0.962(02) 0.907(03) 0.970(02)
128 0.912(00) 0.964(02) 0.909(03) 0.970(03)
64 0.913(01) 0.964(02) 0.911(03) 0.969(04)
Time Range for Channel JEPA Training

Because ER-JEPA consists of two JEPA modules, it involves two distinct pretraining processes: one predicting target channels from a given context, and another predicting target time intervals from a given context. Because the pretraining of the channel JEPA is not restricted by the subsequent temporal pretraining, the range of the time interval utilized for channel pretraining can be freely selected. Table 6 compares the linear evaluation results of models trained with different time interval selections for channel pretraining. Specifically, a model with the channel JEPA pretrained exclusively over the context time interval of the temporal pretraining is compared against models pretrained over all available time intervals and over the target time interval of the temporal pretraining. The selected time range for channel pretraining affects the the overall scope of data utilized during the pretraining process.

Table 6: Linear Evaluation Across Training Time Interval.
Training Interval Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
Target Mask 0.913(02) 0.966(03) 0.906(01) 0.969(03)
Random Sampling 0.911(03) 0.967(00) 0.907(05) 0.971(03)
All 0.912(01) 0.966(02) 0.908(04) 0.970(05)
Context Mask 0.913(01) 0.964(02) 0.911(03) 0.969(04)
Embedding Dimension

Similar to the issues discussed regarding the batch size ablation and the sensitivity of hierarchical representation pretraining, a model with a larger embedding dimension of demb=768d_{\text{emb}}=768 may require a significantly different pretraining environment to achieve optimal performance. However, the ablation study demonstrates that a smaller embedding dimension (demb=384d_{\text{emb}}=384) outperforms the larger model within the current, controlled environment, a trend similarly observed in the JEPA proposed by Weimann and Conrad [34].

Table 7: Linear Evaluation by Embedding Dimension.
Embedding Dimension Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
768 0.908(04) 0.951(05) 0.894(04) 0.953(04)
384 0.913(01) 0.964(02) 0.911(03) 0.969(04)
Without Channel JEPA

As Table 8 indicates, pretraining solely with the temporal JEPA produced a negative effect on representation learning (see Section 5.2). By exhibiting definitively inferior performance compared to the complete model, this ablation provides strong empirical evidence for the structural necessity of the channel JEPA.

Large Loss and Dropout Layer

Within the current pretraining environment, repeated trials rarely produced significantly underperforming models (see Section 5.2). Table 8 presents the downstream results of these anomalous models, which are characterized by a loss value at Epoch 2 larger than 0.0080.008. Additionally, Table 8 highlights the notable performance decrease observed when the dropout layer is completely omitted from the architecture.

Table 8: Linear Evaluation Across Miscellaneous Ablations.
Ablations Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
No Dropout 0.908(01) 0.961(06) 0.903(02) 0.969(02)
No Channel 0.902(03) 0.959(06) 0.892(07) 0.965(06)
Large Loss 0.904(03) 0.953(12) 0.900(03) 0.954(10)
Normal 0.913(01) 0.964(02) 0.911(03) 0.969(04)

6.2 Fine-Tuning Across Ablations

In contrast to the linear evaluation, the performance across ablation studies on the fine-tuning downstream task did not exhibit significant deviation, although the default hyperparameters remained optimal by a minimal margin. Table 9 presents the average and standard deviation of the benchmark results grouped by broader categories. While most of the categories showed heavily saturated performance, the encoders trained without the channel JEPA noticeably and consistently deviated from the majority.

Table 9: Fine-Tuning Performance Across Ablation Studies. To summarize the results concisely, several minor variations are grouped into broader categories (excluding the default configuration): ‘Mask All’ encompasses all mask size and masking strategy ablations; ‘Interval All’ aggregates the variations in channel training intervals; and ‘Batch All’ includes all tested batch sizes.
Category Multi-Label Multi-Class
PTB-XL CPSC2018 PTB-XL CPSC2018
No Channel 0.931(01) 0.975(02) 0.936(03) 0.980(01)
Large Loss 0.934(00) 0.974(03) 0.943(01) 0.979(02)
No Drop Rate 0.936(01) 0.973(02) 0.941(5) 0.980(01)
demb=768d_{\text{emb}}=768 0.935(01) 0.974(01) 0.938(5) 0.978(00)
Mask All 0.935(01) 0.974(01) 0.943(02) 0.980(01)
Interval All 0.936(01) 0.974(01) 0.943(02) 0.980(01)
Batch All 0.936(01) 0.975(01) 0.942(03) 0.981(01)
Default 0.936(01) 0.974(01) 0.943(02) 0.981(01)

7 Conclusion

This study demonstrates the effectiveness of a lightweight framework utilizing hierarchical joint-representation learning on ECG data. Our empirical results reveal that, contrary to expectations regarding structural sensitivity, the concatenation of JEPAs proves robust against representation collapse. Furthermore, this dual-JEPA approach facilitates enhanced representation learning compared to an identical architecture relying on a single JEPA. By adopting a two-stage structure that encodes each multichannel time interval into a holistic embedding before processing them as a univariate time series, ER-JEPA achieves highly efficient performance characterized by reduced memory usage and rapid computational speed. Validated through extensive downstream assessments, the hierarchical structure of ER-JEPA demonstrates highly competitive performance across standard benchmarks, notably surpassing existing state-of-the-art models on the PTB-XL multi-class classification task with a macro AUC of 0.9430.943.

References

  • [1] M. Assran, Q. Duval, I. Misra, P. Bojanowski, P. Vincent, M. Rabbat, Y. LeCun, and N. Ballas (2023) Self-supervised learning from images with a joint-embedding predictive architecture. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15619–15629. Cited by: §1, §2.2, §3.2, §5.1, §5.1, §5.3.
  • [2] A. Baevski, W. Hsu, Q. Xu, A. Babu, J. Gu, and M. Auli (2022) Data2vec: a general framework for self-supervised learning in speech, vision and language. arXiv preprint arXiv:2202.03555. Cited by: §5.2.
  • [3] H. Bao, L. Dong, S. Piao, and F. Wei (2021) Beit: bert pre-training of image transformers. arXiv preprint arXiv:2106.08254. Cited by: §1.
  • [4] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton (2020) A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597–1607. Cited by: §1, §5.3.1.
  • [5] X. Chen and K. He (2020) Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566. Cited by: §5.2.
  • [6] J. Devlin, M. Chang, K. Lee, and K. Toutanova (2019) Bert: pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pp. 4171–4186. Cited by: §1.
  • [7] Y. Dong, J. Cordonnier, and A. Loukas (2021) Attention is not all you need: pure attention loses rank doubly exponentially with depth. In International conference on machine learning, pp. 2793–2803. Cited by: §5.5.3.
  • [8] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. (2020) An image is worth 16x16 words: transformers for image recognition at scale. arXiv preprint arXiv:2010.11929. Cited by: §2.1, §5.4.
  • [9] B. Gow, T. Pollard, L. A. Nathanson, A. Johnson, B. Moody, C. Fernandes, N. Greenbaum, J. W. Waks, P. Eslami, T. Carbonati, et al. (2023) MIMIC-iv-ecg: diagnostic electrocardiogram matched subset. Type: dataset. Cited by: item 3, item 3.
  • [10] J. Grill, F. Strub, F. Altché, C. Tallec, P. H. Richemond, E. Buchatskaya, C. Doersch, B. A. Pires, Z. D. Guo, M. G. Azar, et al. (2020) Bootstrap your own latent: a new approach to self-supervised learning. arXiv preprint arXiv:2006.07733. Cited by: §1, §5.2.
  • [11] D. Ha and J. Schmidhuber (2018) World models. arXiv preprint arXiv:1803.10122 2 (3), pp. 440. Cited by: §1.
  • [12] K. He, X. Chen, S. Xie, Y. Li, P. Dollár, and R. Girshick (2021) Masked autoencoders are scalable vision learners. arXiv:2111.06377. Cited by: §A.1, §1, §1, §2.2, §5.3.3.
  • [13] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick (2020) Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9729–9738. Cited by: §1.
  • [14] G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R. R. Salakhutdinov (2012) Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580. Cited by: §5.2.
  • [15] H. Huang, L. Lin, R. Tong, H. Hu, Q. Zhang, Y. Iwamoto, X. Han, Y. Chen, and J. Wu (2020) Unet 3+: a full-scale connected unet for medical image segmentation. In ICASSP 2020-2020 IEEE international conference on acoustics, speech and signal processing (ICASSP), pp. 1055–1059. Cited by: §5.5.2, §5.5.2.
  • [16] C. Joung, M. Kim, T. Paik, S. Kong, S. Oh, W. K. Jeon, J. Jeon, J. Hong, W. Kim, W. Kook, et al. (2024) Deep learning based ecg segmentation for delineation of diverse arrhythmias. PloS one 19 (6), pp. e0303178. Cited by: §5.5.1, §5.5.2, §5.5.2, §5.5.4.
  • [17] S. Kim (2027) Learning general representation of 12-lead ecg with a joint-embedding predictive architecture. Neural Networks 205, pp. 109334. External Links: ISSN 0893-6080, Document, Link Cited by: §1, §4, §5.3.1, §5.3, §5.4, Table 1, Table 2.
  • [18] Y. LeCun, S. Chopra, R. Hadsell, M. Ranzato, F. Huang, et al. (2006) A tutorial on energy-based learning. Predicting structured data 1 (0). Cited by: §2.2.
  • [19] Y. LeCun et al. (2022) A path towards autonomous machine intelligence version 0.9. 2, 2022-06-27. Open Review 62 (1), pp. 1–62. Cited by: §1, §1, §2.2, §2.3.
  • [20] D. Lee, J. Hur, J. Choi, J. Yu, and J. Kim (2026) Frequency-aware token reduction for efficient vision transformer. Advances in Neural Information Processing Systems 38, pp. 34058–34083. Cited by: §5.5.3.
  • [21] F. Liu, C. Liu, L. Zhao, X. Zhang, X. Wu, X. Xu, Y. Liu, C. Ma, S. Wei, Z. He, et al. (2018) An open access database for evaluating the algorithms of electrocardiogram rhythm and morphology abnormality detection. Journal of Medical Imaging and Health Informatics 8 (7), pp. 1368–1373. Cited by: 4th item, §4, §5.3, §5.3.
  • [22] I. Loshchilov and F. Hutter (2016) Sgdr: stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983. Cited by: §5.1.
  • [23] I. Loshchilov and F. Hutter (2017) Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101. Cited by: §5.1, §5.3.2, §5.3.3.
  • [24] K. McKeen, S. Masood, A. Toma, B. Rubin, and B. Wang (2025) Ecg-fm: an open electrocardiogram foundation model. Jamia Open 8 (5), pp. ooaf122. Cited by: §1, item 4, item 4, §5.3.1.
  • [25] Y. Na, M. Park, Y. Tae, and S. Joo (2024) Guiding masked representation learning to capture spatio-temporal relationship of electrocardiogram. arXiv preprint arXiv:2402.09450. Cited by: 4th item, §1, §5.3.1, §5.3.3, §5.3, §5.4, Table 1, Table 2.
  • [26] A. H. Ribeiro, G. Paixao, E. M. Lima, M. H. Ribeiro, M. M. Pinto Filho, P. R. Gomes, D. M. Oliveira, W. Meira Jr, T. B. Schon, and A. L. P. Ribeiro (2021) CODE-15%: a large scale annotated dataset of 12-lead ecgs. Zenodo, Jun 9, pp. 10–5281. Cited by: §5.1.
  • [27] A. L. P. Ribeiro, G. M. Paixao, P. R. Gomes, M. H. Ribeiro, A. H. Ribeiro, J. A. Canazart, D. M. Oliveira, M. P. Ferreira, E. M. Lima, J. L. de Moraes, et al. (2019) Tele-electrocardiography and bigdata: the code (clinical outcomes in digital electrocardiography) study. Journal of electrocardiology 57, pp. S75–S78. Cited by: §5.1.
  • [28] O. Ronneberger, P. Fischer, and T. Brox (2015) U-net: convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234–241. Cited by: §5.5.2.
  • [29] O. Siméoni, H. V. Vo, M. Seitzer, F. Baldassarre, M. Oquab, C. Jose, V. Khalidov, M. Szafraniec, S. Yi, M. ë. Ramamonjisoa, et al. (2025) Dinov3. arXiv preprint arXiv:2508.10104. Cited by: §5.5.3.
  • [30] M. S. Thaler (2021) The only ekg book you’ll ever need. Lippincott Williams & Wilkins. Cited by: §1, §3.1, §3.3, §5.5.1.
  • [31] Y. Tian, Z. Li, Y. Jin, M. Wang, X. Wei, L. Zhao, Y. Liu, J. Liu, and C. Liu (2024) Foundation model of ecg diagnosis: diagnostics and explanations of any form and rhythm on ecg. Cell Reports Medicine 5 (12). Cited by: §1, §5.3.1.
  • [32] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin (2017) Attention is all you need. Advances in neural information processing systems 30. Cited by: §A.1, §1, §2.1, §5.4.
  • [33] P. Wagner, N. Strodthoff, R. Bousseljot, D. Kreiseler, F. I. Lunze, W. Samek, and T. Schaeffter (2020) PTB-xl, a large publicly available electrocardiography dataset. Scientific data 7 (1), pp. 154. Cited by: 4th item, §4, §5.3, §5.3.
  • [34] K. Weimann and T. O. Conrad (2025) Self-supervised pre-training with joint-embedding predictive architecture boosts ecg classification performance. Computers in Biology and Medicine 196, pp. 110809. Cited by: §1, §4, §5.3.1, §5.3.3, §5.4, Table 1, Table 2, §6.1.
  • [35] Z. Xie, Z. Zhang, Y. Cao, Y. Lin, J. Bao, Z. Yao, Q. Dai, and H. Hu (2022) Simmim: a simple framework for masked image modeling. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9653–9663. Cited by: §1.
  • [36] J. Zheng, H. Guo, and H. Chu (2022) A large scale 12-lead electrocardiogram database for arrhythmia study (version 1.0. 0). PhysioNet 2022Available online httpphysionet orgcontentecg arrhythmia10 0accessed on 23, pp. 7. Cited by: §5.1.
  • [37] Z. Zhou, M. M. Rahman Siddiquee, N. Tajbakhsh, and J. Liang (2018) Unet++: a nested u-net architecture for medical image segmentation. In International workshop on deep learning in medical image analysis, pp. 3–11. Cited by: §5.5.2.

Appendix A Hyperparameters

In this appendix, we provide the detailed hyperparameters used for the pretraining, linear evaluation, and fine-tuning phases of the ER-JEPA model.

A.1 Model Architecture

The ER-JEPA architecture comprises a channel and a temporal module, each with a Vision Transformer (ViT) backbone. Most configurations are inherited from widely used baseline models, with a slight modification to the network depth, distributing 1212 layers evenly across the two encoders. Because the channel JEPA processes tokens indexed by (channel, interval), it utilizes 2D sinusoidal positional encoding [12]. Conversely, the temporal JEPA processes purely temporal tokens and utilizes standard 1D sinusoidal positional encoding [32]. After every attention layer and MLP, a dropout layer with a probability of 0.10.1 is applied.

Table 10: Architecture Hyperparameters.
Hyperparameter Value
Embedding Dimension (dembd_{\text{emb}}) 384384
Encoder Depth (Channel & Temporal) 66
Encoder Heads (Channel & Temporal) 1212
Predictor Embedding Dimension 192192
Predictor Depth (Channel & Temporal) 33
Predictor Heads (Channel & Temporal) 66
MLP Expansion Ratio ×\times44
Input Sampling Frequency 250 Hz250\text{\,}\mathrm{H}\mathrm{z}
Patch Size (pp) 5050
Positional Encoding (2D & 1D) Sinusoidal
Drop Path Rate (Between Layers) 0.10.1

A.2 Pretraining

Table 11 summarizes the configurations utilized during the ER-JEPA pretraining phase. Following standard practice, a weight decay of 0.050.05 was applied exclusively to multidimensional weight parameters, while biases and one-dimensional normalization parameters were excluded from weight decay. Data augmentations, including baseline wander, Gaussian noise, and powerline noise, were applied during pretraining.

Table 11: Pretraining Hyperparameters.
Hyperparameter Configuration
Epochs 300300
Batch Size 6464
Optimizer AdamW
Scheduler SGDR
Base Learning Rate 2×1042\text{\times}{10}^{-4}
Minimum Learning Rate 5×1055\text{\times}{10}^{-5}
Warmup Epochs 10 %10\text{\,}\mathrm{\char 37\relax}
SGDR Restarts 88
Weight Decay 0.050.05
Target EMA Momentum 0.9960.996 \rightarrow 1.01.0
Number of Context Channels 2244
Number of Target Channels 2233
Number of Channel Target Masks 22
Channel Sampling Weight I, II: 3, V1–V6: 1
Context Mask Size Range 1.41.43.6 s3.6\text{\,}\mathrm{s}
Target Mask Size Range 0.80.81.4 s1.4\text{\,}\mathrm{s}
Number of Temporal Target Masks 44
Masking Strategy Block
Channel Time Interval Temporal Context

A.3 Downstream Tasks

Table 12 details the hyperparameters used for the downstream linear evaluation and fine-tuning tasks on the PTB-XL and CPSC2018 datasets. The base evaluation procedure follows the methodology outlined in Section 5.3.1, incorporating additional data augmentations and filtering during the fine-tuning phase, as described in Section 5.3.3.

Table 12: Downstream Task Hyperparameters.
Hyperparameter Linear Evaluation Fine-Tuning
Epochs 7070 66
Batch Size 1616 1616
Scheduler Cosine Decay Cosine Decay with Warmup
Optimizer AdamW AdamW
Base Learning Rate 5×1035\text{\times}{10}^{-3} 1.8×1041.8\text{\times}{10}^{-4}
Minimum Learning Rate 0 0
Weight Decay 0.010.01 0.050.05