## 4 Results and Discussion
### Cross-Subject Method Comparison Results
Table 6 summarizes the key demographic characteristics of these subgroups, including subject sex along with minimum, maximum, and average ages. Tables 7 and 8 show the cross-subject pain detection results for males and females, respectively, from sex-based grouping as in Table 6. As seen, straightforward FBCSP achieves a poor generalization performance. DL-based approaches, such as EEGNet and KCS-FCnet, demonstrate good generalization performance for male-based cross-subject analysis. However, KCS-FCnet outperformed the others, particularly for male-based grouping. Notably, TCFusionNet is the second-best performer for the male group, but it trails in terms of Kappa and AUC metrics, suggesting less consistent inter-subject discrimination. EEGNet and ShallowConvNet also perform reasonably well, indicating their suitability for EEG decoding tasks, yet they lack the functional connectivity modeling capabilities of KCS-FCnet. Figure 8: Two-dimensional \(t\)-SNE projection visualizing cross-subject relationships. Subject-dependent performance (ACC, AUC, and Kappa) for FBSCP, EEGNet, and KCS-FCnet. Also, KCS-FCnet functional connectivity patterns, sex, and age features are used for subject stratification. Points within the blue region represent women, while those within the orange regions represent men. The sizes correspond to the subjects’ ages, and the color point stands for subject-dependent pain detection ACC. In the female subgroup, all methods show a noticeable drop in performance, highlighting the challenges posed by higher inter-subject variability or less pronounced neural correlates of pain in female EEG data. Despite this, KCS-FCnet still achieves the highest performance among all approaches, reinforcing its generalization capabilities, even in more variable scenarios. ShallowConvNet and EEGNet follow with 67.1% and 63.3% accuracy, respectively, but their lower AUC and Kappa scores suggest reduced reliability in decision-making. TCFusionNet, although competitive in other tasks, does not maintain its advantage in this group. Classical methods like FBCSP and DeepConvNet again underperform, with accuracy barely surpassing the 60% threshold. These results suggest that while deep learning methods generally outperform traditional ML techniques in EEG-based pain detection, incorporating functional connectivity--especially with kernel-based spectral analysis--provides critical advantages in uncovering complex pain-related neural dynamics, even in populations with more subtle or heterogeneous EEG patterns. Of note, the LOSO strategy yields higher pain detection performance among male subjects compared to female subjects. The latter may be attributed to sex-related differences in EEG patterns, which have been shown to be distinguishable with high ACC by both ML and DL models. Such findings suggest that sex-specific neural characteristics can significantly influence classification outcomes in tasks like pain detection [51]. \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Group** & **Subjects** & **Min Age** & **Max Age** & **Average Age** \\ \hline Females & 1, 10, 12, 23, 29, 46 & 20 & 36 & 26.5 \(\pm\) 3.9 \\ Males & 15, 19, 21, 25, 27 & 22 & 33 & 27.1 \(\pm\) 3.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Gender-based group distribution. Male and female subjects with subject-dependent \(ACC\ >\ 85\) % are considered. Figure 9: Two-dimensional \(t\)-SNE projection visualizing cross-subject relationships regarding the KCS-FCnet estimated connectivity. Pruned functional connectivity matrices based on the 2 KS are shown (see Section 2.4). The color bar depicts the \(p\)-value of every connection for each subject matrix, where deep blue means more class separability. Therefore, the bluer the matrix, the better the discriminability. Outer boxes indicate subject gender: orange for male and blue for female. Furthermore, Figure 10 compares the models' ACC within the male group across subject-dependent and cross-subject pain detection experiments.