Interpretable machine learning distinguishes skip from continuous metastasis in N1b papillary thyroid carcinoma Authors: Wei Yan, Haoyi Gao, Wenli Ni, Yusen Liu, Danfeng Sun, Guoyang Wu Published: 2026 ABSTRACT AbstractSkip metastasis—defined as lateral lymph node metastasis(N1b) in the absence of central lymph node involvement—represents a distinct yet underrecognized metastatic pattern in papillary thyroid carcinoma (PTC). Accurate identification of skip metastasis is clinically important. However, reliable tools to distinguish skip from continuous metastasis in N1b PTC remain limited. We developed and validated prediction models to discriminate skip from continuous metastasis using a multi-cohort design. A retrospective cohort of 739 patients with N1b PTC who underwent routine bilateral CND with lateral neck dissection was used for model development. Ten machine learning algorithms were trained using clinically available variables and evaluated through internal validation and two independent external validation cohorts. Model performance was assessed in terms of discrimination, calibration, clinical utility, and risk reclassification. Model interpretability was evaluated using SHapley Additive exPlanations (SHAP). Skip metastasis was identified in 14.2% of N1b PTC patients. Among all candidate models, the XGBoost algorithm consistently demonstrated superior and stable discrimination across development and validation cohorts, achieving the highest area under the receiver operating characteristic and precision–recall curves. Calibration analyses showed good agreement between predicted and observed risks, and decision curve analysis demonstrated a favorable net clinical benefit across clinically relevant threshold probabilities. Compared with alternative models, XGBoost provided significant improvements in patient-level risk stratification, as reflected by positive net reclassification improvement and integrated discrimination improvement in both internal and external validations. SHAP analyses revealed that the number of central lymph nodes dissected, number of metastatic lateral lymph nodes, tumor location, age, and tumor size were the most influential predictors, capturing clinically coherent and non-linear risk patterns. We developed and externally validated an interpretable and clinically deployable machine learning model to distinguish skip from continuous metastasis in N1b PTC. This model enables individualized risk assessment and may support tailored surgical decision-making. Larger and more prospective studies are warranted to evaluate its impact on clinical outcomes.Supplementary InformationThe online version contains supplementary material available at 10.1038/s41598-026-57626-8.Keywords: Papillary thyroid carcinoma, Skip metastasis, Lateral lymph node metastasis, Machine learning, InterpretableSubject terms: Biomarkers, Cancer, Computational biology and bioinformatics, Oncology Introduction Papillary thyroid carcinoma (PTC) is traditionally considered to spread through a stepwise lymphatic pathway from the central to the lateral cervical compartments1. However, skip metastasis—defined as lateral lymph node metastasis (LLNM, N1b) in the absence of central lymph node metastasis (CLNM, N1a)—challenges this paradigm and is increasingly recognized as a clinically relevant metastatic pattern1,2. A meta-analysis reported that skip metastasis occurs in approximately 14.9% of PTC patients with LLNM3. Failure to recognize this pattern at initial presentation may result in imprecise surgical planning, unnecessary extension of surgery, and avoidable postoperative morbidity, with meaningful physical and psychological consequences for patients1–3. Accumulating evidence suggests that skip metastasis is associated with distinct clinical outcomes compared with continuous metastasis involving both central and lateral compartments. Several studies have demonstrated that patients with skip metastasis experience recurrence patterns and recurrence-free survival comparable to those with isolated CLNM and more favorable than those with continuous metastasis2,4–6. These findings raise important questions regarding whether uniform surgical strategies and treatment intensity are appropriate for all PTC patients classified as N1b. Despite its clinical implications, reliable identification of skip metastasis at the time of initial surgery remains challenging7. Prior studies have largely focused on risk factor analyses or conventional regression-based nomograms4–13, which have shown limited predictive performance and restricted clinical usefulness. Few machine learning–based approaches have recently been explored14,15 and they even defined skip metastasis based on postoperative follow-up rather than pathological confirmation at initial surgery15, limiting their relevance to perioperative surgical decision-making. The certainty of skip metastasis has also direct implications for the extent of central neck dissection (CND). Improved identification of skip metastasis may support more individualized surgical decision-making and help avoid unnecessary contralateral central neck dissection in appropriately selected patients1,2,16.In N1b PTC patients with no clinical CLNM, ipsilateral unilateral CND has been reported to achieve oncologic outcomes comparable to those of bilateral CND16. In contrast, bilateral CND is consistently associated with a substantially higher risk of postoperative hypoparathyroidism and hypocalcemia16. However, the absence of reliable tools to identify N1b PTC patients without central compartment involvement has contributed to persistent controversy regarding prophylactic or therapeutic CND, particularly contralateral CND. Within this context, skip metastasis represents a potentially important determinant of surgical extent. By definition, the absence of CLNM suggests that unilateral ipsilateral CND may be sufficient in selected N1b PTC patients, thereby reducing the risk of hypocalcemia without compromising oncologic outcomes. However, most previous studies have not analyzed or specified cohorts clearly, in which bilateral CND was routinely performed in combination with lateral neck dissection, limiting accurate pathological discrimination between skip and continuous metastasis.Therefore, the present study aimed to develop predictive models to distinguish skip from continuous metastasis using data from N1b PTC patients who underwent bilateral CND with lateral neck dissection. Methods Ethics statement The study was approved by the Medical Ethics Committee of Zhongshan Hospital, Xiamen University (Approval No. 2023 − 211), and by the Medical Ethics Committee of Haicang Hospital, Xiamen Medical College (Approval No. IIT-2025024). The requirement for informed consent was waived for the retrospective cohort and obtained for the prospective cohort in accordance with institutional regulations.All methods were performed in accordance with the Declaration of Helsinki. Study design This study was designed to develop, validate, and clinically deploy a predictive model to distinguish skip metastasis from continuous metastasis in patients with N1b papillary thyroid carcinoma. A retrospective–prospective, multi-cohort framework was adopted, incorporating internal and external validation cohorts to evaluate model robustness and generalizability (Fig. 1). Schematic overview of the study design and patient cohorts for model development and validation. Patients with N1b papillary thyroid carcinoma were retrospectively enrolled and allocated to a model development cohort, followed by two independent external validation cohorts. The flowchart illustrates inclusion and exclusion criteria, cohort sizes, and the overall analytical framework for model development, validation, and clinical deployment. Study population Consecutive patients who underwent thyroidectomy with routine bilateral central neck dissection(CND) and unilateral or bilateral lateral neck dissection (LND)(at least level IIa, III, IV) at Zhongshan Hospital, Xiamen University, between December 2006 and December 2024 were retrospectively screened.Patients were excluded if they met any of the following criteria: (1) absence of pathologically confirmed lateral lymph node metastasis; (2) incomplete central neck dissection records; (3) non–papillary thyroid carcinoma (including medullary, follicular, poorly differentiated, or anaplastic carcinoma); (4) history of other malignancies; (5) reoperation for recurrent disease.After applying these criteria, a total of 739 patients with N1b PTC were included in the retrospective development cohort.To assess external validity, two independent validation cohorts were incorporated: a prospective validation cohort, consecutively enrolled at Zhongshan Hospital and Haicang Hospital between January 2025 and December 2025 using identical inclusion and exclusion criteria; and an independent institutional cohort from the China–Japan Union Hospital of Jilin University (January 2020 to November 2022),public available dataset8. Outcome definition Skip metastasis was defined as the presence of lateral lymph node metastasis in the absence of any central lymph node metastasis, whereas continuous metastasis was defined as the coexistence of central and lateral lymph node metastases.The dependent variable was skip metastasis, coded as 1 for skip metastasis and 0 for continuous metastasis. The routine performance of bilateral CND in all included patients enabled accurate pathological discrimination between skip and continuous metastasis, minimizing outcome misclassification and providing a robust reference standard for model development and validation. Candidate predictors and minimum sample size estimation Candidate clinicopathological predictors were selected based on clinical expertise, prior literature and availability at or before the time of initial surgery, ensuring applicability for perioperative decision-making(Supplementary materials, Table S1,Figure S2-S12).Variables were grouped into three clinically meaningful categories: demographic factors: age and gender; primary tumor characteristics: maximum tumor diameter, tumor location (upper pole involvement), unilateral lobe involvement, multifocality, extrathyroidal extension (ETE), capsular invasion, and coexistence of Hashimoto’s thyroiditis or nodular goiter; lymph node burden indicators: number of central lymph nodes dissected (No. CND) and number of metastatic lateral lymph nodes (No. LLNM).Binary variables were encoded as 0 (absence) or 1 (presence). Continuous variables, including age, No. CND, No. LLNM and tumor size, were primarily retained in continuous form. For exploratory and sensitivity analyses during feature selection, age was additionally dichotomized at 55 years and tumor size at 1 cm, consistent with established clinical staging thresholds. To determine the minimum sample size required for developing a robust clinical prediction model for skip metastasis, we performed a power analysis using the pmsampsize package in R. Based on an estimated outcome prevalence of 14.8% derived from our meta-analysis(Supplementary materials, Figure S1), a targeted C-statistic of 0.80, and the inclusion of 10 predictor parameters, a minimum sample size of 553 patients with at least 82 events is required. This ensures a global shrinkage factor of 0.90 and a small margin of error (0.05) in the estimation of the intercept and R-squared (Supplementary materials, Figure S13). Risk factor identification and feature selection To identify clinicopathological factors associated with skip metastasis, univariate logistic regression analyses were first performed in patients with N1b PTC. Variables with a P value < 0.20 in univariate analysis were subsequently entered into a multivariate logistic regression model.A backward stepwise elimination procedure based on the Akaike information criterion was applied to derive a parsimonious set of predictors. This regression-based feature selection was used to anchor model development in clinically interpretable associations and to reduce dimensionality prior to machine learning model construction, rather than to establish causal inference.Adjusted odds ratios (ORs) with 95% confidence intervals (CIs) were calculated. Variables retained after stepwise selection were used as input features for subsequent machine learning model development. Model development The retrospective cohort was randomly divided into a training set (n = 555) and an internal validation set (n = 184) at a 3:1 ratio. Ten machine learning algorithms were developed using the training set, including linear, tree-based, and ensemble methods: logistic regression, decision tree, k-nearest neighbors, naive Bayes, neural network, support vector machine, random forest, AdaBoost, stochastic gradient boosting tree, and extreme gradient boosting (XGBoost).Model hyperparameters were optimized through repeated 10-fold cross-validation(10 repeats)within the training set using a grid search strategy(Supplementary materials, Table S2). The internal validation set was used solely for performance assessment and model comparison. External validation cohorts were not involved in model training, feature selection, or hyperparameter tuning and served as independent test sets to evaluate generalizability. Model performance evaluation and comparison Model performance was evaluated across three complementary dimensions: discrimination, calibration, and clinical utility.Discriminative ability was assessed using the area under the receiver operating characteristic curve (AUROC) and the area under the precision–recall curve (AUPRC), the latter accounting for class imbalance. Differences in AUROC between models were compared using DeLong’s test.Calibration was evaluated using calibration curves comparing predicted probabilities with observed event rates and quantified using the Brier score.Clinical usefulness was assessed using decision curve analysis (DCA), which estimated the net benefit of each model across a range of clinically relevant threshold probabilities. Threshold-dependent performance metrics, including sensitivity, specificity, accuracy, positive predictive value, negative predictive value, and F1 score, were calculated. Agreement between model-based classifications was assessed using Cohen’s κ coefficient. To evaluate incremental predictive value, categorical and continuous net reclassification improvement (Cat-NRI and Cont-NRI) and integrated discrimination improvement (IDI) were calculated to compare the final model with alternative algorithms. Model interpretability To enhance transparency and clinical trust, SHapley Additive exPlanations (SHAP) were applied to the final model. Global feature importance was quantified using mean absolute SHAP values, while SHAP summary plots were used to characterize the direction, magnitude, and non-linear effects of individual predictors. Individual-level explanations were generated using SHAP waterfall plots to illustrate how specific features contributed to model predictions in representative cases.Restricted cubic spline(RCS) analyses were additionally performed to explore and explain the non-linear associations between continuous predictors(age, maximum tumor diameter, No. CND and No. LLNM) and the outcome(skip metastasis). Clinical deployment The final model was implemented as a Shiny-based web application to facilitate real-time individualized risk estimation at the point of care. The application allows clinicians to input patient-specific variables and obtain predicted risk of skip versus continuous metastasis. Statistical analysis The normality of data distribution was assessed using the Shapiro-Wilk test. Continuous variables with a normal distribution were expressed as mean ± standard deviation (SD), while non-normally distributed data were presented as median (IQR, interquartile range).Categorical variables were summarized as counts and percentages. Inter-group comparisons were performed using the Wilcoxon or Kruskal-Wallis rank sum test for continuous variables and the chi-square test for categorical variables, as appropriate. All statistical analyses were conducted using R software (version 4.4.1). A two-sided P value < 0.05 was considered statistically significant. Code availability The custom R code used for data preprocessing, machine learning model development, validation, and visualization is publicly available at GitHub:https://github.com/zsgk2003/skipmetastasis.An archived version of the repository has been deposited in Zenodo and assigned a DOI:10.5281/zenodo.20558645.The repository contains all scripts necessary to reproduce the analyses reported in this study. Results Patient characteristics and outcome distribution across study cohorts Baseline clinicopathological characteristics of patients in the training set, internal validation set, and two external validation cohorts are summarized in Table 1. Overall, key demographic and tumor-related variables were well balanced between the training and internal validation sets(all P > 0.05), indicating that random data splitting did not introduce substantial selection bias.Patients in the development cohort were slightly older than those in the external validation cohorts(P < 0.001), whereas sex distribution and tumor size were comparable across cohorts(P = 0.366 and P = 0.403, respectively). Although several clinicopathological features, including extrathyroidal extension(P < 0.001) and capsular invasion(P < 0.001), differed between institutions—reflecting real-world heterogeneity—the proportion of skip metastasis remained consistent across the development and validation cohorts(P = 0.369). This stable outcome distribution ensured adequate representation of both skip and continuous metastasis for model training and external validation. Table 1Baseline characteristics of training set, internal validation set, external validation set 1 and external validation set 2.VariableLevelModel development setExternal validation set 1 (N = 128)External validation set 2 (N = 640) P (Comparison between Model development set, External validation set 1 and 2)All(N = 739)Training set (N = 555)Internal validation set (N = 184) P (Training vs. Internal validation set)Age(years)Median (IQR)41.0 (34.0 to 53.0)41.0 (34.0 to 53.5)40.0 (34.0 to 52.0)0.62639.0 (31.0 to 50.5)39.0 (31.0 to 47.5)< 0.001GenderMale248 (33.6%)190 (34.2%)58 (31.5%)0.55848 (37.5%)201 (31.4%)0.366Female491 (66.4%)365 (65.8%)126 (68.5%)80 (62.5%)439 (68.6%)Tumor size(cm)Median (IQR)1.3 (0.8 to 2.1)1.4 (0.8 to 2.1)1.3 (0.9 to 2.1)0.9851.5 (0.9 to 2.1)1.3 (0.8 to 2.0)0.403No.CNDMedian (IQR)7.0 (4.0 to 11.0)7.0 (4.0 to 11.0)6.5 (4.0 to 11.0)0.4347.0 (5.0 to 11.0)8.0 (5.0 to 12.0)< 0.001No.LLNMMedian (IQR)4.0 (2.0 to 7.0)4.0 (2.0 to 7.0)4.0 (2.0 to 7.0)0.4984.0 (3.0 to 7.0)4.0 (2.0 to 7.0)0.629Unilateral tumorNo317 (42.9%)235 (42.3%)82 (44.6%)0.65851 (39.8%)307 (48.0%)0.084Yes422 (57.1%)320 (57.7%)102 (55.4%)77 (60.2%)333 (52.0%)LocationNo390 (52.8%)294 (53%)96 (52.2%)0.91867 (52.3%)442 (69.1%)< 0.001Yes349 (47.2%)261 (47%)88 (47.8%)61 (47.7%)198 (30.9%)ETENo340 (46.0%)260 (46.8%)80 (43.5%)0.47874 (57.8%)488 (76.2%)< 0.001Yes399 (54.0%)295 (53.2%)104 (56.5%)54 (42.2%)152 (23.8%)Capsular invasionNo621 (84.0%)465 (83.8%)156 (84.8%)0.838108 (84.4%)566 (88.4%)< 0.001Yes118 (16.0%)90 (16.2%)28 (15.2%)20 (15.6%)74 (11.6%)Concomitant NGNo332 (44.9%)241 (43.4%)91 (49.5%)0.1871 (55.5%)278 (43.4%)0.043Yes407 (55.1%)314 (56.6%)93 (50.5%)57 (44.5%)362 (56.6%)Skip metastasisNo634 (85.8%)476 (85.8%)158 (85.9%)1108 (84.4%)563 (88.0%)0.369Yes105 (14.2%)79 (14.2%)26 (14.1%)20 (15.6%)77 (12.0%) Baseline characteristics of training set, internal validation set, external validation set 1 and external validation set 2. Clinicopathological risk factors associated with skip metastasis in N1b PTC and feature selection for model development Among 739 patients with N1b PTC in model development set, 105 (14.2%) presented with skip metastasis. Univariate analysis identified older age, female gender, smaller tumor size, unilateral tumor, and upper pole location as significant risk factors (p < 0.05), while ETE, capsular invasion, concomitant NG, and higher nodal yield (No. CND and No. LLNM) were inversely associated with skip patterns(Table 2).After multivariable adjustment, tumor location remained a strong independent predictor of skip metastasis, whereas capsular invasion and concomitant nodular goiter were inversely associated with the outcome. In addition, a lower number of central lymph nodes dissected and a lower burden of metastatic lateral lymph nodes were independently associated with skip metastasis. These findings indicate that skip metastasis is characterized by a distinct clinicopathological profile rather than representing a random metastatic pattern. Table 2Risk predictors selection for skip metastasis by univariate and multivariate analyses in patients with N1b PTC and perform stepwise backward elimination to select variables for model development.VariablelevelContinuous metastasis(N = 634)Skip metastasis(N = 105)OR (univariable)OR (multivariable)OR (final)Age(years)Mean ± SD42.5 ± 13.149.2 ± 14.11.04 (1.02–1.05, p < 0.001)1.03 (1.00–1.06, p = 0.062)1.03 (1.01–1.05, p = 0.002)Age > 55 yearsNo504 (79.5%)65 (61.9%)Yes130 (20.5%)40 (38.1%)2.39 (1.54–3.70, p < 0.001)1.02 (0.42–2.45, p = 0.964)GenderMale224 (35.3%)24 (22.9%)Female410 (64.7%)81 (77.1%)1.84 (1.14–2.99, p = 0.013)1.53 (0.86–2.73, p = 0.144)1.54 (0.88–2.70, p = 0.133)Tumor sizeMean ± SD1.7 ± 1.21.2 ± 1.00.63 (0.50–0.79, p < 0.001)0.63 (0.43–0.94, p = 0.023)0.65 (0.50–0.84, p < 0.001)Tumor dimension<10 mmNo494 (77.9%)68 (64.8%)Yes140 (22.1%)37 (35.2%)1.92 (1.23–2.99, p = 0.004)0.79 (0.39–1.60, p = 0.518)Unilateral tumorNo283 (44.6%)34 (32.4%)Yes351 (55.4%)71 (67.6%)1.68 (1.09–2.61, p = 0.020)1.38 (0.82–2.35, p = 0.229)1.45 (0.87–2.41, p = 0.156)LocationMean ± SD0.4 ± 0.50.6 ± 0.52.31 (1.50–3.55, p < 0.001)2.95 (1.74–5.02, p < 0.001)2.80 (1.68–4.66, p < 0.001)ETENo277 (43.7%)63 (60%)Yes357 (56.3%)42 (40%)0.52 (0.34–0.79, p = 0.002)0.62 (0.37–1.04, p = 0.072)0.65 (0.40–1.08, p = 0.096)Capsular invasionNo524 (82.6%)97 (92.4%)Yes110 (17.4%)8 (7.6%)0.39 (0.19–0.83, p = 0.015)0.29 (0.13–0.67, p = 0.004)0.29 (0.13–0.66, p = 0.003)Concomitant NGNo275 (43.4%)57 (54.3%)Yes359 (56.6%)48 (45.7%)0.65 (0.43–0.98, p = 0.038)0.59 (0.36–0.97, p = 0.037)0.59 (0.36–0.97, p = 0.037)Concomitant HTNo402 (63.4%)71 (67.6%)Yes232 (36.6%)34 (32.4%)0.83 (0.53–1.29, p = 0.405)multifocalityNo420 (66.2%)80 (76.2%)Yes214 (33.8%)25 (23.8%)0.61 (0.38–0.99, p = 0.045)0.84 (0.47–1.49, p = 0.555)No. CNDMean ± SD8.6 ± 5.44.1 ± 5.00.78 (0.73–0.83, p < 0.001)0.79 (0.73–0.85, p < 0.001)0.80 (0.75–0.85, p < 0.001)No.LLNMMean ± SD5.3 ± 4.13.6 ± 3.50.84 (0.78–0.91, p < 0.001)0.83 (0.76–0.92, p < 0.001)0.84 (0.76–0.92, p < 0.001)No.LNDMean ± SD30.9 ± 13.527.3 ± 12.30.98 (0.96–1.00, p = 0.012)1.01 (0.99–1.03, p = 0.302) Risk predictors selection for skip metastasis by univariate and multivariate analyses in patients with N1b PTC and perform stepwise backward elimination to select variables for model development. Subsequent stepwise backward elimination finalized 10 independent predictors for the model, which included demographic characteristics(age, gender), key tumor features(tumor location, unilateral tumor involvement, extrathyroidal extension, capsular invasion, concomitant nodular goiter), and lymph node burden indicators(number of central lymph nodes dissected, and number of metastatic lateral lymph node), forming a clinically grounded feature space for subsequent machine learning model construction(Table 2). As is shown in Table 2 and Figure S14,upper pole location (Final OR: 2.80, 95% CI: 1.68–4.66) and tumor size (Final OR: 0.65 per 1-cm increase) remained the strongest anatomical and morphological predictors, consistent with our meta-analysis(supplementary Tables S1 and Figure S12). Notably, capsular invasion (Final OR: 0.29, 95% CI: 0.13–0.66) and concomitant NG (Final OR: 0.59) were identified as significant protective factors. The final set of 10 variables maintained an adequate events per predictor parameter ratio, providing a robust foundation for the clinical model-building. In accordance with an estimated outcome prevalence of 14.8% (our meta-analysis, supplementary Figure S1),our final training set comprised 555 cases, consisting of 476 cases (85.8%) of continuous metastasis and 79 cases (14.2%) of skip metastasis(Table 1),which effectively meets the minimum requirement of 553 patients (with approximately 82 expected events) determined by our power analysis(supplementary Figure S13). This robust sample size provides a solid foundation for the subsequent development and internal validation of the clinical prediction model, ensuring adequate power to accommodate the 10 candidate predictor parameters while maintaining a global shrinkage factor of 0.90(supplementary Figure S13). Discrimination performance of prediction models across development and validation cohorts Overall model discrimination was first evaluated using AUROC(Fig. 2A-D) and AUPRC(Fig. 2E-H) across the development, internal validation, and two external validation cohorts. Among all candidate models, XGBoost consistently achieved the highest or near-highest AUROC and AUPRC values across datasets, indicating superior overall discrimination and robust performance under class imbalance. Importantly, this advantage was preserved in both external validation cohorts despite substantial inter-cohort heterogeneity, supporting strong generalizability. Assessment of discriminative performance across prediction models. (A-D) Receiver operating characteristic (ROC) curves in the development and validation cohorts. (E-H) Precision–recall (PR) curves highlighting model performance under class imbalance. (I-L) Heatmap of pairwise AUROC comparisons across models based on DeLong’s test, with colors indicating levels of statistical significance (*** P < 0.001, ** P < 0.01, * P < 0.05, NS: not significant). To formally assess whether the observed differences in AUROC were statistically meaningful, pairwise comparisons were conducted using DeLong’s test(Fig. 2I-L). XGBoost demonstrated significantly higher AUROC values compared with the reference model and several alternative algorithms in the majority of comparisons (P < 0.05 to P < 0.001). When compared with other high-performing ensemble models, differences were occasionally non-significant; however, XGBoost consistently ranked among the top-performing methods and was not inferior in any validation cohort, indicating stable and reproducible discriminative ability rather than chance-driven superiority. Decision consistency and threshold-dependent performance of competing models Beyond overall discrimination, threshold-dependent performance and decision consistency were assessed to evaluate the stability of model-based classifications (Fig. 3A-D, supplementary Table S3, S4, S5, S6). The XGBoost model demonstrated a favorable balance between sensitivity and specificity across clinically relevant thresholds and achieved consistently high F1 scores across cohorts.Agreement analysis using Cohen’s κ coefficient showed that XGBoost exhibited predominantly moderate to substantial agreement with reference classifications across the development and validation cohorts, whereas several alternative models demonstrated lower or more variable agreement(Fig. 3E-H). These findings suggest that XGBoost provides more stable and reproducible decision behavior when applied at fixed clinical thresholds. Assessment of model robustness at clinically relevant decision thresholds and model agreement analysis. (A-D) Threshold-dependent performance metrics, including sensitivity, specificity, and F1-score. (E-H) Heatmap of pairwise model agreement quantified by Cohen’s κ coefficient, with color coding indicating agreement levels from poor to almost perfect. Calibration and clinical utility of prediction models Calibration curves demonstrated good agreement between predicted probabilities and observed outcomes for ensemble-based models, particularly XGBoost and random forest, across the development and validation cohorts (Fig. 4A-D). Although mild deviations were observed at extreme probability ranges, overall calibration remained stable in external validation.Decision curve analysis further demonstrated the clinical usefulness of the prediction models(Fig. 4E-H). Across a wide range of clinically relevant threshold probabilities, XGBoost consistently yielded higher net benefit than “treat-all” and “treat-none” strategies, as well as most alternative models. This favorable net benefit was preserved in both external validation cohorts, supporting the potential of the model to improve clinical decision-making rather than merely statistical performance. Evaluation of probability reliability and clinical usefulness of the prediction models. (A-D) Calibration curves comparing predicted probabilities with observed outcomes, demonstrating agreement between estimated risk and actual event rates. (E-H) Decision curve analysis (DCA) showing the net clinical benefit of each model across a range of threshold probabilities. Incremental value of XGBoost over alternative models assessed by NRI and IDI The incremental predictive value of XGBoost over alternative models was further evaluated using categorical net reclassification improvement (Cat-NRI), continuous net reclassification improvement (Cont-NRI), and integrated discrimination improvement (IDI), with results summarized in forest plots across the training, internal validation, and two external validation cohorts (Fig. 5A-D). Forest plots showing pairwise comparisons of risk reclassification performance between the XGBoost model and alternative prediction models in training (A),internal validation (B), and two external validation sets (C, D). Categorical net reclassification improvement (Cat-NRI), continuous net reclassification improvement (Cont-NRI), and integrated discrimination improvement (IDI) were calculated to assess the incremental predictive value of XGBoost. Points represent estimated effect sizes, and horizontal lines indicate 95% confidence intervals. Positive values favor XGBoost, indicating improved patient-level risk stratification and discrimination compared with competing models across the training, internal validation, and external validation cohorts. In the training cohort, XGBoost demonstrated positive Cat-NRI, Cont-NRI, and IDI values compared with competing models such as NB, KNN, LR, SGB, SVM and DT (Fig. 5A), indicating improved risk stratification and discrimination. Similar patterns were observed in the internal validation cohort, where XGBoost consistently showed favorable reclassification performance relative to traditional machine learning approaches, including LR, KNN, SVM, SGB, DT and RF classifiers (Fig. 5B). Importantly, the superiority of XGBoost in risk reclassification was preserved in both external validation cohorts. In external validation set 1 and set 2 (Fig. 5C-D), XGBoost continued to yield predominantly positive Cont-NRI and IDI values when compared with alternative models, suggesting a consistent ability to more accurately reassign patients to appropriate risk levels. Although Cat-NRI estimates varied across models and cohorts, the overall direction of improvement favored XGBoost, reflecting robust enhancement in individualized risk prediction rather than cohort-specific effects. Collectively, these findings indicate that XGBoost not only improves overall discrimination, but also provides meaningful gains in patient-level risk reclassification, reinforcing its clinical relevance and supporting its selection as the final prediction model. Risk stratification and global interpretability of the final model The outcome variable, skip metastasis, is displayed at the top of the heatmap to facilitate intuitive assessment of its relationship with the model-predicted risk. Categorical variables (including gender, unilateral tumor, tumor location, extrathyroidal extension, capsular invasion, and concomitant nodular goiter) are represented by discrete colors, while continuous variables (including age, tumor size, central lymph node dissection count [No.CND], lateral lymph node metastasis count [No.LLNM], and XGBoost-predicted probability) are visualized using gradient color scales reflecting their respective value ranges(Fig. 6).A clear risk gradient is observed across the heatmap, with increasing model-predicted probability accompanied by a higher prevalence of skip metastasis and an accumulation of adverse clinicopathological features. This coherent alignment between predicted risk, outcome status, and key clinical variables highlights the interpretability of the XGBoost model and supports its potential clinical utility for individualized risk stratification. Interpretable heatmap of clinicopathological variables ordered by XGBoost-predicted risk. A clear gradient in skip metastasis risk was observed, with higher predicted risk corresponding to a greater burden of adverse clinicopathological features. Vertically arranged heatmap displaying the distribution of clinicopathological variables and the XGBoost-predicted risk across the study population. Each column represents an individual patient, and each row corresponds to a single variable, with each variable visualized using an independent color scale. Patients were ordered from left to right according to increasing predicted probability generated by the XGBoost model (XGBoost, bottom row). Model interpretation using SHAP analysis at global and individual levels To enhance the interpretability of the final XGBoost model, SHapley Additive exPlanations (SHAP) were applied to investigate both global and individual-level feature contributions to model predictions.The SHAP summary bar plot (Fig. 7A) illustrates the global importance of features ranked by their mean absolute SHAP values.(No. CND was identified as the most influential predictor, followed by No.LLNM, tumor location, and age. Other variables, including largest tumor dimension, concomitant nodular goiter, gender, tumor laterality, capsular invasion, and extrathyroidal extension, contributed to a lesser extent. This ranking indicates that the XGBoost model primarily relied on a limited set of clinically relevant variables to generate predictions. Interpretation of the final XGBoost model using SHAP method. (A) SHAP summary bar and (B) beeswarm plots illustrating global feature importance and the direction, magnitude, and distribution of feature effects across all samples. (C-D) SHAP waterfall plots providing individualized explanations for representative low-risk and high-risk cases. The SHAP summary dot (beeswarm) plot (Fig. 7B) further demonstrates the distribution, direction, and magnitude of feature effects across all samples. Lower values of No. CND and No.LLNM were predominantly associated with positive SHAP values, indicating an increased predicted risk, whereas higher values contributed to reduced risk. Features such as age, tumor size, No. CND and No.LLNM exhibited heterogeneous SHAP value distributions, suggesting non-linear relationships and potential interaction effects captured by the XGBoost model. Overall, the beeswarm plot highlights both the consistency and complexity of feature influences on the predicted skip metastasis risk. Individual-level SHAP waterfall plots further illustrated how combinations of risk-increasing and risk-decreasing features contributed to personalized predictions in representative low- and high-risk cases, enhancing model transparency and clinical interpretability.To illustrate individual-level decision-making, a SHAP waterfall plot was generated for a representative low-risk case (Fig. 7C), which shows how each feature shifts the model output from the baseline E[f(x)] = − 2.05 to the final prediction f(x) = − 4.53, indicating an overall lower predicted risk for skip metastasis.The prediction is mainly driven by several strong negative contributors, with no involved in upper hole (− 0.738) having the largest impact, followed by No. CND = 7 (− 0.601) and Tumor size = 2.2 cm(− 0.52). Male (− 0.413) and No. LLNM = 4 (− 0.39) further decrease the predicted value, while bilateral tumor (− 0.18) has a smaller negative effect. In contrast, only weak positive contributions are observed, primarily from without concomitant NG (+ 0.213), whereas age, capsular invasion, and ETE have minimal influence.Overall, the combined effect of dominant negative features shifts the prediction well below the baseline, resulting in a low predicted probability of the risk for skip metastasis. In contrast, a second SHAP waterfall plot illustrates a representative high-risk case (Fig. 7D), which illustrates how the model output for this individual increases from the baseline E[f(x)] = − 2.05 to the final prediction f(x) = 1.46, indicating a markedly higher predicted risk.The prediction is predominantly driven by strong positive contributors. No. CND = 1 (+ 1.29) has the largest impact, followed by Age = 67 (+ 0.932) and upper hole tumor (+ 0.644). Additional positive effects are observed for No. LLNM = 2 (+ 0.402) and without Concomitant NG (+ 0.30). In contrast, not Unilateral tumor and no ETE exert small negative influences, while capsular invasion, gender, and tumor size contribute only minimally.Overall, the cumulative effect of several high-weight positive features shifts the prediction from well below the baseline to a positive value, resulting in a high predicted probability of skip metastasis for this patient. Collectively, the SHAP analyses demonstrate that the XGBoost model provides transparent and coherent explanations at both the global and individual levels, capturing clinically meaningful feature importance, non-linear effects, and personalized risk contributions. These findings further support the interpretability, reliability, and clinical credibility of the final model. Model interpretation analysis for non-linear relationships via restricted cubic splines To further elucidate the relationships between continuous clinicopathological variables and the risk of skip metastasis, we performed Restricted Cubic Spline (RCS) analysis. While age demonstrated a predominantly linear association with the risk of skip metastasis (Poverall < 0.001; Pnon−linear = 0.681), significant non-linear dependencies were identified for tumor size, No. CND, and No. LLNM (Pnon−linear : 0.013,< 0.001,< 0.001,respectively) (Fig. 8). Specifically, the risk of skip metastasis was highest in patients with smaller tumor sizes, particularly those below the 0.7 cm threshold. Furthermore, both No. CND and No. LLNM exhibited a sharp decrease in skip metastasis risk as nodal counts increased. For No. CND, the odds ratio (OR) plummeted from over 7.5 at minimal dissection levels and stabilized as the count exceeded 4 nodes. Similarly, the probability of skip metastasis decreased significantly as No. LLNM increased, reaching a baseline risk level at approximately 4 nodes. Restricted Cubic Spline (RCS) Analysis of continuous predictors for skip metastasis.The curves represent the estimated odds ratios (ORs) (solid red line) with 95% confidence intervals (CIs) (red shaded area) for the association between continuous clinicopathological variables and the risk of skip metastasis in N1b papillary thyroid carcinoma. (A) Age (years). (B) Tumor size (cm). (C) Number of central lymph nodes dissected (No. CND).(D) Number of metastatic lateral lymph nodes (No. LLNM). Web-based implementation of the final model for clinical decision support To facilitate clinical translation, the final XGBoost model was implemented as a web-based application enabling real-time individualized risk estimation (Fig. 9).The application allows clinicians to input patient-specific variables and obtain predicted probabilities of skip versus continuous metastasis, providing decision support at the point of care.The design emphasizes usability and accessibility, enabling clinicians to obtain model predictions without the need for specialized computational expertise.This web-based implementation demonstrates the feasibility of deploying the XGBoost model in a real-world clinical setting, bridging the gap between model development and practical application. Together with the model’s robust predictive performance, reliable calibration, favorable clinical net benefit, and interpretability, the web application highlights the translational potential of the proposed approach for assisting clinical risk assessment.The web can be accessed online at the following link:Distinguish SM and CM(https://predictingptcskipmetastasis.shinyapps.io/DistinguishSMCM/). Deployment of the final XGBoost model. Screenshot of the web-based application implementing the final model, enabling real-time individualized risk estimation to support clinical decision-making. Discussion In this multi-cohort study, we developed and externally validated a machine learning–based prediction model to distinguish skip metastasis from continuous metastasis in patients with N1b PTC. By leveraging a rigorously defined pathological reference standard, we demonstrated that skip metastasis represents a distinct clinicopathological pattern rather than a random metastatic phenomenon. Among multiple candidate models, the XGBoost algorithm consistently achieved superior discrimination, stable decision behavior, favorable calibration, and meaningful clinical net benefit across independent validation cohorts. Importantly, the model provides interpretable and individualized risk estimates that may support more tailored surgical decision-making, especially regarding the extent of central neck dissection. To our knowledge, this study represents the first multi-center investigation to systematically develop, externally validate, and comparatively evaluate multiple prediction models for distinguishing skip from continuous metastasis in N1b PTC patients. Moreover, it constitutes the largest modeling-based analysis to date focused on skip metastasis, anchored by a robust pathological reference standard derived from routine bilateral central neck dissection. Previous studies have predominantly relied on single-center cohorts limited sample sizes, or conventional regression-based approaches, often without independent external validation4–7,9–12. In contrast, the present work integrates a large retrospective cohort with both prospective and independent institutional validation datasets, enabling comprehensive assessment of model discrimination, calibration, decision consistency, and clinical utility. This design allowed not only robust validation across heterogeneous populations but also a systematic comparison of diverse modeling strategies, thereby providing a reliable foundation for clinical translation. Skip metastasis is a clinically significant yet under-recognized pattern in N1b PTC patients. While traditional metastatic progression is thought to be stepwise, our study data showed the prevalence of skip metastasis is approximately 14% and is according to our meta-analysis (Supplementary Figure S1)4–14,17–51 and prior meta-analyses3, which indicates that skip metastasis is not an uncommon phenomenon in PTC. Due to its unique metastatic pattern, it often leads to the missed diagnosis of LLNM in clinical practice, resulting in postoperative recurrence and the need for secondary or multiple surgeries52. Therefore, precise identification of skip metastasis is of paramount clinical importance, yet it remains challenging. Over the past decade, while the application of artificial intelligence and machine learning (ML) in thyroid nodule diagnosis has grown exponentially53, research focused specifically on predicting skip metastasis remains sparse.Previous studies have primarily focused on identifying risk factors and constructing nomograms based on logistic regression3–13. However, their clinical utility is often limited by practical inconvenience. Furthermore, some existing models suffer from methodological heterogeneity; for instance, the cohort used by Jiwang et al.54 did not consist exclusively of surgically confirmed N1b PTC cases, which may compromise predictive accuracy. Similarly, the study by Li et al.55 included patients who were not undergoing primary surgery.As a unique subset of LLNM, skip metastasis is not explicitly classified in the AJCC TNM Staging System (8th Edition). Yang et al.4 demonstrated that the recurrence rate for skip metastasis is significantly lower than that of continuous metastasis, exhibiting a recurrence tendency similar to N1a disease. Consequently, their team proposed that skip metastasis should be downstaged to N1a, potentially allowing for more conservative therapeutic strategies.Thus, preoperative identification of skip metastasis is critical for precise surgical planning, preventing recurrence, guiding TNM staging, and tailoring follow-up strategies.To address these gaps, our study strictly screened cases confirmed as skip or continuous metastasis at the time of primary surgery. We compared ten machine learning algorithms and identified XGBoost as the top-performing model. XGBoost is an efficient boosting algorithm that constructs multiple weak classifiers sequentially and is renowned for its powerful performance in handling non-linear relationships. To overcome the “black box” nature of ML, we utilized the SHAP method for both global and local model interpretation. Furthermore, we developed a web-based application to facilitate clinical use, enabling clinicians to perform aggressive preoperative assessments of the lateral neck for patients identified as high-risk. Our analysis identified upper-pole involvement, maximum tumor diameter, No. CND), and No. LLNM as key predictors. While these findings align with some literature, they diverge from other studies regarding factors like age, female sex, unilateral location, and tumor size < 1 cm. For example, Zhao et al.3 identified female sex, age ≥ 45, and size ≤ 1 cm as risk factors in a meta-analysis, whereas Nie et al.7 found skip metastasis more common in microcarcinomas (≤ 0.5 cm) but found no association with age or tumor location. Conversely, Hu et al.10 reported that age > 55 and upper-pole location were independent risk factors. Such inconsistencies highlight significant research heterogeneity and suggest the existence of highly complex, non-linear interactions. A review of existing models reveals a predominance of linear logistic regression. Reported AUCs vary, such as Li’s nomogram (AUC 0.870)8, Wang’s model (AUC 0.806)9, Yang’s consistency index (0.886)11, and Zhao’s clinical-ultrasound model (C-index 0.797)12. While Zhu et al.14 achieved high accuracy (91.7%) using a SVM in a large sample, their predictors differed from ours, including factors like the absence of BRAF V600E mutations. Our XGBoost model achieved performance comparable to or exceeding these studies while maintaining robustness across multi-center data.The divergent conclusions regarding quantitative variables like age and tumor diameter in the literature further suggest complex correlations. Risk thresholds for age vary wildly across studies (> 4012, > 44.5[17], ≥ 4518, or ≥ 55 years9,19. Furthermore, there is substantial variability in the sample sizes across these studies, most of which are relatively constrained, ranging from only 49 to 567 cases. Similarly, while most studies associate tumor size ≤ 1 cm with skip metastasis, a large-scale study of 2,585 N1b PTC patients by Sui et al.20 paradoxically identified upper-pole location as a protective factor.These contradictions confirm that the occurrence of skip metastasis may not be fully captured by linear modeling. By using XGBoost, we revealed the non-linear impact of variables like tumor size through SHAP and RCS analyses. In conclusion, the adoption of non-linear machine learning models like XGBoost provides superior predictive power and deeper insights into the complex clinicopathological landscape of skip metastasis in PTC. Notably, two quantitative lymph node–related variables(No.CND and No. LLNM)—emerged as key contributors to model performance, where few have explicitly incorporated quantitative measures of lymph node burden into predictive modeling for skip metastasis8,14,21,22. The inclusion of No. CND and No. LLNM allows the model to capture gradations in nodal disease extent and surgical sampling intensity, thereby providing a more nuanced representation of metastatic patterns. This approach is biologically intuitive, as a lower central lymph node yield combined with limited lateral lymph nodal burden may reflect alternative lymphatic drainage pathways characteristic of skip metastasis from the upper thyroid pole directly to the lateral cervical compartment, By employing the RCS method, we identified that the associations between No. CND, No. LLNM, and skip metastasis are characterized by complex, non-linear dependencies rather than simple linear correlations. Finally, To bridge the gap between complex computational modeling and bedside clinical practice, we implemented two key strategies: interpretability and accessibility. First, we utilized SHAP to decompose the XGBoost “black box” machine learning model56,57, providing clinicians with a clear understanding of how each variable—such as the number of dissected central nodes or tumor location—contributes to an individual patient’s risk profile. Second, we developed a user-friendly web application to facilitate real-time risk assessment. For patients identified as high risk for skip metastasis by our model, clinicians can prioritize more rigorous preoperative lateral neck imaging (e.g., targeted ultrasound or fine needle aspiration biopsy), thereby reducing the risk of missed metastases and subsequent re-operation. Limitations Despite the strengths of this multi-center study, several limitations should be acknowledged. First, the retrospective nature of the primary development cohort may introduce inherent selection bias. Although we incorporated independent external validation datasets to mitigate this risk and enhance robustness, the validation cohorts remain relatively modest in size, which may constrain the model’s generalizability. Future multi-center investigations with larger prospective datasets are warranted to facilitate broader clinical implementation and external validation. Second, while this study represents the largest modeling-based analysis of skip metastasis to date, the total sample size remains relatively small for certain machine learning applications57,58,. Since machine learning and advanced boosting algorithms typically yield superior performance with expansive “big data“57,58, expanding the dataset in future studies may further optimize model stability and predictive accuracy. Third, due to sample size constraints, we were unable to conduct subgroup analyses, such as investigating skip metastasis patterns specifically within papillary thyroid microcarcinoma, which remains a key priority for future expanded research. Fourth, our model primarily integrates clinical and pathological variables.However, some variables, such as No. CND, may partially reflect procedural variability related to surgical extent and pathological examination rather than intrinsic tumor biology alone, although these clinically available perioperative features were retained to optimize predictive performance and model generalizability.The incorporation of multimodal data sources—including preoperative laboratory findings, advanced imaging (ultrasound and computed tomography) features, and molecular profiles such as BRAF V600E mutation status—is expected to further enhance predictive performance in future model iterations. Conclusions In conclusion, we developed and externally validated an interpretable, robust, and clinically deployable prediction model for distinguishing skip from continuous metastasis in N1b papillary thyroid carcinoma. XGBoost-based model demonstrates strong potential to support individualized surgical decision-making. Future larger and more prospective studies are warranted to further evaluate its clinical impact and facilitate broader implementation. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Acknowledgements We are grateful to all the participants in the study for their contributions. Author contributions Wei Yan: data collection, data curation, data verification, statistical analysis, and manuscript drafting.Haoyi Gao, Wenli Ni, Yusen Liu: data collection, data curation, and manuscript revision.Danfeng Sun, Guoyang Wu: study supervision and manuscript revision. Funding This study was supported by the Science and Technology Program of Fujian Province(Grant No. 2025Y9779,and 2018J01390);Science and Technology Program of Haicang district of Xiamen city(Grant No. 350205Z20252007);National Nature Science Foundation of China (Grant No.81172285). Data availability The datasets used and/or analyzed during the current study are available fromthe corresponding author on reasonable request. Declarations Competing interests The authors declare no competing interests. Ethics approval and consent to participate This study was approved by the Medical Ethics Committee of Zhongshan Hospital, Xiamen University (Approval No. 2023 − 211) and the Medical Ethics Committee of Haicang Hospital affiliated to Xiamen Medical College (Approval No. IIT-2025024). Informed consent was waived for the retrospective cohort and obtained for the prospective cohort in accordance with institutional regulations. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Contributor Information Danfeng Sun, Email: 240407261@qq.com. Guoyang Wu, Email: 13400677116@126.com. References Associated Data Supplementary Materials Supplementary Material 1 Data Availability Statement The datasets used and/or analyzed during the current study are available fromthe corresponding author on reasonable request.