## 4 Results and Discussion
### Experiment 2: Evaluation of the Proposed Method on Cross-Database
#### 4.3.1 Effect of Patient Loss (\(L_{patient}\)) on PI-BSM Generation  
In this section, we conducted experiments to analyze the impact of patient loss (\(L_{patient}\)), described in Equation (3), on PI-BSM generation. In this equation, the hyperparameter \(\lambda_{2}\) serves to control the degree to which patient loss is reflected in the PI-beat-classifier training, with \(\lambda_{1}\) being fixed at one. Increasing the value of \(\lambda_{2}\) results in less learning of patient-specific features, thereby increasing the patient invariance of the model. On the other hand, decreasing the value of \(\lambda_{2}\) enlarges learning about patient-specific features and reduces patient invariance in the model.  
Figure 7 depicts PI-BSM images of four different rhythm samples generated using different \(\lambda_{2}\) values of 0.01, 0.075, and 0.5, where (a), (b), (c), and (d) represent the AFib, GSVT, SB, and SR rhythms, respectively. This illustrates that the value of \(\lambda_{2}\) highly influences the pattern of PI-BSM. When \(\lambda_{2}\) is set to 0.5, the image appears blurry, making it difficult to distinguish between the 15 beat types. This is attributed to relatively little learning of beat-related characteristics from ECG signals in the PI-beat-classifier training stage. Conversely, setting \(\lambda_{2}\) to 0.01 removes patient-specific features less, making the PI-BSM images less discriminative across rhythm types. Table 5 compares the performance of rhythm classification for different \(\lambda_{2}\) values. Based on Table 5 and Figure 7, 0.075 was chosen as the optimal weight for the SPH dataset. For subsequent experiments, the hyperparameter was, thus, fixed at 0.075.  
From Table 5, it is observed that AFib exhibited the lowest performance in the baseline setting but improved by 16.22% through the proposed framework, marking the most substantial enhancement among the four rhythms evaluated. These results demonstrate that significant variability exists among patients with AFib rhythm, decreasing performance in inter-patient schemes. Thus, the elimination of patient variability appears to be crucial for accurate AFib detection.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \multirow{2}{*}{**Merged Rhythm**} & \multirow{2}{*}{**Rhythm**} & \multicolumn{4}{c}{**Number of Samples**} \\ \cline{3-6}  & & \multicolumn{2}{c}{**Before Preprocessing**} & \multicolumn{2}{c}{**After Preprocessing**} \\ \hline  & \multicolumn{2}{c}{Sinus Tachycardia} & 1568 & \multirow{2}{*}{2307} & \multirow{2}{*}{544} & \multirow{2}{*}{2260} \\ \cline{2-2} \cline{5-6} GSVT &
\begin{tabular}{c} Supraventricular \\ Tachycardia \\ \end{tabular} & 587 & & & & \\ \hline SB & \multicolumn{2}{c}{Sinus Bradycardia} & 3889 & 3889 & 3888 & 3888 \\ \hline SR & \multicolumn{2}{c}{Sinus Rhythm} & 1836 & \multirow{2}{*}{2225} & \multirow{2}{*}{1564} & \multirow{2}{*}{2222} \\ \cline{2-2} \cline{5-6}  & \multicolumn{2}{c}{Sinus Irregularity} & 399 & & & \\ \hline Total & & & 10,646 & & 20,588 \\ \hline \end{tabular}
\end{table}
Table 4: _Cont._  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \multirow{2}{*}{**Parameter \(\lambda_{2}\)**} & \multirow{2}{*}{**AFib\({}_{\text{FI}}\)(\%)**} & \multirow{2}{*}{**GSVT\({}_{\text{FI}}\)(\%)**} & \multirow{2}{*}{**SB\({}_{\text{FI}}\)(\%)**} & \multirow{2}{*}{**SR\({}_{\text{FI}}\)(\%)**} & \multirow{2}{*}{**Avg\({}_{\text{FI}}\)(\%)**} & \multirow{2}{*}{**Acc (\%)