UniECG: Unified Multilead ECG Representation
- UniECG is a unifying research label that develops both a lead-agnostic latent representation and a unified model for ECG interpretation and generation.
- The lead-agnostic approach uses per-lead Masked Autoencoders with synchronized alignment and reconstruction to generate modality-invariant embeddings.
- The unified model blends evidence-based ECG-to-text reasoning with text-conditioned ECG generation, enabling multi-task, multimodal ECG analysis.
UniECG is a research label applied to two related but distinct efforts to unify electrocardiography: a lead-agnostic latent representation for multi-lead ECG obtained through simultaneous alignment and reconstruction, and a later unified model that combines evidence-based ECG interpretation with text-conditioned ECG generation in a single system (Ibtehaz et al., 2024, Jin et al., 23 Sep 2025). In both usages, the unifying objective is to reduce dependence on a fixed lead configuration, a fixed modality interface, or a single downstream task. One line of work treats the 12 leads as multiple views of the same underlying cardiac state and learns embeddings that generalize across leads; the other line of work treats ECG understanding and ECG synthesis as jointly addressable capabilities within one multimodal model.
1. Nomenclature and conceptual scope
In current arXiv usage, the name “UniECG” denotes more than one technical construction rather than a single canonical architecture. The two principal usages differ in task definition, training data, and operational semantics, but both are organized around unification.
| Usage of “UniECG” | Core objective | Representative mechanism |
|---|---|---|
| Lead-agnostic UniECG | Channel-agnostic ECG representation from multi-lead recordings | Per-lead MAEs with simultaneous alignment and reconstruction |
| Unified-model UniECG | ECG understanding and text-conditioned ECG generation in one model | Two-stage training with LLM fine-tuning and latent alignment to DiffuSETS |
The first usage emerges from “modally reduced representation learning,” where each lead is modeled as a projection of a latent heart state and embeddings from different leads of the same heart are aligned while remaining reconstructive (Ibtehaz et al., 2024). The second usage appears in the paper titled “UniECG: Understanding and Generating ECG in One Unified Model,” where an LLM is first trained for grounded ECG-to-text interpretation and then augmented with text-to-ECG generation through latent alignment of special [ECG] tokens to a frozen diffusion-based ECG generator (Jin et al., 23 Sep 2025).
A common misconception is to treat these two systems as successive versions of the same architecture. The available descriptions instead indicate two separate research programs that share a unification motif: one is centered on cross-lead latent invariance for physiological signals, while the other is centered on multimodal reasoning and controllable synthesis.
2. Lead-agnostic UniECG as modally reduced representation learning
The lead-agnostic formulation begins from the observation that multi-lead ECG systems provide complementary but redundant projections of the same cardiac process, whereas wearables often provide only one or two leads. The method therefore treats each lead as a modality of a single underlying source, with synchronized recordings written as
where each channel is a projection of cardiac state (Ibtehaz et al., 2024).
To operationalize this view, the model learns per-lead encoder–decoder pairs such that
Each lead has an independent Masked Autoencoder built from a 1-D MAE with ViT blocks. Inputs are 5-second windows at $500$ Hz, partitioned into non-overlapping 100-sample patches, corresponding to $0.2$ seconds per patch, using a 1D convolutional patch embedder with stride equal to patch length. Temporal identity is encoded with sine–cosine positional embeddings. The encoder uses 12 ViT layers with embed_dim = 768, num_heads = 8, MLP ratio = 4, qkv_bias = True, and LayerNorm. The decoder uses 8 ViT layers with embed_dim = 512, num_heads = 16, MLP ratio = 4, qkv_bias = True, and LayerNorm. Weights are not shared across leads.
The learning objective combines reconstruction with cross-lead alignment. The reconstruction term is
Alignment is enforced with a triplet loss in which the anchor and positive are embeddings from different leads of the same synchronized recording, while the negative comes from a different recording:
The total objective is curriculum-weighted by epoch index :
with
0
This schedule emphasizes reconstruction early and alignment later. The stated rationale is to avoid trivial solutions in which embeddings become highly aligned but insufficiently informative for reconstruction.
An important architectural point is that latent unification is semantic rather than parametric. There is no shared encoder across leads, and no cross-reconstruction term of the form 1 during training. Cross-lead reconstruction is evaluated only at test time. This design preserves lead-specific information while still encouraging a shared latent geometry.
3. Training regime, empirical behavior, and wearable deployment
Pretraining for the lead-agnostic UniECG used the PhysioNet/Computing in Cardiology Challenge 2021 collection, comprising 88,000 public recordings from 6 sources, restricted to recordings at 500 Hz. Training employed random 5-second window crops, mean normalization, MAE-style masked reconstruction, AdamW with base learning rate 2, cosine learning rate scheduling, 200 epochs, and batch size 256. Each lead’s MAE was trained independently, while a coordinator exchanged per-lead embeddings within a minibatch to form triplets for the alignment loss (Ibtehaz et al., 2024).
Evaluation was performed on several external datasets. PTB and INCART were used for correlation analysis, with 590 signals combined, random 5-second crops, and repetition 10 times per channel pair. A subset of the Ribeiro et al. dataset, containing 827 recordings at 400 Hz, was used for reconstruction analysis with 2-second examples and 75% masking. ECG-ID was used to test whether the learned representation encoded individual-specific ECG signatures.
The reported behavior of the embeddings is central to the method’s interpretation. Cosine similarity between embeddings across lead pairs was high even when the raw signals themselves were only weakly correlated; the paper highlights pairs such as V5–aVR as examples. For already correlated pairs, such as V1–V2, the embedding space retained or improved correlation. This indicates that the alignment objective does not merely mirror raw inter-lead similarity.
Reconstruction results were described as morphology-preserving but amplitude-attenuated, with reduced R-peak magnitude attributed to the known tendency of MAEs to produce smoother, “blurry” outputs. When each lead was reconstructed from embeddings originating in different input leads, the mean absolute error per lead stayed within 3 of the loss obtained from the native lead’s own embedding. A notable exception was V1 in the reported dataset, where reconstruction from its own embedding underperformed relative to some cross-lead inputs; this was attributed to distribution mismatch with pretraining data.
For downstream myocardial infarction diagnosis on PTB under 5-fold cross-validation, logistic regression classifiers trained on aligned embeddings improved F1 scores across all leads relative to baseline per-lead MAEs without alignment, especially for less informative leads such as I and aVL, while retaining performance for informative leads such as V5 and V6. For biometric authentication on ECG-ID, a 1-NN classifier on the class token embedding achieved 99.68% accuracy under 10-fold cross-validation without finetuning.
These results motivate the wearable deployment scenario explicitly described for UniECG. A single-lead device can run only its dedicated encoder 4 to obtain an embedding 5 in a lead-agnostic latent space. That embedding can be used directly by downstream classifiers or, if approximate multi-lead signals are needed, passed to per-lead decoders 6 on-server or off-device. The practical caveat is that reconstructions may be morphology-faithful but amplitude-attenuated.
4. UniECG as a unified model for understanding and generating ECG
The later UniECG formulation addresses a different problem. It starts from the claim that recent unified multimodal models often fail both to interpret ECGs correctly and to generate clinically meaningful raw ECG signals. The proposed solution is a decoupled two-stage system that first learns evidence-based ECG interpretation and then adds text-conditioned ECG generation by aligning LLM latents to a frozen ECG diffusion model (Jin et al., 23 Sep 2025).
In Stage 1, the model performs ECG-to-Text reasoning. Inputs may include ECG signals 7, ECG images 8, and text caption tokens 9. Modality-specific backbones produce signal embeddings 0 and visual embeddings 1, which are linearly projected into the LLM input space by 2 and 3. The LLM is then fine-tuned end-to-end with the autoregressive loss
4
The supervision source is ECG-Grounding, described as approximately 30,000 instruction–response pairs derived from MIMIC-IV-ECG and annotated with heartbeat-level features such as QRS, PR, QTc, and ST.
Stage 2 adds Text-to-ECG generation without retraining the diffusion backend. UniECG extends the vocabulary with special tokens [ECG1], \ldots, [ECGn]. The LLM parameters are frozen; only the input embeddings of the new ECG tokens are updated while the model learns to emit them using
5
The final-layer hidden states of the emitted ECG tokens are then mapped by an encoder–decoder Transformer 6 with learnable queries 7 into the text-embedding space of DiffuSETS’ frozen text encoder 8:
9
The combined generation objective is
0
This construction makes the model “unified” in the sense that the same LLM can answer interpretation queries or generate ECGs depending on prompt intent and modality. If the input includes ECG data or asks for interpretation, the model produces evidence-based text. If the prompt asks to generate an ECG, the model emits [ECG] tokens, passes their hidden states through the mapper, and uses the DiffuSETS decoder for signal synthesis. The paper does not specify a formal gating classifier or threshold-based routing rule.
5. Data, evaluation, and empirical profile of the unified-model UniECG
Training data for the unified-model UniECG include MIMIC-IV-ECG, reported as 800,035 ECG recordings from 161,352 subjects at 500 Hz and 10 seconds, together with ECG-Grounding for grounded interpretation (Jin et al., 23 Sep 2025). The generation stage uses textual reports converted into prompts of the form “Generate an ECG of …” paired with answers of the form “This is an ECG of …”, after which the [ECG] tokens are appended.
Understanding performance is reported on a grounded ECG interpretation benchmark scored by DeepSeek V3.1. Relative to PULSE and GEM, UniECG occupies an intermediate position. On “Grounded ECG Understanding (Part 1),” its scores were: Diagnosis Accuracy 66.80, Analysis Completeness 3.94, Analysis Relevance 5.62, Lead Assessment Coverage 34.12, and Lead Assessment Accuracy 14.45. On “Grounded ECG Understanding (Part 2),” its scores were: ECG Feature Grounding 69.44, Evidence-Based Reasoning 61.76, Clinical Diagnostic Fidelity 60.74, and Average 63.98. The paper states that UniECG improves markedly over PULSE on evidence-grounded metrics, but is slightly lower than GEM after Stage 2 because of some knowledge forgetting associated with fine-tuning the input embeddings for [ECG] tokens.
Generation evaluation is qualitative rather than quantitative. The examples include prompts for atrial fibrillation with irregular R–R intervals and absent P waves, and prompts that control heart rate and demographic attributes such as sex and age. The output is a multi-lead time series synthesized by the DiffuSETS decoder. However, the paper explicitly does not report quantitative generation metrics such as RMSE, DTW, spectral measures, FID, MMD, or clinician ratings. This omission is significant: it means the generative side of UniECG is established primarily by example and architecture rather than by a formal signal-fidelity benchmark.
The interpretive side is likewise evidence-oriented in training but not paired with a formal rationale-localization metric. The paper shows evidence-highlighted text and lead-wise reasoning examples, yet it does not provide an attention-based rationale mechanism, saliency maps, or quantitative localization scores. A plausible implication is that “evidence-based” in this context refers chiefly to the supervision source and output style rather than to a separately verified explanation module.
6. Relation to adjacent paradigms, misconceptions, and limitations
UniECG belongs to a broader family of attempts to overcome the mismatch between clinical ECG practice and the constraints of single-lead devices or generic multimodal models. One antecedent is the subject-specific synthesis pipeline of “Simultaneous 12-Lead Electrocardiogram Synthesis using a Single-Lead ECG Signal: Application to Handheld ECG Devices,” which uses 60 seconds of a subject’s historical synchronous 12-lead ECG, dynamic time warping for morphology selection, and random-forest prediction of inter-lead lag 1 to synthesize the remaining 11 leads from a current single lead (Afrin et al., 2018). That work reports average 2 for PTB healthy, 3 for PTB MI, and 4 for TWA, and emphasizes VCG axis correctness after lag correction. Its strategy differs sharply from lead-agnostic UniECG: it is personalized, beat-wise, and synthesis-centric rather than representation-centric.
Another adjacent line is “ECG-aBcDe: Overcoming Model Dependence, Encoding ECG into a Universal Language for Any LLM,” which converts ECGs into an alternating token grammar of lowercase amplitude bins and uppercase interval bins, enabling direct LLM fine-tuning without architectural modification (Xia et al., 16 Sep 2025). That method addresses time-scale representation and interpretability through a bidirectionally decodable ECG language, and reports BLEU-4 scores of 42.58 in-dataset and 30.76 cross-dataset in the abstract. It is therefore related to the unified-model UniECG in its ambition to integrate ECG with LLMs, but it is encoder-free and language-mediated rather than latent-aligned to an external diffusion generator.
Several limitations recur across the UniECG literature. In the lead-agnostic representation setting, residual lead-specific bias remains because encoders and decoders are per-lead and there is no cross-reconstruction constraint during training; reconstruction is smoother and peak-attenuated; and domain shifts, including unusual V1 morphology, sampling-rate changes, and device differences, can impair fidelity. In the unified-model setting, encoder backbones, exact dimensionalities, training hyperparameters, and compute configuration are not specified; generation lacks quantitative fidelity metrics; domain shift and device variability are not evaluated; and synthesized ECGs are stated not to be suitable for clinical decisions without validation.
Taken together, these limitations clarify what UniECG does and does not denote. It does denote an attempt to unify ECG information across leads, tasks, or modalities. It does not denote a finalized standard for universal ECG reasoning or clinically validated single-lead replacement of synchronous 12-lead acquisition. The term instead marks an active research area whose central technical question is how much of the clinically relevant structure of ECG can be preserved when representation, interpretation, and generation are forced into a shared space.