Hierarchical Self-Supervised Representation Learning Framework for Multivariate Time Series Grounded in ECG Analysis
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 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 and 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 input tokens with an embedding dimension of , we define the query (), key (), and value () matrices in as learnable linear transformations of the input tokens. Written in matrix form, the output is:
where each output row can be interpreted as a linear combination of value vectors weighted by their mutual correlations:
Here, are the rows of the matrices, respectively, and the attention weight is derived from the scaled dot-product such that .
Notation.
We refer to the input tokens processed within a single attention operation as a sequence, and the number of input tokens as the sequence length. With a slight abuse of notation, we denote the attention operation over a token sequence indexed by as:
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 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 .
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)).
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).
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 tokens to the sequence for a -channel time series, resulting in a total sequence length of . Because the time and memory complexity of the standard self-attention algorithm scales quadratically with the sequence length , this -fold increase renders rapid analysis computationally infeasible. Conversely, fusing multichannel information during the preprocessing step circumvents this quadratic bottleneck, as the embedding dimension 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.
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
as an input, the objective of the event reconstruction module is to construct a unified representation for each time interval:
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:
Subsequently, an aggregation layer, such as average pooling, summarizes these concurrent representations into a single, unified representation for that specific interval:
Event Analysis
With the constructed representations , 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 are transformed into a contextually refined embedding of the corresponding time interval:
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):
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:
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 to just , shifting the factor of 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:
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 ; and by fixing the sampling rate for a -second recording, the length of the time series is set to . Formally, the input ECG is represented as a matrix with entries .
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 and a fixed patch length , a single patch corresponds to the -th non-overlapping temporal segment of the -th channel, formally denoted as
Consequently, analogous to the image domain, a 1D convolutional layer with both the kernel size and stride set to , a single input channel, and an output channel equal to the embedding dimension yields the tokenized patch from the time interval .
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.
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 recordings, and the CODE-15 dataset [26], comprising 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 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 -second recordings reduces the number of usable recordings to for the CODE-15 dataset. Additionally, recordings containing NaN values or missing leads were removed, yielding a total pretraining dataset of recordings ( from the Shaoxing dataset and from the CODE-15 dataset). All recordings were resampled to . 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 epochs with a batch size of . The AdamW optimizer [23] was utilized, adjusted by a Stochastic Gradient Descent with Warm Restarts (SGDR) scheduler [22], featuring a base learning rate of , a minimum learning rate of , eight restarts, and warmup epochs. The target encoder was updated via an exponential moving average with a linearly increasing momentum value from to , following the configuration of I-JEPA [1]. Training on a workstation equipped with an NVIDIA GeForce RTX 3090 GPU ( VRAM) takes approximately hours and requires of VRAM, or hours and 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.
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 , 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 of the trials exhibited significant deviations in the minimum loss value, observable in both the channel and temporal loss.
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 -second -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 clinical -second -lead ECG recordings collected from patients. The annotations, provided by two cardiologists, cover 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 diagnostic statements, aggregated into subclasses and 5 coarser superclasses.
CPSC 2018
The China Physiological Signal Challenge (CPSC) 2018 dataset [21] comprises a collection of ECG recordings donated by hospitals for the 2018 competition. The dataset features eight arrhythmia classes across -lead ECG recordings for training and 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 through were used as the training set, while fold and fold served as the validation and test sets, respectively.
For CPSC2018, all 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 batches, with 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 , sampling rate) and utilizes a vastly different data-intensive pretraining regime (sampling recordings from public datasets, batch size , training for up to K epochs, with downstream evaluations starting from a minimum of K 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 epochs using a decreasing learning rate starting from , a batch size of , and the AdamW optimizer [23].
| Model | Pretrain Dataset | Records | Multi-Label | Multi-Class | Source | ||
| PTB-XL | CPSC2018 | PTB-XL | CPSC2018 | ||||
| MoCo v3 | CS + CODE-15 | - | - | 0.739 | 0.712 | [25] | |
| MTAE | - | - | 0.807 | 0.818 | |||
| MLAE | - | - | 0.779 | 0.794 | |||
| ST-MEM | CS + CODE-15 | 0.882 | 0.955 | 0.879 | 0.964 | [17] | |
| SimCLR | 0.875 | 0.915 | 0.830 | 0.925 | |||
| ECG-FM | UHN-ECG4 | 0.878 | 0.916 | 0.856 | 0.931 | ||
| KED | MIMIC-IV-ECG | 0.885 | 0.883 | 0.888 | 0.906 | ||
| ECG-JEPA | CS + CODE-15 | 0.912 | 0.966 | 0.903 | 0.973 | ||
| JEPA1 | datasets3 | - | - | 0.928(03) | - | [34] | |
| JEPA1 | MIMIC-IV-ECG | - | - | 0.920(02) | 0.976(01) | ||
| 1D-JEPA2 | CS + CODE-15 | 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) | |||
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 .
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 epochs using a decreasing learning rate with cosine decay and linear warmup [12] based on a learning rate of , a batch size of , 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].
| Model | Pretrain Dataset | Records | Multi-Label | Multi-Class | Source | ||
| PTB-XL | CPSC2018 | PTB-XL | CPSC2018 | ||||
| MoCo v3 | CS + CODE-15 | - | - | 0.913 | 0.967 | [25] | |
| MTAE | - | - | 0.910 | 0.961 | |||
| MLAE | - | - | 0.915 | 0.973 | |||
| ST-MEM | CS + CODE-15 | 0.929 | 0.973 | 0.910 | 0.977 | [17] | |
| SimCLR | 0.918 | 0.936 | 0.928 | 0.955 | |||
| ECG-FM | UHN-ECG4 | 0.899 | 0.922 | 0.895 | 0.947 | ||
| KED | MIMIC-IV-ECG | 0.901 | 0.891 | 0.906 | 0.923 | ||
| ECG-JEPA | CS + CODE-15 | 0.931 | 0.973 | 0.928 | 0.976 | ||
| JEPA1 | datasets3 | - | - | 0.935(02) | - | [34] | |
| JEPA1 | MIMIC-IV-ECG | - | - | 0.928(02) | 0.983(00) | ||
| 1D-JEPA2 | CS + CODE-15 | 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) | |||
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 – 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 and an encoder depth of are prevalent baseline choices. ER-JEPA also follows this general convention, utilizing an embedding dimension of , 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, with depths , 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 , at the expense of increasing the effective batch size by a factor of . However, in the current implementation ( and ), this increase in effective batch size dominates the computational cost over the reduced sequence length, despite the 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.
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 . 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 ( data with a smaller patch size of ).
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 speedup under benchmark conditions, and maintains a maximum speedup even under the unified embedding dimension of .
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 , memory usage is similar for a unit batch size, but the baseline multichannel encoders scale to consume between and 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 increase in operation time and 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 ( 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 was utilized as a single batch of recordings. This was partitioned into a shape of , or for the 1D-JEPA, using a unified patch size of . For the ViT-1D-S-F model, which operates on a different data resolution, an input tensor of shape was used with a patch size of , yielding an initial patch tensor of shape . The latency per batch was averaged over 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 for small batch sizes (under four), while the majority remained well below .
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 , 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 second-degree AV block samples and third-degree AV block samples in the Shaoxing dataset were manually annotated. Approximately recordings, including 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.
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.
| 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 – outperformed a larger mask scheme sampled from the range of –. However, the broader range of –, which encompasses both, proved optimal by preventing the model from overfitting to a fixed trend in size sampling.
| 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 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.
| 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.
| 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 may require a significantly different pretraining environment to achieve optimal performance. However, the ablation study demonstrates that a smaller embedding dimension () outperforms the larger model within the current, controlled environment, a trend similarly observed in the JEPA proposed by Weimann and Conrad [34].
| 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 . Additionally, Table 8 highlights the notable performance decrease observed when the dropout layer is completely omitted from the architecture.
| 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.
| 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) |
| 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 .
References
- [1] (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] (2022) Data2vec: a general framework for self-supervised learning in speech, vision and language. arXiv preprint arXiv:2202.03555. Cited by: §5.2.
- [3] (2021) Beit: bert pre-training of image transformers. arXiv preprint arXiv:2106.08254. Cited by: §1.
- [4] (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] (2020) Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566. Cited by: §5.2.
- [6] (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] (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] (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] (2023) MIMIC-iv-ecg: diagnostic electrocardiogram matched subset. Type: dataset. Cited by: item 3, item 3.
- [10] (2020) Bootstrap your own latent: a new approach to self-supervised learning. arXiv preprint arXiv:2006.07733. Cited by: §1, §5.2.
- [11] (2018) World models. arXiv preprint arXiv:1803.10122 2 (3), pp. 440. Cited by: §1.
- [12] (2021) Masked autoencoders are scalable vision learners. arXiv:2111.06377. Cited by: §A.1, §1, §1, §2.2, §5.3.3.
- [13] (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] (2012) Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580. Cited by: §5.2.
- [15] (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] (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] (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] (2006) A tutorial on energy-based learning. Predicting structured data 1 (0). Cited by: §2.2.
- [19] (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] (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] (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] (2016) Sgdr: stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983. Cited by: §5.1.
- [23] (2017) Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101. Cited by: §5.1, §5.3.2, §5.3.3.
- [24] (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] (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] (2021) CODE-15%: a large scale annotated dataset of 12-lead ecgs. Zenodo, Jun 9, pp. 10–5281. Cited by: §5.1.
- [27] (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] (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] (2025) Dinov3. arXiv preprint arXiv:2508.10104. Cited by: §5.5.3.
- [30] (2021) The only ekg book you’ll ever need. Lippincott Williams & Wilkins. Cited by: §1, §3.1, §3.3, §5.5.1.
- [31] (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] (2017) Attention is all you need. Advances in neural information processing systems 30. Cited by: §A.1, §1, §2.1, §5.4.
- [33] (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] (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] (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] (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] (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 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 is applied.
| Hyperparameter | Value |
| Embedding Dimension () | |
| Encoder Depth (Channel & Temporal) | |
| Encoder Heads (Channel & Temporal) | |
| Predictor Embedding Dimension | |
| Predictor Depth (Channel & Temporal) | |
| Predictor Heads (Channel & Temporal) | |
| MLP Expansion Ratio | |
| Input Sampling Frequency | |
| Patch Size () | |
| Positional Encoding (2D & 1D) | Sinusoidal |
| Drop Path Rate (Between Layers) |
A.2 Pretraining
Table 11 summarizes the configurations utilized during the ER-JEPA pretraining phase. Following standard practice, a weight decay of 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.
| Hyperparameter | Configuration |
|---|---|
| Epochs | |
| Batch Size | |
| Optimizer | AdamW |
| Scheduler | SGDR |
| Base Learning Rate | |
| Minimum Learning Rate | |
| Warmup Epochs | |
| SGDR Restarts | |
| Weight Decay | |
| Target EMA Momentum | |
| Number of Context Channels | – |
| Number of Target Channels | – |
| Number of Channel Target Masks | |
| Channel Sampling Weight | I, II: 3, V1–V6: 1 |
| Context Mask Size Range | – |
| Target Mask Size Range | – |
| Number of Temporal Target Masks | |
| 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.
| Hyperparameter | Linear Evaluation | Fine-Tuning |
|---|---|---|
| Epochs | ||
| Batch Size | ||
| Scheduler | Cosine Decay | Cosine Decay with Warmup |
| Optimizer | AdamW | AdamW |
| Base Learning Rate | ||
| Minimum Learning Rate | ||
| Weight Decay |