## 4 Results and Discussion
### Cross-Subject Method Comparison Results  
Figure 8 shows the 2D \(t\)-SNE projection of the suggested method for cross-subject analysis, which is explained in Section 2.4. The embedding illustrates the cross-subject relationships based on subject-dependent performance measures (ACC, AUC, Kappa) for the FBCSP, EEGNet, and KSC-FCnet pain detection methods. The latter aims to include three representative strategies for pain detection. In addition, it includes the KCS-FCnet-derived functional connectivity patterns and demographic attributes, including sex and age. Hence, 22 features are used to represent each subject (see Table 5). Each of the 22 features were normalized independently to the \([0,1]\) range using min-max normalization, ensuring comparable scales across diverse features. Standard deviations were inverted by subtracting from one to maintain the higher is better principle. Of note, points within the blue region represent female subjects, while those in the orange region correspond to male subjects. Additionally, marker sizes correspond to subject age, while color intensity reflects subject-dependent pain detection ACC. At first glance, the subject-dependent performance metrics, when analyzed alongside demographic data, suggest that gender plays a significant role in influencing the model's decision-making. Indeed, visual inspection shows that gender alone divides the subjects into two well-defined clusters, highlighting its importance as a conditioning variable in the cross-subject model. This observation underscores the importance of incorporating gender as a critical factor in pain classification analyses. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Feature Type** & **Name** & **Added for** & **\# of Features** \\ \hline \multirow{6}{*}{Subject-Specific Features} & Sex & Every Subject & 1 \\  & Age & Every Subject & 1 \\  & Accuracy & FB-CSP, EEGNet, KCS-FCnet & 3 \\  & Cohen’s Kappa & FB-CSP, EEGNet, KCS-FCnet & 3 \\  & AUC & FB-CSP, EEGNet, KCS-FCnet & 3 \\ \hline \multirow{3}{*}{Classification Variability} & Accuracy STD & FB-CSP, EEGNet, KCS-FCnet & 3 \\  & Cohen’s Kappa STD & FB-CSP, EEGNet, KCS-FCnet & 3 \\  & AUC STD & FB-CSP, EEGNet, KCS-FCnet & 3 \\ \hline KCS-FCnet Functional Connectivity & 2 KS Test Results & KCS-FCnet & 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Scoring matrix features details to support cross-subject pain detection analysis. Figure 7: Pairwise statistical comparison of subject-dependent accuracies. The matrix displays the \(p\)-values obtained from two-tailed paired \(t\)-tests comparing the classification accuracies of every method as reported in Figure 6 across all subjects. Comparisons with \(p\)-values below 0.05 are considered statistically significant. Similarly, Figure 9 presents a 2D \(t\)-SNE projection illustrating cross-subject relationships based on the functional connectivity estimated by KCS-FCnet. The two-sample Kolmogorov-Smirnov (2 KS) test was selected to quantify statistical differences between the connectivity distributions of pain and non-pain states. This non-parametric test provides a distribution-free measure of separability, making it suitable given the non-Gaussian nature of EEG-derived functional connectivity values. The color bar represents the \(p\)-values of each connection within the subject-specific connectivity matrices, with darker blue tones indicating stronger class separability. Thus, the bluer the matrix, the greater its discriminative power. The visualization reveals substantial inter-subject variability, particularly in terms of local and global discriminative connectivity patterns identified via the 2 KS test (see Section 2.4). Overall, male subjects tend to exhibit denser brain connectivity profiles, whereas female subjects display more sparse but distinct FC. Given the demonstrated impact of gender on EEG-based pain classification, new subgroups were formed by selecting male and female subjects with subject-dependent ACC exceeding 85% to preserve good-performing pain detection.