Introduction

Chronic neck and shoulder pain (CNSP) is the most common clinical symptom of cervical spondylosis, defined as persistent pain in the neck and shoulder region lasting more than 3 months1. CNSP has a high incidence rate, with one systematic review estimating global annual and lifetime prevalence rates of 37.2% (range 16.7–75.1%) and 48.5% (range 14.2–71%), respectively2. In the United States, neck pain is the fourth leading cause of disability, following back pain, depression, and other musculoskeletal disorders3. A recent study estimated that among 154 diseases in the United States, low back and neck pain accounted for the highest healthcare spending, with an estimated $134.5 billion (95% CI, $122.4–$146.9 billion) in expenditure4.

However, current analgesic treatment options are often associated with various adverse effects, such as gastrointestinal discomfort, excessive sedation, and even drug dependence and addiction. Some patients still struggle with chronic pain even after undergoing surgical treatment, leaving considerable room for improvement in the treatment of chronic pain5. In recent years, non-invasive neuromodulation techniques have emerged, effectively improving chronic pain symptoms by precisely delivering electrical or other energy signals to central and peripheral nerve sites, showing great potential6,7,8. However, current research on the central mechanisms of chronic pain is not yet thorough, and many factors influencing the onset, progression, and transmission of pain have been identified9,10,11. These have become major issues limiting the further improvement of the efficacy and widespread clinical application of such invasive neuromodulation technologies. Therefore, exploring the central nervous mechanisms of CNSP is of significant importance for the objective assessment and intervention guidance of chronic pain.

In recent years, resting-state functional magnetic resonance imaging (rs-fMRI) has been widely used to study potential brain function changes in various chronic pain disorders, including CNSP12. Numerous rs-fMRI studies have revealed disruptions in brain functional connectivity within or between multiple brain regions in CNSP patients13,14,15. However, increasing evidence suggests that the human brain system is complex and dynamic, and that brain functional connectivity fluctuates over time during scanning16. A recent study using the sliding window method explored the changes in dynamic functional connectivity density (dFCD) between CNSP patients and healthy controls (HCs), and found that compared to HCs, CNSP patients showed increased dFCD in the anterior cingulate cortex, occipital lobe, temporal lobe, and cerebellum, which was correlated with the patients’ disease duration and clinical symptoms (pain and depression)17.

Although the sliding window method is currently the most commonly used method for studying dynamic functional connectivity, it still has many limitations. The sliding window method assumes that functional connectivity remains constant within each window, but this assumption may not be accurate when capturing the true rapid changes in the brain. Additionally, the choice of window size presents a challenge. A window that is too large may ignore short-term variations, while a window that is too small may miss enough data, making reliable network estimation impossible18. The Hidden Markov Model19 (HMM) assumes that the brain is in different hidden states at different time points, with each state corresponding to a distinct connectivity pattern. It identifies state changes adaptively, without relying on preset time windows. The HMM model reveals the dynamic regulation mechanisms between different brain functional states by learning the characteristics of these states and the transition probabilities between states. Pain experience is often non-linear, and even at rest, the intensity of pain in chronic pain patients may fluctuate, potentially changing rapidly within a short period, such as shifting between “relief” and “exacerbation” states20. Additionally, HMM can identify multiple discrete brain functional states21, such as “pain-related state,” “emotional regulation state,” or “cognitive load state.” The characteristics of these states help to identify the interactions between the pain network and other neural networks. HMM, by revealing the transition patterns of these states, is highly beneficial for identifying abnormal neural state transition patterns in chronic pain patients.

In this study, we will perform HMM analysis on rs-fMRI data from CNSP patients and healthy control groups to explore the complex temporal dynamics of brain activity in CNSP patients. In addition, this study aims to identify specific patterns in the cross-state transitions of CNSP patients. This research will provide a novel neuroimaging perspective for the objective assessment of chronic pain experience in patients.

Methods

All research procedures were approved by the Ethics Committee of North Sichuan Medical College Affiliated Hospital and adhered to the principles outlined in the Declaration of Helsinki (Approval No. 2023ER95-1). Written informed consent was obtained from all participants, who were fully briefed on the study prior to participation.

Participants

CNSP group: Participants in the CNSP group were diagnosed with chronic neck and shoulder pain by two experienced pain specialists at the Affiliated Hospital of North Sichuan Medical College, according to the chronic pain classification criteria in the International Classification of Diseases, 11th Revision (ICD-11)22. Inclusion Criteria: (1) Persistent neck and shoulder pain, with or without radiating arm pain (unilateral or bilateral), lasting at least three months. Radiographic evidence of cervical degeneration on X-ray or MRI; (2) Age between 20 and 70 years, right-handed; (3) No analgesic medication used within two weeks prior to the study; (4) No contraindications to MRI; (5) No significant pain in other body regions. Exclusion Criteria: (1) Significant cerebral pathology, such as extensive cerebral infarction, cerebromalacia, or tumors; (2) Primary psychiatric disorders, including anxiety, depression, Alzheimer’s disease, schizophrenia, or other neurological or psychiatric conditions; (3) Inability to tolerate prolonged MRI scans due to severe pain; (4) Severe underlying cardiac, hepatic, or renal diseases.

HCs group: Inclusion criteria: (1) Matched with the CNSP group in terms of age and handedness; (2) No contraindications to MRI; (3) No acute or chronic pain symptoms. Exclusion Criteria: (1) Significant intracranial lesions; (2) Neurological or psychiatric disorders.

Clinical indicators assessment

All evaluations were conducted before the MRI scans. The average pain intensity over the past week was assessed using a visual analogue scale (VAS), ranging from 0 (no pain) to 10 (the most intense pain imaginable). Anxiety and depression levels were concurrently assessed using the Self-Rating Anxiety Scale (SAS)23 and the Self-Rating Depression Scale (SDS)24, respectively. The duration of pain was defined as the time between the initial diagnosis of CNSP and the date of the preoperative brain MRI.

Imaging acquisition

All MRI scans were conducted using a Siemens MAGNETOM Skyra 3.0T MRI scanner, equipped with a standard 20-channel head-neck combined coil. Subjects were positioned supine on the examination bed, with their heads comfortably secured using foam padding to minimize movement. Earplugs were provided to reduce external noise. Participants were instructed to remain awake, close their eyes, avoid specific thoughts, and keep their heads still throughout the procedure.

High-resolution T1 structural images were obtained using a three-dimensional (3D) Magnetization Prepared Rapid Gradient Echo (MP-RAGE) sequence. The imaging parameters were as follows: repetition time (TR) = 2240 ms, inversion time (TI) = 1130 ms, data matrix = 256 × 256, field of view (FOV) = 256 × 256 mm, slices = 192, slice thickness = 1 mm (no gap), and voxel size = 1.0 × 1.0 × 1.0 mm.

Rs-fMRI data were acquired using a T2-weighted echo planar imaging (EPI) sequence. The parameters for rs-fMRI included: multiband (MB) factor = 4, TR = 2000 ms, echo time (TE) = 30 ms, data matrix = 80 × 80, FOV = 240 × 240 mm, slices = 52, slice thickness = 3 mm (no gap), voxel size = 3.0 × 3.0 × 3.0 mm, and total volume = 200.

Data preprocessing

Image preprocessing was performed using the Conn Connectivity (CONN) toolbox25 based on MATLAB 2022b and Statistical Parametric Mapping (SPM12) software (http://www.fil.ion.ucl.ac.uk/spm). The following steps were included: (1) the first 10 volumes were discarded due to the instability of the initial magnetic field. (2) Slice-timing correction was applied to the remaining 190 volumes. (3) Head motion correction was performed using rigid body transformation with 6 degrees of freedom (3 translations and 3 rotations). (4) Artifact Detection Tools (ART) from the CONN toolbox were used to detect problematic time points during scanning. In this study, if the framewise displacement (FD) was greater than 0.5 mm compared to the previous frame or greater than 3 standard deviations of the whole-brain average intensity, it was considered an outlier26. (5) Functional and structural data were segmented into gray matter, white matter, and cerebrospinal fluid tissue27, and normalized to the standard Montreal Neurological Institute (MNI) space. (6) Spatial smoothing was performed using a Gaussian kernel with a full-width at half-maximum (FWHM) of 6 mm.

To further reduce physiological and motion-related noise in fMRI data, we applied the anatomical component-based noise correction (aCompCor)28 method using the CONN toolbox, which extracts five potential noise components from signals originating from white matter and cerebrospinal fluid, and regresses these principal components as covariates. We then extracted the motion parameters (including three translation and three rotation parameters, along with their respective first derivatives) and used them as covariates in the regression model for linear regression29. Additionally, outliers detected by ART were scrubbed (if more than 40 images were removed, which exceeds 20% of the acquired volumes, the subject was excluded from subsequent analyses)30. Moreover, to mitigate low-frequency drift effects and high-frequency respiratory and cardiac noise in the fMRI data, we performed linear detrending and applied a temporal band-pass filter within the frequency range of 0.008 to 0.09 Hz31.

Hidden Markov model

The brains of all participants were divided into 116 regions of interest (ROIs) based on the Automated Anatomical Labeling (AAL) atlas32 (Fig. 1A, B). Temporal data, consisting of 116 ROIs × 190 time points (Fig. 1C), were extracted from each participant and used to construct the HMM. The HMM assumes that fMRI time-series data can be represented as a dynamic sequence of a limited number of hidden brain states and their transitions. The number of states in the HMM is a free parameter that must be defined beforehand19. We utilized the Hidden Markov Model - Multivariate Autoregressive (HMM-MAR) toolbox implemented in MATLAB (available at https://github.com/OHBA-analysis/HMM-MAR) to perform variational Bayes inversion of the HMM, running 500 cycles. States were defined as multivariate Gaussian distributions33. To select the optimal number of states in the HMM, we evaluated the range of state numbers from k = 2 to k = 15 based on previous research34 and performed 100 repeated experiments to ensure result stability. In each experiment, we trained the model for each state number and calculated the model’s free energy and state occupancy ratio. Free energy is an important indicator of model stability, with lower free energy generally indicating better fit and higher stability35. The state occupancy ratio is used to assess the extent to which each state is occupied in the time series, ensuring that all states are utilized. Finally, we selected k = 5 as the optimal number of clusters based on the mean free energy and mean state occupancy ratio for each state number (Fig. 1D), choosing the state number with the lowest free energy and all states occupied. This selection ensures the model balances fit and stability while avoiding excessive unoccupied state distributions.

Each state is characterized by the parameters of a multivariate normal distribution34: (1) spatial states, representing the “average functional activity” of the state (Fig. 1E). These spatial states were derived from the average Blood Oxygen Level Dependent (BOLD) time series (representing average functional activity), which captured systematic, recurring patterns of activation across the 116 ROIs at specific time points. Positive activations (warm/red colors) indicated relatively high BOLD activity in certain regions, while negative activations (cool/blue colors) indicated relatively low BOLD activity; (2) covariance matrix, which reflects the “functional connectivity” of the state (Fig. 1F). This covariance matrix measured the strength of the connections between brain regions involved in each state. To interpret the functional connectivity more effectively, the 116 ROIs were divided into 9 large brain networks: including seven brain networks described by Yeo et al.36: Default Mode Network (DMN), Frontoparietal Network (FPN), Salience Network (SN), Dorsal Attention Network (DAN), Sensorimotor Network (SMN), Visual Network (VN), and Limbic Network (LN); subcortical regions described by Tian et al.37; and the cerebellar network. The specific allocation of the 116 ROIs can be found in Supplementary Table 1.

Our strategy allowed for a consistent set of brain states to be identified across both patient and healthy control groups, enabling direct comparisons of brain state dynamics. While all participants shared the same set of states, individual differences could be captured in the temporal dynamics of these states. The HMM parameterized brain state dynamics in terms of these temporal properties. Specifically, the model accounted for variability in the following parameters: (1) Fractional occupancy (FO): the proportion of total scan time spent in each state; (2) Averaged lifetime (ALT) refers to the average duration an individual remains in a given state during the scanning session. If the ALT of a particular brain state is long, it indicates that the brain maintains this state for a longer period each time it transitions into it; (3) Switching rate (SR): the frequency at which individuals switch between different states; (4) Transition probability: the likelihood of transitioning from one state to another.

Fig. 1
figure 1

Flowchart of the Hidden Markov Model (HMM) construction. (A) Preprocessed fMRI data from one subject, consisting of 190 volumes. (B) The Automated Anatomical Labeling (AAL) atlas, which includes 116 cortical and subcortical brain regions of interest (ROIs). (C) ROI time courses were extracted for each subject based on the 190 volumes and the segmentation scheme shown in panel B. (D) The HMM uses the ROI time courses from all subjects to calculate the activation probabilities of latent states at each time point in the scanning sequence. (E) The latent states are characterized by a covariance matrix, which quantifies the strength of connections between brain regions involved in each state. (F) The latent states are also described by average functional activity, representing the systematic and repetitive activation patterns of the 116 ROIs in each state. The 3D graphics in this figure were created using BrainNet Viewer Version 1.7 (https://www.nitrc.org/projects/bnv/).

Statistical analysis

The Shapiro-Wilk (SW) test was used to assess the data distribution. Independent samples t-tests were used for comparisons between age groups. Chi-square tests were used for comparisons between gender groups. Group comparisons for fractional occupancy, averaged lifetime, and switching frequency were conducted using analysis of covariance (ANCOVA), with age and gender as covariates. Since the FO and ALT indicators each correspond to five states, the false discovery rate (FDR) method was used to perform multiple comparisons correction for each indicator, with a significance threshold set at P < 0.05. Due to the skewed distribution of state transition probability data, we employed a non-parametric permutation test (5000 permutations) to compare state transition probabilities between CNSP patients and HC groups. Specifically, we first combined all state transition probability data from CNSP patients and HCs and then randomly reassigned these data. After each reassignment, we calculated the state transition probability once, repeating this process 5000 times, each time obtaining a new statistic, thereby generating a null distribution. We compared the original statistic to this null distribution to calculate the P-value. In this process, we further considered age and gender as covariates and employed the FDR method for multiple comparison correction, with a significance threshold of P < 0.05. Partial correlation analysis was used to assess the relationships between VAS scores, disease duration, SDS scores, SAS scores, and changes in fractional occupancy, averaged lifetime, and switching frequency in CNSP patients. Age and gender were treated as confounding factors and adjusted for in the partial correlation analysis, along with other control variables, and multiple comparisons were corrected using the FDR method, with a significance threshold of P < 0.05. Additionally, we conducted partial correlation analysis between the FO, ALT, and SR indices, and multiple comparisons were corrected using the FDR method, with a significance threshold of P < 0.05.

Results

Demographics and clinical measures

In this study, a total of 36 patients with CNSP were initially recruited. However, one patient withdrew from the MRI procedure due to pain, and three patients were excluded because excessive head motion resulted in outliers detected by the Artifact Detection Tools (ART) exceeding 40 volumes (more than 20% of the total acquired volumes). As a result, the final sample consisted of 32 CNSP patients. Additionally, 32 healthy controls were included. No significant differences in age or gender were observed between the two groups (P > 0.05). CNSP patients showed significantly higher scores on the SAS and SDS compared to the healthy controls (P < 0.05). There were no significant differences between the two groups in head motion (Framewise Displacement) (P > 0.05). Detailed clinical and demographic data for both groups are provided in Table 1.

Table 1 Demographic and behavioral data.

Average functional activity and functional connectivity of HMM States

Using rs-fMRI data from all participants, the HMM model identified five distinct spatial states, each characterized by specific patterns of functional connectivity (FC) and averaged functional activity (Fig. 2 and Supplementary Fig. 1).

  1. State 1:

    This state exhibits stronger FC within the SN, FPN, and subcortical regions, as well as between the SN and subcortical regions, compared to other states. The averaged functional activity in the bilateral dorsolateral prefrontal cortex is higher than in the other states.

  2. State 2:

    Compared to other states, there is stronger FC within the SMN and between the SMN and SN. Additionally, the averaged functional activity in the sensorimotor region is higher than in the other states.

  3. State 3:

    This state is characterized by generally stronger FC across the brain. However, the averaged functional activity across all brain regions is relatively lower compared to the other states.

  4. State 4:

    Compared to other states, there is stronger FC within the VN; the FC within and between the remaining networks is stronger than in State 5, but weaker than in all other networks. The averaged functional activity in the bilateral occipital cortex is higher than in the other states.

  5. State 5:

    This state shows weaker overall brain FC compared to other states, while the averaged functional activity in the bilateral superior parietal lobule is higher than in the other states.

Fig. 2
figure 2

Representation of Hidden Markov Model (HMM) hidden states and group comparisons of the temporal features. The HMM was applied to identify 5 spatial states, each of which is represented by a brain map indicating average functional activity (with blue to red indicating low to high average functional activity) and a covariance matrix representing functional connectivity (with blue to yellow indicating weak to strong functional connectivity). To interpret the functional connectivity more effectively, the 116 ROIs were divided into 9 large brain networks: including seven brain networks described by Yeo et al.36: Default Mode Network (DMN), Frontoparietal Network (FPN), Salience Network (SN), Dorsal Attention Network (DAN), Sensorimotor Network (SMN), Visual Network (VN), and Limbic Network (LN); subcortical regions described by Tian et al.37; and the cerebellar network. The specific allocation of the 116 ROIs can be found in Supplementary Table 1. This figure contains the representation results of states 1, 2, and 3, while the representation results of states 4 and 5 can be found in Supplementary Fig. 1. The violin plot represents the group comparisons of temporal features (fractional occupancy and averaged lifetime) between healthy controls and Chronic neck and shoulder pain (CNSP) patients, with the p-values corrected for false discovery rate (FDR) displayed at the top of each comparison.The 3D graphics in this figure were created using BrainNet Viewer Version 1.7 (https://www.nitrc.org/projects/bnv/).

Fractional occupancy

FO represents the proportion of total scan time occupied by a particular state. A higher FO indicates that the state is more common. People with CNSP showed significantly higher FO in state 1 and state 2 compared to HCs adjusted for age and gender, FDR corrected (state 1: P = 0.026; and state 2: P = 0.031). HCs showed significantly higher FO in state 3 compared to people with CNSP adjusted for age and gender, FDR corrected (P<0.001) (Fig. 3A).

Averaged lifetime

ALT indicates the average duration spent in a given state. A higher ALT means longer dwell time in that state, indicating greater stability. People with CNSP showed significantly higher ALT in state 1 and state 2 compared to HCs adjusted for age and gender, FDR corrected (state 1: P = 0.041; and state 2: P = 0.023). HCs showed significantly higher ALT in state 3 compared to people with CNSP adjusted for age and gender, FDR corrected (P<0.001) (Fig. 3B).

Switching rate

SR refers to the frequency of transitions between states. A high switching rate indicates more frequent state transitions. People with CNSP showed significantly higher SR compared to HCs adjusted for age and gender, FDR corrected (P = 0.045) (Fig. 3C).

Fig. 3
figure 3

Group comparisons of temporal features and states switching rate. Blue represents the Chronic Neck and Shoulder Pain (CNSP) group, while orange represents the Healthy Controls (HCs) group. Asterisks indicate statistical significance after false discovery rate (FDR) correction (P < 0.05). The p-values, corrected for FDR, are displayed at the top of the violin plot.

Transition probability

Figure 4A, B shows group-averaged state transition probability matrices, with the top 50% of these transitions visualized as state transition diagrams in Fig. 4D, E, highlighting the transitions that are more likely to occur on average. The top 50% represent the stronger state transitions observed in the rs-fMRI data. We observed that CNSP patients are more likely to transition from other states to state 1 or state 2, with the highest probability of transitioning from state 2 to state 1 (probability = 0.5); In contrast, healthy controls are more likely to transition from other states to state 3, with the highest probability of transitioning from state 1 to state 3 (probability = 0.55).

These observations were substantiated by statistical analysis of between-group differences, showing significant differences between CNSP patients and healthy participants in some state transition probabilities (Fig. 4C). Compared to the healthy control group, CNSP patients showed significantly increased probabilities of transitioning from state 2 and state 5 to state 1 (state 2 to 1: P = 0.042; state 5 to 1: P = 0.048); and showed significantly increased probabilities of transitioning from state 3 and state 4 to state 2 (state 3 to 2: P = 0.036; state 4 to 2: P = 0.043); while the probabilities of transitioning from state 1 and state 2 to state 3 were significantly decreased (state 1 to 3: P = 0.023; state 2 to 3: P = 0.031).

Fig. 4
figure 4

Transition probabilities of Hidden Markov Model (HMM) hidden states. (A) The average state transition probability matrix for the Chronic neck and shoulder pain (CNSP) group; (B) The average state transition probability matrix for the healthy controls (HCs) group; (C) The results of permutation tests (5000 permutations) for the state transition probability matrices of the CNSP and HCs groups. Only t-values with statistical significance (P < 0.05, FDR corrected) are marked. (D) The top 50% of the state transition probabilities for the CNSP group. Each circle represents a state. The circle diameter represents the sum of the transition probabilities from other states to that state. The thickness of the arrows represents the magnitude of the state transition probabilities. (E) The top 50% of state transition probabilities for the HCs group.

Results of partial correlation analysis

The partial correlation analysis results showed a significant positive correlation between the FO of State2 and VAS scores (r = 0.431, P = 0.048, FDR corrected), and a significant negative correlation between the FO of State3 and the ALT of State 3 with VAS scores (State3_FO: r=-0.523, P = 0.018; State3_ALT: r=-0.502, P = 0.025, FDR corrected). The FO of State3 and the ALT of State 3 showed a significant negative correlation with SAS scores (State3_FO: r=-0.473, P = 0.036; State3_ALT: r=-0.452, P = 0.042, FDR corrected). SR showed a significant positive correlation with SAS scores (r = 0.475, P = 0.034, FDR corrected). The FO of State1 and the ALT of State1 showed a significant positive correlation with SDS scores (State1_FO: r = 0.512, P = 0.021; State1_ALT: r = 0.453, P = 0.041, FDR corrected). The FO of State3 and the ALT of State3 showed a significant negative correlation with SDS scores (State3_FO: r=-0.458, P = 0.039; State3_ALT: r=-0.435, P = 0.046, FDR corrected). There was no significant correlation between the duration of illness and dynamic characteristics in CNSP patients. FO and ALT show a significant positive correlation in all five states (State 1: r = 0.92, P < 0.001; State 2: r = 0.87, P < 0.001; State 3: r = 0.87, P < 0.001; State 4: r = 0.91, P < 0.001; State 5: r = 0.89, P < 0.001), as shown in Supplementary Fig. 2. No significant correlation exists between SR and FO, or between SR and ALT, as demonstrated in Supplementary Figs. 3 and 4.

Fig. 5
figure 5

Partial correlation analysis between temporal features of Hidden Markov Model (HMM) hidden states and clinical measures. Only correlation coefficients (r) with statistical significance (P < 0.05, FDR corrected) are marked. VAS visual analogue scale, SAS Self-Rating Anxiety Scale, SDS Self-Rating Depression Scale, FO fractional occupancy, ALT averaged lifetime, SR switching rate (Fig. 5).

Discussion

This study applied the HMM model to obtain five distinct spatial states characterized by functional connectivity and mean functional activity across the entire research sample, and for the first time, identified specific patterns in CNSP patients during cross-state transitions from the perspectives of HMM states and state transitions. Additionally, we found that although CNSP patients and HCs shared the same five brain states, there were significant differences in brain dynamics, such as FO, ALT, SR, and state transition probability.

Comparisons of dynamic measures reveal that, compared to healthy controls, CNSP patients exhibit higher FO and ALT in state 1. This state is characterized by stronger FC within the Salience Network (SN), Fronto-Parietal Network (FPN), and subcortical regions, as well as enhanced connectivity between the SN and subcortical regions, when compared to other states. Additionally, the averaged functional activity in the bilateral dorsolateral prefrontal cortex (DLPFC) is greater than in the other states. The DLPFC is a brain region critically involved in higher-order functions, including cognitive control, decision-making, and emotional regulation38. Previous studies have demonstrated that DLPFC activation is closely associated with reduced pain perception39. Specifically, when the DLPFC is stimulated through repetitive transcranial magnetic stimulation (rTMS), patients report a significant reduction in pain intensity. This suggests that the DLPFC may modulate pain experience by regulating cognitive responses to pain40. The elevated averaged functional activity observed in state 1 in this study implies that this state may be associated with patients’ active regulation of pain. A similar functional state has also been detected in patients with major depressive disorder41, highlighting the significant role of this state in the cognitive regulation of emotions. The SN is considered a crucial neural system for integrating sensory information with emotional experience, cognitive evaluation, and behavioral responses42. Research has highlighted the significant role of the SN in emotional processing, cognitive regulation, and behavioral responses in chronic pain, particularly in pain perception, attention allocation, and emotional regulation43. The core regions of the FPN, including the prefrontal cortex (PFC) and parietal cortex, are instrumental in enhancing cognitive control over pain signals, allowing individuals to reduce or ignore excessive focus on pain44. Subcortical regions, such as the thalamus, basal ganglia, and amygdala, are involved in the emotional processing of pain, with dysfunction in these areas potentially exacerbating the emotional experience of pain, including anxiety, depression, and distress45. In the present study, we observed higher functional connectivity within the SN, FPN, and subcortical regions, as well as between the SN and subcortical regions. This suggests that patients in state 1 may be engaging in a complex interplay of emotional and cognitive regulation to suppress pain perception. The higher FO and ALT observed in CNSP patients in state 1 indicate that these patients likely spend more time actively regulating their pain experience.

The results of this study indicate that, compared to healthy controls, CNSP patients exhibit higher FO and ALT in state 2. This state is characterized by enhanced FC within the sensorimotor network (SMN), as well as between the SMN and SN, relative to other states. Moreover, the average functional activity in the sensorimotor region is higher in this state than in others. The SMN plays a crucial role in processing sensory information from the body and coordinating motor execution. Its primary function is to integrate sensory inputs with motor outputs, thereby maintaining both motor function and the perception of the external environment46. The elevated functional activity observed in state 2 suggests that this state may correspond to the patient’s process of perceiving pain stimuli. The functional activity of this state is similar to State 6 detected by Jing et al.47 in patients with irritable bowel syndrome (IBS), where they suggested that this state is closely associated with the abdominal pain symptoms of IBS patients. Additionally, the increased functional connectivity within the SN may reflect an inter-network interaction, where the SMN handles bodily perception and motor control, while the SN is responsible for evaluating the emotional and physiological significance of pain. The higher FO and ALT values observed in CNSP patients during state 2 imply that patients may spend more time perceiving and assessing pain.

The comparison of dynamic measures further reveals that, compared to CNSP patients, healthy controls exhibit higher FO and ALT in state 3. This state is characterized by generally stronger FC across the brain. However, the average functional activity across all brain regions is relatively lower than in other states. A lower level of whole-brain activity suggests that the individual may no longer be focused on processing external tasks or environmental information, but rather has entered a relatively “relaxed” or “meditative” state48. A similar state has been observed in numerous studies involving different types of diseases using HMM41;47;49, suggesting that this state may represent a fundamental brain activity state, widely present across various subjects. Notably, the increased FC within and between brain networks in this state may indicate that the brain, in a “non-task-directed” mode, facilitates coordination among distinct neural networks to prepare for future cognitive demands. This enhanced synergy helps the brain rapidly enter an efficient working mode, improving cognitive flexibility. When external stimuli occur, the brain can quickly mobilize relevant brain regions to process information efficiently50.

Compared to healthy controls, patients with CNSP exhibit a significantly higher rate of state transitions, suggesting that they experience more frequent shifts between different states. This implies that pain experience in CNSP patients may be non-linearly variable, with fluctuations even during resting states. These pain experiences can change rapidly over short periods20. Patients may continuously transition between various states, including pain perception and evaluation, self-regulation of pain, and relatively “relaxed” or “meditative” states.

The state transition probability map reveals that CNSP patients are more likely to transition from other states to State 1 or State 2. These findings suggest that, during episodes of pain, the brain’s network system is more inclined to shift toward states associated with perception, assessment, and self-regulation. This pattern of state transitions may reflect a cyclical process of cognitive and emotional processing that develops in patients over the course of prolonged pain experiences51. Notably, the probability of transitioning from State 2 to State 1 is the highest (probability = 0.5), which may indicate that chronic pain patients, after perceiving and assessing the pain, tend to suppress the pain experience through self-regulation. In contrast, the healthy control group demonstrates a clear tendency to transition from other states to State 3. This shift likely reflects the brain’s inclination to enter a low-tension “rest” state after information processing, allowing for the restoration of neural resources, self-regulation, and cognitive reset when the individual is in a non-stressful or relaxed state. Such a pattern enables individuals to alleviate stress, recover energy, and prepare for new cognitive tasks48. These observations were corroborated through permutation testing of the state transition probability matrix between the two groups (Fig. 3). Statistical analysis reveals significant differences in transition probabilities between different states in CNSP patients compared to healthy controls, particularly in transitions from other states to States 1, 2, and 3. This suggests that state transition rates may serve as a promising neuroimaging biomarker for studying CNSP patients.

The current findings differ significantly from previous studies on brain FC in CNSP. Earlier research typically employed seed-based FC analysis, using regions such as the anterior cingulate cortex, insula, and prefrontal cortex as seed regions13,14,15. While these studies identified disruptions in FC within and between various brain regions in CNSP patients, these studies did not consider the possibility that CNSP patients may rapidly switch between different states during the scanning process16. This may be one of the reasons for the significant differences in the results of previous FC studies on CNSP. A recent study employing the sliding window method revealed that, compared to HCs, CNSP patients exhibited increased dynamic functional connectivity density (dFCD) in the anterior cingulate cortex, occipital lobe, temporal lobe, and cerebellum17. However, this study’s use of a fixed sliding window method failed to address the variability in state transitions experienced by individuals52. For instance, some patients, with a stronger ability to self-regulate pain, may complete this process quickly, while others, with weaker self-regulation abilities, may remain in this state for extended periods. This may limit the generalizability of these findings in individualized assessments.

The correlation analysis revealed a significant positive relationship between the FO and ALT in State 1 and patients’ depression scores. Individuals in a depressive state typically experience impaired emotional regulation, which complicates their ability to recover from emotional distress53. We hypothesize that CNSP patients with depression may have a diminished capacity to self-regulate in response to pain, leading to prolonged periods spent in this state. In State 2, the FO was significantly positively correlated with patients’ VAS scores, suggesting that higher pain intensity drives patients to focus more on the perception and evaluation of pain. We speculate that as pain intensity increases, patients may require additional time to assess its severity, as well as its emotional and physiological implications. Furthermore, the analysis showed that the FO and ALT in State 3 were negatively correlated with patients’ SAS, SDS, and VAS scores. As the intensity of these negative emotional states or symptoms increased, patients likely spent more time managing and regulating their emotions, which may have reduced the time spent in a “relaxed” or “meditative” state. Finally, we found that SR was significantly positively correlated with anxiety levels in patients. Anxious patients may focus more frequently on their pain and may rapidly switch between states of anxiety, anger, distress, and frustration54. This heightened emotional volatility may contribute to greater instability in emotional regulation, further complicating their emotional recovery.

Additionally, we found a significant correlation between FO and ALT. FO reflects the proportion of time that a specific brain state is sustained within the total scanning time, while ALT represents the “average dwell time” of the brain in a particular activity state. If the ALT of a brain state is long, it suggests that the brain maintains that state for a relatively extended period each time it transitions into that state. We hypothesize that if the FO of a state is high, it indicates that the state is occupied for a longer period, and a longer ALT could be one of the reasons for the high FO. If a brain state has both a high FO and a long ALT, it implies that the state not only occurs frequently but is also sustained for a longer duration, suggesting that this brain state might play an important role in certain cognitive tasks.

Limitations

Resting-state fMRI cannot directly measure fluctuations in pain, so external validation (such as task-based fMRI or real-time subjective reports) is necessary to determine whether HMM can more accurately capture pain-related states compared to sliding window methods or clustering-based approaches. Additionally, further research is required to assess whether the number and nature of the internal states identified in this study are generalizable to other CNSP patient populations. Furthermore, the interpretation of pain-related state transitions in this study lacks direct evidence. Future research should incorporate external validation to substantiate these interpretations. While this study suggests that CNSP patients experience maladaptive state transitions, it is important to consider that other factors, such as fatigue, attention shifts, and anxiety, could also contribute to these transitions. Future research should investigate these alternative factors to provide a more comprehensive understanding of the mechanisms underlying state transitions in CNSP patients.

This study excluded CNSP patients who were unable to tolerate prolonged MRI scanning due to pain, which may introduce selection bias by excluding those with more severe pain. Additionally, the study primarily focused on baseline data from patients, and future research should incorporate longitudinal measurements to better understand how symptom relief impacts brain function in these individuals. Investigating the recovery or potential reconstruction of dynamic brain characteristics in patients would be an important area for further exploration. Moreover, it remains to be determined whether these dynamic brain features influence treatment outcomes, and whether individual brain dynamics can be measured to predict treatment efficacy, enabling precision pain management.

Conclusion

This study represents the first attempt to identify specific patterns of state transitions across states in CNSP patients from the perspective of HMM states and transitions. In contrast to traditional dynamic FC approaches that rely on sliding window methods, our approach considers the unique state transition patterns of each individual participant. This offers a novel neuroimaging perspective for personalizing interventions based on the individualized dynamic characteristics of CNSP patients. However, further research is needed to determine whether the number and nature of the internal states identified in this study can be generalized to other CNSP patient cohorts.