BackgroundPacing artifacts must be excluded from the analysis of paced ECG waveform. This study aimed to develop and validate an algorithm to identify and remove the pacing artifacts on ECG.MethodsWe developed a semi-automatic algorithm that identifies the onset and offset of a pacing artifact based on the ECG signal’ slope steepness and designed a graphical user interface that permits quality control and fine-tuning the constraining threshold values. We used 1,054 ECGs from the retrospective, multicenter cohort study “Global Electrical Heterogeneity and Clinical Outcomes,” including 3,825 atrial and 10,031 ventricular pacing artifacts for the algorithm development and 22 ECGs including 108 atrial and 241 ventricular pacing artifacts for validation. Validation was performed per digital sample. We used the kappa-statistic of interrater agreement between manually labeled sample (ground-truth) and automated detection.ResultsThe constraining parameter values were for onset threshold 13.06±6.21 μV/ms, offset threshold 34.77±17.80 μV/ms, and maximum window size 27.23 ± 3.53 ms. The automated algorithm detected a digital sample belonging to pacing artifact with a sensitivity of 74.5% and specificity of 99.6% and classified correctly 98.8% of digital samples (ROC AUC 0.871; 95%CI 0.853-0.878). The kappa-statistic was 0.785, indicating substantial agreement. The agreement was on 98.81% digital samples, significantly (P<0.00001) larger than the random agreement on 94.43% of digital samples.ConclusionsThe semi-automated algorithm can detect and remove ECG pacing artifacts with high accuracy and provide a user-friendly interface for quality control.HighlightsWe developed and validated a semi-automated algorithm to detect and remove pacing spike artifacts from a digital ECG signal.The semi-automated algorithm can detect and remove pacing spike artifacts with high accuracy and provide a user-friendly interface for quality control.