Skip to main content

Resting-state magnetoencephalographic oscillatory connectivity to identify patients with chronic migraine using machine learning


To identify and validate the neural signatures of resting-state oscillatory connectivity for chronic migraine (CM), we used machine learning techniques to classify patients with CM from healthy controls (HC) and patients with other pain disorders. The cross-sectional study obtained resting-state magnetoencephalographic data from 240 participants (70 HC, 100 CM, 35 episodic migraine [EM], and 35 fibromyalgia [FM]). Source-based oscillatory connectivity of relevant cortical regions was calculated to determine intrinsic connectivity at 1–40 Hz. A classification model that employed a support vector machine was developed using the magnetoencephalographic data to assess the reliability and generalizability of CM identification. In the findings, the discriminative features that differentiate CM from HC were principally observed from the functional interactions between salience, sensorimotor, and part of the default mode networks. The classification model with these features exhibited excellent performance in distinguishing patients with CM from HC (accuracy ≥ 86.8%, area under the curve (AUC) ≥ 0.9) and from those with EM (accuracy: 94.5%, AUC: 0.96). The model also achieved high performance (accuracy: 89.1%, AUC: 0.91) in classifying CM from other pain disorders (FM in this study). These resting-state magnetoencephalographic electrophysiological features yield oscillatory connectivity to identify patients with CM from those with a different type of migraine and pain disorder, with adequate reliability and generalizability.

Peer Review reports


Migraine, a highly prevalent neurological disorder, is a disabling disease that affects more than one billion people worldwide, with a global age-standardised prevalence of 14.4%, according to the World Health Organization’s Global Burden of Disease study [1]. Patients with migraine experience substantial functional disability, especially when the migraine evolves from episodic migraine (EM) to chronic migraine (CM; ≥ 15 headache days per month for > 3 months) [2], which also imposes a considerable economic burden [3]. Migraine is a complex brain network disorder with a strong genetic basis in which interactions of multiple neuronal systems cause the wide variety of symptoms, including pain, that characterise a migraine attack. Neuroimaging studies have revealed widespread structural and functional abnormalities in the brain areas involved in multisensory, affective, and cognitive processing [4,5,6,7,8,9]. Whether these neuroimaging results represent a potential migraine signature that can be used to discriminate patients with migraine from those without migraine or with other pain disorders remains debatable.

Although many neuroimaging studies have focused on identifying brain signatures for migraine, neurologists still rely on traditional diagnostic tools to diagnose patients with CM. This may be because neuroimaging studies have typically reported the differences between groups, whereas doctors in clinical settings must make clinical decisions at the individual level [10]. To utilise the strengths of neuroimaging for individualised diagnosis of migraine, the supervised machine learning (ML) approach may be a promising method, in which algorithms and techniques are developed to automatically detect patterns in data, which are then used to predict or classify future data. This approach may thus allow a high level of individual characterisation suitable for routine clinical use.

In this study, we used magnetoencephalography (MEG) to directly record neural activity in a wide frequency range and analyse resting-state oscillatory connectivity within cortical networks that are promising for the investigation of ongoing processing in chronic pain [11] and consequently can help diagnose migraine. Compared with conventional scalp electroencephalography, MEG is superior in the localisation and measurement of cortical activities [12]. Notably, although many migraine researches using functional magnetic resonance imaging (fMRI) pointed to the brainstem and hypothalamus as involved in generation and maintenance of migraine attacks [13, 14], we focused on the multisensory higher cortical networks for their engagement of subsequent pain processing. MEG recording, which has excellent temporal resolution and is especially sensitive to neural signals tangential to the scalp, well detects the dynamics of multisensory higher cortical interactions. In contrast, due to the limited temporal resolution, fMRI cannot provide the cortical dynamics in the > 0.1 Hz frequency range. To identify the electrophysiological features for CM diagnosis, we used a classification model to differentiate patients with CM from healthy controls (HC), validated this model with a new testing data set (CM vs. HC), and assessed its performance on another testing data set (CM vs. EM and CM vs. fibromyalgia [FM]) to evaluate generalizability.

Materials and methods


All participants were 20–60 years old, right-handed, had no history of systemic or major neurological diseases, had normal results on physical and neurological examinations, and were enrolled from the headache clinic of Taipei Veterans General Hospital. Patients with EM and CM were diagnosed according to the International Classification of Headache Disorders, Third Edition [2], and they were naïve to preventive treatment of migraine. CM was characterized with headache occurring on 15 or more days/month for more than 3 months, which, on at least 8 days/month, has the features of migraine headache. We excluded patients with headache medication overuse and those taking migraine prophylactic drugs, hormones, or other medications on a regular (daily) basis. FM was diagnosed according to the modified 2010 American College of Rheumatology criteria [15]. For the FM group, patients who had a CM, tension-type headache or autoimmune rheumatic disease or who took hormones or other medications on a daily basis were excluded. None of the HC participants had personal or family histories of pain disorders or had experienced any significant pain condition over the previous year. The hospital’s Institutional Review Board approved the study protocol (VGHTPE: IRB 2015–10-001BC), and all participants provided written informed consent before study commencement.

Study design

All participants completed semistructured questionnaires on demographic information and psychometric scales, including the Hospital Anxiety and Depression Scale (HADS) [16]. For patients with migraine, the headache profile was recorded, including the headache days per month, duration (months) of headache attack, and average headache intensity over the preceding year. Moreover, the Migraine Disability Assessment (MIDAS) questionnaire was administered to evaluate migraine-related disability [17]. All patients maintained a headache diary after recruitment, in which they recorded the following data: date/time of headache attacks, pain intensity, associated symptoms, medication used (if any), and menstrual periods. For patients with FM, the FM profile was collected, including the distribution (widespread pain index) accompanying somatic or psychiatric symptoms (symptom severity scale) [15], and the days of painkiller use per month. In addition, the Fibromyalgia Impact Questionnaire-revised was administered to assess functional disability associated with FM.

Each participant underwent MEG recording. For patients with migraine, the recording was conducted during the interictal period, arbitrarily defined as the absence of an acute migraine attack in the 2 days before and after the MEG recording. The presence of a background or interval headache during this period was allowed for patients with CM [6]. The MEG recording was rescheduled in case of an acute attack during this period or the use of analgesics, triptans, or ergots for any reason in the 48 h before the recording. The temporal relationship between MEG recordings and attacks was determined from the headache diary or through follow-up phone calls.

MEG recording

Brain activity was recorded using a whole-scalp 306-channel MEG system (Vectorview; Elekta Neuromag, Helsinki, Finland). Four coils representing the head position were placed on the participant’s scalp, positioned in the head coordinate frame with respect to the nasion and two preauricular points by using Cartesian coordinates, and measured with a three-dimensional (3D) digitiser. Approximately 100 additional scalp points were also digitised to obtain an accurate registration. These landmarks enabled further alignment of the MEG and magnetic resonance imaging (MRI) coordinate systems. Individual brain T1 images were acquired using a 3-T MRI system (Discovery 750; GE Medical Systems, WI, USA) with the following parameters: repetition time: 9.4 ms, echo time: 4 ms, recording matrix: 256 × 256 pixels, field of view: 256 mm, and slice thickness: 1 mm.

During the 5-min resting-state MEG recordings with a digitisation rate of 600 Hz, the participants were instructed to close their eyes but remain awake, relax, and perform no explicit task. If a participant fell asleep or had excessive within-run head movement, the recording was stopped and then rerun. Electrooculography (EOG) and electrocardiography (ECG) activities were also acquired simultaneously for offline artefact elimination. A 3-min empty-room recording to capture sensor and environmental noise was applied to calculate the noise covariance for the offline source analysis.

MEG data preprocessing and analysis

To eliminate the contamination of nonbrain or environmental artefacts from spontaneous resting-state MEG data (Fig. 1), (i) segments containing artefacts from environmental noise were discarded, (ii) notch filters (60 Hz and its harmonics) were used to remove powerline contaminations, and (iii) identified heartbeat and eye blinking events from ECG and EOG data were used to separately define the projectors through principal component analysis [18]. Regarding the T1-weighted brain images, for establishing the cortical model used in source analysis, MR images were automatically reconstructed into a surface model by using BrainVISA (4.5.0, The anatomical MR images and reconstructed cortical surface were subsequently coregistered with the corresponding MEG data set.

Fig. 1
figure 1

Pipeline of the resting-state MEG and machine learning analysis. CM, chronic migraine; HC, healthy controls; EM, episodic migraine; FM, fibromyalgia

To obtain source-based cortical activation, a distributed source model of the MEG data was established using Brainstorm [19]. The overlapping sphere method [20] and inverse operator were calculated using a depth-weighted minimum norm estimate (MNE) analysis. The source model presents each grid point of the cortical source as a current dipole. The cortical activation dynamics of each participant were finally morphed into a common source space for group analysis. The MNE parameters were described in our previous studies [5, 8, 21]. In the present study, we defined regions of interest (ROIs) in the structural T1 template volume by using Mindboggle cortical parcellation [22], and we selected 26 cortical regions, including the default mode, sensorimotor, visual, salience, and pain networks (details in supplementary Fig. 1).

The oscillatory functional connectivity (FC) between ROIs was calculated from activation dynamics by using the imaginary coherence method at 1–40 Hz with a frequency resolution of 0.586 Hz [6], which essentially measures how the phases between two cortical sources are coupled to each other with minimal crosstalk effects between the sources [23]. The frequency bands of FC were classified as delta (1–4 Hz), theta (5–7 Hz), alpha (8–13 Hz), beta (14–25 Hz), and gamma (26–40 Hz).

ML analysis

Feature selection

Altered oscillatory FC values were associated with the chronification of migraine [6]; thus, utilising these features to establish the predictive migraine model is desirable to obtain high classification accuracy. Feature selection is the process of selecting a subset from the original set of extracted features to increase classification performance with a compact feature subset, which might reduce computational complexity and diminish irrelevant features. Therefore, we applied univariate analyses (independent t test) for the factors of the group with the false detection of discovery (FDR) corrections to obtain the most discriminative features, which were also used to construct training and testing data sets (Fig. 1).

Classification models and statistical analysis

This study used support vector machine (SVM) algorithms to establish the classification model. SVM algorithms maps input feature vectors into a high-dimensional space to create a linear classification system. By implementing the algorithm with training data, SVM can determine an optimal hyperplane that minimises risks and produces a classification model. The supervised learning approach to train the SVM classifiers decoded two conditions in a pairwise manner (CM vs. HC). The kernel functions and parameters for all classification analyses are listed in Table 1. To avoid overfitting, we trained the models based on a fivefold leave-one-out cross-validation technique. All ML analyses were performed using the ML toolbox from MATLAB software (R2019a).

Table 1 Models and parameters of machine classification

The performance of each classification model was evaluated based on accuracy, sensitivity, specificity, and the area under the curve (AUC). After the reconstruction and evaluation of the classification models using the training data set, these models were further validated to determine whether identified features are generalisable across various testing data sets, including new testing data sets (CM vs. HC) and other data sets (CM vs. EM; CM vs. FM) (Fig. 1). These data sets were extracted based on the discriminative feature index. The testing data set labels were blinded, and the classification models were applied to the discriminative features without any model training procedure. Predictive accuracy and AUC were obtained for each model. Additionally, to estimate the statistical significance of predictive accuracy, the statistical significance of the observed classification accuracy was estimated using nonparametric permutation tests (10,000 times). The number of permutations in this null distribution that achieved a higher accuracy than the true labels was divided by the total number of permutations. This provided an estimate of the significance of the accuracy relative to chance.


Discriminative features of oscillatory connectivity and the classification model for CM

This study included 240 participants—70 HCs, 100 patients with CM, 35 patients with EM, and 35 patients with FM; of them, the data of 56 HCs and 80 patients with CM were included in the training data set, and those of 14 HCs, 20 patients with CMs, 35 patients with EM, and 35 patients with FM were included in the testing data sets. The clinicodemographic characteristics of all participants are summarised in Table 2. In the training data set (HC [n = 56] vs. CM [n = 80]), the two groups did not differ significantly in terms of age or sex. Anxiety (HADS_A) and depression (HADS_D) scores were higher in the CM group than in the HC group (all p < 0.005). In the testing data sets, the groups did not differ significantly in age or sex, except for significantly more women in the FM group than in the CM group (p = 0.02). Similar to the training data set, anxiety and depression scores were higher in the CM group than in the HC group (all p < 0.005). As expected, patients with CM had more monthly headache days (p < 0.001) than those with EM; however, disease duration and severity in the preceding year were comparable between the two groups. MIDAS scores were higher in patients with CM than in those with EM (p < 0.05). Notably, the psychometric scores were comparable between the CM, EM, and FM groups.

Table 2 Demographics and clinical profiles

For feature selection, in the training data set, we obtained 1820 FCs; univariate analysis with FDR corrections revealed that the resting-state oscillatory FCs were significantly different between HC and CM groups. Specifically, patients with CM had decreased oscillatory FCs. These discriminative FCs are illustrated with adjacency matrices from delta to gamma bands (Fig. 2 (a)), and the connections are topographically displayed onto the cortical surfaces with axial and coronal views (Fig. 2 (b) and (c)). The differences were dominantly noted in the beta (19.1% of all significant connections) and gamma (77.4% of all significant connections) bands and primarily located within the following networks: salience (in the insula [7.5%] and anterior cingulate cortex [9.1%]), sensorimotor (in the primary motor cortex [6.6%] and primary [7.3%] and secondary somatosensory cortex [7.1%]), and part of the default mode (in the posterior cingulate cortex [8.1%]) networks. With these discriminative features, classifiers for differentiating CM from HC achieved > 80% accuracy using Linear (accuracy: 83.1%, AUC: 0.9, sensitivity: 0.97, specificity: 0.62), Quadratic (accuracy: 80.1%, AUC: 0.85, sensitivity: 0.96, specificity: 0.57), and Fine Gaussian (accuracy: 86.8%, AUC: 0.9, sensitivity: 1.0, specificity: 0.68) SVMs (Fig. 3).

Fig. 2
figure 2

Characteristic features of oscillatory connectivity for differentiating chronic migraine from healthy controls. L, left; R, right

Fig. 3
figure 3

Accuracy and area under the curve (AUC) of machine learning analysis with six kernels for classifying chronic migraine (CM) from healthy controls (HCs) in the training data set. SVM, support vector machine

Generalizability of the classification model for CM

We further examined the generalizability of the classification model with the three SVMs by using an independent data set of 20 patients with CM and 14 HCs. The model exhibited good performance using Linear (accuracy: 94.1%, AUC: 0.94, sensitivity: 0.95, specificity: 0.93, p < 0.0001), Quadratic (accuracy: 82.3%, AUC: 0.79, sensitivity: 0.95, specificity: 0.64, p = 0.0004), and Fine Gaussian (accuracy: 94.1%, AUC: 0.93, sensitivity: 1.0, specificity: 0.86, p < 0.0001) SVMs (Fig. 4). The model performance in classifying different headache subtypes was assessed using a data set of 20 patients with CM and 35 patients with EM. The Fine Gaussian SVM achieved high performance (accuracy: 94.5%, AUC: 0.96, sensitivity: 1.0, specificity: 0.91, p < 0.0001) (Fig. 5). Finally, the model performance in identifying CM compared with other chronic pain disorders was assessed using a data set of 20 patients with CM and 35 patients with FM. The Fine Gaussian SVM (Fig. 6) achieved favourable results (accuracy: 89.1%, AUC: 0.91, sensitivity: 1.0, specificity: 0.83, p < 0.0001). In summary, these findings indicated that our model had good generalizability for identifying patients with CM in an independent data set.

Fig. 4
figure 4

a Confusion matrix, (b) area under the curve (AUC), and overall prediction accuracy (permutation test) of machine learning analysis with three kernels for classifying chronic migraine (CM) from healthy controls (HC) in the independent testing data set. SVM, support vector machine

Fig. 5
figure 5

a Confusion matrix, (b) area under the curve (AUC), and overall prediction accuracy (permutation test) of machine learning analysis with three kernels for classifying chronic migraine (CM) from episodic migraine (EM) in the independent testing data set. SVM, support vector machine

Fig. 6
figure 6

a Confusion matrix, (b) area under the curve (AUC), and overall prediction accuracy (permutation test) of machine learning analysis with three kernels for classifying the chronic migraine (CM) from fibromyalgia (FM) in the independent testing data set. SVM, support vector machine


In this study, by utilising resting-state MEG recording data to develop SVM models, we discovered the FCs of spontaneous neuromagnetic activities that could identify patients with CM. The discriminative features were principally deciphered from the functional interactions among salience, sensorimotor, and part of the default mode networks. The classification model with these features exhibited excellent performance in differentiating patients with CM from HC (training data set: accuracy = 86.8%, AUC = 0.9; testing data set: accuracy = 94.1%, AUC = 0.93). Moreover, this model also performed well in distinguishing patients with CM from those with EM (accuracy: 94.5%, AUC: 0.96) as well as from those with FM (accuracy: 89.1%, AUC: 0.91). These findings imply that resting-state MEG signatures can be specific and reliable for identifying patients with CM.

Characteristic features of oscillatory connectivity in CM

Altered oscillatory connectivity was dominantly noted in the beta and gamma bands among salience, sensorimotor, and default mode networks; this indicated that patients with CM had altered oscillatory synchrony, impairing flexible routing of information across brain areas [24, 25]. Consistent with previous MEG [6] and EEG findings [26, 27], our data revealed decreased FC at distinct frequency bands in patients with migraine. This corresponds to the notion that pain is associated with complex temporal–spectral–spatial synchrony patterns of brain activity [11], which are abnormal in patients with chronic pain [6, 28,29,30]. Although the findings implied no substantial relationship of the specific brain oscillation with pain processing [31], pain occurring with the integration of nociceptive and contextual information is mediated by feedforward and feedback processes in the brain [32], which are, respectively, engaged in gamma and alpha/beta oscillations [11]. Correspondingly, aberrant cortical processing for CM was mainly identified with beta and gamma oscillations in this study. Beta activities in animal models of chronic pain changed over the primary somatosensory and frontal cortex [30, 33, 34]. Gamma oscillation before stimulus onset was correlated with pain perception [35], and abnormal gamma oscillation has been associated with neurological and psychiatric symptoms, including ongoing pain, resulting from thalamocortical dysrhythmia [36, 37]. Taken together, the oscillatory connectivity selected from this study by using a statistical approach adequately represents the cortical-level neuropathological characteristics in patients with CM.

The main hubs in the cortical areas exhibiting the alterations for CM included the insula, anterior cingulate cortex (ACC), primary motor, primary somatosensory, secondary somatosensory, and posterior cingulate cortex areas, which are located in the salience, sensorimotor, and default mode networks. In accordance with previous neurophysiological findings [6, 26, 27], decreased FC within the frontal–central, central–parietal, temporal-parietal, or pain-related networks was noted in patients with migraine. Intriguingly, these cortical areas have shown their crucial roles in sensory-discriminative and affective-motivational pain, associated with headache severity. Activities in the sensorimotor cortex were associated with pain intensity [38]. FC in ACC was related to migraine chronification [6]. The subjective perception of pain intensity was related to bilateral insula activation [39, 40]. Moreover, the posterior cingulate cortex is engaged in both pain sensitivity and integration of inputs from different sensory modalities (multisensory integration), which is declined in patients with migraine [41]. Theta connectivity between the insula and default mode network exhibited associations with FM severity [42]. Altered activities in the salience, sensorimotor, and default mode networks have also been noted in patients with chronic pain [28, 29, 43]. Notably, gamma oscillation was elicited to encode afferent sensory information over the sensory cortex; however, after long-lasting pain, it appeared over brain areas encoding emotional–motivational processing and dominated the processing and perception of pain [11, 44]. This implies that the pain process not only is spatially distributed over the brain network but also dynamically recruits brain areas for the adaptive integration of nociceptive, cognitive, and affective processing, which are apparently aberrant in patients with chronic pain. Therefore, the characteristic features of FC among the cortical networks that were observed in this study might serve as pivotal signatures to identify CM.

In this resting-state MEG study, the participants were instructed to close their eyes but remain awake, relax, and perform no explicit task. Thus, the recorded MEG signals were spontaneous cortical activities and originated from the intrinsic brain networks, which were distinct from the evoked activities from pain-related emotional stimuli [45]. Besides, Hepschke and colleagues suggested that rhythmical brain activity in the primary visual cortex is both hyperexcitable and disorganized in visual snow syndrome [46]. Notably, in our study, no migraine patient was diagnosed with visual snow syndrome; nevertheless, in our previous and present studies, patients with CM was characterized with hyperexcitability or disinhibition in visual and somatosensory cortices [5, 8, 47,48,49] and aberrant functional connectivity in pain-related areas [6]. Common altered pathophysiological mechanisms might exist between patients with and without visual snow syndrome, but the dominant involved cortical areas should differ from both.

Identifying patients with CM using ML

The classification model of the present study exhibited favourable performance in differentiating patients with CM from HC, EM, and FM (all accuracy > 86% and AUC > 0.9), indicating the generalizability of this model on the prediction of patients with CM from the populations of migraine (CM vs. EM) and from chronic pain disorders (CM vs. FM). By using advanced neuroimaging approaches, studies have reported that the brain networks during the stimulus-evoked or resting-state conditions were altered in patients with migraine; however, whether these functional or structural features can help achieve migraine classification using ML algorithms has been somewhat unclear. The CM classification model developed by Schwedt and colleagues [50] by using brain structural imaging data achieved accuracies of 86.3% (CM [n = 15] vs. HC [n = 54]) and 84.2% (CM [n = 15] vs. EM [n = 51]). Resting-state FC data obtained from functional MRI achieved 86.1% accuracy in discriminating the brain of patients with migraine [n = 58] from that of HC [n = 50] [51]. The combination of functional and structural MRI data achieved 83.67% accuracy in discriminating the patients with migraine (n = 21) from HC (n = 28) [52]. These three studies also exhibited the prominent role of the pain-related areas, especially the insula and cingulate cortex, in the identification of patients with migraine. However, the parameters of somatosensory-evoked high-frequency oscillations achieved somewhat higher accuracies of 89.7% (HC [n = 15] vs. ictal migraine [n = 13]) and 88.7% (HC [n = 15] vs. interictal migraine [n = 29]) in identifying patients with migraine [53]. Nevertheless, these studies have limited reliability and generalizability because of small sample sizes, lack of independent data to validate the findings, and lack of evaluation of whether these discriminative features specifically characterised the migraine. Our study overcame these shortcomings by recruiting 240 participants and dividing them into subgroups of training or independent testing data sets; moreover, the factors of different migraine spectrum and other chronic pain disorders were considered.

One promising study by Tu and colleagues [54] identified, cross-validated, independently validated, and cross-sectionally validated the fMRI-based neural marker and claimed that the functional connections within the visual, default mode, sensorimotor, and frontoparietal networks had 84.2%–91.4% accuracy in identifying patients with EM from HC and 73.1% accuracy in identifying patients with EM from those with other chronic pain disorders (FM and chronic low back pain). In addition to the fundamental difference between fMRI and MEG techniques, oscillatory connectivity analysis in this study (MEG with frequency bands of 1–40 Hz neural activities compared with fMRI confined within < 0.01 Hz blood oxygen level–dependent activities) might contribute to improved accuracies of migraine classification. Rocca et al. [55] claimed that classification performance using fMRI data might be influenced by the factors of scanners and acquisition protocols. MEG-based electrophysiological features obtained from direct neural recordings with fine spatial resolution and excellent temporal resolution, which assess the oscillatory connectivity between relevant cortical areas, might eventually help diagnose patients with CM. Moreover, the frequency- and region-specific MEG signatures used in this model might represent the targeting candidates of migraine neuromodulation using transcranial magnetic and direct current stimulation.


Our study had several limitations. First, all participants were naïve to any migraine preventive medication, precluding the determination of whether our model can be generalised to patients taking such treatments. Second, the presence of background or interval headache, but not ictal attack, was allowed for patients with CM. Although our study noted the dynamic brain excitability within the migraine cycle in patients with EM [56], the longitudinal day-to-day dynamics of FC between brain networks in patients with CM remain unresolved, which leads to an unsettled question of how the classification model performs for the factor of headache status. Third, we demonstrated the reliability and generalizability of using MEG-based electrophysiological features. However, whether the aforementioned brain signatures are shared with primary headaches or chronic pain disorders other than CM, EM, and FM remains unknown. Finally, MEG is expensive and not easily accessible, thus limiting the clinical application of this classification model; therefore, translations between MEG and high-density EEG are warranted.


These resting-state MEG-based electrophysiological features yield oscillatory connectivity to differentiate patients with CM from those with a different type of migraine and chronic pain disorders with good reliability and generalizability. This classification model may help in an objective and individualised diagnosis of migraine. However, the present findings need further studies to examine their diagnostic value in real-world clinical settings and to justify their link to the CM pathophysiology.



Episodic migraine


Chronic migraine


Machine learning




Healthy controls




Hospital Anxiety and Depression Scale


Migraine Disability Assessment Scale




Magnetic resonance imaging






Minimum norm estimate


Regions of interest


Functional connectivity


False detection of discovery


Support vector machine


Area under the curve


Anterior cingulate cortex


  1. Stovner LJ, Nichols E, Steiner TJ, Abd-Allah F, Abdelalim A, Al-Raddadi RM, Ansha MG, Barac A, Bensenor IM, Doan LP (2018) Global, regional, and national burden of migraine and tension-type headache, 1990–2016: a systematic analysis for the Global Burden of Disease Study 2016. Lancet Neurol 17:954–976

    Article  Google Scholar 

  2. (2018) Headache Classification Committee of the International Headache Society (IHS) The International Classification of Headache Disorders, 3rd edition. Cephalalgia 38:1–211.

  3. Ashina M, Katsarava Z, Do TP, Buse DC, Pozo-Rosich P, Ozge A, Krymchantowski AV, Lebedeva ER, Ravishankar K, Yu S, Sacco S, Ashina S, Younis S, Steiner TJ, Lipton RB (2021) Migraine: epidemiology and systems of care. Lancet 397:1485–1495

    Article  PubMed  Google Scholar 

  4. Chen WT, Chou KH, Lee PL, Hsiao FJ, Niddam DM, Lai KL, Fuh JL, Lin CP, Wang SJ (2018) Comparison of gray matter volume between migraine and “strict-criteria” tension-type headache. J Headache Pain 19:4

    Article  PubMed  PubMed Central  Google Scholar 

  5. Chen WT, Hsiao FJ, Ko YC, Liu HY, Wang PN, Fuh JL, Lin YY, Wang SJ (2018) Comparison of somatosensory cortex excitability between migraine and “strict-criteria” tension-type headache: a magnetoencephalographic study. Pain 159:793–803

    Article  PubMed  Google Scholar 

  6. Hsiao FJ, Chen WT, Liu HY, Wang YF, Chen SP, Lai KL, Hope Pan LL, Coppola G, Wang SJ (2021) Migraine chronification is associated with beta-band connectivity within the pain-related cortical regions: a magnetoencephalographic study. Pain 162:2590–2598

    PubMed  Google Scholar 

  7. Hsiao FJ, Chen WT, Wang YF, Chen SP, Lai KL, Liu HY, Pan LH, Wang SJ (2021) Somatosensory Gating Responses Are Associated with Prognosis in Patients with Migraine. Brain Sci 11(2):166

    Article  PubMed  PubMed Central  Google Scholar 

  8. Hsiao FJ, Wang SJ, Lin YY, Fuh JL, Ko YC, Wang PN, Chen WT (2018) Somatosensory gating is altered and associated with migraine chronification: A magnetoencephalographic study. Cephalalgia 38:744–753

    Article  PubMed  Google Scholar 

  9. Liu HY, Chou KH, Lee PL, Fuh JL, Niddam DM, Lai KL, Hsiao FJ, Lin YY, Chen WT, Wang SJ, Lin CP (2017) Hippocampus and amygdala volume in relation to migraine frequency and prognosis. Cephalalgia 37:1329–1336

    Article  PubMed  Google Scholar 

  10. Orru G, Pettersson-Yeo W, Marquand AF, Sartori G, Mechelli A (2012) Using support vector machine to identify imaging biomarkers of neurological and psychiatric disease: a critical review. Neurosci Biobehav Rev 36:1140–1152

    Article  PubMed  Google Scholar 

  11. Ploner M, Sorg C, Gross J (2017) Brain Rhythms of Pain. Trends Cogn Sci 21:100–110

    Article  PubMed  PubMed Central  Google Scholar 

  12. Hamalainen MS, Ilmoniemi RJ (1994) Interpreting magnetic fields of the brain: minimum norm estimates. Med Biol Eng Comput 32:35–42

    Article  CAS  PubMed  Google Scholar 

  13. Schulte LH, May A (2016) The migraine generator revisited: continuous scanning of the migraine cycle over 30 days and three spontaneous attacks. Brain 139:1987–1993

    Article  PubMed  Google Scholar 

  14. Schulte LH, Menz MM, Haaker J, May A (2020) The migraineur’s brain networks: Continuous resting state fMRI over 30 days. Cephalalgia 40:1614–1621

    Article  PubMed  Google Scholar 

  15. Wolfe F, Clauw DJ, Fitzcharles MA, Goldenberg DL, Hauser W, Katz RS, Mease P, Russell AS, Russell IJ, Winfield JB (2011) Fibromyalgia criteria and severity scales for clinical and epidemiological studies: a modification of the ACR Preliminary Diagnostic Criteria for Fibromyalgia. J Rheumatol 38:1113–1122

    Article  PubMed  Google Scholar 

  16. Zigmond AS, Snaith RP (1983) The hospital anxiety and depression scale. Acta Psychiatr Scand 67:361–370

    Article  CAS  PubMed  Google Scholar 

  17. Hung PH, Fuh JL, Wang SJ (2006) Validity, reliability and application of the Taiwan version of the migraine disability assessment questionnaire. J Formos Med Assoc 105:563–568

    Article  PubMed  Google Scholar 

  18. Florin E, Baillet S (2015) The brain’s resting-state activity is shaped by synchronized cross-frequency coupling of neural oscillations. Neuroimage 111:26–35

    Article  PubMed  Google Scholar 

  19. Tadel F, Baillet S, Mosher JC, Pantazis D, Leahy RM (2011) Brainstorm: a user-friendly application for MEG/EEG analysis. Comput Intell Neurosci 2011:879716

    Article  PubMed  PubMed Central  Google Scholar 

  20. Huang MX, Mosher JC, Leahy RM (1999) A sensor-weighted overlapping-sphere head model and exhaustive head model comparison for MEG. Phys Med Biol 44:423–440

    Article  CAS  PubMed  Google Scholar 

  21. Hsiao FJ, Yu HY, Chen WT, Kwan SY, Chen C, Yen DJ, Yiu CH, Shih YH, Lin YY (2015) Increased Intrinsic Connectivity of the Default Mode Network in Temporal Lobe Epilepsy: Evidence from Resting-State MEG Recordings. PLoS ONE 10:e0128787

    Article  PubMed  PubMed Central  Google Scholar 

  22. Klein A, Tourville J (2012) 101 labeled brain images and a consistent human cortical labeling protocol. Front Neurosci 6:171

    Article  PubMed  PubMed Central  Google Scholar 

  23. Nolte G, Bai O, Wheaton L, Mari Z, Vorbach S, Hallett M (2004) Identifying true brain interaction from EEG data using the imaginary part of coherency. Clin Neurophysiol 115:2292–2307

    Article  PubMed  Google Scholar 

  24. Akam T, Kullmann DM (2014) Oscillatory multiplexing of population codes for selective communication in the mammalian brain. Nat Rev Neurosci 15:111–122

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  25. Schnitzler A, Gross J (2005) Normal and pathological oscillatory communication in the brain. Nat Rev Neurosci 6:285–296

    Article  CAS  PubMed  Google Scholar 

  26. Cao Z, Lin CT, Chuang CH, Lai KL, Yang AC, Fuh JL, Wang SJ (2016) Resting-state EEG power and coherence vary between migraine phases. J Headache Pain 17:102

    Article  PubMed  PubMed Central  Google Scholar 

  27. de Tommaso M, Trotta G, Vecchio E, Ricci K, Siugzdaite R, Stramaglia S (2017) Brain networking analysis in migraine with and without aura. J Headache Pain 18:98

    Article  PubMed  PubMed Central  Google Scholar 

  28. Baliki MN, Baria AT, Apkarian AV (2011) The cortical rhythms of chronic back pain. J Neurosci 31:13981–13990

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  29. Malinen S, Vartiainen N, Hlushchuk Y, Koskinen M, Ramkumar P, Forss N, Kalso E, Hari R (2010) Aberrant temporal and spatial brain activity during rest in patients with chronic pain. Proc Natl Acad Sci U S A 107:6493–6497

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  30. Stern J, Jeanmonod D, Sarnthein J (2006) Persistent EEG overactivation in the cortical pain matrix of neurogenic pain patients. Neuroimage 31:721–731

    Article  PubMed  Google Scholar 

  31. Legrain V, Iannetti GD, Plaghki L, Mouraux A (2011) The pain matrix reloaded: a salience detection system for the body. Prog Neurobiol 93:111–124

    Article  PubMed  Google Scholar 

  32. Wiech K (2016) Deconstructing the sensation of pain: The influence of cognitive processes on pain perception. Science 354:584–587

    Article  CAS  PubMed  Google Scholar 

  33. LeBlanc BW, Bowary PM, Chao YC, Lii TR, Saab CY (2016) Electroencephalographic signatures of pain and analgesia in rats. Pain 157:2330–2340

    Article  PubMed  Google Scholar 

  34. LeBlanc BW, Lii TR, Silverman AE, Alleyne RT, Saab CY (2014) Cortical theta is increased while thalamocortical coherence is decreased in rat models of acute and chronic pain. Pain 155:773–782

    Article  PubMed  Google Scholar 

  35. Tu Y, Zhang Z, Tan A, Peng W, Hung YS, Moayedi M, Iannetti GD, Hu L (2016) Alpha and gamma oscillation amplitudes synergistically predict the perception of forthcoming nociceptive stimuli. Hum Brain Mapp 37:501–514

    Article  PubMed  Google Scholar 

  36. Llinas R, Urbano FJ, Leznik E, Ramirez RR, van Marle HJ (2005) Rhythmic and dysrhythmic thalamocortical dynamics: GABA systems and the edge effect. Trends Neurosci 28:325–333

    Article  CAS  PubMed  Google Scholar 

  37. Llinas RR, Ribary U, Jeanmonod D, Kronberg E, Mitra PP (1999) Thalamocortical dysrhythmia: A neurological and neuropsychiatric syndrome characterized by magnetoencephalography. Proc Natl Acad Sci U S A 96:15222–15227

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  38. Gross J, Schnitzler A, Timmermann L, Ploner M (2007) Gamma oscillations in human primary somatosensory cortex reflect pain perception. PLoS Biol 5:e133

    Article  PubMed  PubMed Central  Google Scholar 

  39. Hsiao FJ, Chen WT, Liu HY, Wang YF, Chen SP, Lai KL, Pan LH, Wang SJ (2020) Individual pain sensitivity is associated with resting-state cortical activities in healthy individuals but not in patients with migraine: a magnetoencephalography study. J Headache Pain 21:133

    Article  PubMed  PubMed Central  Google Scholar 

  40. Mathur VA, Moayedi M, Keaser ML, Khan SA, Hubbard CS, Goyal M, Seminowicz DA (2016) High Frequency Migraine Is Associated with Lower Acute Pain Sensitivity and Abnormal Insula Activity Related to Migraine Pain Intensity, Attack Frequency, and Pain Catastrophizing. Front Hum Neurosci 10:489

    Article  PubMed  PubMed Central  Google Scholar 

  41. Zhang J, Su J, Wang M, Zhao Y, Yao Q, Zhang Q, Lu H, Zhang H, Wang S, Li GF, Wu YL, Liu FD, Shi YH, Li J, Liu JR, Du X (2016) Increased default mode network connectivity and increased regional homogeneity in migraineurs without aura. J Headache Pain 17:98

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  42. Hsiao FJ, Wang SJ, Lin YY, Fuh JL, Ko YC, Wang PN, Chen WT (2017) Altered insula-default mode network connectivity in fibromyalgia: a resting-state magnetoencephalographic study. J Headache Pain 18:89

    Article  PubMed  PubMed Central  Google Scholar 

  43. Alshelh Z, Di Pietro F, Youssef AM, Reeves JM, Macey PM, Vickers ER, Peck CC, Murray GM, Henderson LA (2016) Chronic Neuropathic Pain: It’s about the Rhythm. J Neurosci 36:1008–1018

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  44. Schulz E, May ES, Postorino M, Tiemann L, Nickel MM, Witkovsky V, Schmidt P, Gross J, Ploner M (2015) Prefrontal Gamma Oscillations Encode Tonic Pain in Humans. Cereb Cortex 25:4407–4414

    Article  PubMed  PubMed Central  Google Scholar 

  45. Ren J, Yao Q, Tian M, Li F, Chen Y, Chen Q, Xiang J, Shi J (2022) Altered effective connectivity in migraine patients during emotional stimuli: a multi-frequency magnetoencephalography study. J Headache Pain 23:6

    Article  PubMed  PubMed Central  Google Scholar 

  46. Hepschke JL, Seymour RA, He W, Etchell A, Sowman PF, Fraser CL (2022) Cortical oscillatory dysrhythmias in visual snow syndrome: a magnetoencephalography study. Brain Commun 4:fcab296

    Article  PubMed  Google Scholar 

  47. Chen WT, Wang SJ, Fuh JL, Lin CP, Ko YC, Lin YY (2009) Peri-ictal normalization of visual cortex excitability in migraine: an MEG study. Cephalalgia 29:1202–1211

    Article  PubMed  Google Scholar 

  48. Pan LH, Chen WT, Wang YF, Chen SP, Lai KL, Liu HY, Hsiao FJ, Wang SJ (2022) Resting-state occipital alpha power is associated with treatment outcome in patients with chronic migraine. Pain 163:1324–1334

    Article  PubMed  Google Scholar 

  49. Pan LH, Hsiao FJ, Chen WT, Wang SJ (2022) Resting State Electrophysiological Cortical Activity: A Brain Signature Candidate for Patients with Migraine. Curr Pain Headache Rep 26:289–297

    Article  PubMed  Google Scholar 

  50. Schwedt TJ, Chong CD, Wu T, Gaw N, Fu Y, Li J (2015) Accurate Classification of Chronic Migraine via Brain Magnetic Resonance Imaging. Headache 55:762–777

    Article  PubMed  PubMed Central  Google Scholar 

  51. Chong CD, Gaw N, Fu Y, Li J, Wu T, Schwedt TJ (2017) Migraine classification using magnetic resonance imaging resting-state functional connectivity data. Cephalalgia 37:828–844

    Article  PubMed  Google Scholar 

  52. Zhang Q, Wu Q, Zhang J, He L, Huang J, Zhang J, Huang H, Gong Q (2016) Discriminative Analysis of Migraine without Aura: Using Functional and Structural MRI with a Multi-Feature Classification Approach. PLoS ONE 11:e0163875

    Article  PubMed  PubMed Central  Google Scholar 

  53. Zhu B, Coppola G, Shoaran M (2019) Migraine classification using somatosensory evoked potentials. Cephalalgia 39:1143–1155

    Article  PubMed  Google Scholar 

  54. Tu Y, Zeng F, Lan L, Li Z, Maleki N, Liu B, Chen J, Wang C, Park J, Lang C, Yujie G, Liu M, Fu Z, Zhang Z, Liang F, Kong J (2020) An fMRI-based neural marker for migraine without aura. Neurology 94:e741–e751

    Article  PubMed  PubMed Central  Google Scholar 

  55. Rocca MA, Harrer JU, Filippi M (2020) Are machine learning approaches the future to study patients with migraine? Neurology 94:291–292

    Article  PubMed  Google Scholar 

  56. Hsiao FJ, Chen WT, Pan LH, Liu HY, Wang YF, Chen SP, Lai KL, Coppola G, Wang SJ (2022) Dynamic brainstem and somatosensory cortical excitability during migraine cycles. J Headache Pain 23:21

    Article  CAS  PubMed  PubMed Central  Google Scholar 

Download references


We would like to thank the study participants for actively participating. This work was supported by the Brain Research Center, National Yang Ming Chiao Tung University, from the Featured Areas Research Center Program within the framework of the Higher Education Sprout Project by the Ministry of Education of Taiwan.


This study was founded by the Ministry of Science and Technology of Taiwan (MOST 109–2314-B-075 -050 -MY2 to WT Chen, 108–2321-B-010–014-MY2, 110–2321-B-010–005, and 111–2321-B-A49-004 to SJ Wang, and 108–2221-E-010–004 and 109–2221-E-003-MY2 to FJ Hsiao). The funders had no role in the study design, data collection and analysis, decision to publish, or manuscript preparation.

Author information

Authors and Affiliations



F.J. Hsiao, W.T. Chen, and S.J. Wang contributed to the study design. F.J. Hsiao, W.T. Chen, H.Y. Liu, Y.F. Wang, S.P. Chen, K.L. Lai, and S.J. Wang recruited patients and collected data. F.J. Hsiao, W.T. Chen, L.L.H. Pan, H.Y. Liu, Y.F. Wang, S.P. Chen, K.L. Lai, and S.J. Wang performed data analysis and interpretation. F.J. Hsiao, W.T. Chen, and S.J. Wang wrote the manuscript. W.T. Chen, G. Coppola, and S.J. Wang critically reviewed the article. All authors interpreted the data, reviewed the manuscript, and approved the final version.

Corresponding authors

Correspondence to Fu-Jung Hsiao or Wei-Ta Chen.

Ethics declarations

Competing interests

FJ Hsiao, WT Chen, LLH Pan, HY Liu, YF Wang, SP Chen, KL Lai, and G Coppola declare no potential conflicts of interest. SJ Wang reports grants and personal fees from Norvatis Taiwan, personal fees from Daiichi-Sankyo, grants and personal fees from Eli-Lilly, personal fees from AbbVie/Allergan, personal fees from Pfizer Taiwan, personal fees from Biogen, Taiwan, outside the submitted work.

Additional information

Publisher’s Note

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

Supplementary Information

Additional file 1: Supplementary Fig. 1.

Regions of interest used in the study. Abbr., abbreviation; P, posterior; A: anterior; L, left; R, right.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, 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 changes were made. 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 The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated in a credit line to the data.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Hsiao, FJ., Chen, WT., Pan, LL.H. et al. Resting-state magnetoencephalographic oscillatory connectivity to identify patients with chronic migraine using machine learning. J Headache Pain 23, 130 (2022).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: