Background: Electrocardiograms are indispensable for diagnosing cardiovascular diseases, yet in many settings they exist only as paper printouts stored in multiple recording layouts. Converting these images into digital signals introduces two key challenges: temporal asynchrony among leads and partial blackout missing, where contiguous signal segments become entirely unavailable. Existing models cannot adequately handle these concurrent problems while maintaining interpretability. Methods: We propose PatchECG, combining an adaptive variable block count missing learning mechanism with a masked training strategy. The model segments each lead into fixed-length patches, discards entirely missing patches, and encodes the remainder via a pluggable patch encoder. A disordered patch attention mechanism with patch-level temporal and lead embeddings captures cross-lead and temporal dependencies without interpolation. PatchECG was trained on PTB-XL and evaluated under seven simulated layout conditions, with external validation on 400 real ECG images from Chaoyang Hospital across three clinical layouts. Results: PatchECG achieves an average AUROC of approximately 0.835 across all simulated layouts. On the Chaoyang cohort, the model attains an overall AUROC of 0.778 for atrial fibrillation detection, rising to 0.893 on the 12x1 subset -- surpassing the pre-trained baseline by 0.111 and 0.190, respectively. Model attention aligns with cardiologist annotations at a rate approaching inter-clinician agreement. Conclusions: PatchECG provides a robust, interpolation-free, and interpretable solution for arrhythmia detection from digitized ECG images across diverse layouts. Its direct modeling of asynchronous and partially missing signals, combined with clinically aligned attention, positions it as a practical tool for cardiac diagnostics from legacy ECG archives in real-world clinical environments.
翻译:背景:心电图对诊断心血管疾病不可或缺,但在许多场景中仅以纸质打印件形式存储,且包含多种记录布局。将这些图像转化为数字信号会引入两个关键挑战:导联之间的时间异步性和部分区域缺失(即连续信号段完全不可用)。现有模型在保持可解释性的同时,难以充分应对这些并发问题。方法:本文提出PatchECG,将自适应可变块数缺失学习机制与掩码训练策略相结合。该模型将每个导联分割为固定长度的块,丢弃完全缺失的块,并通过可插拔块编码器对剩余块进行编码。一种结合块级时间嵌入和导联嵌入的无序块注意力机制,无需插值即可捕捉跨导联和时间依赖关系。PatchECG在PTB-XL上训练,并在七种模拟布局条件下评估,同时利用朝阳医院来自三种临床布局的400张真实心电图图像进行外部验证。结果:PatchECG在所有模拟布局上平均AUROC约为0.835。在朝阳医院队列中,模型对房颤检测的整体AUROC达到0.778,在12x1子集上提升至0.893——分别比预训练基线高出0.111和0.190。模型注意力与心脏病专家标注的一致性接近临床专家间共识水平。结论:PatchECG为来自不同布局数字化心电图图像的房颤检测提供了鲁棒、无需插值且可解释的解决方案。其对异步和部分缺失信号的直接建模,结合临床对齐的注意力机制,使其成为在真实临床环境中从历史心电图档案进行心脏诊断的实用工具。