Lymph node metastasis (LNM) -- the spread of prostate cancer cells to nearby lymph nodes -- is one of the most powerful predictors of long-term outcomes. Research shows that patients with lymph node involvement have a 10-year risk of distant spread of 83% and a 10-year risk of dying from prostate cancer of 57%. Identifying LNM before treatment is therefore critical for planning appropriate therapy.
The standard surgical response to LNM risk is extended pelvic lymph node dissection (ePLND) -- removal of the lymph nodes during radical prostatectomy. Both the American and European urology guidelines recommend ePLND for intermediate- and high-risk patients whose predicted probability of LNM exceeds 5%, based on a tool called the Briganti nomogram. For lower-risk patients, ePLND is not recommended because it carries procedural risks without benefit.
Current imaging technologies fall short of reliable LNM detection. Standard CT and MRI can assess lymph node size but achieve only about 40% sensitivity and 82% specificity. Multiparametric MRI and PSMA PET/CT improve detection but still miss 40% of affected lymph nodes that are too small (2-5 mm) to show up clearly. This leaves a significant clinical gap for patients who need more accurate preoperative risk assessment.
Machine learning (ML) offers a promising approach to filling this gap. Unlike traditional regression models, ML algorithms can capture complex nonlinear relationships between multiple clinical variables in large databases. This study used the SEER database -- one of the world's largest cancer registries -- to build and compare six ML models for predicting LNM in intermediate- and high-risk prostate cancer patients.
The study drew primarily from the SEER (Surveillance, Epidemiology and End Results) database, a large US national cancer registry. Patients diagnosed with intermediate- or high-risk prostate cancer between 2000 and 2019 were included if they met at least one of: PSA 10 ng/mL or higher, Gleason score 7 or above, or tumor stage T2b or above. After applying these criteria, 24,470 patients were included total -- 24,359 from SEER and 111 from Gansu Provincial Hospital in China as an external validation set.
The dataset was split 70/30 for training and testing within the SEER cohort, while the 111 hospital patients served as a completely separate external validation group. This three-way split (training, test, external) provides a rigorous assessment of model performance on data the model has never seen and on patients from a different healthcare system and population than the training data.
Variables collected for each patient included age, race, tumor grade, T stage (how far the primary tumor had grown), M stage (distant metastasis), Gleason score, PSA level, and the presence of bone, liver, or lung metastasis. The primary outcome was whether each patient had lymph node metastasis -- which was confirmed in 1,782 patients (7.3% of the total cohort), reflecting the known prevalence of LNM in this risk group.
Statistical analysis confirmed significant differences between patients with and without LNM across nearly all variables including grade (p less than 0.001), T stage, Gleason score, PSA level, and bone metastasis -- providing strong signal for the machine learning models to learn from.
Before building the machine learning models, the researchers used multivariate logistic regression to identify which clinical variables were truly independent predictors of LNM, rather than variables that are only significant because they correlate with other variables. This step is essential for identifying the genuine drivers of lymph node involvement.
In univariate analysis (testing each variable alone), many factors were significantly associated with LNM including race, tumor grade, T stage, M stage, Gleason score, PSA, and all metastasis variables. However, when all variables were tested simultaneously in multivariate analysis, only four emerged as statistically independent predictors: T stage (p = 0.016), Gleason score (p = 0.031), PSA level (p = 0.033), and bone metastasis (p less than 0.001).
These four independent predictors were then used as the input variables for all six machine learning models. The exclusion of variables like tumor grade and distant organ metastasis from the independent predictor set means they likely carry information that overlaps with the four retained variables -- a common finding in cancer staging where multiple measures capture overlapping aspects of disease burden.
The biological rationale for these four predictors is well established: T stage reflects how far the primary tumor has grown locally, increasing proximity to lymphatic channels. Higher Gleason score indicates more aggressive tumor biology with greater invasion potential. PSA level scales with tumor volume. Bone metastasis indicates the tumor has already demonstrated the capacity to spread hematogenously, suggesting lymphatic spread is also more likely.
Six machine learning algorithms were built and compared head-to-head using the same four input variables: Random Forest (RF), Naive Bayesian Classifier (NBC), XGBoost (XGB), Gradient Boosting Machine (GBM), standard Logistic Regression (LR), and Decision Tree (DT). Each algorithm approaches the classification problem differently, and comparing them identifies which approach best captures the patterns in this specific dataset.
All models were trained using 10-fold cross-validation: the training data was split into 10 equal parts, with the model trained on 9 parts and tested on the remaining part in rotation, then averaged. This approach is more robust than a single train-test split because it assesses performance across the full range of data variability. The best hyperparameters for each model were selected using a random search method.
To handle the class imbalance in the dataset (only 7.3% of patients had LNM versus 92.7% without), the researchers applied data balancing techniques. Without this correction, models tend to simply predict the majority class (no LNM) most of the time and still appear accurate, while failing on the clinically important minority class. Balancing forces models to learn genuine distinguishing patterns for both groups.
Model performance was evaluated using three complementary metrics: AUC (area under the ROC curve), which measures overall discrimination; sensitivity (recall), which measures how often the model correctly identifies true LNM cases; and specificity, which measures how often it correctly identifies true non-LNM cases. The F1 score was used as the primary composite metric because it balances precision and recall and is appropriate for unbalanced datasets.
In the training set, Random Forest (RF) achieved the highest AUROC at 0.82, reflecting its strong ability to memorize training data patterns. However, the key comparison is on the test set -- data the models have not seen during training -- where a different picture emerged.
On the test set, GBM (Gradient Boosting Machine) achieved the best balanced performance with an F1 score of 0.838, sensitivity of 87.7%, and specificity of 78.3%. XGBoost came close with F1 = 0.836, while RF dropped to F1 = 0.798 -- suggesting that RF had overfit to the training data, a known limitation of that algorithm. The Naive Bayesian Classifier performed notably worse (F1 = 0.418), showing poor sensitivity for LNM cases.
The GBM model's performance of AUC 0.813 on the test set compares favorably to the standard clinical tool currently recommended by European urology guidelines -- the Briganti nomogram -- which achieved sensitivity 0.882, specificity 0.705, and AUC 0.80 in head-to-head comparison. The GBM model thus matches or exceeds the established standard while using only four readily available clinical variables.
Decision curve analysis confirmed that the GBM model provided positive net clinical benefit compared to treating all patients as LNM-positive or LNM-negative across threshold probabilities from 0.1 to 0.9. The variable importance ranking across all six models consistently placed T stage, PSA, and Gleason score as the top three predictors, with bone metastasis contributing somewhat less but still meaningfully.
To make the GBM model accessible to practicing urologists without statistical software, the researchers built a preliminary web-based calculator that allows clinicians to input a patient's T stage, PSA, Gleason score, and bone metastasis status and instantly receive an individualized probability of LNM. This type of tool bridges the gap between research models and real clinical decision-making.
The practical application is directly tied to the clinical decision about whether to perform ePLND during radical prostatectomy. ePLND adds surgical time and carries risks of lymphocele formation and nerve damage; skipping it avoids these complications in patients who do not have LNM. The GBM calculator allows urologists to go beyond the current guidelines' fixed threshold and compute an individualized risk estimate for each patient.
Compared to existing tools, the GBM model offers a specific advantage: it was developed from a very large SEER database of over 24,000 patients spanning 20 years, giving it statistical power that most single-institution prediction models lack. The external validation on hospital patients from China also supports generalizability beyond the US registry population, though the external validation set was small (111 patients).
Future clinical integration could include embedding the calculator into electronic health record systems, allowing automatic LNM risk scoring when preoperative PSA, Gleason, and imaging staging data are entered -- enabling real-time decision support without requiring any additional clinical workflow steps.
This study successfully developed and validated six machine learning models for predicting lymph node metastasis in intermediate- and high-risk prostate cancer, establishing that the Gradient Boosting Machine (GBM) model provides the best overall performance. Built from 24,470 patients in the SEER database and externally validated on hospital data, the GBM model performs on par with or better than the currently recommended Briganti nomogram.
The four independent predictors identified -- T stage, Gleason score, PSA, and bone metastasis -- are all obtained through standard preoperative workup, meaning the model requires no additional testing or imaging beyond what patients already undergo. This makes clinical implementation straightforward and cost-free in terms of additional diagnostic burden.
The main limitations are that this is a retrospective study with potential selection bias, the SEER database lacks important clinical detail such as tumor volume and percentage of positive biopsy cores, and the external validation cohort of 111 patients is too small to fully establish generalizability. The sample imbalance between LNM-positive and LNM-negative cases also introduces uncertainty despite the balancing techniques applied.
Future work should include prospective validation in larger multicenter cohorts, ideally incorporating additional clinical variables not available in SEER. Combining machine learning predictions with advanced imaging data such as PSMA PET/CT could potentially push performance beyond what clinical variables alone can achieve, creating even more powerful preoperative risk stratification tools for individualized prostate cancer treatment planning.