A convolutional neural network to distinguish between brain responses to non-noxious and noxious input of the same modality: what does the machine see that we do not see? | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article A convolutional neural network to distinguish between brain responses to non-noxious and noxious input of the same modality: what does the machine see that we do not see? Nickolaj Ajay Atchuthan, Mikkel Bjerre Danyar, Hjalte Færregård Clark, and 3 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7658321/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Background: Chronic pain affects approximately 20% of the population, with a higher prevalence in females, and presents significant diagnostic and treatment challenges. While opioids are commonly prescribed, they carry risks of addiction and overdose, highlighting the need for reliable pain biomarkers. New Method: To develop such a biomarker, we recorded non-noxious and noxious evoked potentials from the primary somatosensory cortex (S1) in 8 female pigs across 16 sessions. A convolutional neural network (CNN) was trained, validated, and tested on time-frequency maps of these responses. Three interpretability methods, saliency, integrated gradients, and occlusion were applied to identify neural features critical for distinguishing pain states. Results: The CNN achieved an overall accuracy of 73.5%, with higher accuracy for non-noxious stimuli (85%) than for noxious stimuli (62%). Feature attributions consistently highlighted a window 93–173 ms post-stimulus in the 35–75 Hz gamma-band. Comparison with Existing Methods: The CNN automatically extracted features from spectrograms, addressing the overlap between noxious and non-noxious responses. Interpretability methods revealed gamma-band oscillations (GBOs) consistent with nociceptive processing in humans and rodents. While this architecture offers valuable insights, recent studies suggest that hybrid models (e.g., CNN-LSTM) and transformers may further improve performance and robustness. Conclusion: This CNN-based approach identified GBOs as a promising neural marker of pain, with potential applications in translational research, pre-clinical trials, and pain assessment in non-verbal subjects. Brain recordings Event-related potentials Pain Biomarker Gamma-band Oscillations Deep Learning Explainable AI Figures Figure 1 Figure 2 Figure 3 Figure 4 1 Introduction The primary and often pressing reason most people seek medical help is pain. Nevertheless, pain remains difficult to diagnose other than by subjective verbal descriptions. Moreover, it is difficult to treat pain, in particular chronic pain. Chronic pain affects approximately 20% of the general population and is therefore one of the most prevalent, costly, and disabling diseases of our time (James et al., 2018 ; Davis et al., 2020 ). Opioids are often prescribed against chronic pain, leading to large-scale addiction in approximately 10% of the patients, and opioid overdose deaths (Mackey and Kao, 2019 ; Davis et al., 2020 ; Volkov, 2023 ). To develop more effective drugs with fewer side effects, a more reliable, translational, and objective biomarker is needed (Davis et al., 2020 ). The current, much debated, golden standard biomarker in pre-clinical trials is the withdrawal threshold (Mogil, 2009 ; Burma et al., 2017 ; Fisher et al., 2021 ). This is a measure of nociception and (hyper)sensitivity but cannot be equated with pain complaints of patients, as their complaints occur without a stimulus (Mogil, 2009 ; Fisher et al., 2021 ). Furthermore, it appears that measures of hypersensitivity are not related to non-evoked pain in either humans (Forstenpointner et al., 2021 ) or animals (Urban et al., 2011 ). There is thus a pressing need for a biomarker that is objective, translatable between species, and selective to pain. Using brain signals to decode such information has the advantage that it is not prone to subjectivity and is thus an excellent candidate for a translational biomarker (Fisher, 2021). The search for a pain biomarker in the human brain has been ongoing since the 1990s (Melzack, 1990 , 1999 ; Davis et al., 2017 ; Mouraux and Iannetti, 2018 ; Ploner and May, 2018 ). Some success has been reported (Wager et al., 2013 ), but the specificity of brain biomarkers remains a challenge, as the brain appears to respond similarly to pain and non-pain-related highly salient stimuli (Mouraux and Iannetti, 2018 ; Ploner and May, 2018 ). The search for a brain biomarker of pain is further hampered by a degree of subjectivity since specific features are apriori identified and extracted from the brain signals (Mouraux and Iannetti, 2018 ; Rockholt et al., 2023 ), such as components of the event-related potentials (ERP) (Sales et al., 2021 ), power in specific frequency bands (Shirvalkar et al., 2023 ) or brain regions of interest (Wager et al., 2013 ). However, methods are available to remove subjectivity, given that deep learning algorithms can objectively extract features from complex data structures. Therefore, inputs to a deep learning classifier do not have to be specifically tailored or apriori selected; for instance, in brain signals, inputs presented to a deep learning classifier can be the entire time-domain signals, frequency spectrum, or time-frequency maps (Rockholt et al., 2023 ). This paper builds upon a convolutional neural network (CNN) classifier developed in a previous study, demonstrating proficiency in autonomously extracting features, from a spectral input derived from event-related potentials (ERPs) in animals (Atchuthan et al., 2023 ). Given the novelty of this µECoG pain dataset and the goal of applying XAI techniques, a relatively simple CNN architecture was intentionally chosen to establish a baseline before exploring more complex models. While hybrid approaches (e.g., CNN-LSTM or transformer-based ) models may offer improved temporal modeling (GAO et al., 2020 ; Lu et al., 2023 ), CNNs have shown superior performance compared to other networks when used on ERPs in various contexts (Craik et al., 2019 ). A challenge with these models is to interpret how they weigh different features, since they are characterized by thousands or even millions of parameters (Angelov et al., 2021 ). Not only is the parameter space large but parameters are difficult to relate to the physical phenomena they are predicting (i.e. electrophysiological responses). The primary goal of this study is therefore to implement and explore explainable artificial intelligence (XAI) methods to interpret a previously developed CNN model trained on somatosensory brain signals. Multiple interpretability methods, including Saliency, Integrated Gradients, and Occlusion, are used to comprehend which features within the spectrograms play a pivotal role in distinguishing between noxious and non-noxious brain signal classes. This approach presents a unique challenge in attempting to distinguish sensation from pain, which are correlated sensory experiences driven by Aβ, Aδ, and C peripheral nerve fiber populations. Moreover, it represents a novel application of interpretability techniques in the context of EEG-based pain research, as previous studies have primarily focused on traditional machine learning methods or black-box deep learning models without exploring their inner workings. 2 Materials and Methods Surgeries were done on Danish landrace pigs, aiming to record neural signals from the primary somatosensory cortex (S1), in response to electrical stimulation (noxious and non-noxious). Responses were converted to spectrograms and utilized as input for a CNN. The CNN was evaluated using performance metrics such as accuracy, F1-score, and Receiver Operating Characteristic (ROC) Area Under the Curve (AUC). To enhance interpretability, we incorporate XAI methods and generate delta maps to highlight distinctions between noxious and non-noxious stimuli. 2.1 Surgery Eight female Danish Landrace pigs (average weight 30 ± 4.6 kg) were used across 16 recordings. Given that chronic pain disproportionately affects females in the human population, using female subjects in translational pain research may improve relevance for modeling clinical conditions. To minimize variability in this limited dataset, a single sex were chosen for their consistency and ease of handling in laboratory settings. All surgical procedures and stimulation sessions were performed under deep anesthesia, and animals remained unconscious throughout the entire experimental period. This study exclusively focused on neural responses acquired during anesthesia, eliminating behavioral confounds. The experiments were approved by the Danish Veterinary and Food Administration under the Ministry of Food, Agriculture and Fisheries of Denmark (protocol number 2020-15-0201-00514). Anesthesia administration and surgical preparation were conducted by a qualified laboratory anesthetist. Electrode implantation and surgical procedures were performed by trained and experienced researchers. The methods and acquired data were used in this and previous studies (Meijs et al., 2024a , b ). Animals were tranquilized with the zoletil blend for pigs without ketamine (5 ml zoletil - tiletamine 25 mg/ml and zolazepam 25 mg/ml-, 6.25 ml xylazine (20 mg/ml), and 2.5 ml butorphanol (10 mg/ml)), after which they were intubated. Anesthesia was maintained during surgery with sevoflurane (1.0%) and injection of propofol (10 mg/ml) and fentanyl (50 µg/ml). Procedures were performed in a sterile environment. Heart rate, core temperature, blood oxygenation, and expired CO2 were monitored continuously to ensure appropriate anesthetic depth. Anesthetic parameters were adjusted if one of these parameters was outside of the physiological range. During neural recordings, sevoflurane was turned off to prevent any depression of the neural signals while fentanyl and propofol levels were increased to maintain the anesthetic level. A 10 cm midline incision was made, after which the subcutaneous skin was loosened. The periosteum was incised and held aside exposing the cranium. The bregma point was identified and a circular hole with 1 cm diameter was drilled lateral and frontal to the bregma point. Pilot research has shown that this provides access to the S1, which was confirmed by evoking a brain response using ulnar nerve stimulation (Meijs et al., 2024b ). A custom-made 3D-printed cranial window was implanted and fastened to the skull using stainless steel screws. One of these screws was used as a ground and reference for the neural recordings. A Neuronexus microelectrocorticography (µECoG) electrode array with 32 electrodes in an 8x4 configuration (E32-1000-30-200, Neuronexus, Ann Arbor, USA) was placed on top of the dura to record ulnar nerve-evoked activity from the S1. The minimally invasive surgery technique was performed to increase animal welfare. S1 was selected as the measurement site due to its accessibility in both animals and humans, as well as its role in processing sensory discriminative information (Lim et al., 2016 ). Partly de-insulated stainless steel cooner wires were implanted subcutaneously in the forearm using 21 gauge needles. The wires were passed through the needles, after which the needles were removed leaving the de-insulated part under the skin. Movement responses were used to verify the placement of these electrodes. At the end of the experiments, the cortical site was sutured in two layers and afterward glued. The animals were awakened by shutting off the anesthesia. 2.2 Recordings Non-noxious stimulation was delivered at twice the motor threshold, a level typically associated with activation of Aβ fibers, while noxious stimulation was applied at ten times the motor threshold, a range known to engage Aδ pathways (Chang et al., 2001). Motor threshold determination began at 50 µA. The stimulation intensity was then increased in 200 µA increments until a detectable motor response was elicited. Following this, the amplitude was reduced in 50 µA steps until the response was abolished. The current was subsequently raised again in 50 µA increments, with the lowest intensity that re-evoked a response defined as the threshold. The pulse shape was biphasic, asymmetric, rectangular, and charge-balanced to avoid tissue damage over time, with a secondary phase amplitude of 10% of the primary phase and an inter-pulse interval of 10 ms. Hundred non-noxious and 100 noxious stimuli were delivered to the ulnar nerve at a frequency of 0.5 Hz using a programmable stimulator (STG4008, Multichannel Systems, Reutlingen, Germany). This was repeated for three sets at a 10-minute interval. The cortical signals were recorded at a sampling frequency of 6 kHz using a Tucker-Davis Technologies system (TDT, Alachua, FL, USA), including a pre-amplifier (model SI-8), a processor (model RZ2), and a workstation (model WS8). Evoked responses were visualized online to confirm the placement and functionality of the cortical electrodes. In total, 16 recording sessions were conducted, comprising 42 sets of stimulations. Each set included 100 noxious and 100 non-noxious stimulations, recorded across 32 channels, resulting in 8,400 stimuli and a total of 268,800 channel-epochs. Following visual quality control, 360 noisy channel instances (i.e., specific channel-in-set recordings) were removed, corresponding to 72,000 discarded epochs. The final dataset contained 196,800 clean epochs, balanced between conditions (98,400 noxious and 98,400 non-noxious). Each retained epoch was then transformed using a Short-Time Fourier Transform (STFT) with a Hann window (350 samples, 50% overlap), producing 0–250 Hz time–frequency spectrograms that served as inputs to the CNN. 2.3 Cortical Data Processing Data pre-processing involved applying a series of filters and transformations to ensure optimal signal quality. Initially, a high-pass filter at 1 Hz (10th-order Butterworth) and a low-pass filter at 250 Hz (4th-order Butterworth) were employed. Subsequently, a 16th-order Butterworth filter was used to eliminate 50 Hz line noise, covering up to the fourth harmonic, with cut-off frequencies set at 48 Hz and 52 Hz. Both forward and backward filtering techniques were utilized, with the specified filter orders representing their effective application. The resulting spectrogram image had a time range of -50 to 500 ms on the x-axis and a frequency range of 0 to 250 Hz on the y-axis. The image resolution was 26.19 ms per pixel temporally and 17.24 Hz per pixel in the frequency domain. To facilitate CNN convergence, amplitude normalization was performed by scaling all amplitudes to the range of 0–1, achieved by dividing each STFT's amplitudes by their maximum value. Further, interpolation (spline, zoom factor of two) was applied to increase resolution, thus enabling convolutions using different size filters. To minimize neural variability, we averaged 25 STFTs per subject, as this approach provided the highest classification accuracy with the fewest averages needed. The total number of epochs was 196,800, and after averaging, this resulted in 7,872 STFTs. The pre-processing steps were implemented using Python (version 3.9.7, 2022). This large volume of high-resolution µECoG trials, combined with substantial variability across time, trials, and channels, provides a robust and diverse basis for model training, despite the limited number of animals. 2.4 CNN Design and Performance Evaluation The final architecture employed in this paper consisted of a sequential arrangement of two convolutional layers, two pooling layers, a flattening layer, two fully-connected layers, and an output layer. This design was refined through an iterative training strategy, where we systematically tested a range of parameters; STFT settings, kernel and filter sizes, dropout rates, and interpolation factors. One key parameter was modified at a time while monitoring validation performance to avoid overfitting. The final model was selected based on the lowest validation loss across multiple runs. (For a detailed overview of the model development and training methodology, see Atchuthan et al., 2023 .) The convolutional layers utilized zero padding and Rectified Linear Unit (ReLU) activation functions. The initial convolutional layer featured four 5 x 5 pixel-sized kernels generating four feature maps, while the subsequent convolutional layer had eight 3 x 3 pixel-sized kernels producing eight feature maps. Following each convolutional layer, max pooling was implemented, with the first pooling layer utilizing a 3 x 3 kernel and a stride of 3, and the second pooling layer having a 2 x 2 kernel with a stride of 2. The flattening layer, comprising 120 neurons, processed the output from the second pooling layer, and this flattened data was then fed into the first fully connected layer containing 30 neurons. The first fully connected layer was linked to the second fully connected layer, which consisted of two neurons. Sigmoid activation functions were applied in both layers. The output layer, facilitating binary classification of noxious or non-noxious stimulation, comprised two neurons and utilized a softmax activation function for output normalization and posterior probability calculation for the actual classification task. During the training phase, dropout was incorporated as a regularization technique to reduce overfitting. Specifically, a dropout rate of 50% was employed for the convolutional layers, and for the first fully connected layer, a dropout rate of 70% was applied. Figure 1 provides an overview of the employed CNN architecture, while Table 1 presents detailed information on the number of parameters. The data were split into training (60%), validation (20%), and test (20%) sets, with each set containing recordings from distinct animals to ensure subject independence. Cross-validation was not applied due to the computational demands of retraining a deep CNN across folds. Given the model’s scale and training time, repeated training runs on a subject-independent split were used instead, and the best-performing model (based on validation loss) was selected. For training and optimization, the chosen optimizer was a Nesterov-accelerated Adaptive Moment Estimation (NAdam), with a starting learning rate of 0.0002. NAdam is an extension of the Adam optimizer with added Nesterov Acceleration for the first-order momentum estimation, conceptually this means that the model will converge faster towards optima. Binary cross-entropy was implemented as the loss function, which is well-suited for this binary classification task. To enhance efficiency and prevent overfitting, a minimum validation loss checkpointing was implemented, and early stopping was activated if there was no decrease in validation loss over 100 epochs. The batch size was set to 50. Data splitting for training, testing, and validation involved allocating 60%, 20%, and 20% of the data, respectively, ensuring no overlap between subjects. The algorithm was implemented using the PyTorch framework (version 1.11.0, 2022). The GPU utilized for training was an NVIDIA GeForce RTX 3080 with CUDA 11.6. Table 1 Overview of parameters of each layer of the proposed CNN. The modules are presented in chronological order. Layer No. Modules Parameters 1 conv1.weight 100 conv1.bias 4 2 conv2.weight 288 conv2.bias 8 3 fc1.weight 3600 fc1.bias 30 4 fc2.weight 60 fc2.bias 2 The assessment of CNN’s performance involved three crucial metrics: accuracy, F1-score, and the ROC-AUC. These calculations were also performed to ensure comparability with other studies. Accuracy is a comprehensive performance measure unaffected by classification error types. To address this F1-score was also computed. F1 integrates precision and true positive rate, thereby taking into account class imbalance in the dataset. The ROC analysis, a binary classification evaluation method, focuses on the true positive rate (TPR) and false positive rate (FPR). The resulting ROC curve illustrates classifier performance, with AUC serving as a performance metric. An AUC of 0.5 indicates no discrimination, 0.7 to 0.8 is acceptable, 0.8 to 0.9 is excellent, and values exceeding 0.9 are outstanding. (Mandrekar, 2010 ) 2.5 Model Interpretability Methods and Analysis To thoroughly comprehend the underlying importance of features within the architecture, diverse interpretability methods were employed. Emphasis was on attribution methods providing a holistic overview of the network's weighting. For this Saliency, Integrated gradients and Occlusion were chosen. (Kokhlikyan et al., 2020 ) NoiseTunnel was integrated on top of all methods, to ensure more robust attribution maps, by iteratively adding noise to a method's input and averaging the calculated attributions. This is to overcome the noisiness that occurs when introducing ReLU activation functions to a network. (Smilkov et al., 2020). NoiseTunnel was implemented with the 'smoothgrad_sq' method since it removes noise while still keeping detail. The key disadvantage to this method is the computational overhead that scales linearly with number of samples. Hence, the sample size (nt_samples) was fixed at 50, as additional increments yielded diminishing returns, also reported by (Smilkov et al., 2020). Finally, a standard deviation of 0.2 was employed, striking a balance between the sharpness of the attribution maps and noise, also reported by (Smilkov et al., 2020). The Python package Captum was utilized for implementing feature attribution methods. (Kokhlikyan et al., 2020 ). A total of 600 epochs from the original test dataset were used for each class to prevent overfitted attributions. Data was derived from the same subject. Each epoch was subsequently utilized as an input for the NoiseTunnel and Model Interpretability techniques. Following this, the attributions were aggregated and averaged for both classes, resulting in a final averaged map for each method. Additionally, an averaged spectrogram was derived for both classes, to facilitate comparison between signal and attribution. In summary, this process yielded a set of three attribution maps and one spectrogram for both the noxious and non-noxious classes. Saliency is a baseline approach for exploring network attention, which computes the gradients of the input with respect to the output. When the absolute value of these gradients is computed, they can be used as importance scores for each feature. Conceptually, the approach involves a first-order Taylor expansion of the network with respect to the input, emphasizing coefficients assigned to each feature. (Simonyan et al., 2013 ). Saliency was chosen as a baseline method for comparison with other model interpretability methods. Integrated Gradients represent a more advanced and contemporary methodology within the domain of gradient-based techniques. It gauges the contribution of each feature by computing the integral of gradients of the model's output concerning that feature, tracing a path from a baseline input to the actual input (Sundararajan et al., 2017 ). This method was implemented in response to disparities from Saliency, providing a more comprehensive understanding of the model. A crucial distinction lies in its implementation invariance, focusing solely on input and output and disregarding the network's architecture. Additionally, this method also satisfies the sensitivity axiom, meaning that change in an important feature should show an equal amount of change in the predictability of a class, and oppositely this should be true for less important features. (Sundararajan et al., 2017 ). Furthermore, Integrated Gradients exhibited a notable capability for producing feature maps with reduced noise, thereby enhancing its overall effectiveness. To implement Integrated Gradients, employed the 'Gauss-Legendre' method for integral approximation, integrating 50 steps between the baseline and the input interpolation while utilizing a zero scalar baseline. This approach ensured a smoother and more precise feature representation, contributing to improved interpretability. Occlusion was employed to address potential biases arising from the exclusive utilization of gradient-based methods, such as saliency and integrated gradients. Occlusion, a perturbation-based approach, involves selectively masking distinct regions of the input image using predefined filters (Zeiler et al., 2013). This method looks at the impact of the model's discriminative prowess when removing specific features. When a masked feature is identified as discriminative, it receives a correspondingly high score, culminating in the generation of a feature attribution map. In our implementation, we employed a 1x1 mask with strides of 1, ensuring a more detailed attribution map. By utilizing smaller filters, we captured intricate details regarding the precise locations of the crucial features. Given that the input image measured 28 x 42, it was crucial to maintain compact filters to preserve the overall fidelity of the analysis. Delta maps were created to highlight the key differences between the two classes noxious and non-noxious. They were computed by subtracting the non-noxious from the noxious class. Linear normalization was done after subtraction for attribution maps to avoid attributions being heightened from one class and enable better comparability between interpretability methods. For the spectrogram, a different colormap was used to highlight suppression and excitation. All interpretability methods were implemented using the Captum framework (version 0.6.0, 2023). 3 Results 3.1 CNN Performance The algorithm excelled in predicting non-noxious stimuli, achieving an 85% correct prediction rate. However, its performance diminished for noxious stimuli, yielding a 62% correct prediction rate. The classifier's accuracy and F1 score were 73.5% and 70.1%, respectively. In the binary classification of noxious and non-noxious stimulations on the test data, the ROC curve's AUC reached 0.722, which is considered acceptable according to (Mandrekar, 2010 ). The ROC curve shown in Fig. 2 , consistently surpassed the line of no discrimination, indicating favorable classifier performance. Beyond an FPR of 0.9, the ROC curve regresses below the line of no discrimination. The optimal threshold is identified at the point closest to (0,1), aligning with a TPR of approximately 0.6 in these results. 3.2 Model Interpretability While the STFTs (Fig. 3 ) enable traditional peak-based comparison, the visual differences between classes are subtle and overlapping. Attribution methods, in contrast, revealed class-specific features not readily discernible from inspection activation alone. Based on the saliency analysis shown in Fig. 3 , it is evident that the attributions exhibit a more spread-out pattern for the non-noxious class. Particularly, prominent and sizable attribution patterns appear at 69–174 ms at frequencies ranging from 27 to 72 Hz and around 250–345 ms at 100–160 Hz. Notably, both of these attributions demonstrate minimal overlap with the pattern of the input. Upon examination of the noxious response, it becomes apparent that the aforementioned spread-out attributions are comparatively less pronounced. Instead, a more prominent peak emerges at 93–173 ms with frequencies 36 to 72 Hz, resembling the one seen in the non-noxious response. Contrary to the saliency method, the integrated gradients technique demonstrates a greater concurrence with peaks in both classes at 15–43 ms and 55–95 ms with frequencies below 50 Hz (Fig. 3 ). This specific coherence appears to be notably similar in both classes, albeit less pronounced in the noxious category. The most substantial difference in the noxious class occurs at 81–160 ms, involving frequencies spanning from 27–71 Hz. Notably, this distinct pattern within the noxious category exhibits minimal overlap with the actual input. The occlusion map depicted in Fig. 3 exhibits resemblances in attributions to the saliency analysis, particularly in the non-noxious class. The non-noxious map reveals speckle-like features that extend across the attribution map following the stimulation. The densest concentration of attributions is notably observed immediately after stimulation, 16–55 ms, with frequencies at 27–54 Hz. Additionally, there exists a distinct occurrence of late-stage attribution at 409–435 ms, with frequencies at 98–125 Hz. Upon inspecting the noxious class, noteworthy parallels can be drawn between the occlusion map and the other methods, particularly attribution at 80–160 ms, with frequencies across 36–72 Hz. The analysis of delta maps (Fig. 4 ) indicates predominantly negative values, suggesting a suppressive tendency in the noxious response compared to the non-noxious counterpart, particularly below 50 Hz, likely attributed to the 1/f limitation inherent in the signal. Temporally, suppressive phenomena occur at 0–55, 66–108, 212–252, and 345–409 ms, with less pronounced occurrences at 435–475 ms. Excitation is observed around 64–135 ms, initially as a temporally large feature and transitioning into a more specific pattern with a frequency range of 0–60 Hz, overlapping with low-frequency suppression in the 0–26 Hz range. Delta attribution maps consistently show patterns at approximately 93–173 ms and 35–75 Hz. Disparities arise in integrated gradients, with some attributions occurring before 93 ms, overlapping with the input excitation. However, the majority of attributions from all maps manifest after the nearest excitation. 4 Discussion 4.1 CNN Performance The CNN used in this study was able to distinguish between non-noxious and noxious signals with an acceptable to good performance, with an accuracy of 73.5%. While the CNN showed strong performance for non-noxious stimuli (85% accuracy), classification of noxious stimuli was lower (62%). The relatively lower accuracy on noxious stimuli can be attributed to the overlapping spectral features between the two classes. Although class sizes were balanced during training, the CNN may have struggled to distinguish subtle differences due to shared components in the evoked responses. Apart from class balancing, no additional methods such as class weighting or focal loss were applied (Lin et al., 2017 ). These methods may help mitigate the disparity and should be explored in future work. The various interpretability methods consistently demonstrated that the difference between non-noxious and noxious responses did not align with the visible ERP, which appears reduced in noxious responses compared to non-noxious ones. Instead, it occurs slightly later (93–173 ms) and in a higher frequency band (35–75 Hz). Several studies have been conducted comparing brain signals as inputs using a CNN. Chen et al. ( 2022 ) developed a CNN to classify movement-induced pain in 10 subjects, yielding an AUC between 0.80–0.84 depending on the brain regions used. This is comparable to our study with an AUC of 0.72. It should be noted that Chen et al. ( 2022 ) distinguished between evoked and resting states. This difference implies potentially less overlap in signal characteristics since the model would be able to do the actual classification based on simple peak detection, thereby facilitating a relatively simpler classification task. In contrast, our study presents a more complex challenge as it discriminates between two overlapping stimulation types which are characterized by overlapping features (non-noxious: Aβ, noxious: Aβ & Aδ). This makes the model and findings more robust and applicable to the real world. In real-world scenarios, most painful experiences are typically accompanied by non-painful sensations, either preceding the painful stimulus or in the area around it. Therefore, a biomarker specific to pain should be able to distinguish the two. Shirvalkar et al. ( 2023 ) trained separate models for each of their four subjects using leave-one-out cross-validation (LOOCV), focusing on personalized models. In contrast, our study trained a single model across 16 sessions to promote generalizability across individuals. While subject-specific models may better capture individual patterns, they risk overfitting due to limited data per subject. Chen et al. ( 2022 ) used leave-one-subject-out cross-validation (LOSOCV), which supports generalization but can be affected by uneven data distribution—making it harder to attribute performance differences to the model or dataset. Future studies may benefit from incorporating LOSOCV to further assess robustness. Ghosh et al. ( 2021 ) achieved 73.02% accuracy using a CNN with the Hilbert spectrum—comparable to our result of 73.5%. However, combining the CNN with a Bidirectional LSTM significantly improved performance to 91.3%, a trend also seen in other studies, such as Gao et al. ( 2020 ), who reported 91.86% accuracy using a CNN-LSTM architecture. Ghosh et al. also incorporated spatial features, which may further enhance classification but would require a larger dataset, as using all channels reduces the number of usable epochs. In our study, electrodes were limited to the primary somatosensory cortex, where spatial activity is likely correlated. Future work could explore multi-region recordings—e.g., including the prefrontal cortex—to meaningfully leverage spatial information. These studies suggest that a standalone CNN may be insufficient for optimal performance, partly due to its translation invariance, which limits its ability to capture temporal dynamics in EEG-like data (Livezey & Glaser, 2021). Combining CNNs with architectures like LSTMs offers a promising solution. CNNs are effective at extracting spatial features, while LSTMs capture temporal dependencies (Amrani et al., 2021 ; Ghosh et al., 2021 ). Sun et al. ( 2022 ) applied a CNN–LSTM hybrid architecture to spectral EEG data for cold pain classification, achieving 88% accuracy. To our knowledge, this is the only prior study applying such a hybrid model specifically for pain detection, underscoring the relevance of exploring temporal modeling in future work Although we did not implement a hybrid CNN-LSTM in this study to avoid added complexity, especially given the underexplored nature of µECoG pain decoding, future studies should consider such architectures to better leverage temporal patterns in the data. Another solution would be to implement transformers, which can offer computational benefits by avoiding recursion and enabling parallel computation. This is achieved while maintaining performance in handling long-term dependencies by processing input as a whole (Vaswani et al., 2017 ). The nature of this method enhances interpretability, as the attention mechanism in transformers reveals the significance specific features have on classification accuracy (Maurício et al., 2023 ). Furthermore, exploring the use of Vision Transformers (ViT) instead of CNN’s could be worthwhile. ViTs demonstrate superior performance on noisy data and require fewer computational resources (Maurício et al., 2023 ). Additionally, ViTs are observed to generally have better or comparable performance to CNNs (Yang et al., 2023; Maurício et al., 2023 ). In EEG decoding tasks, Song et al. ( 2022 ) achieved 79–85% accuracy on motor imagery and 95% on emotion classification using a CNN-transformer hybrid. Lu et al. ( 2023 ) reported 88% accuracy with a spatio-temporal Vision Transformer (Bi-ViT) for emotion classification. Recent studies have also applied transformer-based architectures to EEG. Song et al. ( 2022 ) achieved 79–85% accuracy on motor imagery and 95% on emotion classification using a CNN–Transformer model. Lu et al. ( 2023 ) reached 88% with a spatio-temporal Vision Transformer (Bi-ViT) for emotion classification. These results highlight the potential of attention-based models for complex EEG decoding tasks. Table 2 Performance comparison of deep learning architectures applied to EEG datasets. Study Model Input Task Accuracy (%) Atchuthan et al. ( 2023 ) CNN µECoG (Time-Frequency) Pain Classification 74 Chen et al. ( 2022 ) CNN EEG (Time-Frequency) Pain Classification 84 Sun et al., ( 2022 ) CNN - LSTM EEG (Spectral) Cold Pain Classification 88 Ghosh et al. ( 2021 ) CNN - Bi-LSTM EEG (Hilbert) Face Perceptual Ability 91 Gao et al. ( 2020 ) CNN - LSTM EEG (Spectral) Visual Evoked Potential 92 Song et al. ( 2022 ) CNN - Transformer EEG (Time Series) Motor Imagery and 79–85 Emotion Classification 95 Lu et al. ( 2023 ) Bi-ViT EEG (Spatio-Temporal) Emotion Classification 88 Finally, it is noteworthy that substantial performance improvements can be attained through the utilization of pre-trained models. These models, initially trained on conventional images, have demonstrated the ability to enhance classification performance even when applied to EEG datasets (Yang et al., 2023), which often are limited by resources and time constraints. Leveraging pre-trained models could serve as a valuable alternative, offering a synthetic boost to performance in scenarios where such limitations exist. Moreover, data augmentation strategies, such as segmentation and recombination, may enhance training performance by increasing dataset variability (Song et al., 2022 ). 4.2 Interpretability Methods (XAI) Three interpretability methods were used to determine which features distinguished the brain responses to noxious from brain responses to non-noxious stimulation. The main attribution that was consistently highlighted by all methods occurred 93–173 ms after the stimulus in the 35–75 Hz frequency band, or gamma band (Buzsáki and Wang, 2012 ; Ploner et al., 2017 ). Activity in this frequency band is related to phasic, tonic, and chronic pain in humans and rodents (Li et al., 2023 ). Gamma band oscillations (GBOs) can be elicited by stimulation of various modalities (Li et al., 2023 ), including electrical stimulation, as used in this study. Stimulation-evoked gamma oscillations encode pain variability and encode pain perception independent of saliency (Schulz et al., 2012 ; Zhang et al., 2012 ; Heid et al., 2020 ; Yue et al., 2020 ; Li et al., 2023 ). This stimulus-evoked activity is generated in S1 (Yue et al., 2020 ) and is spatially somatotopically organized (Heid et al., 2020 ). GBOs are phylogenetically preserved in humans and rodents (Li et al., 2023 ). This study is the first to show that they also exist in pigs. The brain area where GBOs are generated is consistent in humans, rodents, and pigs, but their frequency band and latency vary (Li et al., 2023 ). The frequencies observed in rodents are higher than those observed in humans (30–100 Hz), and the current results are in the lowest frequency ranges of those observed in humans (Li et al., 2023 ). It should be noted, however, that this study was not optimized to detect GBOs like other hypothesis-driven approaches. Typically GBOs are visualized as percentage change from baseline (Schulz et al., 2012 ; Michail, 2016). It is likely that the CNN performance could be further improved, by transforming the time-frequency maps to show the percentage change from baseline. Indeed, there is evidence that GBOs are related to pain ratings at the single-session level (Michail et al., 2016 ; Black et al., 2023 ). Due to the cross-species preservation of GBOs during nociceptive processing, the features identified in this study may hold translational potential. A CNN-based pain detection system that leverages GBO patterns could be particularly useful in non-verbal populations—such as infants, unconscious patients, or animals—where subjective reporting is impossible. In pre-clinical settings, this approach could address a major limitation of current models: the lack of objective biomarkers for spontaneously occurring pain (Sadler et al., 2022 ). Establishing such a biomarker has been linked to improved success in analgesic drug development (Davis et al., 2020 ). However, we also note that using GBOs in practice would require consideration of inter-species differences and measurement constraints. However, the use of pigs marks a substantial step toward translatability, as their neuroanatomy is more comparable to humans than rodent models typically used in pain research. While these findings are promising, the practical implementation of such a system in clinical settings is outside the scope of this study. Successful translation will require larger, more diverse datasets and, ultimately, validation in non-invasive paradigms using EEG. The interpretability methods also revealed that the CNN also attributes the low-frequency activity that is time-locked to the stimulus. This activity is evoked by both stimuli and is equally attributed to both classes by the CNN. Other studies have found differences in the lower theta and alpha frequency bands (Schulz et al., 2012 ; Michail et al., 2016 ). A plausible explanation for why no differences were detected by the CNN is that the theta frequency (4–8 Hz) is not distinguishable from alpha frequencies (8–13 Hz) in our frequency maps (resolution: 9 Hz). While theta frequencies are enhanced, alpha frequencies are suppressed by noxious stimulation (Michail et al., 2016 ; Heid et al., 2020 ), which overlaps with the current frequency resolution. Another reason could be that theta and alpha frequencies are to some extent related to saliency and attention (Bauer et al., 2006 ; Michail et al., 2016 ), where pain is typically more salient than a non-noxious stimulus. In our study, subjects are anesthetized, which would diminish the difference in saliency. Comparing the different interpretability methods revealed minute differences. Here, integrated gradients seem to exhibit a higher degree of overlap with the visible peak of the signal. However, some ambiguity remains as to whether this implies that integrated gradients is capturing fewer critical features overlooked by other methods. The reason why this method highlights these differences more than others could be explained by how integrated gradients aggregate gradients across different interpolations between a blank image and the original input (Sundararajan et al., 2017 ). This aggregation may lift features with strong attributions even in areas with low pixel intensity. Notably, these patterns in noxious signals bear resemblances to non-noxious ones, potentially explaining instances where the model misclassifies noxious signals as non-noxious. This is consistent with the observed false negatives, accounting for 38%. In contrast, saliency exhibits more noisy attributions, which could be explained by the lack of aggregation of multiple interpolated images like integrated gradients (Simonyan et al., 2013 ). Lastly, the occlusion method tended to smooth and remove details, possibly leading to a loss of important information. This could be due to the coarse nature of the occlusion process, where individual regions are sequentially masked (Zeiler et al., 2013). In most interpretability methods, it was consistently observed that feature attribution was strongest when unrelated to peaks, underscoring the importance of objective feature learning. While there may be a certain bias in how the input was prepared and in the selection of the neural network architecture, this method represents a relatively more unbiased approach. The dataset was not specifically tailored for optimal GBO detection, yet it successfully identified them. Traditional approaches, such as manually comparing spectrograms, might overlook such subtle nuances, highlighting the significance of neural networks in revealing hidden insights beyond traditional peak detection in spectrograms. Considering the variations in the individual methods, a combined approach utilizing multiple attribution methods is therefore recommended for a comprehensive analysis. 5 Conclusion and Outlook We developed a CNN to distinguish between noxious and non-noxious stimuli with 73.5% accuracy, despite the overlap in activated nerve fibers that is inherent to electrical stimulation. This overlap is considered an advantage of the methodology, rather than a drawback. Most noxious stimuli will be accompanied by non-noxious input, so the ability to distinguish the two increases its specificity as a biomarker. XAI methods revealed that the most substantial difference between noxious and non-noxious responses occurred at 93–173 ms post-stimulus, involving frequencies from 35–75 Hz. This frequency range was consistent with GBOs. CNN-driven pain detection can be useful to detect noxious events in non-verbal patients, e.g. infants, unconscious or veterinary patients and has the potential to transform pre-clinical research, which warrants greater success in drug development. Declarations 6 Conflict of Interest The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest . 7 Author Contributions M.B.D., H.F.C., and N.A.A. performed the data analysis and implemented/trained the CNN. N.A.A. developed and applied the new XAI methods and prepared the figures. S.M. and N.A.A. drafted the manuscript. S.M. and W.J. conceived the study. S.M., F.R.A., and W.J. collected the data. F.R.A., W.J., M.B.D., and H.F.C. reviewed the manuscript. 8 Funding This work was funded by the Center for Neuroplasticity and Pain (CNAP). CNAP is supported by the Danish National Research Foundation (DNRF121). 9 Acknowledgements We thank the staff at the biomedical laboratory of Aalborg University Hospital for their assistance during the experiments. References Amrani, G., Adadi, A., Berrada, M., Souirti, Z., & Boujraf, S. (2021, October). EEG signal analysis using deep learning: A systematic literature review. In 2021 Fifth International Conference On Intelligent Computing in Data Sciences (ICDS) (pp. 1-8). IEEE. Angelov, P. P., Soares, E. A., Jiang, R., Arnold, N. I., & Atkinson, P. M. (2021). Explainable artificial intelligence: an analytical review. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 11(5), e1424. https://doi.org/10.1002/widm.1424 Atchuthan, N. A., Clark, H., Danyar, M. B., Andersen, A. K., Andreis, F. R., & Meijs, S. (2023, April). Classification of noxious and non-noxious event-related potentials from S1 in pigs using a convolutional neural network. In 2023 11th International IEEE/EMBS Conference on Neural Engineering (NER) (pp. 1-4). IEEE. Bauer, M., Oostenveld, R., Peeters, M., and Fries, P. (2006). Tactile Spatial Attention Enhances Gamma-Band Activity in Somatosensory Cortex and Reduces Low-Frequency Activity in Parieto-Occipital Areas. J. Neurosci. 26, 490–501. doi: 10.1523/JNEUROSCI.5228-04.2006. Black, C. J., Saab, C. Y., and Borton, D. A. (2023). Transient gamma events delineate somatosensory modality in S1. Neuroscience doi: 10.1101/2023.03.30.534945. Burma, N. E., Leduc-Pessah, H., Fan, C. Y., and Trang, T. (2017). Animal models of chronic pain: Advances and challenges for clinical translation: Animal Models of Chronic Pain. Journal of Neuroscience Research 95, 1242–1256. doi: 10.1002/jnr.23768. Buzsáki, G., and Wang, X.-J. (2012). Mechanisms of Gamma Oscillations. Annu. Rev. Neurosci. 35, 203–225. doi: 10.1146/annurev-neuro-062111-150444. Chang, Chen, og Bai-Chuang Shyu. “A fMRI study of brain activations during non-noxious and noxious electrical stimulation of the sciatic nerve of rats”. Brain Research 897, nr. 1 (6. april 2001): 71–81. https://doi.org/10.1016/S0006-8993(01)02094-7. Chen et al., 2022. Duo Chen, Haihong Zhang, Perumpadappil Thomas Kavitha, Fong Ling Loy, Soon Huat Ng, Chuanchu Wang, Kok Soon Phua, Soon Yin Tjan, Su-Yin Yang and Cuntai Guan. Scalp EEG-Based Pain Detection Using Convolutional Neural Network. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 30, 274–285, 2022. Craik et al., 2019. Alexander Craik, Yongtian He and Jose L Contreras-Vidal. Deep learning for electroencephalogram (EEG) classification tasks: a review. Journal of neural engineering, 16(3), 031001, 2019. Davis, K. D., Aghaeepour, N., Ahn, A. H., Angst, M. S., Borsook, D., Brenton, A., et al. (2020). Discovery and validation of biomarkers to aid the development of safe and effective pain therapeutics: challenges and opportunities. Nat Rev Neurol 16, 381–400. doi: 10.1038/s41582-020-0362-2. Davis, K. D., Flor, H., Greely, H. T., Iannetti, G. D., Mackey, S., Ploner, M., et al. (2017). Brain imaging tests for chronic pain: medical, legal and ethical issues and recommendations. Nat Rev Neurol 13, 624–638. doi: 10.1038/nrneurol.2017.122. Dobariya, A., El Ahmadieh, T. Y., Good, L. B., Hernandez-Reynoso, A. G., Jakkamsetti, V., Brown, R., et al. (2022). Recording of pig neuronal activity in the comparative context of the awake human brain. Sci Rep 12, 15503. doi: 10.1038/s41598-022-19688-2. Dong, W. K., Chudler, E. H., Sugiyama, K., Roberts, V. J., and Hayashi, T. (1994). Somatosensory, multisensory, and task-related neurons in cortical area 7b (PF) of unanesthetized monkeys. Journal of Neurophysiology 72, 542–564. doi: 10.1152/jn.1994.72.2.542. Duo Chen, Haihong Zhang, Perumpadappil Thomas Kavitha, Fong Ling Loy, Soon Huat Ng, Chuanchu Wang, Kok Soon Phua, Soon Yin Tjan, Su-Yin Yang and Cuntai Guan. Scalp EEG-Based Pain Detection Using Convolutional Neural Network. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 30, 274–285, 2022. Fisher, A. S., Lanigan, M. T., Upton, N., and Lione, L. A. (2021). Preclinical Neuropathic Pain Assessment; the Importance of Translatability and Bidirectional Research. Front. Pharmacol. 11, 614990. doi: 10.3389/fphar.2020.614990. Forstenpointner, J., Ruscheweyh, R., Attal, N., Baron, R., Bouhassira, D., Enax-Krumova, E. K., et al. (2021). No pain, still gain (of function): the relation between sensory profiles and the presence or absence of self-reported pain in a large multicenter cohort of patients with neuropathy. Pain 162, 718–727. doi: 10.1097/j.pain.0000000000002058. Gao, Zhongke, et al. "A deep learning method for improving the classification accuracy of SSMVEP-based BCI." IEEE Transactions on Circuits and Systems II: Express Briefs 67.12 (2020): 3447-3451. Ghosh, Lidia, et al. "Exploration of face-perceptual ability by EEG induced deep learning algorithm." Biomedical Signal Processing and Control 66 (2021): 102368. Heid, C., Mouraux, A., Treede, R.-D., Schuh-Hofer, S., Rupp, A., and Baumgärtner, U. (2020). Early gamma-oscillations as correlate of localized nociceptive processing in primary sensorimotor cortex. Journal of Neurophysiology 123, 1711–1726. doi: 10.1152/jn.00444.2019. J. N. Mandrekar, “Receiver operating characteristic curve in diagnostic test assessment,” Journal of Thoracic Oncology, vol. 5, no. 9, pp. 1315–1316, 2010. James, S. L., Abate, D., Abate, K. H., Abay, S. M., Abbafati, C., Abbasi, N., et al. (2018). Global, regional, and national incidence, prevalence, and years lived with disability for 354 diseases and injuries for 195 countries and territories, 1990–2017: a systematic analysis for the Global Burden of Disease Study 2017. The Lancet 392, 1789–1858. doi: 10.1016/S0140-6736(18)32279-7. Jesse A Livezey and Joshua I Glaser. Deep learning approaches for neural decoding across architectures and recording modalities. Briefings in bioinformatics, 22(2), 1577–1591, 2021. Kokhlikyan et al., 2020. Narine Kokhlikyan, Vivek Miglani, Miguel Martin, Edward Wang, Bilal Alsallakh, Jonathan Reynolds, Alexander Melnikov, Natalia Kliushkina, Carlos Araya, Siqi Yan and Orion Reblitz-Richardson. Captum: A unified and generic model interpretability library for PyTorch, 2020. LeBlanc, B. W., Bowary, P. M., Chao, Y.-C., Lii, T. R., and Saab, C. Y. (2016). Electroencephalographic signatures of pain and analgesia in rats. Pain 157, 2330–2340. doi: 10.1097/j.pain.0000000000000652. Li, Z., Zhang, L., Zeng, Y., Zhao, Q., and Hu, L. (2023). Gamma-band oscillations of pain and nociception: A systematic review and meta-analysis of human and rodent studies. Neuroscience & Biobehavioral Reviews 146, 105062. doi: 10.1016/j.neubiorev.2023.105062. Lim, M., Roosink, M., Kim, J.S., Kim, H.W., Lee, E.B., Son, K.M., Kim, H.A. and Chung, C.K., 2016. Augmented pain processing in primary and secondary somatosensory cortex in fibromyalgia: a magnetoencephalography study using intra-epidermal electrical stimulation. PLoS One, 11(3), p.e0151776. Lin, Tsung-Yi, et al. "Focal loss for dense object detection." Proceedings of the IEEE international conference on computer vision. 2017. Lu, Wei, Tien-Ping Tan, and Hua Ma. "Bi-branch vision transformer network for EEG emotion recognition." IEEE Access 11 (2023): 36233-36243. Mackey, S., and Kao, M.-C. (2019). Managing twin crises in chronic pain and prescription opioids. BMJ, l917. doi: 10.1136/bmj.l917. Maurício, J., Domingues, I., & Bernardino, J. (2023). Comparing Vision Transformers and Convolutional Neural Networks for Image Classification: A Literature Review. Applied Sciences, 13(9), 5521. Meijs, Suzan, Carsten Reidies Bjarkam, Felipe Rettore Andreis, og Winnie Jensen. “First Demonstration of Nociceptive and Non-Nociceptive Responses from Spinal Neurons in a Porcine Model”. I 2023 11th International IEEE/EMBS Conference on Neural Engineering (NER), 1–4, 2023. https://doi.org/10.1109/NER52421.2023.10123833. Meijs, S., Andreis, F. R., Janjua, T. A. M., Graven-Nielsen, T., and Jensen, W. (2024a). High frequency electrical stimulation increases cortical excitability and mechanical sensitivity in a chronic large animal model. Pain Accepted. Meijs, S., Andreis, F. R., Janjua, T. A. M., and Jensen, W. (2024b). Reliability of a cranial window for chronic epidural recordings from the pig primary somatosensory cortex., in 2024 46th annual international conference of the IEEE engineering in medicine and biology society, (Orlando: IEEE). Melzack, R. (1990). Phantom limbs and the concept of a neuromatrix. Trends in Neurosciences 13, 88–92. doi: 10.1016/0166-2236(90)90179-E. Melzack, R. (1999). From the gate to the neuromatrix: Pain 82, S121–S126. doi: 10.1016/S0304-3959(99)00145-1. Michail, G., Dresel, C., Witkovský, V., Stankewitz, A., and Schulz, E. (2016). Neuronal Oscillations in Various Frequency Bands Differ between Pain and Touch. Front. Hum. Neurosci. 10. doi: 10.3389/fnhum.2016.00182. Mogil, J. S. (2009). Animal models of pain: progress and challenges. Nat Rev Neurosci 10, 283–294. doi: 10.1038/nrn2606. Mouraux, A., and Iannetti, G. D. (2018). The search for pain biomarkers in the human brain. Brain 141, 3290–3307. doi: 10.1093/brain/awy281. Ploner, M., and May, E. S. (2018). Electroencephalography and magnetoencephalography in pain research—current state and future perspectives. Pain 159, 206–211. doi: 10.1097/j.pain.0000000000001087. Ploner, M., Sorg, C., and Gross, J. (2017). Brain Rhythms of Pain. Trends in Cognitive Sciences 21, 100–110. doi: 10.1016/j.tics.2016.12.001. Rockholt, M. M., Kenefati, G., Doan, L. V., Chen, Z. S., and Wang, J. (2023). In search of a composite biomarker for chronic pain by way of EEG and machine learning: where do we currently stand? Front. Neurosci. 17, 1186418. doi: 10.3389/fnins.2023.1186418. Sadler, K. E., Mogil, J. S., and Stucky, C. L. (2022). Innovations and advances in modelling and measuring pain in animals. Nat Rev Neurosci 23, 70–85. doi: 10.1038/s41583-021-00536-7 Sales, A. C., Blockeel, A. J., Huxter, J. R., Dunham, J. P., Drake, R. A. R., Truini, A., et al. (2021). Trial by trial, machine learning approach identifies temporally discrete Aδ- and C-fibre mediated laser evoked potentials that predict pain behaviour in rats. Neuroscience doi: 10.1101/2021.08.10.455801. Schulz, E., Tiemann, L., Witkovsky, V., Schmidt, P., and Ploner, M. (2012). Gamma oscillations are involved in the sensorimotor transformation of pain. Journal of Neurophysiology 108, 1025–1031. doi: 10.1152/jn.00186.2012. Shirvalkar, P., Prosky, J., Chin, G., Ahmadipour, P., Sani, O. G., Desai, M., et al. (2023). First-in-human prediction of chronic pain state using intracranial neural biomarkers. Nat Neurosci 26, 1090–1099. doi: 10.1038/s41593-023-01338-z. Simonyan, Karen, Andrea Vedaldi, and Andrew Zisserman. "Deep inside convolutional networks: Visualising image classification models and saliency maps." arXiv preprint arXiv:1312.6034 (2013). Smilkov, D., Thorat, N., Kim, B., Viégas, F., & Wattenberg, M. (2017). Smoothgrad: removing noise by adding noise. arXiv preprint arXiv:1706.03825. Song, Yonghao, et al. "EEG conformer: Convolutional transformer for EEG decoding and visualization." IEEE Transactions on Neural Systems and Rehabilitation Engineering 31 (2022): 710-719. Sun, Mingxuan, et al. "EEG-based tonic cold pain intensity assessment using CNN-LSTM." 2022 3rd International Conference on Big Data, Artificial Intelligence and Internet of Things Engineering (ICBAIE). IEEE, 2022. Sundararajan, Mukund, Ankur Taly, and Qiqi Yan. "Axiomatic attribution for deep networks." International conference on machine learning. PMLR, 2017. Urban, R., Scherrer, G., Goulding, E. H., Tecott, L. H., and Basbaum, A. I. (2011). Behavioral indices of ongoing pain are largely unchanged in male mice with tissue or nerve injury-induced mechanical hypersensitivity. Pain 152, 990–1000. doi: 10.1016/j.pain.2010.12.003. Vaswani, Ashish, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. "Attention is all you need." Advances in neural information processing systems 30 (2017). Volkov, S. (2023). World Health Organization factsheet on Opioid Overdose. Opioid overdose. Available at: https://www.who.int/news-room/fact-sheets/detail/opioid-overdose [Accessed November 22, 2023]. Wager, T. D., Atlas, L. Y., Lindquist, M. A., Roy, M., Woo, C.-W., and Kross, E. (2013). An fMRI-Based Neurologic Signature of Physical Pain. N Engl J Med 368, 1388–1397. doi: 10.1056/NEJMoa1204471. Yang, R., & Modesitt, E. (2023). ViT2EEG: Leveraging Hybrid Pretrained Vision Transformers for EEG Data. arXiv preprint arXiv:2308.00454. Yue, L., Iannetti, G. D., and Hu, L. (2020). The Neural Origin of Nociceptive-Induced Gamma-Band Oscillations. J. Neurosci. 40, 3478–3490. doi: 10.1523/JNEUROSCI.0255-20.2020. Zeiler, M. D., and R. Fergus. "Visualizing and understanding convolutional networks. arXiv." arXiv preprint arXiv:1311.2901 (2013). Zhang, Z. G., Hu, L., Hung, Y. S., Mouraux, A., and Iannetti, G. D. (2012). Gamma-Band Oscillations in the Primary Somatosensory Cortex—A Direct and Obligatory Correlate of Subjective Pain Intensity. J. Neurosci. 32, 7429–7438. doi: 10.1523/JNEUROSCI.5877-11.2012. Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7658321","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":523722960,"identity":"ac7e89fe-a159-4c2d-b7f0-475da4b670e8","order_by":0,"name":"Nickolaj Ajay Atchuthan","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA70lEQVRIiWNgGAWjYDACZiBkKAARzMfggpINBLUYgAi2NAaGBGK0MEC0AAGPGXFazNmZHxt8MLBj528/8+3hzx8M8vwzEhhvzsCjxbKZzThxhkEys8SZ3O3GPAkMhjNuJDBbbsCjxeAwD/NhHgNmZoYDudukgQ5jbLiRwCb5gLCWemb582+eSf5IYLCfT4yWZB6Dw8wGN3LYJIAOS9wA0oLfYWzGhjMMjjMb3nhmJs2TJpG88czDZkt83jc4f/ixxIeK6mS588lAh9nY2M47nnzwZg8eLTCQDKUlgJixgQgNDAx2RKkaBaNgFIyCkQkAVglH08cC9mgAAAAASUVORK5CYII=","orcid":"","institution":"Aalborg University","correspondingAuthor":true,"prefix":"","firstName":"Nickolaj","middleName":"Ajay","lastName":"Atchuthan","suffix":""},{"id":523722961,"identity":"71cc7cb8-1fa4-4364-8a30-6aa3b491d432","order_by":1,"name":"Mikkel Bjerre Danyar","email":"","orcid":"","institution":"Aalborg University","correspondingAuthor":false,"prefix":"","firstName":"Mikkel","middleName":"Bjerre","lastName":"Danyar","suffix":""},{"id":523722962,"identity":"aff2d07c-9dd1-4049-b885-0e0082ca68ec","order_by":2,"name":"Hjalte Færregård Clark","email":"","orcid":"","institution":"Aalborg University","correspondingAuthor":false,"prefix":"","firstName":"Hjalte","middleName":"Færregård","lastName":"Clark","suffix":""},{"id":523722963,"identity":"fcf88dd5-2303-44a1-9eb6-cdf65f354399","order_by":3,"name":"Felipe Rettore Andreis","email":"","orcid":"","institution":"Aalborg University","correspondingAuthor":false,"prefix":"","firstName":"Felipe","middleName":"Rettore","lastName":"Andreis","suffix":""},{"id":523722964,"identity":"05158044-1364-4e23-88c7-b4b0dd2e418b","order_by":4,"name":"Winnie Jensen","email":"","orcid":"","institution":"Aalborg University","correspondingAuthor":false,"prefix":"","firstName":"Winnie","middleName":"","lastName":"Jensen","suffix":""},{"id":523722965,"identity":"4d7ed434-89ef-4894-abb3-3daeca713157","order_by":5,"name":"Suzan Meijs","email":"","orcid":"","institution":"Aalborg University","correspondingAuthor":false,"prefix":"","firstName":"Suzan","middleName":"","lastName":"Meijs","suffix":""}],"badges":[],"createdAt":"2025-09-19 11:53:29","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7658321/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7658321/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":92690654,"identity":"0f95b610-1b25-4300-83ca-30f5f2497b59","added_by":"auto","created_at":"2025-10-03 04:53:53","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":914679,"visible":true,"origin":"","legend":"","description":"","filename":"XAIPaperBrainInfomaticsV7.docx","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/066351c8c98ca5c7c3fbe7e0.docx"},{"id":92690649,"identity":"5d376085-5880-44bc-a025-e53bc3966b5f","added_by":"auto","created_at":"2025-10-03 04:53:52","extension":"json","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":7650,"visible":true,"origin":"","legend":"","description":"","filename":"167efeb01e6d4221ba1c53dd22e1a761.json","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/31fba6af4d79e79c4dabdec4.json"},{"id":92690629,"identity":"c370b748-6dea-480b-a808-42886ebb3431","added_by":"auto","created_at":"2025-10-03 04:53:50","extension":"xml","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":144091,"visible":true,"origin":"","legend":"","description":"","filename":"167efeb01e6d4221ba1c53dd22e1a7611enriched.xml","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/58c789488db7babdae479e02.xml"},{"id":92690631,"identity":"3cbb8bd4-47d4-490f-b20a-91204ed0e025","added_by":"auto","created_at":"2025-10-03 04:53:51","extension":"png","order_by":3,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":226017,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/76dc8002c55b04e25ab99bfc.png"},{"id":92690657,"identity":"b6ad82ae-ae66-4f33-8b3c-44dfcf75794c","added_by":"auto","created_at":"2025-10-03 04:53:54","extension":"png","order_by":4,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":14973,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/93e9a47c9562da28c2f0bf36.png"},{"id":92690642,"identity":"0e3d9360-7235-402e-8c45-7001c56e6ee4","added_by":"auto","created_at":"2025-10-03 04:53:51","extension":"png","order_by":5,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":319639,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/6c9e5f5e0a46fb0ca7ada859.png"},{"id":92690630,"identity":"8095baac-e320-4d32-9e78-9a3acc28a845","added_by":"auto","created_at":"2025-10-03 04:53:50","extension":"png","order_by":6,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":366963,"visible":true,"origin":"","legend":"","description":"","filename":"floatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/dc8173d110e7747f2a91e4f1.png"},{"id":92690644,"identity":"7e19f7be-8d94-4ae9-9c1b-8a72f24c8f56","added_by":"auto","created_at":"2025-10-03 04:53:51","extension":"png","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":56431,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/d37cf33b5b7dd28e9e83dbac.png"},{"id":92690632,"identity":"97fcb9c4-a00f-4652-9206-694af10731b2","added_by":"auto","created_at":"2025-10-03 04:53:51","extension":"png","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":5505,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/1112e318d1b503ab3115260c.png"},{"id":92690650,"identity":"a82d6b83-46fb-43ed-a8ac-e4bd317afff2","added_by":"auto","created_at":"2025-10-03 04:53:52","extension":"png","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":38256,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/074ea7f939694907a7f2c8e7.png"},{"id":92690656,"identity":"3ec7b7ff-b1ee-4760-8b29-d9108f00b3e6","added_by":"auto","created_at":"2025-10-03 04:53:54","extension":"png","order_by":10,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":44970,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/7879afcd0db6440342ebf412.png"},{"id":92690652,"identity":"81fb5906-f874-42dc-9a8d-66fb5cb8f1f8","added_by":"auto","created_at":"2025-10-03 04:53:53","extension":"xml","order_by":11,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":139227,"visible":true,"origin":"","legend":"","description":"","filename":"167efeb01e6d4221ba1c53dd22e1a7611structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/607fde3acbc756132e342a57.xml"},{"id":92690645,"identity":"55ed2593-3c54-472e-82b4-bd2dda17b20b","added_by":"auto","created_at":"2025-10-03 04:53:51","extension":"html","order_by":12,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":150819,"visible":true,"origin":"","legend":"","description":"","filename":"earlyproof.html","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/3d04586d2c2e2627d97b4b54.html"},{"id":92690646,"identity":"148bceb0-a77c-41e3-91aa-9e428208db38","added_by":"auto","created_at":"2025-10-03 04:53:51","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":103792,"visible":true,"origin":"","legend":"\u003cp\u003eCNN architecture comprises an input layer featuring an STFT image, followed by two convolutional layers, two max-pooling layers, a flattening layer, two fully connected layers, and an output layer. The dimensions of input and output for each layer in the network are denoted within parentheses.\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/ef5152b8fa60d149289baf86.png"},{"id":92690655,"identity":"ffebd20d-de9b-4a1a-ac28-30c32e94076b","added_by":"auto","created_at":"2025-10-03 04:53:53","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":33729,"visible":true,"origin":"","legend":"\u003cp\u003eROC curve comparing the performance of a CNN model (orange line) to a random classifier (blue dashed line). The CNN achieves an area under the curve (AUC) of 0.722, indicating better-than-random performance in classification. Reprinted with permission from IEEE, Copyright © 2023 IEEE (Atchuthan et al., 2023).\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/a7dd74ec11683edd7d98087c.png"},{"id":92690651,"identity":"aeac0a84-cfc7-447c-8723-14a735049234","added_by":"auto","created_at":"2025-10-03 04:53:52","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":104644,"visible":true,"origin":"","legend":"\u003cp\u003eA grid overview of the three interpretability methods used in both classes. The first column is the average of all the inputs used for inference and interpretability. The rest of the columns are the averages of saliency, integrated gradients, and occlusion respectively (overlaid with STFT for direct comparison).\u003c/p\u003e","description":"","filename":"3.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/1264d2aa843f4f811a08105f.png"},{"id":92690653,"identity":"25c3c78d-f5c8-4b4f-89eb-47d9bec874b2","added_by":"auto","created_at":"2025-10-03 04:53:53","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":97776,"visible":true,"origin":"","legend":"\u003cp\u003eDelta maps reveal differences between noxious and non-noxious responses in both the spectrogram and the attribution maps (overlaid with STFT for direct comparison). In the delta maps, blue hues indicate lower intensity for the noxious condition (relative suppression), whereas red hues indicate higher intensity (relative activation). The dashed red line in each subplot indicates the same time-frequency point, to highlight corresponding attribution patterns across methods.\u003c/p\u003e","description":"","filename":"4.png","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/aec1934fa20499bb5d93417a.png"},{"id":94235343,"identity":"75e9e9a6-43d6-477e-8d02-e798539d8a7a","added_by":"auto","created_at":"2025-10-24 01:46:49","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":980109,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7658321/v1/61336951-52ad-4976-8cd6-500c1fb88806.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"A convolutional neural network to distinguish between brain responses to non-noxious and noxious input of the same modality: what does the machine see that we do not see?","fulltext":[{"header":"1 Introduction","content":"\u003cp\u003eThe primary and often pressing reason most people seek medical help is pain. Nevertheless, pain remains difficult to diagnose other than by subjective verbal descriptions. Moreover, it is difficult to treat pain, in particular chronic pain. Chronic pain affects approximately 20% of the general population and is therefore one of the most prevalent, costly, and disabling diseases of our time (James et al., \u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e2018\u003c/span\u003e; Davis et al., \u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e2020\u003c/span\u003e). Opioids are often prescribed against chronic pain, leading to large-scale addiction in approximately 10% of the patients, and opioid overdose deaths (Mackey and Kao, \u003cspan citationid=\"CR30\" class=\"CitationRef\"\u003e2019\u003c/span\u003e; Davis et al., \u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Volkov, \u003cspan citationid=\"CR54\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). To develop more effective drugs with fewer side effects, a more reliable, translational, and objective biomarker is needed (Davis et al., \u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e2020\u003c/span\u003e). The current, much debated, golden standard biomarker in pre-clinical trials is the withdrawal threshold (Mogil, \u003cspan citationid=\"CR38\" class=\"CitationRef\"\u003e2009\u003c/span\u003e; Burma et al., \u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e2017\u003c/span\u003e; Fisher et al., \u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). This is a measure of nociception and (hyper)sensitivity but cannot be equated with pain complaints of patients, as their complaints occur without a stimulus (Mogil, \u003cspan citationid=\"CR38\" class=\"CitationRef\"\u003e2009\u003c/span\u003e; Fisher et al., \u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). Furthermore, it appears that measures of hypersensitivity are not related to non-evoked pain in either humans (Forstenpointner et al., \u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e2021\u003c/span\u003e) or animals (Urban et al., \u003cspan citationid=\"CR52\" class=\"CitationRef\"\u003e2011\u003c/span\u003e). There is thus a pressing need for a biomarker that is objective, translatable between species, and selective to pain.\u003c/p\u003e\u003cp\u003eUsing brain signals to decode such information has the advantage that it is not prone to subjectivity and is thus an excellent candidate for a translational biomarker (Fisher, 2021). The search for a pain biomarker in the human brain has been ongoing since the 1990s (Melzack, \u003cspan citationid=\"CR35\" class=\"CitationRef\"\u003e1990\u003c/span\u003e, \u003cspan citationid=\"CR36\" class=\"CitationRef\"\u003e1999\u003c/span\u003e; Davis et al., \u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e2017\u003c/span\u003e; Mouraux and Iannetti, \u003cspan citationid=\"CR39\" class=\"CitationRef\"\u003e2018\u003c/span\u003e; Ploner and May, \u003cspan citationid=\"CR40\" class=\"CitationRef\"\u003e2018\u003c/span\u003e). Some success has been reported (Wager et al., \u003cspan citationid=\"CR55\" class=\"CitationRef\"\u003e2013\u003c/span\u003e), but the specificity of brain biomarkers remains a challenge, as the brain appears to respond similarly to pain and non-pain-related highly salient stimuli (Mouraux and Iannetti, \u003cspan citationid=\"CR39\" class=\"CitationRef\"\u003e2018\u003c/span\u003e; Ploner and May, \u003cspan citationid=\"CR40\" class=\"CitationRef\"\u003e2018\u003c/span\u003e). The search for a brain biomarker of pain is further hampered by a degree of subjectivity since specific features are apriori identified and extracted from the brain signals (Mouraux and Iannetti, \u003cspan citationid=\"CR39\" class=\"CitationRef\"\u003e2018\u003c/span\u003e; Rockholt et al., \u003cspan citationid=\"CR42\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), such as components of the event-related potentials (ERP) (Sales et al., \u003cspan citationid=\"CR44\" class=\"CitationRef\"\u003e2021\u003c/span\u003e), power in specific frequency bands (Shirvalkar et al., \u003cspan citationid=\"CR46\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) or brain regions of interest (Wager et al., \u003cspan citationid=\"CR55\" class=\"CitationRef\"\u003e2013\u003c/span\u003e). However, methods are available to remove subjectivity, given that deep learning algorithms can objectively extract features from complex data structures. Therefore, inputs to a deep learning classifier do not have to be specifically tailored or apriori selected; for instance, in brain signals, inputs presented to a deep learning classifier can be the entire time-domain signals, frequency spectrum, or time-frequency maps (Rockholt et al., \u003cspan citationid=\"CR42\" class=\"CitationRef\"\u003e2023\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eThis paper builds upon a convolutional neural network (CNN) classifier developed in a previous study, demonstrating proficiency in autonomously extracting features, from a spectral input derived from event-related potentials (ERPs) in animals (Atchuthan et al., \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Given the novelty of this \u0026micro;ECoG pain dataset and the goal of applying XAI techniques, a relatively simple CNN architecture was intentionally chosen to establish a baseline before exploring more complex models. While hybrid approaches (e.g., CNN-LSTM or transformer-based ) models may offer improved temporal modeling (GAO et al., \u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Lu et al., \u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), CNNs have shown superior performance compared to other networks when used on ERPs in various contexts (Craik et al., \u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e2019\u003c/span\u003e). A challenge with these models is to interpret how they weigh different features, since they are characterized by thousands or even millions of parameters (Angelov et al., \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). Not only is the parameter space large but parameters are difficult to relate to the physical phenomena they are predicting (i.e. electrophysiological responses).\u003c/p\u003e\u003cp\u003eThe primary goal of this study is therefore to implement and explore explainable artificial intelligence (XAI) methods to interpret a previously developed CNN model trained on somatosensory brain signals. Multiple interpretability methods, including Saliency, Integrated Gradients, and Occlusion, are used to comprehend which features within the spectrograms play a pivotal role in distinguishing between noxious and non-noxious brain signal classes. This approach presents a unique challenge in attempting to distinguish sensation from pain, which are correlated sensory experiences driven by Aβ, Aδ, and C peripheral nerve fiber populations. Moreover, it represents a novel application of interpretability techniques in the context of EEG-based pain research, as previous studies have primarily focused on traditional machine learning methods or black-box deep learning models without exploring their inner workings.\u003c/p\u003e"},{"header":"2 Materials and Methods","content":"\u003cp\u003eSurgeries were done on Danish landrace pigs, aiming to record neural signals from the primary somatosensory cortex (S1), in response to electrical stimulation (noxious and non-noxious). Responses were converted to spectrograms and utilized as input for a CNN. The CNN was evaluated using performance metrics such as accuracy, F1-score, and Receiver Operating Characteristic (ROC) Area Under the Curve (AUC). To enhance interpretability, we incorporate XAI methods and generate delta maps to highlight distinctions between noxious and non-noxious stimuli.\u003c/p\u003e\u003cdiv id=\"Sec3\" class=\"Section2\"\u003e\u003ch2\u003e2.1 Surgery\u003c/h2\u003e\u003cp\u003eEight female Danish Landrace pigs (average weight 30\u0026thinsp;\u0026plusmn;\u0026thinsp;4.6 kg) were used across 16 recordings. Given that chronic pain disproportionately affects females in the human population, using female subjects in translational pain research may improve relevance for modeling clinical conditions. To minimize variability in this limited dataset, a single sex were chosen for their consistency and ease of handling in laboratory settings. All surgical procedures and stimulation sessions were performed under deep anesthesia, and animals remained unconscious throughout the entire experimental period. This study exclusively focused on neural responses acquired during anesthesia, eliminating behavioral confounds. The experiments were approved by the Danish Veterinary and Food Administration under the Ministry of Food, Agriculture and Fisheries of Denmark (protocol number 2020-15-0201-00514). Anesthesia administration and surgical preparation were conducted by a qualified laboratory anesthetist. Electrode implantation and surgical procedures were performed by trained and experienced researchers. The methods and acquired data were used in this and previous studies (Meijs et al., \u003cspan citationid=\"CR33\" class=\"CitationRef\"\u003e2024a\u003c/span\u003e, \u003cspan citationid=\"CR34\" class=\"CitationRef\"\u003eb\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eAnimals were tranquilized with the zoletil blend for pigs without ketamine (5 ml zoletil - tiletamine 25 mg/ml and zolazepam 25 mg/ml-, 6.25 ml xylazine (20 mg/ml), and 2.5 ml butorphanol (10 mg/ml)), after which they were intubated. Anesthesia was maintained during surgery with sevoflurane (1.0%) and injection of propofol (10 mg/ml) and fentanyl (50 \u0026micro;g/ml). Procedures were performed in a sterile environment. Heart rate, core temperature, blood oxygenation, and expired CO2 were monitored continuously to ensure appropriate anesthetic depth. Anesthetic parameters were adjusted if one of these parameters was outside of the physiological range. During neural recordings, sevoflurane was turned off to prevent any depression of the neural signals while fentanyl and propofol levels were increased to maintain the anesthetic level.\u003c/p\u003e\u003cp\u003eA 10 cm midline incision was made, after which the subcutaneous skin was loosened. The periosteum was incised and held aside exposing the cranium. The bregma point was identified and a circular hole with 1 cm diameter was drilled lateral and frontal to the bregma point. Pilot research has shown that this provides access to the S1, which was confirmed by evoking a brain response using ulnar nerve stimulation (Meijs et al., \u003cspan citationid=\"CR34\" class=\"CitationRef\"\u003e2024b\u003c/span\u003e). A custom-made 3D-printed cranial window was implanted and fastened to the skull using stainless steel screws. One of these screws was used as a ground and reference for the neural recordings. A Neuronexus microelectrocorticography (\u0026micro;ECoG) electrode array with 32 electrodes in an 8x4 configuration (E32-1000-30-200, Neuronexus, Ann Arbor, USA) was placed on top of the dura to record ulnar nerve-evoked activity from the S1. The minimally invasive surgery technique was performed to increase animal welfare. S1 was selected as the measurement site due to its accessibility in both animals and humans, as well as its role in processing sensory discriminative information (Lim et al., \u003cspan citationid=\"CR27\" class=\"CitationRef\"\u003e2016\u003c/span\u003e).\u003c/p\u003e\u003cp\u003ePartly de-insulated stainless steel cooner wires were implanted subcutaneously in the forearm using 21 gauge needles. The wires were passed through the needles, after which the needles were removed leaving the de-insulated part under the skin. Movement responses were used to verify the placement of these electrodes. At the end of the experiments, the cortical site was sutured in two layers and afterward glued. The animals were awakened by shutting off the anesthesia.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec4\" class=\"Section2\"\u003e\u003ch2\u003e2.2 Recordings\u003c/h2\u003e\u003cp\u003eNon-noxious stimulation was delivered at twice the motor threshold, a level typically associated with activation of Aβ fibers, while noxious stimulation was applied at ten times the motor threshold, a range known to engage Aδ pathways (Chang et al., 2001). Motor threshold determination began at 50 \u0026micro;A. The stimulation intensity was then increased in 200 \u0026micro;A increments until a detectable motor response was elicited. Following this, the amplitude was reduced in 50 \u0026micro;A steps until the response was abolished. The current was subsequently raised again in 50 \u0026micro;A increments, with the lowest intensity that re-evoked a response defined as the threshold. The pulse shape was biphasic, asymmetric, rectangular, and charge-balanced to avoid tissue damage over time, with a secondary phase amplitude of 10% of the primary phase and an inter-pulse interval of 10 ms. Hundred non-noxious and 100 noxious stimuli were delivered to the ulnar nerve at a frequency of 0.5 Hz using a programmable stimulator (STG4008, Multichannel Systems, Reutlingen, Germany). This was repeated for three sets at a 10-minute interval.\u003c/p\u003e\u003cp\u003eThe cortical signals were recorded at a sampling frequency of 6 kHz using a Tucker-Davis Technologies system (TDT, Alachua, FL, USA), including a pre-amplifier (model SI-8), a processor (model RZ2), and a workstation (model WS8). Evoked responses were visualized online to confirm the placement and functionality of the cortical electrodes.\u003c/p\u003e\u003cp\u003eIn total, 16 recording sessions were conducted, comprising 42 sets of stimulations. Each set included 100 noxious and 100 non-noxious stimulations, recorded across 32 channels, resulting in 8,400 stimuli and a total of 268,800 channel-epochs. Following visual quality control, 360 noisy channel instances (i.e., specific channel-in-set recordings) were removed, corresponding to 72,000 discarded epochs. The final dataset contained 196,800 clean epochs, balanced between conditions (98,400 noxious and 98,400 non-noxious). Each retained epoch was then transformed using a Short-Time Fourier Transform (STFT) with a Hann window (350 samples, 50% overlap), producing 0\u0026ndash;250 Hz time\u0026ndash;frequency spectrograms that served as inputs to the CNN.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec5\" class=\"Section2\"\u003e\u003ch2\u003e2.3 Cortical Data Processing\u003c/h2\u003e\u003cp\u003eData pre-processing involved applying a series of filters and transformations to ensure optimal signal quality. Initially, a high-pass filter at 1 Hz (10th-order Butterworth) and a low-pass filter at 250 Hz (4th-order Butterworth) were employed. Subsequently, a 16th-order Butterworth filter was used to eliminate 50 Hz line noise, covering up to the fourth harmonic, with cut-off frequencies set at 48 Hz and 52 Hz. Both forward and backward filtering techniques were utilized, with the specified filter orders representing their effective application.\u003c/p\u003e\u003cp\u003eThe resulting spectrogram image had a time range of -50 to 500 ms on the x-axis and a frequency range of 0 to 250 Hz on the y-axis. The image resolution was 26.19 ms per pixel temporally and 17.24 Hz per pixel in the frequency domain. To facilitate CNN convergence, amplitude normalization was performed by scaling all amplitudes to the range of 0\u0026ndash;1, achieved by dividing each STFT's amplitudes by their maximum value. Further, interpolation (spline, zoom factor of two) was applied to increase resolution, thus enabling convolutions using different size filters. To minimize neural variability, we averaged 25 STFTs per subject, as this approach provided the highest classification accuracy with the fewest averages needed. The total number of epochs was 196,800, and after averaging, this resulted in 7,872 STFTs. The pre-processing steps were implemented using Python (version 3.9.7, 2022). This large volume of high-resolution \u0026micro;ECoG trials, combined with substantial variability across time, trials, and channels, provides a robust and diverse basis for model training, despite the limited number of animals.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec6\" class=\"Section2\"\u003e\u003ch2\u003e2.4 CNN Design and Performance Evaluation\u003c/h2\u003e\u003cp\u003eThe final architecture employed in this paper consisted of a sequential arrangement of two convolutional layers, two pooling layers, a flattening layer, two fully-connected layers, and an output layer. This design was refined through an iterative training strategy, where we systematically tested a range of parameters; STFT settings, kernel and filter sizes, dropout rates, and interpolation factors. One key parameter was modified at a time while monitoring validation performance to avoid overfitting. The final model was selected based on the lowest validation loss across multiple runs. (For a detailed overview of the model development and training methodology, see Atchuthan et al., \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e.)\u003c/p\u003e\u003cp\u003eThe convolutional layers utilized zero padding and Rectified Linear Unit (ReLU) activation functions. The initial convolutional layer featured four 5 x 5 pixel-sized kernels generating four feature maps, while the subsequent convolutional layer had eight 3 x 3 pixel-sized kernels producing eight feature maps. Following each convolutional layer, max pooling was implemented, with the first pooling layer utilizing a 3 x 3 kernel and a stride of 3, and the second pooling layer having a 2 x 2 kernel with a stride of 2. The flattening layer, comprising 120 neurons, processed the output from the second pooling layer, and this flattened data was then fed into the first fully connected layer containing 30 neurons. The first fully connected layer was linked to the second fully connected layer, which consisted of two neurons. Sigmoid activation functions were applied in both layers. The output layer, facilitating binary classification of noxious or non-noxious stimulation, comprised two neurons and utilized a softmax activation function for output normalization and posterior probability calculation for the actual classification task. During the training phase, dropout was incorporated as a regularization technique to reduce overfitting. Specifically, a dropout rate of 50% was employed for the convolutional layers, and for the first fully connected layer, a dropout rate of 70% was applied. Figure\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e provides an overview of the employed CNN architecture, while Table\u0026nbsp;\u003cspan refid=\"Tab1\" class=\"InternalRef\"\u003e1\u003c/span\u003e presents detailed information on the number of parameters.\u003c/p\u003e\u003cp\u003eThe data were split into training (60%), validation (20%), and test (20%) sets, with each set containing recordings from distinct animals to ensure subject independence. Cross-validation was not applied due to the computational demands of retraining a deep CNN across folds. Given the model\u0026rsquo;s scale and training time, repeated training runs on a subject-independent split were used instead, and the best-performing model (based on validation loss) was selected.\u003c/p\u003e\u003cp\u003eFor training and optimization, the chosen optimizer was a Nesterov-accelerated Adaptive Moment Estimation (NAdam), with a starting learning rate of 0.0002. NAdam is an extension of the Adam optimizer with added Nesterov Acceleration for the first-order momentum estimation, conceptually this means that the model will converge faster towards optima. Binary cross-entropy was implemented as the loss function, which is well-suited for this binary classification task. To enhance efficiency and prevent overfitting, a minimum validation loss checkpointing was implemented, and early stopping was activated if there was no decrease in validation loss over 100 epochs. The batch size was set to 50. Data splitting for training, testing, and validation involved allocating 60%, 20%, and 20% of the data, respectively, ensuring no overlap between subjects. The algorithm was implemented using the PyTorch framework (version 1.11.0, 2022). The GPU utilized for training was an NVIDIA GeForce RTX 3080 with CUDA 11.6.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab1\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eOverview of parameters of each layer of the proposed CNN. The modules are presented in chronological order.\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"3\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eLayer No.\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eModules\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eParameters\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003e1\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003econv1.weight\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e100\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003econv1.bias\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e4\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003e2\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003econv2.weight\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e288\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003econv2.bias\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e8\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003e3\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003efc1.weight\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e3600\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003efc1.bias\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e30\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003e4\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003efc2.weight\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e60\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003efc2.bias\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e2\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003eThe assessment of CNN\u0026rsquo;s performance involved three crucial metrics: accuracy, F1-score, and the ROC-AUC. These calculations were also performed to ensure comparability with other studies. Accuracy is a comprehensive performance measure unaffected by classification error types. To address this F1-score was also computed. F1 integrates precision and true positive rate, thereby taking into account class imbalance in the dataset.\u003c/p\u003e\u003cp\u003eThe ROC analysis, a binary classification evaluation method, focuses on the true positive rate (TPR) and false positive rate (FPR). The resulting ROC curve illustrates classifier performance, with AUC serving as a performance metric. An AUC of 0.5 indicates no discrimination, 0.7 to 0.8 is acceptable, 0.8 to 0.9 is excellent, and values exceeding 0.9 are outstanding. (Mandrekar, \u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e2010\u003c/span\u003e)\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec7\" class=\"Section2\"\u003e\u003ch2\u003e2.5 Model Interpretability Methods and Analysis\u003c/h2\u003e\u003cp\u003eTo thoroughly comprehend the underlying importance of features within the architecture, diverse interpretability methods were employed. Emphasis was on attribution methods providing a holistic overview of the network's weighting. For this Saliency, Integrated gradients and Occlusion were chosen. (Kokhlikyan et al., \u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e2020\u003c/span\u003e)\u003c/p\u003e\u003cp\u003eNoiseTunnel was integrated on top of all methods, to ensure more robust attribution maps, by iteratively adding noise to a method's input and averaging the calculated attributions. This is to overcome the noisiness that occurs when introducing ReLU activation functions to a network. (Smilkov et al., 2020). NoiseTunnel was implemented with the 'smoothgrad_sq' method since it removes noise while still keeping detail. The key disadvantage to this method is the computational overhead that scales linearly with number of samples. Hence, the sample size (nt_samples) was fixed at 50, as additional increments yielded diminishing returns, also reported by (Smilkov et al., 2020). Finally, a standard deviation of 0.2 was employed, striking a balance between the sharpness of the attribution maps and noise, also reported by (Smilkov et al., 2020). The Python package Captum was utilized for implementing feature attribution methods. (Kokhlikyan et al., \u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e2020\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eA total of 600 epochs from the original test dataset were used for each class to prevent overfitted attributions. Data was derived from the same subject. Each epoch was subsequently utilized as an input for the NoiseTunnel and Model Interpretability techniques. Following this, the attributions were aggregated and averaged for both classes, resulting in a final averaged map for each method. Additionally, an averaged spectrogram was derived for both classes, to facilitate comparison between signal and attribution. In summary, this process yielded a set of three attribution maps and one spectrogram for both the noxious and non-noxious classes.\u003c/p\u003e\u003cp\u003eSaliency is a baseline approach for exploring network attention, which computes the gradients of the input with respect to the output. When the absolute value of these gradients is computed, they can be used as importance scores for each feature. Conceptually, the approach involves a first-order Taylor expansion of the network with respect to the input, emphasizing coefficients assigned to each feature. (Simonyan et al., \u003cspan citationid=\"CR47\" class=\"CitationRef\"\u003e2013\u003c/span\u003e). Saliency was chosen as a baseline method for comparison with other model interpretability methods.\u003c/p\u003e\u003cp\u003eIntegrated Gradients represent a more advanced and contemporary methodology within the domain of gradient-based techniques. It gauges the contribution of each feature by computing the integral of gradients of the model's output concerning that feature, tracing a path from a baseline input to the actual input (Sundararajan et al., \u003cspan citationid=\"CR51\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). This method was implemented in response to disparities from Saliency, providing a more comprehensive understanding of the model. A crucial distinction lies in its implementation invariance, focusing solely on input and output and disregarding the network's architecture. Additionally, this method also satisfies the sensitivity axiom, meaning that change in an important feature should show an equal amount of change in the predictability of a class, and oppositely this should be true for less important features. (Sundararajan et al., \u003cspan citationid=\"CR51\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). Furthermore, Integrated Gradients exhibited a notable capability for producing feature maps with reduced noise, thereby enhancing its overall effectiveness. To implement Integrated Gradients, employed the 'Gauss-Legendre' method for integral approximation, integrating 50 steps between the baseline and the input interpolation while utilizing a zero scalar baseline. This approach ensured a smoother and more precise feature representation, contributing to improved interpretability.\u003c/p\u003e\u003cp\u003eOcclusion was employed to address potential biases arising from the exclusive utilization of gradient-based methods, such as saliency and integrated gradients. Occlusion, a perturbation-based approach, involves selectively masking distinct regions of the input image using predefined filters (Zeiler et al., 2013). This method looks at the impact of the model's discriminative prowess when removing specific features. When a masked feature is identified as discriminative, it receives a correspondingly high score, culminating in the generation of a feature attribution map. In our implementation, we employed a 1x1 mask with strides of 1, ensuring a more detailed attribution map. By utilizing smaller filters, we captured intricate details regarding the precise locations of the crucial features. Given that the input image measured 28 x 42, it was crucial to maintain compact filters to preserve the overall fidelity of the analysis.\u003c/p\u003e\u003cp\u003eDelta maps were created to highlight the key differences between the two classes noxious and non-noxious. They were computed by subtracting the non-noxious from the noxious class. Linear normalization was done after subtraction for attribution maps to avoid attributions being heightened from one class and enable better comparability between interpretability methods. For the spectrogram, a different colormap was used to highlight suppression and excitation.\u003c/p\u003e\u003cp\u003eAll interpretability methods were implemented using the Captum framework (version 0.6.0, 2023).\u003c/p\u003e\u003c/div\u003e"},{"header":"3 Results","content":"\u003cdiv id=\"Sec9\" class=\"Section2\"\u003e\u003ch2\u003e3.1 CNN Performance\u003c/h2\u003e\u003cp\u003eThe algorithm excelled in predicting non-noxious stimuli, achieving an 85% correct prediction rate. However, its performance diminished for noxious stimuli, yielding a 62% correct prediction rate. The classifier's accuracy and F1 score were 73.5% and 70.1%, respectively. In the binary classification of noxious and non-noxious stimulations on the test data, the ROC curve's AUC reached 0.722, which is considered acceptable according to (Mandrekar, \u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e2010\u003c/span\u003e). The ROC curve shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e, consistently surpassed the line of no discrimination, indicating favorable classifier performance. Beyond an FPR of 0.9, the ROC curve regresses below the line of no discrimination. The optimal threshold is identified at the point closest to (0,1), aligning with a TPR of approximately 0.6 in these results.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec10\" class=\"Section2\"\u003e\u003ch2\u003e3.2 Model Interpretability\u003c/h2\u003e\u003cp\u003eWhile the STFTs (Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e) enable traditional peak-based comparison, the visual differences between classes are subtle and overlapping. Attribution methods, in contrast, revealed class-specific features not readily discernible from inspection activation alone. Based on the saliency analysis shown in Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e, it is evident that the attributions exhibit a more spread-out pattern for the non-noxious class. Particularly, prominent and sizable attribution patterns appear at 69\u0026ndash;174 ms at frequencies ranging from 27 to 72 Hz and around 250\u0026ndash;345 ms at 100\u0026ndash;160 Hz. Notably, both of these attributions demonstrate minimal overlap with the pattern of the input. Upon examination of the noxious response, it becomes apparent that the aforementioned spread-out attributions are comparatively less pronounced. Instead, a more prominent peak emerges at 93\u0026ndash;173 ms with frequencies 36 to 72 Hz, resembling the one seen in the non-noxious response.\u003c/p\u003e\u003cp\u003eContrary to the saliency method, the integrated gradients technique demonstrates a greater concurrence with peaks in both classes at 15\u0026ndash;43 ms and 55\u0026ndash;95 ms with frequencies below 50 Hz (Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e). This specific coherence appears to be notably similar in both classes, albeit less pronounced in the noxious category. The most substantial difference in the noxious class occurs at 81\u0026ndash;160 ms, involving frequencies spanning from 27\u0026ndash;71 Hz. Notably, this distinct pattern within the noxious category exhibits minimal overlap with the actual input.\u003c/p\u003e\u003cp\u003eThe occlusion map depicted in Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e exhibits resemblances in attributions to the saliency analysis, particularly in the non-noxious class. The non-noxious map reveals speckle-like features that extend across the attribution map following the stimulation. The densest concentration of attributions is notably observed immediately after stimulation, 16\u0026ndash;55 ms, with frequencies at 27\u0026ndash;54 Hz. Additionally, there exists a distinct occurrence of late-stage attribution at 409\u0026ndash;435 ms, with frequencies at 98\u0026ndash;125 Hz. Upon inspecting the noxious class, noteworthy parallels can be drawn between the occlusion map and the other methods, particularly attribution at 80\u0026ndash;160 ms, with frequencies across 36\u0026ndash;72 Hz.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eThe analysis of delta maps (Fig.\u0026nbsp;\u003cspan refid=\"Fig4\" class=\"InternalRef\"\u003e4\u003c/span\u003e) indicates predominantly negative values, suggesting a suppressive tendency in the noxious response compared to the non-noxious counterpart, particularly below 50 Hz, likely attributed to the 1/f limitation inherent in the signal. Temporally, suppressive phenomena occur at 0\u0026ndash;55, 66\u0026ndash;108, 212\u0026ndash;252, and 345\u0026ndash;409 ms, with less pronounced occurrences at 435\u0026ndash;475 ms. Excitation is observed around 64\u0026ndash;135 ms, initially as a temporally large feature and transitioning into a more specific pattern with a frequency range of 0\u0026ndash;60 Hz, overlapping with low-frequency suppression in the 0\u0026ndash;26 Hz range.\u003c/p\u003e\u003cp\u003eDelta attribution maps consistently show patterns at approximately 93\u0026ndash;173 ms and 35\u0026ndash;75 Hz. Disparities arise in integrated gradients, with some attributions occurring before 93 ms, overlapping with the input excitation. However, the majority of attributions from all maps manifest after the nearest excitation.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e"},{"header":"4 Discussion","content":"\u003cdiv id=\"Sec12\" class=\"Section2\"\u003e\u003ch2\u003e4.1 CNN Performance\u003c/h2\u003e\u003cp\u003eThe CNN used in this study was able to distinguish between non-noxious and noxious signals with an acceptable to good performance, with an accuracy of 73.5%. While the CNN showed strong performance for non-noxious stimuli (85% accuracy), classification of noxious stimuli was lower (62%). The relatively lower accuracy on noxious stimuli can be attributed to the overlapping spectral features between the two classes. Although class sizes were balanced during training, the CNN may have struggled to distinguish subtle differences due to shared components in the evoked responses. Apart from class balancing, no additional methods such as class weighting or focal loss were applied (Lin et al., \u003cspan citationid=\"CR28\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). These methods may help mitigate the disparity and should be explored in future work. The various interpretability methods consistently demonstrated that the difference between non-noxious and noxious responses did not align with the visible ERP, which appears reduced in noxious responses compared to non-noxious ones. Instead, it occurs slightly later (93\u0026ndash;173 ms) and in a higher frequency band (35\u0026ndash;75 Hz).\u003c/p\u003e\u003cp\u003eSeveral studies have been conducted comparing brain signals as inputs using a CNN. Chen et al. (\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) developed a CNN to classify movement-induced pain in 10 subjects, yielding an AUC between 0.80\u0026ndash;0.84 depending on the brain regions used. This is comparable to our study with an AUC of 0.72. It should be noted that Chen et al. (\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) distinguished between evoked and resting states. This difference implies potentially less overlap in signal characteristics since the model would be able to do the actual classification based on simple peak detection, thereby facilitating a relatively simpler classification task. In contrast, our study presents a more complex challenge as it discriminates between two overlapping stimulation types which are characterized by overlapping features (non-noxious: Aβ, noxious: Aβ \u0026amp; Aδ). This makes the model and findings more robust and applicable to the real world. In real-world scenarios, most painful experiences are typically accompanied by non-painful sensations, either preceding the painful stimulus or in the area around it. Therefore, a biomarker specific to pain should be able to distinguish the two.\u003c/p\u003e\u003cp\u003eShirvalkar et al. (\u003cspan citationid=\"CR46\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) trained separate models for each of their four subjects using leave-one-out cross-validation (LOOCV), focusing on personalized models. In contrast, our study trained a single model across 16 sessions to promote generalizability across individuals. While subject-specific models may better capture individual patterns, they risk overfitting due to limited data per subject. Chen et al. (\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) used leave-one-subject-out cross-validation (LOSOCV), which supports generalization but can be affected by uneven data distribution\u0026mdash;making it harder to attribute performance differences to the model or dataset. Future studies may benefit from incorporating LOSOCV to further assess robustness.\u003c/p\u003e\u003cp\u003eGhosh et al. (\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2021\u003c/span\u003e) achieved 73.02% accuracy using a CNN with the Hilbert spectrum\u0026mdash;comparable to our result of 73.5%. However, combining the CNN with a Bidirectional LSTM significantly improved performance to 91.3%, a trend also seen in other studies, such as Gao et al. (\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e2020\u003c/span\u003e), who reported 91.86% accuracy using a CNN-LSTM architecture. Ghosh et al. also incorporated spatial features, which may further enhance classification but would require a larger dataset, as using all channels reduces the number of usable epochs. In our study, electrodes were limited to the primary somatosensory cortex, where spatial activity is likely correlated. Future work could explore multi-region recordings\u0026mdash;e.g., including the prefrontal cortex\u0026mdash;to meaningfully leverage spatial information.\u003c/p\u003e\u003cp\u003eThese studies suggest that a standalone CNN may be insufficient for optimal performance, partly due to its translation invariance, which limits its ability to capture temporal dynamics in EEG-like data (Livezey \u0026amp; Glaser, 2021). Combining CNNs with architectures like LSTMs offers a promising solution. CNNs are effective at extracting spatial features, while LSTMs capture temporal dependencies (Amrani et al., \u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e2021\u003c/span\u003e; Ghosh et al., \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). Sun et al. (\u003cspan citationid=\"CR50\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) applied a CNN\u0026ndash;LSTM hybrid architecture to spectral EEG data for cold pain classification, achieving 88% accuracy. To our knowledge, this is the only prior study applying such a hybrid model specifically for pain detection, underscoring the relevance of exploring temporal modeling in future work Although we did not implement a hybrid CNN-LSTM in this study to avoid added complexity, especially given the underexplored nature of \u0026micro;ECoG pain decoding, future studies should consider such architectures to better leverage temporal patterns in the data.\u003c/p\u003e\u003cp\u003eAnother solution would be to implement transformers, which can offer computational benefits by avoiding recursion and enabling parallel computation. This is achieved while maintaining performance in handling long-term dependencies by processing input as a whole (Vaswani et al., \u003cspan citationid=\"CR53\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). The nature of this method enhances interpretability, as the attention mechanism in transformers reveals the significance specific features have on classification accuracy (Maur\u0026iacute;cio et al., \u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Furthermore, exploring the use of Vision Transformers (ViT) instead of CNN\u0026rsquo;s could be worthwhile. ViTs demonstrate superior performance on noisy data and require fewer computational resources (Maur\u0026iacute;cio et al., \u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Additionally, ViTs are observed to generally have better or comparable performance to CNNs (Yang et al., 2023; Maur\u0026iacute;cio et al., \u003cspan citationid=\"CR31\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). In EEG decoding tasks, Song et al. (\u003cspan citationid=\"CR49\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) achieved 79\u0026ndash;85% accuracy on motor imagery and 95% on emotion classification using a CNN-transformer hybrid. Lu et al. (\u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) reported 88% accuracy with a spatio-temporal Vision Transformer (Bi-ViT) for emotion classification. Recent studies have also applied transformer-based architectures to EEG. Song et al. (\u003cspan citationid=\"CR49\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) achieved 79\u0026ndash;85% accuracy on motor imagery and 95% on emotion classification using a CNN\u0026ndash;Transformer model. Lu et al. (\u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) reached 88% with a spatio-temporal Vision Transformer (Bi-ViT) for emotion classification. These results highlight the potential of attention-based models for complex EEG decoding tasks.\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab2\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003ePerformance comparison of deep learning architectures applied to EEG datasets.\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"5\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eStudy\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eModel\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eInput\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eTask\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c5\"\u003e\u003cp\u003eAccuracy (%)\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eAtchuthan et al. (\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCNN\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e\u0026micro;ECoG (Time-Frequency)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003ePain Classification\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e74\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eChen et al. (\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e2022\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCNN\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eEEG (Time-Frequency)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003ePain Classification\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e84\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eSun et al., (\u003cspan citationid=\"CR50\" class=\"CitationRef\"\u003e2022\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCNN - LSTM\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eEEG (Spectral)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eCold Pain Classification\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e88\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eGhosh et al. (\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2021\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCNN - Bi-LSTM\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eEEG (Hilbert)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eFace Perceptual Ability\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e91\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eGao et al. (\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e2020\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCNN - LSTM\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eEEG (Spectral)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eVisual Evoked Potential\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e92\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003eSong et al. (\u003cspan citationid=\"CR49\" class=\"CitationRef\"\u003e2022\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003eCNN - Transformer\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003eEEG (Time Series)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eMotor Imagery and\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e79\u0026ndash;85\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eEmotion Classification\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e95\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eLu et al. (\u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2023\u003c/span\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eBi-ViT\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003eEEG (Spatio-Temporal)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eEmotion Classification\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e88\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003eFinally, it is noteworthy that substantial performance improvements can be attained through the utilization of pre-trained models. These models, initially trained on conventional images, have demonstrated the ability to enhance classification performance even when applied to EEG datasets (Yang et al., 2023), which often are limited by resources and time constraints. Leveraging pre-trained models could serve as a valuable alternative, offering a synthetic boost to performance in scenarios where such limitations exist. Moreover, data augmentation strategies, such as segmentation and recombination, may enhance training performance by increasing dataset variability (Song et al., \u003cspan citationid=\"CR49\" class=\"CitationRef\"\u003e2022\u003c/span\u003e).\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec13\" class=\"Section2\"\u003e\u003ch2\u003e4.2 Interpretability Methods (XAI)\u003c/h2\u003e\u003cp\u003eThree interpretability methods were used to determine which features distinguished the brain responses to noxious from brain responses to non-noxious stimulation. The main attribution that was consistently highlighted by all methods occurred 93\u0026ndash;173 ms after the stimulus in the 35\u0026ndash;75 Hz frequency band, or gamma band (Buzs\u0026aacute;ki and Wang, \u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Ploner et al., \u003cspan citationid=\"CR41\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). Activity in this frequency band is related to phasic, tonic, and chronic pain in humans and rodents (Li et al., \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Gamma band oscillations (GBOs) can be elicited by stimulation of various modalities (Li et al., \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2023\u003c/span\u003e), including electrical stimulation, as used in this study. Stimulation-evoked gamma oscillations encode pain variability and encode pain perception independent of saliency (Schulz et al., \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Zhang et al., \u003cspan citationid=\"CR59\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Heid et al., \u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Yue et al., \u003cspan citationid=\"CR57\" class=\"CitationRef\"\u003e2020\u003c/span\u003e; Li et al., \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). This stimulus-evoked activity is generated in S1 (Yue et al., \u003cspan citationid=\"CR57\" class=\"CitationRef\"\u003e2020\u003c/span\u003e) and is spatially somatotopically organized (Heid et al., \u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e2020\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eGBOs are phylogenetically preserved in humans and rodents (Li et al., \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). This study is the first to show that they also exist in pigs. The brain area where GBOs are generated is consistent in humans, rodents, and pigs, but their frequency band and latency vary (Li et al., \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). The frequencies observed in rodents are higher than those observed in humans (30\u0026ndash;100 Hz), and the current results are in the lowest frequency ranges of those observed in humans (Li et al., \u003cspan citationid=\"CR26\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). It should be noted, however, that this study was not optimized to detect GBOs like other hypothesis-driven approaches. Typically GBOs are visualized as percentage change from baseline (Schulz et al., \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Michail, 2016). It is likely that the CNN performance could be further improved, by transforming the time-frequency maps to show the percentage change from baseline. Indeed, there is evidence that GBOs are related to pain ratings at the single-session level (Michail et al., \u003cspan citationid=\"CR37\" class=\"CitationRef\"\u003e2016\u003c/span\u003e; Black et al., \u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e2023\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eDue to the cross-species preservation of GBOs during nociceptive processing, the features identified in this study may hold translational potential. A CNN-based pain detection system that leverages GBO patterns could be particularly useful in non-verbal populations\u0026mdash;such as infants, unconscious patients, or animals\u0026mdash;where subjective reporting is impossible. In pre-clinical settings, this approach could address a major limitation of current models: the lack of objective biomarkers for spontaneously occurring pain (Sadler et al., \u003cspan citationid=\"CR43\" class=\"CitationRef\"\u003e2022\u003c/span\u003e). Establishing such a biomarker has been linked to improved success in analgesic drug development (Davis et al., \u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e2020\u003c/span\u003e). However, we also note that using GBOs in practice would require consideration of inter-species differences and measurement constraints. However, the use of pigs marks a substantial step toward translatability, as their neuroanatomy is more comparable to humans than rodent models typically used in pain research.\u003c/p\u003e\u003cp\u003eWhile these findings are promising, the practical implementation of such a system in clinical settings is outside the scope of this study. Successful translation will require larger, more diverse datasets and, ultimately, validation in non-invasive paradigms using EEG.\u003c/p\u003e\u003cp\u003eThe interpretability methods also revealed that the CNN also attributes the low-frequency activity that is time-locked to the stimulus. This activity is evoked by both stimuli and is equally attributed to both classes by the CNN. Other studies have found differences in the lower theta and alpha frequency bands (Schulz et al., \u003cspan citationid=\"CR45\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Michail et al., \u003cspan citationid=\"CR37\" class=\"CitationRef\"\u003e2016\u003c/span\u003e). A plausible explanation for why no differences were detected by the CNN is that the theta frequency (4\u0026ndash;8 Hz) is not distinguishable from alpha frequencies (8\u0026ndash;13 Hz) in our frequency maps (resolution: 9 Hz). While theta frequencies are enhanced, alpha frequencies are suppressed by noxious stimulation (Michail et al., \u003cspan citationid=\"CR37\" class=\"CitationRef\"\u003e2016\u003c/span\u003e; Heid et al., \u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e2020\u003c/span\u003e), which overlaps with the current frequency resolution. Another reason could be that theta and alpha frequencies are to some extent related to saliency and attention (Bauer et al., \u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e2006\u003c/span\u003e; Michail et al., \u003cspan citationid=\"CR37\" class=\"CitationRef\"\u003e2016\u003c/span\u003e), where pain is typically more salient than a non-noxious stimulus. In our study, subjects are anesthetized, which would diminish the difference in saliency.\u003c/p\u003e\u003cp\u003eComparing the different interpretability methods revealed minute differences. Here, integrated gradients seem to exhibit a higher degree of overlap with the visible peak of the signal. However, some ambiguity remains as to whether this implies that integrated gradients is capturing fewer critical features overlooked by other methods. The reason why this method highlights these differences more than others could be explained by how integrated gradients aggregate gradients across different interpolations between a blank image and the original input (Sundararajan et al., \u003cspan citationid=\"CR51\" class=\"CitationRef\"\u003e2017\u003c/span\u003e). This aggregation may lift features with strong attributions even in areas with low pixel intensity. Notably, these patterns in noxious signals bear resemblances to non-noxious ones, potentially explaining instances where the model misclassifies noxious signals as non-noxious. This is consistent with the observed false negatives, accounting for 38%. In contrast, saliency exhibits more noisy attributions, which could be explained by the lack of aggregation of multiple interpolated images like integrated gradients (Simonyan et al., \u003cspan citationid=\"CR47\" class=\"CitationRef\"\u003e2013\u003c/span\u003e). Lastly, the occlusion method tended to smooth and remove details, possibly leading to a loss of important information. This could be due to the coarse nature of the occlusion process, where individual regions are sequentially masked (Zeiler et al., 2013).\u003c/p\u003e\u003cp\u003eIn most interpretability methods, it was consistently observed that feature attribution was strongest when unrelated to peaks, underscoring the importance of objective feature learning. While there may be a certain bias in how the input was prepared and in the selection of the neural network architecture, this method represents a relatively more unbiased approach. The dataset was not specifically tailored for optimal GBO detection, yet it successfully identified them. Traditional approaches, such as manually comparing spectrograms, might overlook such subtle nuances, highlighting the significance of neural networks in revealing hidden insights beyond traditional peak detection in spectrograms.\u003c/p\u003e\u003cp\u003eConsidering the variations in the individual methods, a combined approach utilizing multiple attribution methods is therefore recommended for a comprehensive analysis.\u003c/p\u003e\u003c/div\u003e"},{"header":"5 Conclusion and Outlook","content":"\u003cp\u003eWe developed a CNN to distinguish between noxious and non-noxious stimuli with 73.5% accuracy, despite the overlap in activated nerve fibers that is inherent to electrical stimulation. This overlap is considered an advantage of the methodology, rather than a drawback. Most noxious stimuli will be accompanied by non-noxious input, so the ability to distinguish the two increases its specificity as a biomarker. XAI methods revealed that the most substantial difference between noxious and non-noxious responses occurred at 93\u0026ndash;173 ms post-stimulus, involving frequencies from 35\u0026ndash;75 Hz. This frequency range was consistent with GBOs. CNN-driven pain detection can be useful to detect noxious events in non-verbal patients, e.g. infants, unconscious or veterinary patients and has the potential to transform pre-clinical research, which warrants greater success in drug development.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003e6 Conflict of Interest\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eThe authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest\u003c/em\u003e.\u003c/p\u003e\n\u003cp\u003e7 Author Contributions\u003c/p\u003e\n\u003cp\u003eM.B.D., H.F.C., and N.A.A. performed the data analysis and implemented/trained the CNN. N.A.A. developed and applied the new XAI methods and prepared the figures. S.M. and N.A.A. drafted the manuscript. S.M. and W.J. conceived the study. S.M., F.R.A., and W.J. collected the data. F.R.A., W.J., M.B.D., and H.F.C. reviewed the manuscript.\u003c/p\u003e\n\u003cp\u003e8 Funding\u003c/p\u003e\n\u003cp\u003eThis work was funded by the Center for Neuroplasticity and Pain (CNAP). CNAP is supported by the Danish National Research Foundation (DNRF121).\u003c/p\u003e\n\u003cp\u003e9 Acknowledgements\u003c/p\u003e\n\u003cp\u003eWe thank the staff at the biomedical laboratory of Aalborg University Hospital for their assistance during the experiments.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eAmrani, G., Adadi, A., Berrada, M., Souirti, Z., \u0026amp; Boujraf, S. (2021, October). EEG signal analysis using deep learning: A systematic literature review. In 2021 Fifth International Conference On Intelligent Computing in Data Sciences (ICDS) (pp. 1-8). IEEE.\u003c/li\u003e\n\u003cli\u003eAngelov, P. P., Soares, E. A., Jiang, R., Arnold, N. I., \u0026amp; Atkinson, P. M. (2021). Explainable artificial intelligence: an analytical review. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 11(5), e1424. https://doi.org/10.1002/widm.1424 \u003c/li\u003e\n\u003cli\u003eAtchuthan, N. A., Clark, H., Danyar, M. B., Andersen, A. K., Andreis, F. R., \u0026amp; Meijs, S. (2023, April). Classification of noxious and non-noxious event-related potentials from S1 in pigs using a convolutional neural network. In 2023 11th International IEEE/EMBS Conference on Neural Engineering (NER) (pp. 1-4). IEEE.\u003c/li\u003e\n\u003cli\u003eBauer, M., Oostenveld, R., Peeters, M., and Fries, P. (2006). Tactile Spatial Attention Enhances Gamma-Band Activity in Somatosensory Cortex and Reduces Low-Frequency Activity in Parieto-Occipital Areas. J. Neurosci. 26, 490\u0026ndash;501. doi: 10.1523/JNEUROSCI.5228-04.2006.\u003c/li\u003e\n\u003cli\u003eBlack, C. J., Saab, C. Y., and Borton, D. A. (2023). Transient gamma events delineate somatosensory modality in S1. Neuroscience doi: 10.1101/2023.03.30.534945.\u003c/li\u003e\n\u003cli\u003eBurma, N. E., Leduc-Pessah, H., Fan, C. Y., and Trang, T. (2017). Animal models of chronic pain: Advances and challenges for clinical translation: Animal Models of Chronic Pain. Journal of Neuroscience Research 95, 1242\u0026ndash;1256. doi: 10.1002/jnr.23768.\u003c/li\u003e\n\u003cli\u003eBuzs\u0026aacute;ki, G., and Wang, X.-J. (2012). Mechanisms of Gamma Oscillations. Annu. Rev. Neurosci. 35, 203\u0026ndash;225. doi: 10.1146/annurev-neuro-062111-150444.\u003c/li\u003e\n\u003cli\u003eChang, Chen, og Bai-Chuang Shyu. \u0026ldquo;A fMRI study of brain activations during non-noxious and noxious electrical stimulation of the sciatic nerve of rats\u0026rdquo;. Brain Research 897, nr. 1 (6. april 2001): 71\u0026ndash;81. https://doi.org/10.1016/S0006-8993(01)02094-7.\u003c/li\u003e\n\u003cli\u003eChen et al., 2022. Duo Chen, Haihong Zhang, Perumpadappil Thomas Kavitha, Fong Ling Loy, Soon Huat Ng, Chuanchu Wang, Kok Soon Phua, Soon Yin Tjan, Su-Yin Yang and Cuntai Guan. Scalp EEG-Based Pain Detection Using Convolutional Neural Network. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 30, 274\u0026ndash;285, 2022.\u003c/li\u003e\n\u003cli\u003eCraik et al., 2019. Alexander Craik, Yongtian He and Jose L Contreras-Vidal. Deep learning for electroencephalogram (EEG) classification tasks: a review. Journal of neural engineering, 16(3), 031001, 2019. \u003c/li\u003e\n\u003cli\u003eDavis, K. D., Aghaeepour, N., Ahn, A. H., Angst, M. S., Borsook, D., Brenton, A., et al. (2020). Discovery and validation of biomarkers to aid the development of safe and effective pain therapeutics: challenges and opportunities. Nat Rev Neurol 16, 381\u0026ndash;400. doi: 10.1038/s41582-020-0362-2.\u003c/li\u003e\n\u003cli\u003eDavis, K. D., Flor, H., Greely, H. T., Iannetti, G. D., Mackey, S., Ploner, M., et al. (2017). Brain imaging tests for chronic pain: medical, legal and ethical issues and recommendations. Nat Rev Neurol 13, 624\u0026ndash;638. doi: 10.1038/nrneurol.2017.122.\u003c/li\u003e\n\u003cli\u003eDobariya, A., El Ahmadieh, T. Y., Good, L. B., Hernandez-Reynoso, A. G., Jakkamsetti, V., Brown, R., et al. (2022). Recording of pig neuronal activity in the comparative context of the awake human brain. Sci Rep 12, 15503. doi: 10.1038/s41598-022-19688-2.\u003c/li\u003e\n\u003cli\u003eDong, W. K., Chudler, E. H., Sugiyama, K., Roberts, V. J., and Hayashi, T. (1994). Somatosensory, multisensory, and task-related neurons in cortical area 7b (PF) of unanesthetized monkeys. Journal of Neurophysiology 72, 542\u0026ndash;564. doi: 10.1152/jn.1994.72.2.542.\u003c/li\u003e\n\u003cli\u003eDuo Chen, Haihong Zhang, Perumpadappil Thomas Kavitha, Fong Ling Loy, Soon Huat Ng, Chuanchu Wang, Kok Soon Phua, Soon Yin Tjan, Su-Yin Yang and Cuntai Guan. Scalp EEG-Based Pain Detection Using Convolutional Neural Network. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 30, 274\u0026ndash;285, 2022. \u003c/li\u003e\n\u003cli\u003eFisher, A. S., Lanigan, M. T., Upton, N., and Lione, L. A. (2021). Preclinical Neuropathic Pain Assessment; the Importance of Translatability and Bidirectional Research. Front. Pharmacol. 11, 614990. doi: 10.3389/fphar.2020.614990.\u003c/li\u003e\n\u003cli\u003eForstenpointner, J., Ruscheweyh, R., Attal, N., Baron, R., Bouhassira, D., Enax-Krumova, E. K., et al. (2021). No pain, still gain (of function): the relation between sensory profiles and the presence or absence of self-reported pain in a large multicenter cohort of patients with neuropathy. Pain 162, 718\u0026ndash;727. doi: 10.1097/j.pain.0000000000002058.\u003c/li\u003e\n\u003cli\u003eGao, Zhongke, et al. \u0026quot;A deep learning method for improving the classification accuracy of SSMVEP-based BCI.\u0026quot; IEEE Transactions on Circuits and Systems II: Express Briefs 67.12 (2020): 3447-3451.\u003c/li\u003e\n\u003cli\u003eGhosh, Lidia, et al. \u0026quot;Exploration of face-perceptual ability by EEG induced deep learning algorithm.\u0026quot; Biomedical Signal Processing and Control 66 (2021): 102368.\u003c/li\u003e\n\u003cli\u003eHeid, C., Mouraux, A., Treede, R.-D., Schuh-Hofer, S., Rupp, A., and Baumg\u0026auml;rtner, U. (2020). Early gamma-oscillations as correlate of localized nociceptive processing in primary sensorimotor cortex. Journal of Neurophysiology 123, 1711\u0026ndash;1726. doi: 10.1152/jn.00444.2019.\u003c/li\u003e\n\u003cli\u003eJ. N. Mandrekar, \u0026ldquo;Receiver operating characteristic curve in diagnostic test assessment,\u0026rdquo; Journal of Thoracic Oncology, vol. 5, no. 9, pp. 1315\u0026ndash;1316, 2010.\u003c/li\u003e\n\u003cli\u003eJames, S. L., Abate, D., Abate, K. H., Abay, S. M., Abbafati, C., Abbasi, N., et al. (2018). Global, regional, and national incidence, prevalence, and years lived with disability for 354 diseases and injuries for 195 countries and territories, 1990\u0026ndash;2017: a systematic analysis for the Global Burden of Disease Study 2017. The Lancet 392, 1789\u0026ndash;1858. doi: 10.1016/S0140-6736(18)32279-7.\u003c/li\u003e\n\u003cli\u003eJesse A Livezey and Joshua I Glaser. Deep learning approaches for neural decoding across architectures and recording modalities. Briefings in bioinformatics, 22(2), 1577\u0026ndash;1591, 2021. \u003c/li\u003e\n\u003cli\u003eKokhlikyan et al., 2020. Narine Kokhlikyan, Vivek Miglani, Miguel Martin, Edward Wang, Bilal Alsallakh, Jonathan Reynolds, Alexander Melnikov, Natalia Kliushkina, Carlos Araya, Siqi Yan and Orion Reblitz-Richardson. Captum: A unified and generic model interpretability library for PyTorch, 2020.\u003c/li\u003e\n\u003cli\u003eLeBlanc, B. W., Bowary, P. M., Chao, Y.-C., Lii, T. R., and Saab, C. Y. (2016). Electroencephalographic signatures of pain and analgesia in rats. Pain 157, 2330\u0026ndash;2340. doi: 10.1097/j.pain.0000000000000652.\u003c/li\u003e\n\u003cli\u003eLi, Z., Zhang, L., Zeng, Y., Zhao, Q., and Hu, L. (2023). Gamma-band oscillations of pain and nociception: A systematic review and meta-analysis of human and rodent studies. Neuroscience \u0026amp; Biobehavioral Reviews 146, 105062. doi: 10.1016/j.neubiorev.2023.105062.\u003c/li\u003e\n\u003cli\u003eLim, M., Roosink, M., Kim, J.S., Kim, H.W., Lee, E.B., Son, K.M., Kim, H.A. and Chung, C.K., 2016. Augmented pain processing in primary and secondary somatosensory cortex in fibromyalgia: a magnetoencephalography study using intra-epidermal electrical stimulation. PLoS One, 11(3), p.e0151776.\u003c/li\u003e\n\u003cli\u003eLin, Tsung-Yi, et al. \u0026quot;Focal loss for dense object detection.\u0026quot; Proceedings of the IEEE international conference on computer vision. 2017.\u003c/li\u003e\n\u003cli\u003eLu, Wei, Tien-Ping Tan, and Hua Ma. \u0026quot;Bi-branch vision transformer network for EEG emotion recognition.\u0026quot; IEEE Access 11 (2023): 36233-36243.\u003c/li\u003e\n\u003cli\u003eMackey, S., and Kao, M.-C. (2019). Managing twin crises in chronic pain and prescription opioids. BMJ, l917. doi: 10.1136/bmj.l917.\u003c/li\u003e\n\u003cli\u003eMaur\u0026iacute;cio, J., Domingues, I., \u0026amp; Bernardino, J. (2023). Comparing Vision Transformers and Convolutional Neural Networks for Image Classification: A Literature Review. Applied Sciences, 13(9), 5521.\u003c/li\u003e\n\u003cli\u003eMeijs, Suzan, Carsten Reidies Bjarkam, Felipe Rettore Andreis, og Winnie Jensen. \u0026ldquo;First Demonstration of Nociceptive and Non-Nociceptive Responses from Spinal Neurons in a Porcine Model\u0026rdquo;. I 2023 11th International IEEE/EMBS Conference on Neural Engineering (NER), 1\u0026ndash;4, 2023. https://doi.org/10.1109/NER52421.2023.10123833.\u003c/li\u003e\n\u003cli\u003eMeijs, S., Andreis, F. R., Janjua, T. A. M., Graven-Nielsen, T., and Jensen, W. (2024a). High frequency electrical stimulation increases cortical excitability and mechanical sensitivity in a chronic large animal model. Pain Accepted.\u003c/li\u003e\n\u003cli\u003eMeijs, S., Andreis, F. R., Janjua, T. A. M., and Jensen, W. (2024b). Reliability of a cranial window for chronic epidural recordings from the pig primary somatosensory cortex., in 2024 46th annual international conference of the IEEE engineering in medicine and biology society, (Orlando: IEEE).\u003c/li\u003e\n\u003cli\u003eMelzack, R. (1990). Phantom limbs and the concept of a neuromatrix. Trends in Neurosciences 13, 88\u0026ndash;92. doi: 10.1016/0166-2236(90)90179-E.\u003c/li\u003e\n\u003cli\u003eMelzack, R. (1999). From the gate to the neuromatrix: Pain 82, S121\u0026ndash;S126. doi: 10.1016/S0304-3959(99)00145-1.\u003c/li\u003e\n\u003cli\u003eMichail, G., Dresel, C., Witkovsk\u0026yacute;, V., Stankewitz, A., and Schulz, E. (2016). Neuronal Oscillations in Various Frequency Bands Differ between Pain and Touch. Front. Hum. Neurosci. 10. doi: 10.3389/fnhum.2016.00182.\u003c/li\u003e\n\u003cli\u003eMogil, J. S. (2009). Animal models of pain: progress and challenges. Nat Rev Neurosci 10, 283\u0026ndash;294. doi: 10.1038/nrn2606.\u003c/li\u003e\n\u003cli\u003eMouraux, A., and Iannetti, G. D. (2018). The search for pain biomarkers in the human brain. Brain 141, 3290\u0026ndash;3307. doi: 10.1093/brain/awy281.\u003c/li\u003e\n\u003cli\u003ePloner, M., and May, E. S. (2018). Electroencephalography and magnetoencephalography in pain research\u0026mdash;current state and future perspectives. Pain 159, 206\u0026ndash;211. doi: 10.1097/j.pain.0000000000001087.\u003c/li\u003e\n\u003cli\u003ePloner, M., Sorg, C., and Gross, J. (2017). Brain Rhythms of Pain. Trends in Cognitive Sciences 21, 100\u0026ndash;110. doi: 10.1016/j.tics.2016.12.001.\u003c/li\u003e\n\u003cli\u003eRockholt, M. M., Kenefati, G., Doan, L. V., Chen, Z. S., and Wang, J. (2023). In search of a composite biomarker for chronic pain by way of EEG and machine learning: where do we currently stand? Front. Neurosci. 17, 1186418. doi: 10.3389/fnins.2023.1186418.\u003c/li\u003e\n\u003cli\u003eSadler, K. E., Mogil, J. S., and Stucky, C. L. (2022). Innovations and advances in modelling and measuring pain in animals. \u003cem\u003eNat Rev Neurosci\u003c/em\u003e 23, 70\u0026ndash;85. doi: 10.1038/s41583-021-00536-7\u003c/li\u003e\n\u003cli\u003eSales, A. C., Blockeel, A. J., Huxter, J. R., Dunham, J. P., Drake, R. A. R., Truini, A., et al. (2021). Trial by trial, machine learning approach identifies temporally discrete A\u0026delta;- and C-fibre mediated laser evoked potentials that predict pain behaviour in rats. Neuroscience doi: 10.1101/2021.08.10.455801.\u003c/li\u003e\n\u003cli\u003eSchulz, E., Tiemann, L., Witkovsky, V., Schmidt, P., and Ploner, M. (2012). Gamma oscillations are involved in the sensorimotor transformation of pain. Journal of Neurophysiology 108, 1025\u0026ndash;1031. doi: 10.1152/jn.00186.2012.\u003c/li\u003e\n\u003cli\u003eShirvalkar, P., Prosky, J., Chin, G., Ahmadipour, P., Sani, O. G., Desai, M., et al. (2023). First-in-human prediction of chronic pain state using intracranial neural biomarkers. Nat Neurosci 26, 1090\u0026ndash;1099. doi: 10.1038/s41593-023-01338-z.\u003c/li\u003e\n\u003cli\u003eSimonyan, Karen, Andrea Vedaldi, and Andrew Zisserman. \u0026quot;Deep inside convolutional networks: Visualising image classification models and saliency maps.\u0026quot; arXiv preprint arXiv:1312.6034 (2013).\u003c/li\u003e\n\u003cli\u003eSmilkov, D., Thorat, N., Kim, B., Vi\u0026eacute;gas, F., \u0026amp; Wattenberg, M. (2017). Smoothgrad: removing noise by adding noise. arXiv preprint arXiv:1706.03825.\u003c/li\u003e\n\u003cli\u003eSong, Yonghao, et al. \u0026quot;EEG conformer: Convolutional transformer for EEG decoding and visualization.\u0026quot; IEEE Transactions on Neural Systems and Rehabilitation Engineering 31 (2022): 710-719.\u003c/li\u003e\n\u003cli\u003eSun, Mingxuan, et al. \u0026quot;EEG-based tonic cold pain intensity assessment using CNN-LSTM.\u0026quot; 2022 3rd International Conference on Big Data, Artificial Intelligence and Internet of Things Engineering (ICBAIE). IEEE, 2022.\u003c/li\u003e\n\u003cli\u003eSundararajan, Mukund, Ankur Taly, and Qiqi Yan. \u0026quot;Axiomatic attribution for deep networks.\u0026quot; International conference on machine learning. PMLR, 2017.\u003c/li\u003e\n\u003cli\u003eUrban, R., Scherrer, G., Goulding, E. H., Tecott, L. H., and Basbaum, A. I. (2011). Behavioral indices of ongoing pain are largely unchanged in male mice with tissue or nerve injury-induced mechanical hypersensitivity. Pain 152, 990\u0026ndash;1000. doi: 10.1016/j.pain.2010.12.003.\u003c/li\u003e\n\u003cli\u003eVaswani, Ashish, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. \u0026quot;Attention is all you need.\u0026quot; Advances in neural information processing systems 30 (2017).\u003c/li\u003e\n\u003cli\u003eVolkov, S. (2023). World Health Organization factsheet on Opioid Overdose. Opioid overdose. Available at: https://www.who.int/news-room/fact-sheets/detail/opioid-overdose [Accessed November 22, 2023].\u003c/li\u003e\n\u003cli\u003eWager, T. D., Atlas, L. Y., Lindquist, M. A., Roy, M., Woo, C.-W., and Kross, E. (2013). An fMRI-Based Neurologic Signature of Physical Pain. N Engl J Med 368, 1388\u0026ndash;1397. doi: 10.1056/NEJMoa1204471.\u003c/li\u003e\n\u003cli\u003eYang, R., \u0026amp; Modesitt, E. (2023). ViT2EEG: Leveraging Hybrid Pretrained Vision Transformers for EEG Data. arXiv preprint arXiv:2308.00454.\u003c/li\u003e\n\u003cli\u003eYue, L., Iannetti, G. D., and Hu, L. (2020). The Neural Origin of Nociceptive-Induced Gamma-Band Oscillations. J. Neurosci. 40, 3478\u0026ndash;3490. doi: 10.1523/JNEUROSCI.0255-20.2020.\u003c/li\u003e\n\u003cli\u003eZeiler, M. D., and R. Fergus. \u0026quot;Visualizing and understanding convolutional networks. arXiv.\u0026quot; arXiv preprint arXiv:1311.2901 (2013).\u003c/li\u003e\n\u003cli\u003eZhang, Z. G., Hu, L., Hung, Y. S., Mouraux, A., and Iannetti, G. D. (2012). Gamma-Band Oscillations in the Primary Somatosensory Cortex\u0026mdash;A Direct and Obligatory Correlate of Subjective Pain Intensity. J. Neurosci. 32, 7429\u0026ndash;7438. doi: 10.1523/JNEUROSCI.5877-11.2012.\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Brain recordings, Event-related potentials, Pain, Biomarker, Gamma-band Oscillations, Deep Learning, Explainable AI","lastPublishedDoi":"10.21203/rs.3.rs-7658321/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7658321/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eBackground: Chronic pain affects approximately 20% of the population, with a higher prevalence in females, and presents significant diagnostic and treatment challenges. While opioids are commonly prescribed, they carry risks of addiction and overdose, highlighting the need for reliable pain biomarkers.\u003cbr\u003e\nNew Method: To develop such a biomarker, we recorded non-noxious and noxious evoked potentials from the primary somatosensory cortex (S1) in 8 female pigs across 16 sessions. A convolutional neural network (CNN) was trained, validated, and tested on time-frequency maps of these responses. Three interpretability methods, saliency, integrated gradients, and occlusion were applied to identify neural features critical for distinguishing pain states.\u003cbr\u003e\nResults: The CNN achieved an overall accuracy of 73.5%, with higher accuracy for non-noxious stimuli (85%) than for noxious stimuli (62%). Feature attributions consistently highlighted a window 93–173 ms post-stimulus in the 35–75 Hz gamma-band.\u003cbr\u003e\nComparison with Existing Methods: The CNN automatically extracted features from spectrograms, addressing the overlap between noxious and non-noxious responses. Interpretability methods revealed gamma-band oscillations (GBOs) consistent with nociceptive processing in humans and rodents. While this architecture offers valuable insights, recent studies suggest that hybrid models (e.g., CNN-LSTM) and transformers may further improve performance and robustness.\u003cbr\u003e\nConclusion: This CNN-based approach identified GBOs as a promising neural marker of pain, with potential applications in translational research, pre-clinical trials, and pain assessment in non-verbal subjects.\u003c/p\u003e","manuscriptTitle":"A convolutional neural network to distinguish between brain responses to non-noxious and noxious input of the same modality: what does the machine see that we do not see?","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-10-03 04:53:39","doi":"10.21203/rs.3.rs-7658321/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"affa3100-bc9a-4b25-8a91-9b2834c6b222","owner":[],"postedDate":"October 3rd, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-10-24T01:38:41+00:00","versionOfRecord":[],"versionCreatedAt":"2025-10-03 04:53:39","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7658321","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7658321","identity":"rs-7658321","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.