banner
Home / News / Transformer-based classification of visceral pain-related local field potential patterns in the brain | Scientific Reports
News

Transformer-based classification of visceral pain-related local field potential patterns in the brain | Scientific Reports

Oct 22, 2024Oct 22, 2024

Scientific Reports volume 14, Article number: 24372 (2024) Cite this article

188 Accesses

Metrics details

Neuronal ensemble activity entrained by local field potential (LFP) patterns underlies a variety of brain functions, including emotion, cognition, and pain perception. Recent advances in machine learning approaches may enable more effective methods for analyzing LFP patterns across multiple brain areas than conventional time-frequency analysis. In this study, we tested the performance of two machine learning algorithms, AlexNet and the Transformer models, to classify LFP patterns in eight pain-related brain regions before and during acetic acid-induced visceral pain behaviors. Over short time windows lasting several seconds, applying AlexNet to LFP power datasets, but not to raw time-series LFP traces from multiple brain areas, successfully achieved superior classification performance compared with simple LFP power analysis. Furthermore, applying the Transformer directly to the raw LFP traces achieved significantly superior classification performance than AlexNet when using LFP power datasets. These results demonstrate the utility of the Transformer in the analysis of neurophysiological signals, and pave the way for its future applications in the decoding of more complex neuronal activity patterns.

The organized activity patterns of the neuronal ensembles that control brain functions present as diverse electrophysiological features in the extracellular electroencephalogram (EEG) and local field potential (LFP) signals1. Time-frequency analysis has been widely applied to quantify changes in the intensity of oscillatory electrophysiological signals in each frequency band, including theta (5–8 Hz) and gamma (30–100 Hz) power, unveiling a variety of neuronal mechanisms relevant to emotions and behaviors. Especially, wavelet analysis is a useful method to analyze short-term LFP power fluctuations on the second scale. Additionally, recent advances in machine learning techniques such as Convolutional Neural Networks (CNNs) have garnered significant attention owing to their ability to simultaneously process large-scale physiological datasets spanning multiple brain regions and frequency bands, rather than being limited to single-dimensional LFP power data. Indeed, recent studies have demonstrated the effectiveness of CNN in estimating dynamically changing EEG/LFP patterns2,3,4.

In addition, the development of a Transformer architecture, which incorporates self-attention and parallelization mechanisms, represents a significant breakthrough in machine learning, particularly in natural language processing5. This model is capable of capturing meaningful relationships within dynamically and sequentially changing datasets more precisely, and could potentially achieve superior performance across a wide range of tasks. Given that EEG/LFP signals are time-series datasets that include intricate temporal relationships, the Transformer model has the potential to effectively process these signals to estimate brain states from short time windows. Although several studies have explored this possibility6, such investigations remain in the early stage.

To explore this potential, we compared the performances of the CNN and Transformer models in analyzing the LFP patterns recorded from multiple brain areas in mice. Further, we employed an acetic acid-induced model that causes visceral pain through inflammation of internal organs to induce LFP patterns distinct from normal activity states in mice7,8. This model has the advantage of inducing long-lasting and stable distinct brain states in mice, including changes in LFP power. From these mice, we simultaneously recorded LFP signals from eight brain regions9,10,11,12,13, and subsequently compared performance of classification of the collective LFP patterns within short time windows (i.e., lasting several seconds) using conventional power analysis, AlexNet (CNN)-based machine learning, and Transformer-based machine learning approaches.

We first verified how neurons in pain-related brain regions9,10,11,12,13,14 are activated in the mouse model of visceral pain. To induce writhing reflexes, an aversive behavioral sign of visceral pain, mice were administered an intraperitoneal injection of 0.7% acetic acid (Fig. 1a). Writhing occurred at an average frequency of 1.09 ± 0.33 /min (ranging from 0.43 to 2.98 /min) (Fig. 1b; n = 7 mice). Coronal brain slices were subsequently prepared and immunohistochemical staining for c-Fos, an immediate early marker gene of neuronal activation, was performed from eight brain regions: the primary somatosensory cortex (S1), dorsal anterior cingulate cortex (ACC), prelimbic cortex (PL), periaqueductal gray (PAG), infralimbic cortex (IL), lateral posterior nucleus of thalamus (THL), nucleus accumbens (NAc), and amygdala (AMY) (Fig. 1c). In the ACC and PAG, the proportions of c-Fos-positive neurons in acetic acid-injected mice were significantly larger than those in saline-injected mice (Fig. 1d; n = 7 mice; ACC, t13 = 2.60, P = 0.022; PAG, t13 = 2.38, P = 0.033, Student’s t-test), while no significant differences were observed in the other regions (Fig. 1d; S1, t12 = 0.51, P = 0.62; PL, t13 = 1.13, P = 0.28; IL, t13 = 0.45, P = 0.66; THL, t13 = 0.41, P = 0.69; NAc, t13 = 0.74, P = 0.47; AMY, t13 = 0.51, P = 0.62). These results indicate that the ACC and PAG neurons were activated during acetic acid-induced visceral pain. On the other hand, the apparent lack of c-Fos expression in classic brain regions associated with visceral pain suggests that our model likely induces a milder form of visceral discomfort compared to more severe pain models used in many previous studies9,10,11,12,13. No significant correlations were found between the proportion of c-Fos-positive neurons in the ACC or PAG and the writhing count (Supplementary Fig. S1a; ACC, r = 0.61, P = 0.14; PAG, r = 0.19, P = 0.43). These results further indicate that neuronal c-Fos expression, a widely used marker of neuronal activity, partly represents changes in brain activity associated with visceral pain behaviors.

c-Fos expression was increased in the ACC and PAG of mice with acetic acid-induced visceral pain. (a) (Left) Mice were intraperitoneally injected with 0.7% acetic acid. (Right) An exemplar image of a mouse showing the writhing reflex. (b) (Left) Changes in writhing count every 5 min after an acetic acid injection (n = 7 mice). (Right) The total number of writhing counts in the 40 min following an acetic acid injection in individual mice. (c) Representative fluorescent images of the ACC and PAG neurons labeled with an anti-c-Fos (magenta) antibody and DAPI (blue) following injection of saline or acetic acid. (d) The percentages of c-Fos-positive cells in each brain region (saline, n = 7 mice; acetic acid, n = 6–7 mice). *P < 0.05, Student’s t-test.

Next, we implanted electrodes into the aforementioned target brain regions and measured the LFP patterns for 40 min before and after an acetic acid injection, termed the pre- and post-periods, respectively (Fig. 2a). Using time-frequency analysis, the averaged changes in LFP power were examined over a long time (5 min) window in six frequency bands: delta (1–4 Hz), theta (5–8 Hz), alpha (9–13 Hz), beta (14–30 Hz), slow gamma (31–49 Hz), and fast gamma (51–99 Hz). In the ACC, an acetic acid injection induced significant decreases in LFP power in all frequency bands, except for the fast gamma band (Fig. 2b; n = 9 mice; delta, t8 = 2.86, P = 0.021; theta, t8 = 3.88, P = 0.0047; alpha, t8 = 5.43, P = 6.2 × 10−4; beta, t8 = 4.72, P = 0.0015; slow gamma, t8 = 2.41, P = 0.042; t8 = 1.08, P = 0.31, paired t-test between pre versus post). The lack of significant changes in high gamma power may be attributed to the sensitivity of high gamma oscillations to animal habituation, often declining during recording despite pre-habituation efforts. The resulting variability, reflected in large standard deviations, likely contributed to the non-significant differences. The same statistical analyses were applied to LFP signals from all brain regions, confirming similar decreases in the majority of the analyzed brain regions (Fig. 2c). Mice injected with saline did not exhibit any significant changes in LFP power (Supplementary Fig. S3; n = 3–4 mice; P > 0.05, paired t-test between pre versus post). These results demonstrate that the overall LFP power in these brain regions was attenuated during acetic acid-induced visceral pain. In addition, significant negative correlations between LFP power changes and writhing counts were found in the ACC (Supplementary Fig. S1b, c; n = 9 mice; delta, r = − 0.84, P = 0.0043; theta, r = − 0.72, P = 0.030; alpha, r = − 0.68, P = 0.044), suggesting that the ACC LFP power changes, rather than the proportion of c-Fos-positive neurons, could serve as a physiological marker of the intensity of visceral pain.

Although we simultaneously recorded electrocardiogram (ECG) and respiratory (Resp) signals from the olfactory bulb and electromyogram (EMG) signals from the dorsal neck muscle, no significant differences were found in these physiological parameters before and after an acetic acid injection (Supplementary Fig. S2; n = 9 mice; EMG, t8 = 1.38, P = 0.20; heart rate, HR, t8 = 2.28, P = 0.052; Resp frequency, t8 = 1.28, P = 0.24, paired t-test between pre versus post).

After identifying the overall decrease in LFP power from a time window of 5 min using the same datasets, we evaluated whether similar changes in LFP patterns could be captured over a shorter time (5-s) window using time-frequency analysis (Fig. 2d, Left top). Recording periods of 40 min before and after the injection were divided into 5-s bins, termed pre- and post-bins, respectively, yielding 480 of each. Assuming that the LFP power following an acetic acid injection (post) was lower than that before the injection (pre), for each frequency band in each brain region, we defined the discriminant threshold that best estimated LFP patterns as high in pre-bins and low in post-bins (Fig. 2d, Left bottom; see Methods). In each dataset, a confusion matrix was constructed to evaluate the accuracy of classifying the pre/post-bins, while a d-prime value was computed for each matrix (an example from delta LFP in the ACC is shown in Fig. 2d, Central). For each mouse, the average d-prime value was computed for all of the six frequency bands (Fig. 2d, Right). In all nine mice tested, d-prime values ranged from 0.1 to 1.8. Classification performance was subsequently evaluated using a stratified 10-fold cross-validation in each computational trial, maintaining a train-to-test ratio of 9:1. In this approach, 432 pre-bins and 432 post-bins were randomly selected as the training dataset while the remaining 48 pre- and 48 post-bins constituted the test dataset. Although 66% of datasets (from all brain regions and frequency bands) had d-prime values that significantly exceeded chance levels (defined as the lower limit of the 95% confidence interval being greater than 0, determined by 10-fold cross-validation), their practical significance was limited, as they had relatively higher false alarm rates (~ 40%) and lower hit rates (~ 60%) (as shown in the confusion matrix in Fig. 2d). These results demonstrate that simple discriminant analysis of LFP power from single brain regions computed from 5-s bins is insufficient to distinguish the periods before and afteran acetic acid injection.

LFP power changes were observed in the eight brain regions. (a) (Left) Histological confirmation of LFP electrode locations in the S1, ACC, PL, PAG, IL, THL, NAc, and AMY. Arrowheads represent the tips of electrodes. Dotted lines represent the borders of the subregions. (Right) Representative electrophysiological traces (filtered at 40–500 Hz). (b) Acetic acid-induced time changes in LFP power (bin = 5 min) in the ACC following an acetic acid injection (n = 9 mice). The LFP power was normalized by an average of the LFP power over 40 min before an acetic acid injection. *P < 0.05, **P < 0.01, ***P < 0.001, paired t-test between pre versus post, applied independently to each statistical test. (c) The percentages of changes in LFP power at each frequency band in each brain region 40 min following an acetic acid injection relative to those 40 min prior to an acetic acid injection (n = 6–9 mice). *P < 0.05, **P < 0.01, ***P < 0.001, paired t-test between pre versus post, applied independently to each statistical test. (d) Classification of acetic acid-induced brain states based on LFP power from individual brain regions. (Left) Schematic of the analysis. The ACC LFP power was concatenated in each 5-s bin before (gray, pre) and after (red, post) an acetic acid injection. Each bin was subsequently estimated as a pre or a post-bin based on a discrimination threshold. (Central top) Confusion matrix showing the number of bins in 10-fold cross-validation from a mouse. A d-prime value was defined from each matrix. (Central bottom) For the ACC delta power in this mouse, a real d-prime value was indicated by the red arrow, which was compared to corresponding 1000 shuffled datasets (gray histogram). The dot line indicates chance level. (Right) For individual mice, d-prime values were computed from single LFP patterns. The averaged d-prime value in each mouse was computed from all the six frequency bands. Gray line shows chance level.

Next, we investigated whether machine learning approaches could more effectively discriminate the LFP patterns induced by acetic acid administration. First, we employed AlexNet, a convolutional neural network (CNN) architecture, to analyze sequential vectors/tensors composed of the LFP power, similar to the techniques used in image processing15. Using the same analytical approach, we subsequently applied the supervised AlexNet model to a six-dimensional vector composed of the LFP powers in six frequency bands in a single brain region in each time bin of each mouse (Fig. 3a). Classification performance was also evaluated using a stratified 10-fold cross-validation in each computational trial (432 pre-bins and 432 post-bins as the training dataset and 48 pre- and 48 post-bins as the test dataset). In each computation, we initially adapted the pre-trained AlexNet architecture by replacing the last classification layer, and subsequently applied transfer learning using the training dataset to differentiate between the pre- and post-bins. Next, the modified architecture was employed to classify each bin in the test dataset as either a pre-bin or post-bin. As an example, the averaged d-prime values in the ACC using AlexNet were found to be significantly higher than those obtained from the discrimination analysis of the ACC LFP power presented in Fig. 2d (Fig. 3b; n = 9 mice; t8 = 9.19, P = 1.6 × 10−5, paired t-test). Overall, all datasets from all brain regions and frequency bands had d-prime values that significantly exceeded chance levels (defined as the lower limit of the 95% confidence interval being greater than 0, determined by 10-fold cross-validation). These results demonstrate that the AlexNet-based classification using combined LFP powers across multiple frequency bands can discriminate acetic acid-induced LFP patterns more effectively than the threshold-based discrimination of LFP power from single frequency bands.

AlexNet-based classification of the acetic acid-induced brain states based on LFP patterns from multiple brain regions. (a) The ACC LFP power in the six frequency bands was concatenated in each 5-s bin before (gray, pre) and after (red, post) an acetic acid injection. After training of the datasets with single LFP power in the AlexNet with a supervised learning of correct labels, each bin without training was classified as a pre or post-bin. (b) (Top) A confusion matrix showing the number of bins in 10-fold cross-validation from an individual mouse. A d-prime value was defined in each matrix. (Bottom) For individual mice, d-prime values were computed from single LFP patterns. (c, d) The same as a and b, but LFP powers in all of the recorded eight brain regions were used in the analysis. (e) All d-prime values obtained when single brain regions (left) or all brain regions recorded (rightmost) were included in the analysis. (f) Corresponding with e, comparison of d-prime values from individual brain regions and all brain regions. ***P < 0.001, Student’s t-test between single regions vs. all regions. (g) Original LFP traces from all brain regions concatenated in each 5-s bin before (gray, pre) and after (red, post) an acetic acid injection were trained in the AlexNet with a supervised learning of correct labels, and each bin without training was classified as a pre or post-bin. (h) A confusion matrix from a mouse (top) and d-prime values from all mice (bottom).

To investigate whether incorporating data from all recorded brain regions could improve the classification performance, we subsequently applied the same analysis to the LFP powers obtained from all eight brain regions. An 8 × 6-dimensional tensor was defined as the LFP power in the six frequency bands of the eight brain regions in each time bin for each mouse (Fig. 3c). Similarly, the AlexNet architecture trained with the training dataset (comprising 432 pre- and post-bins) was used to classify each bin in the test datasets (consisting of 48 pre- and post-bins). Overall, d-prime values computed from all brain regions were found to be significantly higher than those computed from single brain regions presented in Fig. 3b (Fig. 3 c–f; n = 9 mice; t8 = 4.51, P = 2.5 × 10−5, Student’s t-test). These results demonstrate that integrating LFP power from multiple brain regions enables a more effective AlexNet-based classification of acetic acid-induced LFP patterns than using data from single brain regions.

The analyses described above all involved a degree of subjectivity, because the frequency bands for computing the LFP power were determined by the experimenters. Furthermore, the AlexNet architecture was originally designed for image processing, and may thus not be optimally suited for time-series data, such as LFP traces. To address this limitation, we directly applied the original LFP traces without subjectively converting them into LFP powers within specific frequency bands (Fig. 3g). Original LFP traces from eight brain regions at a sampling rate of 2000 Hz were downsampled to 200 Hz, defining an 8 × 1000-dimensional tensor in each 5-s bin. When applied to the downsampled LFP traces, AlexNet yielded significantly lower d-prime values (Fig. 3h) compared to its application to tensors comprising LFP power across all frequency bands from all brain regions, as presented in Fig. 3d (n = 9 mice; t8 = 7.62, P = 6.2 × 10−5, paired t-test). The same analyses were performed by using bin sizes ranging from 1 to 20 s; however, d-prime values consistently remained lower, hovering around 1.0 across all time bins (Supplementary Fig. S4). These results indicate that AlexNet achieves better performance when LFP patterns are converted into low-dimensional, image-like datasets of LFP power in specific frequency bands through the power analysis of LFP signals, rather than when the raw LFP time-series traces are directly input to AlexNet.

Subsequently, we evaluated the classification performance of the Transformer model using the same LFP dataset. Similar to the AlexNet analysis shown in Fig. 3h, we used the downsampled LFP traces with an 8 × 1000-dimensional tensor, and the Transformer trained with the training dataset (consisting of 432 pre-and 432 post-bins) to classify each bin in the test datasets (consisting of 48 pre-and 48 post-bins) (Fig. 4a). Seven of the nine mice exhibited prominently higher d-prime values with the Transformer compared to the AlexNet analysis of LFP power presented in Fig. 3d, whereas the remaining two mice showed nearly comparable d-prime values using both approaches (Fig. 4b and c). Overall, the d-prime values obtained using the Transformer were significantly higher than those computed using AlexNet (n = 9 mice; t8 = 3.36, P = 0.0099, paired t-test), indicating that the Transformer exhibits superior performance in classifying LFP patterns related to acetic acid-induced visceral pain compared to AlexNet.

All previous analyses were conducted with a fixed bin size of 5 s. To investigate the classification performance with other bin sizes, the same analyses with the Transformer were performed by varying the bin size from 1 to 20 s (Fig. 4d). We found that the 5-s bin size, which we had been using for our analyses, yielded the highest d-prime values. While the 2-s bin size produced nearly equivalent performance, the d-prime values for the 5-s bin were significantly higher than those with bin sizes of 1, 10, and 20 s (P < 0.05, Tukey’s test after ANOVA). These results confirm that, in our LFP analysis using Transformers, a bin size of approximately 5 s is most appropriate. Additionally, we compared these results with those when the downsampled LFP traces were analyzed by AlexNet (Supplementary Fig. S4). Across all time bins, Transformer consistently demonstrated significantly higher d-prime values compared to AlexNet (Supplementary Fig. S4; n = 9 mice; 1-s bin: t8 = 9.06, P = 1.8 × 10−5; 2-s bin: t8 = 10.6, P = 5.3 × 10−6; 10-s bin: t8 = 19.6, P = 4.8 × 10−8; 20-s bin: t8 = 20.0, P = 4.1 × 10−8, paired t-test).

In this study, we recorded the LFP patterns in eight pain-related brain regions in mice exhibiting acetic acid-induced visceral pain (represented as the writhing reflex, Fig. 1a), a widely used mouse model of nociception. We first confirmed that the overall LFP power in frequency bands lower than the slow gamma range decreased in most brain regions following an acetic acid injection when analyzed over a long time window (5 min, Fig. 2b). However, discriminant analysis with a one-dimensional threshold of LFP power changes within a shorter time window (5 s) could not accurately distinguish the acetic acid-induced LFP patterns (Fig. 2d). However, applying the AlexNet convolutional neural network to LFP powers, particularly when integrating data from all recorded brain regions, yielded an improved classification performance of the LFP patterns (Fig. 3a–f). Furthermore, we demonstrated that the Transformer model, when applied to the original LFP time-series traces without conversion into LFP power, achieved superior classification accuracy compared with AlexNet when using LFP power datasets (Fig. 4a–c).

Pain processing involves diverse brain regions; the sensory aspect is primarily represented in the S1 16, while the affective component is predominantly processed by the ACC and AMY17,18. Somatic pain has further been shown to alter brain LFP oscillations in the ACC, AMY, S1, and VTA in both rodents19,20,21,22,23,24,25 and humans26. We demonstrated that visceral pain induced significant reductions in the overall LFP power (Fig. 2b, c). Assuming LFP power represents overall neuronal population activity, our acetic acid-induced model appears to decrease, rather than increase, neuronal activity in most pain-related brain regions. This widespread LFP power decrease contrasts with findings from other pain studies, which have reported pronounced increases in LFP power, particularly in theta, alpha, and gamma frequency bands27,28,29,30. This discrepancy likely stems from fundamental differences in pain origin: our model uses chemical visceral stimuli (acetic acid), triggering direct peritoneal irritation, local tissue damage, and inflammation. In contrast, other models involve somatic pain, mechanically-induced visceral pain (e.g., colonic distension), or acute nociceptive pain (e.g., capsaicin), which primarily affect nociceptors of the nerves. Further studies are needed to elucidate the exact mechanisms underlying these pronounced inconsistencies in brain activity effects across different pain models.

While we detected significant decreases in the overall LFP power when analyzed over long (5-min) time windows, the accuracy of the power-based classification was substantially reduced when analyzed over short (5-s) time windows (Fig. 2d). This is presumably because the LFP power fluctuates rapidly over short periods, and is more sensitive to biological noise in these time periods. Through supervised machine learning using AlexNet, we demonstrated that integrating LFP powers across six frequency bands and further integrating LFP powers from eight brain regions significantly improved classification accuracy (Fig. 3a–f). These results confirmed the utility of machine learning approaches in the analysis of multidimensional EEG/LFP data from the brain. From a biological perspective, these results indicate that LFP patterns related to visceral pain are not merely evoked by single brain regions, but rather emerge from widespread neural networks across multiple brain areas31.

In addition, the Transformer model provided a better classification accuracy than AlexNet (Fig. 4c). This superior performance of the Transformer is presumably because it is well-suited for analyzing sequential time-series data with intricate temporal dependencies, similar to its applications in natural language processing32. Although the internal structure of the Transformer model obscures the specific features or time points to which it attends, our results highlight its efficacy in analyzing neuronal signal data, including EEG and LFP signals, as well as in reading more intricate neuronal ensemble patterns related to emotions, stimulus responses, and higher-order cognitive functions in various animal models. Furthermore, a significant advantage of the Transformer is not only its superior classification performance, but also its ability to process raw LFP signals directly without requiring subjective conversion into LFP power. This capability facilitates the real-time decoding of recorded neuronal signals, which holds promise for practical applications in various functions.

Transformer-based classification of acetic acid-induced brain states based on LFP patterns from multiple brain regions. (a) Original LFP traces from all brain regions concatenated in each 5-s bin before (gray, pre) and after (red, post) an acetic acid injection were trained in the Transformer with a supervised learning of correct labels, and each bin without training was classified as a pre or post-bin. (b) A confusion matrix from an individual mouse (top) and d-prime values from all mice (bottom). (c) Comparison of d-prime values computed from the AlexNet (corresponding with Fig. 3f, all) and the Transformer. Each line represents an individual mouse. **P < 0.01, Paired t-test bet. (d) (Left) The same analysis with the Transformer was performed with different bin sizes. (Right) d-prime values from all mice plotted against different bin sizes. *P < 0.05, **P < 0.01, ***P < 0.001, ****P < 0.0001, Tukey’s test after ANOVA.

Male 8-to-10-week-old C57BL/6 mice (SLC, Shizuoka, Japan) with a preoperative weight of 20–30 g were housed under conditions of controlled temperature and humidity (22 ± 1ºC, 55 ± 5%) in a vivarium, maintained on a 12:12-h light/dark cycle (lights off from 8 am to 8 pm) with ad libitum access to food and water. All mice were housed individually.

Acetic writhing test was conducted as described33,34. After mice were acclimatized in a Plexiglas chamber for 30 min, they were intraperitoneally injected with 10 ml/kg saline or 0.7% acetic acid. Abdominal constriction responses were visually counted for 40 min after the injection.

The mice received an overdose of urethane 160 min after the injection, and they were perfused intracardially with cold 8% paraformaldehyde (PFA) in 25 mM PBS and decapitated. After dissection, the brains were fixed overnight in 8% PFA. The brains were placed in 30% sucrose until equilibrated and coronally sectioned at a thickness of 50 μm. The slices were rinsed with PBS and then permeabilized in 100 mM PBS with 0.3% Triton X-100 and 5% serum bovine albumin at room temperature for 60 min. The slices were then incubated with a primary rabbit c-Fos antibody (1:5000; Cell Signaling Technology) in 100 mM PBS with 0.3% Triton X-100 and 5% serum bovine albumin for one overnight period at 4 °C. After rinsing with PBS, they were then labeled with a secondary anti-rabbit IgG antibody Alexa 594 (1:500; Thermo Fisher Scientific) in 100 mM PBS with 0.3% Triton X-100 for 90 min. The samples were mounted using Fluoro-KEEPER Antifade Reagent with DAPI (Nacalai Tesque). Images were acquired using a fluorescence microscope (BZ-X800; Keyence, Osaka, Japan) with a water immersion objective lens (×20, 0.75 NA). The c-Fos and DAPI positive cells were counted using an analysis application (BZ-H4C; Keyence, Osaka, Japan).

Standard surgical procedures were similar to those described previously35,36,37,38,39. Mice were anesthetized with 1–2% of isoflurane gas in air. Two ECG electrodes (stainless steel wires; AS633, Cooner Wire Company) were sutured to tissue underneath the skin of the upper chest, and the animal was then fixed in a stereotaxic instrument with two ear bars and a nose clamp. Two incisions (1 cm) were made on both sides of the upper chest. First, craniotomies were made; one covering the coordinates for the primary somatosensory cortex (S1; 1.3–1.6 mm posterior and 1.8–2.2 mm lateral to the bregma), the dorsal anterior cingulate cortex (ACC; 1.1–1.3 mm anterior and 0.2–0.5 mm lateral to the bregma), the prelimbic cortex (PL; 1.6–1.8 mm anterior and 0.1–0.4 mm lateral to the bregma), the periaqueductal gray (PAG; 3.5–3.7 mm posterior and 0.1–0.4 mm lateral to the bregma), the infralimbic cortex (IL; 1.6–1.8 mm anterior and 0.1–0.4 mm lateral to the bregma), the lateral posterior nucleus of thalamus (THL; 1.8–2.2 mm posterior and 1.1–1.6 mm lateral to the bregma), the nucleus accumbens (NAc; 0.7–1.0 mm anterior and 0.6–0.9 mm lateral to the bregma), and the amygdala (AMY; 0.8–1.2 mm posterior and 2.8–3.1 mm lateral to the bregma). For each craniotomy, a nichrome electrode wire (66 μm diameter, 1 MΩ impedance), which was combined as an electrode array, was implanted. The electrode array was directly implanted into the cortical tissue in the left hemisphere with electrodes inserted 0.7–0.9 mm into S1, 1.5–2.0 mm into the ACC, 2.4–2.5 mm into the PL, 2.7–2.9 mm into the PAG, 2.8–3.0 mm into the IL, 2.6–3.0 mm into the THL, 4.2–4.5 mm into the NAc, and 4.2–4.5 mm into the AMY. Two EMG electrodes were implanted into the dorsal neck area. For the olfactory bulb and cerebellum craniotomies, stainless steel screws were implanted on the skull attached to the brain surface, serving as Resp electrodes and ground/reference electrodes, respectively. Finally, all of the wires and the electrode array were secured to the skull using dental cement. After completing all surgical procedures, the anesthesia was terminated and the animals were spontaneously allowed to awake from the anesthesia. Following surgery, each animal was housed with free access to water and food, with daily observation.

In these surgical procedures, metal electrodes were inserted into the brain tissue. The diameter of these electrodes was 66 μm, which is extremely small compared to the volume of the brain parenchyma (0.5 to 0.6 cubic centimeters). Numerous standard electrophysiological measurements have been conducted using such electrodes, including our previous studies35,36,37,38,39, and no significant tissue damage has been observed.

The mouse was connected to the recording equipment via Cereplex M (Blackrock), a digitally programmable amplifier, which was placed close to the animal’s head. The output of the headstage was conducted to the Cereplex Direct recording system (Blackrock), a data acquisition system, via a lightweight multiwire tether and a commutator. For recording electrophysiological signals, the electrical interface board of the tetrode assembly was connected to a Cereplex M digital headstage (Blackrock Microsystems), and the digitized signals were transferred to a Cereplex Direct data acquisition system (Blackrock Microsystems). Electrical signals were sampled at 2 kHz and low-pass filtered at 500 Hz. In each mouse, recordings were performed for each 40 min before and after an acetic acid injection, termed pre- and post-periods, respectively. Datasets from mice showing significant EMG signal contamination in their LFP traces were excluded from analysis.

The animal’s moment-to-moment position was tracked at 15 Hz using a video camera attached to the ceiling. From video recording data, writhing reflexes of mice were manually detected. This process was conducted under blinded conditions, with a single analyst quantifying writhing reflexes from video recordings without knowledge of the treatment group.

The mice were overdosed with isoflurane, perfused intracardially with 8% PFA in phosphate-buffered saline (pH 7.4) and decapitated. After dissection, the brains were fixed overnight in 4% PFA and equilibrated with 20 and 30% sucrose in phosphate-buffered saline for an overnight each. Frozen coronal Sections (50 μm) were cut using a microtome, and serial sections were mounted and processed for cresyl violet staining. For cresyl violet staining, the slices were rinsed in water, stained with cresyl violet, and coverslipped with Permount. The positions of all electrodes were confirmed by identifying the corresponding electrode tracks in histological tissue.

In the two mice out of nine mice, electrodes were located in all eight regions. In the five mice, electrodes were located in seven regions except the IL, AMY or PAG. In the one mouse, electrodes were located in the six regions except the PL and IL. Of the one mouse, electrodes were located in the six regions except the NAc and PAG.

To compute the time-frequency representation of the LFP power change with time, LFP signals were downsampled to 200 Hz and convolved using a Morlet’s wavelet family defined by a constant ratio of f0/σf = 5, where f0 represents the frequency of interest and σf represents the bandwidth of the wavelet in the frequency domain chosen to ensure optimal time-frequency localization properties of the wavelet. The frequency bands were defined as follows: delta: 1–4 Hz, theta: 5–8 Hz, alpha: 9–13 Hz, beta: 14–30 Hz, slow gamma: 31–49 Hz, and fast gamma: 51–99 Hz. The selection of these frequency bands avoided the 50 Hz power line interference.

LFP power or LFP downsampled traces were concatenated in each 5-s bin before (gray, pre) and after (red, post) an acetic acid injection, yielding 480 pre- and post-bins, respectively. In the classification analyses, d-prime values were employed as a measure to assess how accurately our analysis could discriminate between the two conditions (pre- and post-periods). The numbers of hit bins (nhit, where both the prediction and the real data were post-bins), miss bins (nmiss, where the prediction was a pre-bin, but the real data were post-bin), false alarm bins (nFA, where the prediction was a post-bin, but the real data were pre-bin), and correct rejection bins (nCR, where both the prediction and the real data were pre-bins) were computed. The hit rate (dHit = nhit/(nhit+nmiss)) and false alarm rate (pFA = nFA/(nFA+nCR)) were further computed, while the d-prime value was calculated as Z(dHit) × Z(pFA).

The LFP power from all bins was classified as either pre- or post-bins using Linear Discriminant Analysis (LDA), which identified an optimal linear boundary for discrimination. The classification threshold was determined by projecting the LFP power data onto a one-dimensional axis, and data points were classified based on their position relative to this threshold. The performance of the LDA classifier was evaluated using the d-prime value, which quantifies the separation between the two classes. The d-prime values were calculated for each classification and used to assess the discriminative capability.

AlexNet, a convolutional neural network (CNN) primarily employed for image recognition and classification tasks15, was adapted to analyze the LFP power datasets or LFP traces by replacing the classification layer. This adaptation involved the application of transfer learning in the customized model. The architecture of the modified CNN comprised five convolutional layers, each followed by a local response normalization layer, a rectified linear unit (ReLU) activation layer, and a max-pooling layer. A fully-connected layer complemented the configuration. Detailed specifications of each layer of the CNN are provided in Supplementary Table S1.

To evaluate the performance and robustness of AlexNet, we employed stratified 10-fold cross-validation during the training procedure. In each fold, all bins were randomly split into training and test datasets at a 9:1 ratio, such that 432 bins were used for training and 48 bins for testing. This cross-validation process was repeated ten times, each time with different training and test dataset splits. The d-prime value was computed for each fold, and all values from 10 folds were averaged for each mouse.

The downsampled LFP traces from all brain regions were concatenated into 5-s bins and directly input into the vision Transformer (Python 3.10.12 and TensorFlow 2.14.0) using Emotion-Recognition-Transformers6. A learning rate of 0.00001 was used in the study. Patch embedding was applied with a shape of [1, patch size]. The performance of the Transformer was evaluated using d-prime values obtained from stratified 10-fold cross-validation, similar to the method used for AlexNet.

All data are presented as the mean ± SEM, and were analyzed using MATLAB. Normally distributed data are displayed as the sample mean and SEM with individual data points. Comparisons of two-sample data were performed using paired or Student’s t-tests. Multiple group comparisons were performed using Tukey’s test after ANOVA. Pearson’s correlation coefficients were used to statistically evaluate correlations. The null hypothesis was rejected at P < 0.05 level.

The data that support the findings of this study are available from the corresponding authors upon reasonable request.

Buzsaki, G. Rhythms of the Brain. New York: Oxford University Press (2006).

Metzger, S. L. et al. A high-performance neuroprosthesis for speech decoding and avatar control. Nature. 620, 1037–1046. https://doi.org/10.1038/s41586-023-06443-4 (2023).

Article ADS CAS PubMed Central PubMed Google Scholar

Willett, F. R. et al. A high-performance speech neuroprosthesis. Nature. 620, 1031–1036. https://doi.org/10.1038/s41586-023-06377-x (2023).

Article ADS CAS PubMed Central PubMed Google Scholar

Craik, A., He, Y. & Contreras-Vidal, J. L. Deep learning for electroencephalogram (EEG) classification tasks: a review. J. Neural Eng. 16, 031001. https://doi.org/10.1088/1741-2552/ab0ab5 (2019).

Article ADS PubMed Google Scholar

Vaswani, A. et al. In Advances in Neural Information Processing SystemsVol. 305998–6008 (Curran Associates, Inc., 2017).

Arjun, A., Rajpoot, A. S. & Raveendranatha Panicker, M. Introducing attention mechanism for EEG signals: emotion recognition with Vision transformers. Annu. Int. Conf. IEEE Eng. Med. Biol. Soc. 2021, 5723–5726. https://doi.org/10.1109/EMBC46164.2021.9629837 (2021).

Article PubMed Google Scholar

Cervero, F. & Laird, J. M. Visceral pain. Lancet. 353, 2145–2148. https://doi.org/10.1016/S0140-6736(99)01306-9 (1999).

Article CAS PubMed Google Scholar

Mogil, J. S. et al. Heritability of nociception I: responses of 11 inbred mouse strains on 12 measures of nociception. Pain. 80, 67–82. https://doi.org/10.1016/s0304-3959(98)00197-3 (1999).

Article CAS PubMed Google Scholar

Davis, K. D. et al. Brain imaging tests for chronic pain: medical, legal and ethical issues and recommendations. Nat. Rev. Neurol. 13, 624–638. https://doi.org/10.1038/nrneurol.2017.122 (2017).

Article PubMed Google Scholar

Schweinhardt, P. & Bushnell, M. C. Pain imaging in health and disease–how far have we come? J. Clin. Invest. 120, 3788–3797. https://doi.org/10.1172/JCI43498 (2010).

Article CAS PubMed Central PubMed Google Scholar

Apkarian, A. V., Bushnell, M. C., Treede, R. D. & Zubieta, J. K. Human brain mechanisms of pain perception and regulation in health and disease. Eur. J. Pain. 9, 463–484. https://doi.org/10.1016/j.ejpain.2004.11.001 (2005).

Article PubMed Google Scholar

Yang, S. & Chang, M. C. Chronic Pain: structural and functional changes in Brain structures and Associated negative Affective States. Int. J. Mol. Sci. 20https://doi.org/10.3390/ijms20133130 (2019).

Labus, J. S. et al. Sex differences in brain activity during aversive visceral stimulation and its expectation in patients with chronic abdominal pain: a network analysis. Neuroimage. 41, 1032–1043. https://doi.org/10.1016/j.neuroimage.2008.03.009 (2008).

Article CAS PubMed Google Scholar

Sinniger, V., Porcher, C., Mouchet, P., Juhem, A. & Bonaz, B. c-fos and CRF receptor gene transcription in the brain of acetic acid-induced somato-visceral pain in rats. Pain. 110, 738–750. https://doi.org/10.1016/j.pain.2004.05.014 (2004).

Article CAS PubMed Google Scholar

Krizhevsky, A., Sutskever, I. & Geoffrey, E. H. ImageNet classification with deep convolutional neural networks. Commun. ACM. 60, 6 (2017).

Article Google Scholar

Vierck, C. J., Whitsel, B. L., Favorov, O. V., Brown, A. W. & Tommerdahl, M. Role of primary somatosensory cortex in the coding of pain. Pain. 154, 334–344. https://doi.org/10.1016/j.pain.2012.10.021 (2013).

Article Google Scholar

Bushnell, M. C., Ceko, M. & Low, L. A. Cognitive and emotional control of pain and its disruption in chronic pain. Nat. Rev. Neurosci. 14, 502–511. https://doi.org/10.1038/nrn3516 (2013).

Article CAS PubMed Central Google Scholar

Gao, Y. J., Ren, W. H., Zhang, Y. Q. & Zhao, Z. Q. Contributions of the anterior cingulate cortex and amygdala to pain- and fear-conditioned place avoidance in rats. Pain. 110, 343–353. https://doi.org/10.1016/j.pain.2004.04.030 (2004).

Article Google Scholar

Wang, Z. & Peng, Y. B. Multi-region local field potential signatures in response to the formalin-induced inflammatory stimulus in male rats. Brain Res. 1778, 147779. https://doi.org/10.1016/j.brainres.2022.147779 (2022).

Article CAS Google Scholar

Xiao, Z. et al. Cortical Pain Processing in the rat anterior cingulate cortex and primary somatosensory cortex. Front. Cell. Neurosci. 13, 165. https://doi.org/10.3389/fncel.2019.00165 (2019).

Article PubMed Central PubMed Google Scholar

Aminitabar, A., Mirmoosavi, M., Ghodrati, M. T. & Shalchyan, V. Interhemispheric neural characteristics of noxious mechano-nociceptive stimulation in the anterior cingulate cortex. Front. Neural Circuits. 17https://doi.org/10.3389/fncir.2023.1144979 (2023).

Wang, J. et al. Theta-frequency phase-locking of single anterior cingulate cortex neurons and synchronization with the medial thalamus are modulated by visceral noxious stimulation in rats. Neuroscience. 298, 200–210. https://doi.org/10.1016/j.neuroscience.2015.04.024 (2015).

Article CAS PubMed Google Scholar

Cao, B., Wang, J., Mu, L., Poon, D. C. & Li, Y. Impairment of decision making associated with disruption of phase-locking in the anterior cingulate cortex in viscerally hypersensitive rats. Exp. Neurol. 286, 21–31. https://doi.org/10.1016/j.expneurol.2016.09.010 (2016).

Article PubMed Google Scholar

Zhao, R. et al. Neuropathic Pain causes pyramidal neuronal hyperactivity in the Anterior Cingulate Cortex. Front. Cell. Neurosci. 12, 107. https://doi.org/10.3389/fncel.2018.00107 (2018).

Article CAS PubMed Central PubMed Google Scholar

Peng, W. et al. Brain oscillations reflecting pain-related behavior in freely moving rats. Pain. 159, 106–118. https://doi.org/10.1097/j.pain.0000000000001069 (2018).

Article PubMed Google Scholar

Shirvalkar, P. et al. First-in-human prediction of chronic pain state using intracranial neural biomarkers. Nat. Neurosci. 26, 1090–1099. https://doi.org/10.1038/s41593-023-01338-z (2023).

Article CAS PubMed Central PubMed Google Scholar

Gross, J., Schnitzler, A., Timmermann, L. & Ploner, M. Gamma oscillations in human primary somatosensory cortex reflect pain perception. PLoS Biol. 5, e133. https://doi.org/10.1371/journal.pbio.0050133 (2007).

Article CAS PubMed Central PubMed Google Scholar

Ploner, M., Sorg, C. & Gross, J. Brain rhythms of Pain. Trends Cogn. Sci. 21, 100–110. https://doi.org/10.1016/j.tics.2016.12.001 (2017).

Article PubMed Central PubMed Google Scholar

Ta Dinh, S. et al. Brain dysfunction in chronic pain patients assessed by resting-state electroencephalography. Pain. 160, 2751–2765. https://doi.org/10.1097/j.pain.0000000000001666 (2019).

Article PubMed Central PubMed Google Scholar

LeBlanc, B. W., Bowary, P. M., Chao, Y. C., Lii, T. R. & Saab, C. Y. Electroencephalographic signatures of pain and analgesia in rats. Pain. 157, 2330–2340. https://doi.org/10.1097/j.pain.0000000000000652 (2016).

Article PubMed Google Scholar

Johns, E. & Tracey, I. Neuroimaging of Visceral Pain. Rev. Pain. 3, 2–5. https://doi.org/10.1177/204946370900300202 (2009).

Article PubMed Central PubMed Google Scholar

Vaswani, A. et al. Attention is all you need. arXiv:1706.03762 (2017). https://ui.adsabs.harvard.edu/abs/2017arXiv170603762V

Rubinstein, M. et al. Absence of opioid stress-induced analgesia in mice lacking beta-endorphin by site-directed mutagenesis. Proc. Natl. Acad. Sci. U S A. 93, 3995–4000. https://doi.org/10.1073/pnas.93.9.3995 (1996).

Article ADS CAS PubMed Central PubMed Google Scholar

Yang, W., Law, P. Y., Guo, X. & Loh, H. H. In vivo activation of a mutant mu-opioid receptor by antagonist: future direction for opiate pain treatment paradigm that lacks undesirable side effects. Proc. Natl. Acad. Sci. U S A. 100, 2117–2121. https://doi.org/10.1073/pnas.0334906100 (2003).

Article ADS CAS PubMed Central PubMed Google Scholar

Kuga, N. et al. Sniffing behaviour-related changes in cardiac and cortical activity in rats. J. Physiol. 597, 5295–5306. https://doi.org/10.1113/JP278500 (2019).

Article CAS PubMed Google Scholar

Okonogi, T., Nakayama, R., Sasaki, T. & Ikegaya, Y. Characterization of Peripheral Activity States and cortical local field potentials of mice in an elevated plus maze test. Front. Behav. Neurosci. 12, 62. https://doi.org/10.3389/fnbeh.2018.00062 (2018).

Article CAS PubMed Central PubMed Google Scholar

Konno, D., Ikegaya, Y. & Sasaki, T. Weak representation of awake/sleep states by local field potentials in aged mice. Sci. Rep. 12, 7766. https://doi.org/10.1038/s41598-022-11888-0 (2022).

Article ADS CAS PubMed Central PubMed Google Scholar

Konno, D. et al. Collection of biochemical samples with brain-wide electrophysiological recordings from a freely moving rodent. J. Pharmacol. Sci. 139, 346–351. https://doi.org/10.1016/j.jphs.2019.02.006 (2019).

Article CAS Google Scholar

Okonogi, T. et al. Stress-induced vagal activity influences anxiety-relevant prefrontal and amygdala neuronal oscillations in male mice. Nat. Commun. 15, 183. https://doi.org/10.1038/s41467-023-44205-y (2024).

Article ADS CAS PubMed Central Google Scholar

Download references

This work was supported by KAKENHI (21H05243) from the Japan Society for the Promotion of Science (JSPS), a grant (JP21zf0127004) from the Japan Agency for Medical Research and Development (AMED), a grant (JPMJCR21P1) from the Japan Science and Technology Agency (JST) to T. Sasaki; and a grant (JPMJMS2292) from the JST to K. Kitajo, K. Tsutsui, and T. Sasaki; and a JSPS Research Fellowship (23KJ0084) to T. Kayama. We thank Mr. Naoki Takahashi and Dr. Shohei Tsuchimoto for providing technical support.

Tasuku Kayama, Atsushi Tamura and Tuo Xiaoying contributed equally.

Department of Pharmacology, Graduate School of Pharmaceutical Sciences, Tohoku University, 6-3 Aramaki-Aoba, Aoba-Ku, Sendai, 980-8578, Japan

Tasuku Kayama, Atsushi Tamura, Tuo Xiaoying & Takuya Sasaki

Laboratory of Systems Neuroscience, Graduate School of Life Sciences, Tohoku University, Sendai, 980-8577, Japan

Ken-Ichiro Tsutsui

Division of Neural Dynamics, National Institute for Physiological Sciences, 38 Nishigonaka, Myodaiji, Okazaki, 444-8585, Aichi, Japan

Keiichi Kitajo

Physiological Sciences Program, Department of Advanced Studies, Graduate University for Advanced Studies (SOKENDAI), 38 Nishigonaka, Myodaiji, Okazaki, 444-8585, Aichi, Japan

Keiichi Kitajo

Department of Neuropharmacology, Tohoku University School of Medicine, 4-1 Seiryo-machi, Aoba-Ku, Sendai, 980-8575, Japan

Takuya Sasaki

You can also search for this author in PubMed Google Scholar

You can also search for this author in PubMed Google Scholar

You can also search for this author in PubMed Google Scholar

You can also search for this author in PubMed Google Scholar

You can also search for this author in PubMed Google Scholar

You can also search for this author in PubMed Google Scholar

T.K. and T.S. designed the study. T.K. acquired the biological and electrophysiological data. T.K., A.T., and T.X. performed the analyses and prepared the figures. K.T. and K.K. surpervised the project. T.K. and T.S. wrote the main manuscript text, and all the authors reviewed the main manuscript text.

Correspondence to Takuya Sasaki.

The authors declare no competing interests.

All experiments were approved by the Committee on Animal Experiments at Tohoku University (approval number: 2022 PhA-004). The experiments were performed in accordance with the NIH guidelines for the care and use of animals. This study followed ARRIVE guidelines.

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Below is the link to the electronic supplementary material.

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

Kayama, T., Tamura, A., Xiaoying, T. et al. Transformer-based classification of visceral pain-related local field potential patterns in the brain. Sci Rep 14, 24372 (2024). https://doi.org/10.1038/s41598-024-75616-6

Download citation

Received: 03 July 2024

Accepted: 07 October 2024

Published: 17 October 2024

DOI: https://doi.org/10.1038/s41598-024-75616-6

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative