Electrocardiographic imaging (ECGI) provides high-resolution epicardial potential maps, but requires, among other challenges, precise localisation of numerous body-surface electrodes, thus limiting its clinical adoption. As an intermediate step toward not requiring electrode locations as input to ECGI, we investigate whether electrode location information can be inferred directly from ECG signals. Specifically, we consider the standard 12-lead ECG setting, where well-established lead identity serves as a discrete proxy for electrode position.
We propose a permutation-equivariant, input-size agnostic deep learning architecture that assigns lead labels to unordered ECG waveforms. The model combines a multi-branch one-dimensional convolutional neural network to capture multi-scale morphology, a gated recurrent unit with attention for temporal dependencies, and set attention blocks to model inter-lead relationships. The model is trained and evaluated on 21,799 recordings from the PTB-XL dataset using patient-wise splits.
The proposed approach achieves a lead-level accuracy of 98.5% (95% CI: 98.2–98.7) and a lead set accuracy of 91.7% (95% CI: 90.4–92.8) on the test set. Performance remains robust across diagnostic categories, exceeding 97% accuracy for myocardial infarction and conduction disturbances. In contrast, models without inter-lead context perform substantially worse (75.8% lead-level accuracy), demonstrating the importance of inter-lead interactions. Principal component analysis of learned embeddings reveals structured organisation aligned with the standard ECG viewing planes.
These results show that accurate ECG lead identification is possible from waveform data alone, without explicit electrode localisation. Attention-based modelling of inter-lead relationships is critical and yields physiologically meaningful representations. This work supports the feasibility of signal-driven electrode localisation and represents a key step toward practical, imageless ECGI systems.