## 3 Materials and Methods
### Datasets  
We employed three arrhythmia datasets: MITDB, SPH, and PTB-XL. These datasets were chosen to encompass a range of annotation granularities and diverse patient populations. Table 1 provides a structured overview of these datasets.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Dataset** & **Duration** & **Sampling Rate** & **Lead Used** & **Label Types** & **Used For** & \begin{tabular}{c} **Number of** \\ **Records** \\ \end{tabular} \\ \hline MITDB & 30 min & 360 Hz & Lead II & Fifteen beat-level types & Pretraining & 48 \\ \hline SPH & 10 s & 500\(\rightarrow\)360 Hz & Lead II & \begin{tabular}{c} Record-level: nine beat \\ types, four rhythms \\ \end{tabular} & \begin{tabular}{c} Fine-tuning/ \\ evaluation \\ \end{tabular} & 10,696 \\ \hline PTB- & 10 s & 500\(\rightarrow\)360 Hz & Lead II & \
\begin{tabular}{c} Record-level: five beat \\ types, two rhythms \\ \end{tabular} &
\begin{tabular}{c} Fine-tuning/ \\ evaluation \\ \end{tabular} & 18,296 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of the datasets used in this study. See Appendix A Table A1 for full beat-label definitions.  
Figure 1: Overview of the DA-BSM-based ECG arrhythmia classification framework.  
positions, along with rhythm labels that include specific onset times. These detailed annotations provide the granularity required for training the beat-type classifier and evaluating its effectiveness on fine-grained data.  
**Shoaxing People's Hospital (SPH) Arrhythmia Database**[33]: This database includes 10-s ECG recordings from 10,696 patients, sampled at 500 Hz using a 12-lead setup. This dataset was resampled to 360 Hz for consistency with the MITDB and PTB-XL dataset. For this study, only Lead II was used to ensure consistency in analysis while retaining sufficient information for classification. The annotations consist of 11 rhythm classes and nine specific beat types at the record level, making it ideal for testing the DA-BSM's adaptability to coarse-grained annotations. The rhythms were grouped into four primary categories: SB, AFIB, the SR, and GSVT. These categories were selected for their clinical relevance and representation of diverse arrhythmia rhythm types. Table 2 provides the sample distribution across these categories.  
**Physikalisch-Technische Bundesanstalt-XL (PTB-XL)**[35]: This database provides over 21,000 ECG recordings from approximately 18,000 patients, each 10 s long and recorded at 500 Hz. Record-level annotations include diagnostic labels for rhythm types and beat types. For consistency in analysis, only Lead II recordings were utilized in this study. Among the annotated rhythm types, we specifically focused on the sinus rhythm (SR) and atrial fibrillation (AFIB), as they are the most prevalent clinically significant arrhythmias and are widely studied in ECG arrhythmia research, and their reliable discrimination serves as an essential baseline for evaluating classification performance and clinical applicability. Table 3 presents the sample distribution for these rhythm types. This setup is designed to assess the effectiveness of ECG signal classification, even when coarse-grained annotations are used.