## 5 Conclusions  
Despite the widespread application of deep-learning-based diagnostic models for ECG rhythm classification, the challenge of individual variability of ECGs remains. This inter-variability leads to decreased performance when dealing with unseen patients in real-world scenarios. In this study, we addressed the performance-degradation issue encountered in the inter-patient scheme, particularly when using an n-BSM-based ECG rhythm classification. Given the significant variability of ECG signals across individuals, it is essential to minimize the impact of this variability on arrhythmia classification. To address this problem, we introduced the PI-BSM-based classification framework, which leverages adversarial learning to eliminate patient-specific characteristics during the training of the beat classifier used for PI-BSM generation. We conducted PI-BSM experiments in both single-database and cross-database scenarios within a patient-to-patient framework. Our framework demonstrated significant improvements in ECG rhythm classification compared to the original n-BSM approach. Notably, it showed enhanced performance in detecting abnormal rhythms, such as AFib, where cross-patient evaluations suffer from significant performance decline. For real-world medical applications, the patient's ECG signal (10 s or longer in length) needs to be recorded and converted into a PI-BSM image by a pre-trained beat classifier. This beat classifier can be pre-trained on any available large-scale ECG database with good-quality beat annotations. However, for more reliable results, additional processing, such as domain adaptation, may be required while training the beat classifier. With a good pre-trained beat classifier, our method can easily generate PI-BSM from the provided ECG signal and use it for rhythm classification. No additional online training process is required. Nevertheless, there is still room for further improvement in classification performance, especially in cross-database scenarios. Future research will focus on exploring domain adaptation techniques for the beat classifier to enhance performance in classifying arrhythmia using PI-BSM across different databases. Conceptualization, Y.J. ; methodology, M.S. ; formal analysis, Y.J. ; investigation, J.L. ; data curation, Y.J. and J.L. ; writing--original draft preparation, Y.J. ; writing--review and editing, M.S. and J.L. ; visualization, Y.J. ; supervision, M.S. ; project administration, M.S. ; funding acquisition, M.S. All authors have read and agreed to the published version of the manuscript. This work was mainly supported by the Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (2022R11A3054343). Also, this work was partly supported by the Commercialization Promotion Agency for R&D Outcomes (COMPA) grant funded by the Korean Government (Ministry of Science and ICT) (RS-2023-00304695). Not applicable. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Authors** & **Database** & \begin{tabular}{c} **No. of** \\ **Classes** \\ \end{tabular} & **Method** & **Evaluation** & **Lead** & **F1-Score** & **Accuracy** \\ \hline [PERSON] et al. (2021) & SPH & 4 & \
\begin{tabular}{c} Hybrid \\ DNN \\ \end{tabular} & Intra-patient & 1 & 97.7 & 98.0 \\ [PERSON] et al. (2021) & SPH & 4 & MLP & Unknown & 1 & 89.5 & 90.7 \\ [PERSON] et al. (2021) & MII-BIH, & 3 & MLP & Unknown & 1 & 60.3 & 68.0 \\ [PERSON] et al. (2023) & NFH, & 4 & ST-ReGE & Inter-patient & 12 & 88.0 & 89.7 \\ [PERSON] et al. (2024) & MII-BIH, & 4 & SE-ResNet & Inter-patient & 1 & 83.2 & 86.3 \\ Proposed Method &
\begin{tabular}{c} MII-BIH, \\ SPH \\ \end{tabular} & 4 & SE-ResNet & Inter-patient & 1 & 87.4 & 88.7 \\ \hline \hline \end{tabular}
\end{table}