## 5 Conclusions  
We present a novel EEG-based pain detection framework designed to support pain assessment in non-verbal patients. Central to our approach is the Kernel Cross-Spectral Functional Connectivity Network (KCS-FCnet), which effectively captures discriminative spatio-frequency EEG patterns by modeling pairwise channel dependencies through Gaussian kernel-based connectivity. To improve interpretability, we introduce the Frequency Class Activation Mapping (FCAM) technique--an adaptation of the Grad-CAM++ method--allowing for detailed visualization of relevant EEG channels and frequency bands contributing to the model's predictions. Furthermore, we perform a comprehensive cross-subject analysis that incorporates subject-dependent performance metrics, KCS-FCnet-derived functional connectivity patterns, as well as demographic attributes such as sex and age, enabling the grouping of individuals with similar pain-related neural responses. Our results demonstrate that the proposed KCS-FCnet framework offers a robust and interpretable solution for EEG-based pain detection, particularly suited for non-verbal populations. By integrating kernel-based functional connectivity estimation with convolutional neural networks, our model effectively captures spatio-frequency dependencies across EEG channels, achieving superior classification performance compared to traditional machine learning methods and baseline deep learning models such as EEGNet. Also, the incorporation of Frequency Class Activation Maps (FCAMs) further enhances the model's interpretability, providing insight into the spectral and spatial patterns associated with pain states and differentiating male and female pain detection patterns. Additionally, the cross-subject analysis underscores the model's generalization capability, especially when stratifying by sex and leveraging connectivity-based metrics. The improved performance within specific demographic subgroups suggests that personalized models, informed by subject-specific features, can yield more accurate and reliable pain detection. These findings reinforce the importance of considering both biological and connectivity-based heterogeneity in EEG signals when developing clinically applicable tools for objective pain assessment. Future work will explore the extension of this approach to multimodal data, integrating EEG with other physiological or behavioral signals such as RINRS, heart rate variability, or facial expressions to enhance pain classification performance in real-world scenarios [57]. We also plan to validate the framework on clinical datasets involving chronic and spontaneous pain conditions, moving beyond experimental stimuli [58]. In addition, we will incorporate quantitative feature-relevance analyses to objectively determine the contribution of each attribute and eliminate dependence on purely visual evaluation. Also, we will explore the effects of stimulus laterality, including dominant versus non-dominant hand stimulation, on pain-related EEG patterns. Furthermore, the development of lightweight, real-time implementations of KCS-FCnet will be essential for deployment in bedside or wearable monitoring systems, ultimately supporting continuous and objective pain assessment in clinical environments. Conceptualization, S.B.-O., A.M.A.-M. and J.G.-G.; data curation, S.B.-O. ; methodology, S.B.-O., A.M.A.-M. and D.C.-P.; project administration, A.M.A.-M. and A.O.-G.; supervision, A.M.A.-M., J.G.-G. and D.C.-P.; resources, S.B.-O. and D.C.-P. All authors have read and agreed to the published version of the manuscript. This projects received grants provided by the research program ACEMATE, cod. 111091991908, and the project \"Optimizacion de rutas de atencion en salud mental a traves de estrategias comunitarias y de herramientas tecnologicas para el pre-diagnostic, la intervencion y el seguimiento de poblaciones con factores de riesgo biopsicosocial\" with code 92406, both funded by Minciencias. **Institutional Review Board Statement:** Not applicable.