Oscillatory edge connectivity in pain-related regions supports machine learning identification of migraine Authors: Fu-Jung Hsiao, Kuan-Lin Lai, Wei-Ta Chen, Yen-Feng Wang, Shih-Pin Chen, Gianluca Coppola, Shuu-Jiun Wang Published: 2026 ABSTRACT AbstractBackgroundObjective and interpretable brain signatures for migraine diagnosis and phenotyping remain limited. Edge-centric connectivity treats interregional connections as primary analytical units and captures higher-order, frequency-resolved coordination patterns that may not be detected by conventional node-based functional connectivity approaches. This study investigated whether resting-state magnetoencephalography–derived oscillatory edge-connectivity features within pain-related regions may provide mechanistic insights into migraine neuropathology and inform future research on complementary approaches to migraine diagnosis.MethodsThis study included 250 individuals, stratified into healthy controls (n = 72), patients with chronic migraine (CM; n = 98), and patients with episodic migraine (EM; n = 80). Resting-state 306-channel magnetoencephalography activity was source-analysed in predefined pain-related regions: the bilateral insula, primary somatosensory cortex, secondary somatosensory cortex, primary motor cortex, and anterior cingulate cortex (ACC). Dynamic connectivity was estimated using amplitude envelope correlation, with symmetric orthogonalisation to reduce leakage. Edge-centric functional connectivity was calculated from co-fluctuation time series across frequency bands. Seven classifiers were trained using fivefold nested cross-validation with independent testing (80/20 split). Model predictions were further interpreted using Shapley values to identify candidate neurophysiological signatures at the edge-and frequency-band levels.ResultsCompared with HCs, both migraine groups exhibited significantly higher anxiety and depression scores (all p < 0.001), whereas the CM group demonstrated greater headache frequency and migraine-related disability than did the EM group. Using oscillatory edge-connectivity features derived from resting-state magnetoencephalography, multiple machine-learning models successfully discriminated patients with migraine from healthy controls. In the validation and independent test datasets, six models, particularly support vector machine, k-nearest neighbour, and ensemble approaches, achieved the predefined performance criteria (accuracy and weighted F1-score ≥ 0.75). Receiver operating characteristic analysis demonstrated good discriminative performance, with area under the curve values ranging from 0.783 to 0.841 in the validation dataset and from 0.808 to 0.854 in the independent test dataset. Shapley analysis consistently revealed that elevated ACC-centred edges linking the somatosensory cortex, insula, and motor cortex to the ACC contributed most strongly to migraine classification, particularly within alpha-to-gamma frequency bands. Region-level contribution analyses further demonstrated that the ACC and primary somatosensory cortex together accounted for more than 60% of the total feature importance. By contrast, machine learning models failed to reliably distinguish CM from EM under the nested cross-validation framework, with no model meeting the predefined criteria, indicating substantial overlap between migraine phenotypes.ConclusionApplying interpretable machine learning classification to magnetoencephalography-derived oscillatory edge-centric connectivity yields frequency-specific, connection-level signatures that reveal aberrant coordination within pain-related regions. These MEG signatures may warrant future translational research toward complementary tools for migraine diagnosis.Clinical trial numberNot applicable.Supplementary InformationThe online version contains supplementary material available at 10.1186/s10194-026-02420-0.Keywords: Edge connectivity, Pain-related regions, Oscillatory activity, Resting state, Chronic migraine, Episodic migraine, Machine learning Introduction Migraine is a leading contributor to disability-adjusted life years in individuals aged 15–49 years [1]. Recurrent migraine attacks—often accompanied by nausea, vomiting, photophobia, and phonophobia—substantially compromise emotional well-being, social participation, daily functioning, and work productivity; increase absenteeism; and impose a major socioeconomic burden [2]. At present, migraine is diagnosed mainly using a symptom-based approach based on clinical history and the International Classification of Headache Disorders criteria, which depends on patient recall and clinician interpretation. Although attack diaries and disability scales are helpful, current diagnostic practice has several practical limitations. Headache diaries generally require at least one month of recording to establish headache frequency and support diagnostic classification, particularly when distinguishing migraine subtypes such as chronic and episodic migraine, thereby limiting real-time clinical decision-making. In addition, diagnosis often depends on patient retrospective reports of headache frequency and symptom patterns, which may be affected by imperfect memory, reporting variability, and differences in symptom awareness. In this context, the brain-derived features with artificial intelligence–assisted approaches may help identify candidate signatures that could eventually complement existing migraine diagnostic framework. Human pain meta-analysis have consistently highlighted key nodes, such as the insula, anterior cingulate cortex (ACC), primary somatosensory cortex (SI), and secondary somatosensory cortex (SII), and brainstem and thalamic structures as core components of pain processing [3]. Migraine has been repeatedly associated with abnormalities in pain-related circuitry, as reflected by region-specific activation [4–8] and interregional connectivity patterns [4, 5, 8–11]. However, several knowledge gaps remain to be bridged before objective, clinically useful tools can be developed for migraine diagnosis and phenotyping. First, group-level differences often do not translate into reliable individual-level classification. Second, clinically meaningful differences, such as those between chronic migraine (CM) and episodic migraine (EM), likely reflect network reorganisation [5, 10, 11] and dynamic instability [9], which may be underestimated by conventional summary metrics. Finally, the frequency-specific, higher-order coordination among connections within pain-related networks remains insufficiently characterised in migraine, particularly in relation to migraine chronification. If the coordination between connections linking these regions is altered, this would suggest that migraine pathology is expressed not simply as altered regional excitability or isolated pairwise coupling, but as disrupted coordination of sensory, salience, and pain-regulatory pathways. Therefore, investigating oscillatory edge-centric connectivity within pain-related regions may reveal complementary candidate markers of migraine pathophysiology and clinical phenotypes. Edge-centric connectivity treats connections (edges), rather than regions, as primary units of analysis and quantifies moment-to-moment co-fluctuations between pairs of brain regions [12]. This framework captures dynamic, frequency-resolved interactions that extend beyond conventional node-based functional connectivity (FC) by characterising not only pairwise coupling but also higher-order coordination among edges (i.e. how multiple connections co-vary as ensembles) [12]. Put differently, conventional FC asks how strongly two regions are connected, whereas edge-centric connectivity asks how connections interact with other connections. As such, edge-centric connectivity can test whether a disease alters the organisation of communication routes (i.e. whether edge ensembles become more bursty, fragmented, or rigid in a frequency-specific manner), even when the average connectivity strength appears to be preserved [13]. By focusing on time-resolved edge dynamics and edge–edge coordination, rather than only overall connectivity estimates or stimulus-locked responses, oscillatory edge-centric connectivity may reveal whether multiple connections are co-recruited into the pathological state that may not be fully captured by traditional FC or evoked-response analyses, particularly with conventional approaches. In this study, we hypothesized that central sensitization in migraine may involve enhanced higher-order coordination across pain-related communication pathways, reflecting a coordinated reconfiguration of neural systems involved in pain salience, interoception, and sensory gain control. Resting-state MEG-derived edge connectivity can reveal frequency-specific, connection-level abnormalities in the dynamic coordination of the migraine network, thereby providing insight into sensory dysregulation, salience-network dysfunction, chronification-related reorganization, and potential trait biomarkers of migraine pathology. Accordingly, we mapped resting-state oscillatory edge connectivity within pain-related regions using 306-channel magnetoencephalography (MEG) recordings. MEG is well suited for edge-based analysis because it resolves millisecond-scale co-fluctuations at the timescale of neural communication, supports frequency-specific network characterisation, and measures neural activity more directly and with less vascular and neurovascular confounding than does functional MRI. We further applied interpretable machine learning methods to identify neurophysiological signatures for migraine detection and phenotyping, and to investigate the underlying mechanisms from an of edge-edge coordination perspective. In addition, we assessed the generalisability and interpretability of different models to facilitate mechanistic insights into migraine neuropathology and guide future research on complementary diagnostic tools. Materials and methods Study cohort Right-handed adults aged 20–60 years with no history of systemic or major neurological disorders were recruited from Headache Clinic at Taipei Veterans General Hospital. All participants had normal findings on physical and neurological examinations. They were classified into a healthy control (HC) group and a migraine group. Migraine was diagnosed on the basis of the International Classification of Headache Disorders, Third Edition criteria [14]. None of the patients had received any prophylactic treatment for migraine or met the criteria for acute medication overuse. The HC group had no personal or familial history of pain-related disorders and no major pain conditions over the preceding year. Individuals using prophylactic agents, hormonal treatments, or other daily medications were excluded. Study design All participants completed semistructured demographic questionnaires. In addition, they underwent a psychometric assessment performed using the Hospital Anxiety and Depression Scale (HADS) [15]. For the migraine group, headache characteristics were recorded—for example, monthly headache frequency, disease duration (months), and migraine-related disability (assessed using the Migraine Disability Assessment scale) [16]. The patients maintained detailed headache diaries documenting attack timing, pain intensity, associated symptoms, medication use, and menstrual status. These diaries were exclusively used for clinical classification (e.g., CM vs. EM) and did not contribute variables to subsequent analyses. All participants underwent magnetoencephalographic recording. In the migraine group, recording was performed during the interictal period, defined as the period with no acute migraine attacks within 2 days before or after the session. Patients with CM could have background headache during this period [15]. Magnetoencephalography sessions were rescheduled if an acute attack occurred or if analgesics, triptans, or ergot derivatives had been used within 48 h before the recording session. The temporal relationship between magnetoencephalographic acquisition and headache episodes was verified through diary records or follow-up telephone interviews. Resting-state magnetoencephalographic recording Whole-brain neural activity was recorded using a 306-channel whole-head magnetoencephalographic system (VectorView; Elekta Neuromag, Helsinki, Finland) in a magnetically shielded room. Notably, the datasets have been previously analysed to characterise altered dynamic connectivity in migraine [9–11]. During resting-state magnetoencephalography, the participant remained awake with the eyes closed and relaxed. Data were sampled at 600 Hz. Head position was monitored using four head-position indicator coils referenced to anatomical landmarks (nasion and bilateral preauricular points). Coil locations and approximately 100 additional scalp points were digitised with a three-dimensional digitiser to improve magnetoencephalography–MRI co-registration. This approach enabled source reconstruction through integration with structural MRI. High-resolution T1-weighted images were acquired on a 3-T MRI scanner (Discovery 750; GE Medical Systems, Milwaukee, WI, USA) with the following parameters: repetition time = 9.4 ms, echo time = 4 ms, matrix size = 256 × 256, field of view = 256 mm, and slice thickness = 1 mm. During magnetoencephalographic acquisition, the participant was monitored through real-time video to detect drowsiness or sleep. Recording was paused and repeated if signs of reduced alertness (e.g., head nodding or reduced responsiveness) were observed. Head movement was continuously tracked using head-position indicator coils, and datasets with a displacement of > 5 mm from the initial position were excluded. For offline artefact correction, electrooculography and electrocardiography signals were simultaneously recorded. A 3-min empty-room recording was acquired to estimate the noise covariance matrix for source reconstruction. Magnetoencephalographic data preprocessing and analysis Several preprocessing steps were applied to minimise nonneural and environmental artefacts in resting-state magnetoencephalographic recordings (Fig. 1). Segments contaminated by environmental noise were excluded, and cardiac and ocular artefacts identified from electrocardiographic and electrooculographic recordings were removed using signal-space projection with principal component analysis [17]. Power-line interference at 60 Hz, including its harmonics, was attenuated using notch filtering. Direct-current offsets and high-frequency noise were removed using a bandpass filter (1–200 Hz). Details on the number of components removed and the duration of retained data have been reported previously [9]. Pipeline of oscillatory edge-connectivity analysis and machine learning–based prediction of migraine from resting-state magnetoencephalographic data. (a) For data acquisition, 3-minute resting-state recordings were obtained with the participant’s eyes closed. (b) For preprocessing and source analysis, magnetoencephalographic data were notch-filtered, bandpass-filtered, and denoised through signal-space projection. Source reconstruction was performed with an overlapping sphere head model and weighted minimum norm estimates. (c) For edge-connectivity analysis, a time-resolved FC analysis was initially conducted to derive oscillatory region-to-region connectivity (edges) in pain-related regions. Edge-to-edge co-fluctuations were then calculated to quantify edge connectivity across distinct frequency bands. (d) For nested feature extraction and classification, oscillatory edge-connectivity metrics were extracted, and analysis of variance was conducted to identify features with significant group differences. Machine learning models were trained using fivefold nested cross-validation and evaluated in independent datasets. Model performance was assessed by evaluating classification accuracy and receiver operating characteristic curves. SI, primary somatosensory cortex; MI, primary motor cortex; SII, secondary somatosensory cortex; ACC, anterior cingulate cortex; L, left; R, right; HFO, high-frequency oscillation; eFC, edge-centric functional connectivity Individual T1-weighted brain images were used to construct participant-specific cortical surface models for magnetoencephalographic source analysis. Cortical surfaces were automatically reconstructed using BrainVISA (version 4.5.0) and co-registered with the corresponding magnetoencephalographic datasets. Forward modelling was performed using the overlapping sphere method, and source reconstruction was performed using a depth-weighted minimum norm estimate approach (Fig. 1). Each cortical vertex in this distributed source model represented a current dipole. Source estimates were subsequently morphed to a common cortical space to enable group-level analysis [6, 18, 19]. Further analysis was conducted using regions of interest (ROIs) defined per the Mindboggle cortical parcellation scheme [20], applied to the T1-weighted template. Consistent with prior magnetoencephalographic studies [9–11], the present study included the following pain-related ROIs: the bilateral insula, SI, primary motor cortex (MI), SII, and ACC. Dynamic oscillatory FC was assessed using amplitude envelope correlation, a widely applied magnetoencephalography-based measure of resting-state functional coupling between brain regions, which quantifies temporal correlations in oscillatory amplitude fluctuations and provides an index of long-range neural synchrony [21, 22]. Source-reconstructed signals were bandpass-filtered and segmented into nonoverlapping 1-s epochs, after which the Hilbert transform was applied to obtain analytic signals. To mitigate spatial leakage, symmetric orthogonalisation was performed before amplitude envelope extraction [22]. Dynamic FC was then estimated by calculating the Pearson correlation coefficients between the amplitude envelopes of all ROI pairs, which resulted in time-resolved connectivity matrices capturing moment-to-moment co-fluctuations across regions. All analyses were conducted using Brainstorm [23]. To conduct an edge-centric FC (eFC) analysis (Fig. 1), co-fluctuation time series were derived from the dynamic FC between each pair of ROIs across standard frequency bands: delta (1–4 Hz), theta (5–7 Hz), alpha (8–13 Hz), beta (14–25 Hz), gamma (26–40 Hz), high gamma (41–90 Hz), and high-frequency oscillation (91–200 Hz). A total of 45 edge time series were obtained in the predefined pain-related network (10 ROIs), each spanning 180 s. Next, eFC, reflecting higher-order interactions among these 45 connections, was calculated as a normalised temporal correlation between pairs of edge time series in each frequency band: where cij(t) and cuv(t) denote the co-fluctuation time series of edges connecting ROIs i–j and u–v, respectively. This normalisation constrains eFC values to the interval [− 1, 1]. For each participant, 990 eFC values were obtained per frequency band for subsequent analyses. Machine learning classification with nested cross-validation and Shapley analysis Oscillatory edge-centric connectivity (eFC value) was used to develop classification models for migraine diagnosis and phenotyping. For each task (migraine vs. HC and CM vs. EM), the dataset was randomly divided into a training set (80%) and a test set (20%). Machine learning models were examined using strict nested cross validation (Fig. 1). Specifically, within the training dataset, fivefold cross-validation was performed. For each cross-validation fold, analysis of variance was conducted only within the training fold to rank features according to their F values using univariate analysis of variance (ANOVA), and the top-ranked features were selected. The selected feature subset was then applied to the corresponding held-out validation fold for prediction, ensuring that the validation fold was not used for feature ranking, feature selection, or model training. Cross-validated performance was estimated by aggregating predictions across validation folds. After internal validation, the final classifier was trained using the full training dataset and evaluated on the independent test dataset. Notably, the independent test set was completely held out from ANOVA feature selection and model training. The top features (n = 50, 40, 30, 20, and 10), ranked by F values, were selected to construct the training and test datasets (Fig. 1). To reduce bias towards the majority class, a cost matrix was applied to address class imbalance by assigning higher penalties to misclassifications of the smaller group. Seven supervised learning algorithms were evaluated: decision tree, discriminant analysis, naïve Bayes, support vector machine (SVM), k-nearest neighbour (KNN), ensemble method, and neural network. Models were trained using labelled data to learn optimal decision boundaries. Model performance was evaluated through accuracy and area under the receiver operating characteristic (ROC) curve (AUC). Models were evaluated using weighted F1-score, defined as the harmonic mean of precision and recall, weighted by the number of samples in each class. Model generalisability was evaluated on the independent test set with blinded labels. Accuracy and AUC were calculated for each model. For migraine versus HC classification, models were considered acceptable if both the accuracy and weighted F1-score were ≥ 75% and the AUC was ≥ 0.7 in both the validation and test sets. For CM versus EM classification, models were considered acceptable if both the accuracy and weighted F1-score were ≥ 70% and the AUC was ≥ 0.7. To interpret model predictions, Shapley values were calculated to quantify feature contributions [24]. Feature importance was ranked on the basis of average Shapley values from well-performing models. Acceptable predictors were identified by calculating the mean normalised Shapley impact across suitable models at the levels of edge connectivity, edge, brain region, and frequency band. All analyses were conducted using the Machine Learning Toolbox in MATLAB (R2024b). Statistical analysis Intergroup differences in demographic, psychometric, and clinical variables were assessed using independent t tests. Categorical variables were compared using the χ2 test. Key edge-connectivity features were examined in classified groups to clarify their statistical relevance. Correlation analyses were performed to examine the associations between edge-connectivity values and emotional scores measured using the HADS. All tests were two-tailed with a significance threshold of p < 0.05. Results Clinicodemographic characteristics This study included 250 participants. The HC, CM, and EM groups comprised 72, 98, and 80 participants, respectively. Table 1 presents the clinicodemographic characteristics of the study cohort. No significant intergroup difference was observed in age or sex. Compared with the HC group, the CM and EM groups exhibited significantly increased anxiety (HADS-A) and depression (HADS-D) scores (CM, HADS-A: t = 6.76 and HADS-D: t = 5.58; EM, HADS-A: t = 6.27 and HADS-D: t = 4.73; all p < 0.001). The CM group reported a higher frequency of headaches (days per month) than did the EM group (t = 13.6, p < 0.0001). In addition, the CM group obtained higher Migraine Disability Assessment Scale scores than did the EM group (t = 3.21, p = 0.0016). No significant differences were observed between the CM and EM groups in disease duration. Notably, acute medications which participants commonly used were listed in the supplementary Table 1. Importantly, all reported medications have elimination half-lives of less than 3 h. Table 1Demographics and clinical profiles of participantsHCCMEMp-value N 729880Age (years)40.0 ± 9.839.0 ± 11.337.1 ± 10.6p > 0.08Sex54 F/18 M82 F/16 M64 F/16 Mp > 0.37HADS_A4.6 ± 3.58.7 ± 4.4*8.2 ± 3.9*p < 0.001HADS_D3.9 ± 3.06.6 ± 4.1*5.9 ± 3.4*p < 0.001Headache days /(month)-20.2 ± 6.76.9 ± 4.9#p < 0.0001Disease duration (months)-212.3 ± 141.6184.7 ± 105.7p = 0.15MIDAS-48.4 ± 64.922.5 ± 26.2#p = 0.0016HC: Healthy control; CM: Chronic migraine; EM: Episodic migraine; F: female; M: male; HADS: Hospital anxiety and depression score; A: Anxiety; D: Depression; MIDAS: Migraine disability assessment scores*, significant difference compared to HC. #, significant difference compared to CM Demographics and clinical profiles of participants HC: Healthy control; CM: Chronic migraine; EM: Episodic migraine; F: female; M: male; HADS: Hospital anxiety and depression score; A: Anxiety; D: Depression; MIDAS: Migraine disability assessment scores *, significant difference compared to HC. #, significant difference compared to CM Classification of patients with migraine and HCs by using machine learning algorithms Oscillatory edge-connectivity features were used to classify patients with migraine and HCs on the basis of seven algorithms and five feature-set sizes (top N = 50, 40, 30, 20, and 10, ranked by F values) in the validation and independent test datasets. In the validation set (migraine group: n = 142; HC group: n = 58), multiple models, particularly SVM, KNN, and ensemble methods, met the performance thresholds (accuracy ≥ 75% and weighted F1-score ≥ 75%; Fig. 2a, b). In the independent test set (migraine group: n = 35; HC group: n = 14), high performance was still observed, with SVM and ensemble methods generally achieving the highest accuracy and weighted F1-score across feature sizes (Fig. 2d, e). Using the predefined selection criteria of accuracy and weighted F1-score of ≥ 75%, six models met the performance threshold and were retained for subsequent analyses: SVM(50), ensemble(50), SVM(40), SVM(30), KNN(30), ensemble (10). Model performance in differentiating between patients with migraine and healthy controls across various feature-set sizes. Panels (a)–(c) present the results from the validation dataset, and panels (d)–(f) present the results from the independent test dataset. For each feature-set size (50, 40, 30, 20, and 10 features), seven classifiers were evaluated: decision tree, discriminant analysis, naïve Bayes, support vector machine (SVM), k-nearest neighbour (KNN), ensemble method, and neural network. The bar plots depict accuracy (%) in panels (a) and (d) and weighted F1-score (%) in panels (b) and (e). The vertical dashed line indicates the 75% reference threshold, and the asterisks denote models exhibiting reliable performance in each feature set. Panels (c) and (f) present weighted receiver operating characteristic curves and corresponding area under the curve values for select models with reliable classifiers and appropriate feature-set sizes ROC analysis revealed good discrimination. Specifically, the validation AUCs ranged from 0.783 to 0.841—SVM(50) = 0.802, ensemble(50) = 0.783, SVM(40) = 0.841, SVM(30) = 0.796, KNN(30) = 0.798, and ensemble(10) = 0.798. The test AUCs ranged from 0.808 to 0.854—SVM(50) = 0.850, ensemble(50) = 0.839, SVM(40) = 0.854, SVM(30) = 0.843, KNN(30) = 0.808, and ensemble(10) = 0.822. All models achieved an AUC of ≥ 0.7, supporting migraine identification and generalisation. Prominent features of patients with migraine Shapley summary plots were generated to provide global explanations of migraine versus HC classification based on oscillatory edge-connectivity features. In these plots, features are ranked by the mean absolute Shapley value. The top 10 features from each reliable model are presented in Fig. 3a. Each dot represents one participant; its horizontal position indicates the Shapely value (how strongly and in which direction the feature influences the prediction), and its colour represents the corresponding feature value (low to high). Positive Shapely values shift predictions towards migraine, whereas negative values shift predictions towards HC, indicating that a higher edge-connectivity value is associated with a higher likelihood of migraine. The inset in Fig. 3a presents the top 10 features across the six models, ranked by using normalised mean absolute Shapley values. Across models, the most influential features were dominated by ACC-centred edges, particularly connections linking SI/SII/insula/MI to the ACC, often appearing as bilateral ACC pairings. Shapley analysis results of oscillatory edge-connectivity features for differentiating patients with migraine from HCs. (a) Shapley summary plots depicting the top 10 edge-connectivity features derived from select machine learning models for migraine versus HC classification. A positive Shapley value indicates a greater contribution towards classification as migraine, whereas a negative Shapley value indicates a greater contribution towards classification as HC. The inset box presents the 10 features with the greatest normalised impact across the models. (b) Notched box-and-scatter plots depicting intergroup differences in prominent edge-connectivity features identified by Shapley analysis. Patients with migraine exhibited significantly higher edge-connectivity values than did HCs across the highlighted connections. ***p < 0.001. (c) Relative contribution of edges based on normalised feature impact. (d) Relative contribution of brain regions based on normalised feature impact. (e) Relative contribution of frequency bands based on normalised feature impact. HC, healthy control; SI, primary somatosensory cortex; MI, primary motor cortex; SII, secondary somatosensory cortex; ACC, anterior cingulate cortex; L, left; R, right; HFO, high-frequency oscillation To validate the group-level relevance of the top features, the migraine and HC groups were compared using boxplots (Fig. 3b). Significant intergroup differences were observed in all edges (all p < 0.0001), including effects in HF (right SI- left/right ACC, t = 5.77), high gamma (right SI–left/right ACC, t = 6.21), gamma (left SII–left/right ACC, t = 6.16; right SI–left/right ACC, t = 6.50), beta (right SI–left/right ACC, t = 6.59; left MI–left/right ACC, t = 6.03; left SI–left/right ACC, t = 6.18), alpha (right SII–left/right ACC, t = 6.46; left SI–left/right ACC, t = 6.28), and theta (left insula–left/right ACC, t = 6.51). Consistent with these results, normalised mean absolute Shapley value analysis revealed that edges linking the SI/SII/insula/MI to the ACC contributed most to migraine identification, with the connections between the somatosensory and ACC regions providing the largest relative contribution (Fig. 3c). Furthermore, regarding region, the ACC and SI accounted for > 60% of the total importance (Fig. 3d). Regarding frequency, the contributions were concentrated in the alpha-to-gamma range (Fig. 3e). In addition, Pearson correlation analyses between prominent features and anxiety and depression scores were performed, and the results are shown in Table 2. Overall, only a limited subset of features showed nominal associations with emotional scores, whereas most prominent features were not significantly correlated with either anxiety or depression. Specifically, depression scores were associated with a high-gamma SI–ACC feature and with beta- and alpha-band SI–ACC features, while anxiety scores showed a nominal association with one theta-band insula–ACC feature. Several other features showed only marginal significance. Table 2Correlations between prominent features of the classification models (migraine vs. HC) and emotional scoresProminent FeaturesHospital Anxiety and Depression ScaleEdge-ConnectivityAnxiety (A-score)Depression (D-score)High g at SI R-ACC L & SI R-ACC Rr = 0.128, p = 0.063r = 0.159, p = 0.020g at SII L-ACC L & SII L-ACC Rr = 0.099, p = 0.151r = 0.117, p = 0.089β at SI R-ACC L & SI R-ACC Rr = 0.111, p = 0.106r = 0.123, p = 0.072g at SI R-ACC L & SI R-ACC Rr = 0.0789, p = 0.253r = 0.099, p = 0.151α at SII R-ACC L& SII R-ACC Rr = 0.1256, p = 0.068r = 0.117, p = 0.089q at Insula L-ACC L & Insula L-ACC Rr = 0.139, p = 0.043r = 0.124, p = 0.071β at MI L-ACC L & MI L-ACC Rr = 0.122, p = 0.075r = 0.124, p = 0.071HF at SI R-ACC L & SI R-ACC Rr = 0.0711, p = 0.302r = 0.1084, p = 0.1156β at SI L-ACC L & SI L-ACC Rr = 0.098, p = 0.153r = 0.138, p = 0.045α at SI L-ACC L & SI L-ACC Rr = 0.130, p = 0.058r = 0.161, p = 0.019HC, healthy control; SI, primary somatosensory cortex; MI, primary motor cortex; SII, secondary somatosensory cortex; ACC, anterior cingulate cortex; L, left; R, right Correlations between prominent features of the classification models (migraine vs. HC) and emotional scores HC, healthy control; SI, primary somatosensory cortex; MI, primary motor cortex; SII, secondary somatosensory cortex; ACC, anterior cingulate cortex; L, left; R, right Classification of patients with CM and EM by using machine learning algorithms Oscillatory edge-connectivity features were also used to identify patients with CM from EM on the basis of seven algorithms and five feature-set sizes (top N = 50, 40, 30, 20, and 10, ranked by F values) in the validation and independent test datasets. Using the predefined criteria of accuracy and weighted F1-score ≥ 70%, none of the machine-learning models achieved acceptable performance for discriminating CM from EM under the nested cross-validation framework. Across different numbers of selected features (10–50 features) and classification algorithms, validation accuracies generally ranged from approximately 45–58% (Fig. 4a), while test accuracies ranged from approximately 40–71% (Fig. 4c). Similarly, weighted F1-scores remained modest, with most validation and test values below 60% (Fig. b, d). Model performance in differentiating between chronic migraine and episodic migraine across feature-set sizes. Panels (a)–(b) present the results of the validation dataset, and panels (c)–(d) present the results of the independent test dataset. For each feature-set size (50, 40, 30, 20, and 10 features), seven classifiers were evaluated: decision tree, discriminant analysis, naïve Bayes, support vector machine (SVM), k-nearest neighbour (KNN), ensemble method, and neural network. The bar plots depict accuracy (%) in panels (a) and (c) and weighted F1-score (%) in panels (b) and (d) Although several models, particularly ensemble- and tree-based approaches, showed relatively higher performance in the independent test dataset, these improvements were inconsistent and were not accompanied by comparably acceptable validation performance. Therefore, no model simultaneously satisfied the predefined thresholds for both accuracy and weighted F1-score, indicating limited generalizability and substantial overlap between CM and EM phenotypes. Discussion In this study, we characterised migraine-related changes in higher-order brain dynamics on the basis of oscillatory edge-centric connectivity in pain-related regions and identified migraine and its clinical phenotypes by using machine learning classifiers. The resulting models exhibited good performance (accuracy and weighted F1-score of ≥ 70% and AUC of ≥ 0.70) for both migraine versus HC identification. Shapley analysis revealed that migraine classification was primarily driven by elevated high-frequency (gamma or beta) ACC-centred edge connectivity, particularly edges linking the ACC with the SI, SII, insula, and MI, which were consistently prioritised across models and were significantly higher in patients with migraine than in HCs. Notably, under nested cross-validation framework, the limited performance in discriminating CM from EM suggested restricted model generalisability and warrants further investigations. Edge connectivity in resting-state magnetoencephalography Edge connectivity can reveal disease effects that may be missed by conventional FC, particularly because it treats connections as time-varying signals (edge time series) and characterises as higher-order coordination among connections (edge–edge structure). Static FC can be disproportionately shaped by a small number of high-amplitude co-fluctuation moments, which edge-connectivity methods explicitly capture and quantify [25]. In this framework, edge connectivity can reveal altered resting-state co-fluctuation dynamics or disrupted network organisation patterns across brain disorders, such as autism spectrum disorder [26], major depressive disorder [27], subjective cognitive decline [28], and migraine [29]. Collectively, these findings indicate that high-order edge-connectivity measures capture aberrant intrinsic network dynamics associated with brain disease. In a study focusing on migraine, Dai et al. [29] used edge graphs with overlapping communities, entropy, and motif analyses to demonstrate increased lateral thalamus entropy and elevated sensorimotor network entropy. They also identified altered thalamus postcentral community similarity and higher-order thalamocortical motif changes. These findings support the sensitivity of edge-connectivity-based features to migraine-related network dysregulation. In contrast to research involving whole-brain community mapping, the present magnetoencephalography-based study focused on detecting differences in edge-connectivity strength in a restricted, hypothesis-driven, pain-related network. This targeted strategy provides three practical advantages for magnetoencephalography. First, it mitigates spatial and leakage-related constraints by reducing the number of tested edges, thereby improving estimate stability and reproducibility. Second, it yields anatomically interpretable, pathway-level signatures suitable for clinical translation. Finally, it utilises frequency-resolved measurements to link edge-connectivity changes to oscillatory mechanisms relevant to migraine pathophysiology. Although the present findings suggest that edge-centric oscillatory coordination within pain-related networks contains information relevant to migraine diagnosis and phenotyping, the current MEG-based approach should not be interpreted as a ready-to-use clinical screening tool. MEG provides high temporal resolution and relatively favourable source localization for cortical oscillatory activity because it is less affected by skull and scalp conductivity than EEG [7, 9–11]. This is advantageous for estimating source-level connectivity among pain-related cortical regions, including the ACC, insula, and sensorimotor cortices. However, MEG remains expensive and less accessible than EEG, limiting its immediate use in routine clinical settings. Moreover, because several discriminative features, particularly for CM vs. EM, involved low-frequency oscillatory bands, an analogous edge-centric analysis may also be feasible using high-density EEG. Therefore, the present MEG results should be viewed as a translational neurophysiological proof-of-concept rather than a clinically deployable diagnostic test. Future studies should determine whether the identified frequency-specific edge-connectivity signatures can be replicated using more accessible modalities, especially high-density EEG, before claims of clinical diagnostic implementation can be made. Signatures for identifying patients with migraine Using machine learning models with Shapely explanations, we found that co-fluctuations of edges linking the SI, SII, insula, and MI with the ACC contributed most to migraine identification, with somatosensory–ACC connections exhibiting the greatest relative importance, particularly in the alpha-to-gamma frequency range. The ACC is a core hub for pain processing, particularly for the affective motivational or attentional control of pain, and is commonly coactivated with the somatosensory cortex (SI or SII) and insula in human pain, forming a canonical pain network architecture [30]. Changes in salience–sensorimotor circuitry by state and phenotype confirm that abnormal coupling between these nodes contributes to migraine susceptibility and symptoms [5, 30, 31]. Multiple magnetoencephalography-based studies have demonstrated the relevance of pain-related oscillatory networks for migraine. For example, studies based on resting-state magnetoencephalography have reported that oscillatory connectivity patterns in pain-related cortical regions can help characterise migraine and its clinical features [9–11]. Migraine is associated with central sensitization, characterized by abnormal sensory gain and pain or salience gating [4, 5]. In this disorder, the ACC regulates the behavioural relevance of sensory signals and pain-related attention [32–34], whereas the SI and SII encode somatosensory content and the insula supports interoceptive salience [35]. Hence, ACC–sensorimotor coupling disruption may indicate central sensitisation, impaired top-down modulation of sensory inflow, and maladaptive coupling between sensory encoding and salience or affective control, consistent with ‘brain rhythms of pain’ frameworks emphasising dynamic interactions between sensory and contextual (cognitive or affective) systems [36]. In this context, alpha- and beta-band connectivity likely reflects altered gating or inhibitory control [4, 37–39] and top-down regulation [11, 36], whereas gamma-band effects may reflect heightened local excitability and pain-related sensory representation binding [40]. The aforementioned frequency and connection profiles align with the core concepts of altered network connectivity and impaired sensory regulation and suggest that ACC–sensorimotor coupling spanning the alpha-to-gamma range represents a pivotal neurophysiological signature of migraine pathophysiology. Machine learning with Shapley analysis for brain signature discovery Machine learning combined with Shapley explanations can be used to capture the full spatiotemporal complexity of brain activity by simultaneously integrating multiple features [41, 42], accommodating nonlinear relationships, and identifying informative combinations of edge-connectivity features. In contrast to traditional group-comparison statistics, this framework targets individual-level discrimination and validation, with Shapley values providing feature ranking and directionality to support interpretability [43]. In the present study, we used machine learning to derive a compact and generalisable signature, conducted a Shapley analysis to identify the most influential edges, and used conventional statistics to confirm intergroup differences and quantify effect sizes. This approach may identify candidate signatures of migraine neuropathology from a network coordination perspective, thereby supporting further investigations into complementary migraine identification based on network-level features. Notably, the poor performance of the CM versus EM models in both the validation and independent test datasets indicates limited out-of-sample generalisability. The substantial performance reduction under nested cross-validation likely reflects multiple factors, including the high dimensionality of edge-centric functional connectivity features, the relatively limited sample size, and the considerable clinical and biological heterogeneity between CM and EM. In addition, CM and EM are not entirely discrete categories, but partially overlapping phenotypes with shared pathophysiological features, which further complicates stable classification and may reduce the reproducibility of discriminative features in an independent dataset. Taken together, the CM-versus-EM classification results should be regarded as exploratory. Larger cohorts, more stable feature-selection strategies, and external validation will be necessary to improve the generalisability of high-dimensional edge-connectivity based phenotyping. These brain signatures, derived from edge-centric connectivity metrics with machine learning analysis, provide a higher-order description of network organization by quantifying the extent to which functional connections co-fluctuate over time. Rather than characterising only average region-to-region coupling [7, 10, 11] or temporal dynamics [9] within individual connections in our previous works, edge connectivity captures the coordination among multiple communication pathways. In this context, edge-centric analysis may reveal whether ACC-, insula-, and sensorimotor-related connections are co-recruited into coordinated pathological states. This supports the concept that neurological symptoms may arise from maladaptive communication among distributed networks rather than from isolated regional deficits alone [44]. Such coordinated network abnormalities may provide a systems-level substrate for nociceptive salience amplification, interoceptive dysregulation, sensory gain abnormalities, allodynia, and migraine chronification. This interpretation is consistent with evidence linking central sensitization to migraine chronification and with studies showing altered salience, sensorimotor, executive-control, and default-mode network organization in chronic pain and other neurological disorders [44–46]. More broadly, dynamic functional connectivity studies have demonstrated that functional network links fluctuate over time and may provide insights into brain dysfunction beyond static connectivity. In schizophrenia, dysregulated salience-network control over default-mode and executive-control systems has been associated with abnormal large-scale network regulation [47]. Similarly, in autism spectrum disorder, edge-centric network analysis has revealed altered high-order functional organization between the cortical and subcortical regions [26]. Limitations This study has several limitations. First, although oscillatory edge connectivity yields promising results in migraine identification, studies involving other chronic pain disorders are required to establish the specificity and sensitivity of these signatures for migraine. Second, CM–EM phenotyping relies on the accuracy of headache diary and the thresholds used for diagnosis (e.g. ≥15 days/month), but uncertainty in labels [48], particularly near cutoff values, may reduce classification validity. Third, magnetoencephalography-derived connectivity can vary with the hardware, acquisition protocol, preprocessing method, and recording environment used. Therefore, multicentre validation is required to evaluate generalisability, reliability, and reproducibility. Fourth, amplitude envelope correlation (AEC) primarily reflects slow co-fluctuations in oscillatory amplitude and does not directly capture rapid phase-based interactions. Therefore, future studies incorporating complementary phase-based metrics may provide a more comprehensive characterization of migraine-related network dynamics. Finally, although magnetoencephalography is expensive, is less widely accessible than electroencephalography, and requires specialised expertise, these MEG-derived signatures may provide a foundation for future translational research toward complementary tools for migraine diagnosis. Conclusion Oscillatory edge connectivity in pain-related regions, evaluated through resting-state magnetoencephalography, provides candidate neurophysiological signatures for migraine identification. The most informative features converge on higher-order, frequency-resolved dynamic coupling in an insula/ACC–sensorimotor circuit, highlighting altered integration between salience or interoceptive hubs and sensorimotor pathways as a key neurophysiological substrate of migraine. These findings support the hypothesis that higher-order network coordination within distributed pain-related systems may contribute to central sensitization in migraine. Future studies using longitudinal designs, large sample sizes, and outcome-based validation will be important to determine whether neurophysiological signatures can ultimately complement clinical diagnosis. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Acknowledgements 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. Author contributions F.J. Hsiao, K.L. Lai, W.T. Chen, S.J. Wang contributed to the study design. F.J. Hsiao, K.L. Lai, W.T. Chen, Y.F. Wang, S.P. Chen, and S.J. Wang recruited patients and collected data. F.J. Hsiao, K.L. Lai, W.T. Chen, Y.F. Wang, S.P. Chen, and S.J. Wang performed data analysis and interpretation. F.J. Hsiao, K.L. Lai, and W.T. Chen wrote the manuscript. F.J. Hsiao, G. Coppola, and S.J. Wang critically reviewed the article. All authors interpreted the data, reviewed the manuscript, and approved the final version. Funding This study was founded by the National Science and Technology Council (112-2321-B-075-007 and 114-2321-B-A49-016 to SJ Wang, and 112-2221-E-A49 -012 -MY2 and 114-2221-E-A49-080 to FJ Hsiao). The funders had no role in the study design, data collection and analysis, decision to publish, or manuscript preparation. Data availability Derived data supporting the findings of this study are available on request from the corresponding authors. Declarations Ethics approval and consent to participate The study protocol was conducted in accordance with Declaration of Helsinki and was approved by the Institutional Review Board of Taipei Veterans General Hospital (approval numbers: 2015-10-001BC and 2022-02-010 A). Written informed consent was obtained from all participants. Competing interests FJ Hsiao, KL Lai, WT Chen, SP Chen, YF Wang, 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. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Contributor Information Fu-Jung Hsiao, Email: fujunghsiao@gmail.com. Shuu-Jiun Wang, Email: sjwang@vghtpe.gov.tw. References Associated Data Supplementary Materials Supplementary Material 1 Data Availability Statement Derived data supporting the findings of this study are available on request from the corresponding authors.