Abstract
Objectives
This two-center study aimed to establish a model for predicting the risk of lymph node metastasis in gastric cancer patients using machine learning (ML) and logistic regression (LR) algorithms, and to evaluate its predictive performance in clinical practice.
Methods
Data of a total of 369 patients who underwent radical gastrectomy in the Department of General Surgery of Affiliated Hospital of Xuzhou Medical University (Xuzhou, China) from March 2016 to November 2019 were collected and retrospectively analyzed as the training group. In addition, data of 123 patients who underwent radical gastrectomy in the Department of General Surgery of Jining First People's Hospital (Jining, China) were collected and analyzed as the verification group. Besides, 7 ML and logistic models were developed, including decision tree, random forest, support vector machine (SVM), gradient boosting machine (GBM), naive Bayes, neural network, and LR, in order to evaluate the occurrence of lymph node metastasis in patients with gastric cancer. The ML model was established following 10 cross-validation iterations within the training dataset, and subsequently, each model was assessed using the test dataset. The model's performance was evaluated by comparing the area under the receiver operating characteristic curve of each model.
Results
Compared with the traditional logistic model, among the 7 ML algorithms, except for SVM, the other models exhibited higher accuracy and reliability, and the influences of various risk factors on the model were more intuitive.
Conclusion
For the prediction of lymph node metastasis in gastric cancer patients, the ML algorithm outperformed traditional LR, and the GBM algorithm exhibited the most robust predictive capability.
Introduction
Gastric cancer is one of the most common malignant tumors in the digestive system, ranking sixth in the world in incidence and fourth in mortality. 1 At present, gastric cancer typically is managed with comprehensive treatment that includes surgery. However, the overall 5-year survival rate remains below 50%. 2 Lymph node metastasis is reported in 3%-20% of patients with early-stage gastric cancer. Therefore, lymph node dissection plays a crucial role in determining the most suitable treatment approach. The stage of lymph node dissection is also a significant evaluation criterion in gastric cancer treatment.3,4 In recent years, as the role of adjuvant chemotherapy in preventing recurrence has become increasingly evident, accurately determining the extent of lymph node metastasis following gastric cancer surgery is of paramount importance. This determination guides the selection of appropriate adjuvant therapy and ultimately contributes to improving the patient's prognosis. In the TNM staging system of the American Joint Committee on Cancer (AJCC), N represents the number of lymph node metastases, which is itself an independent factor in predicting the overall survival rate of gastric cancer patients.5–7 However, there are some difficulties in the exploration of lymph nodes in patients with gastric cancer, such as multiple regional lymph nodes located in the abdominal cavity, which is not easy to explore preoperatively. In addition, 42.5% of metastatic lymph nodes in gastric cancer belong to nodule type and peripheral type, restricting the application of imaging diagnosis.8,9 Artificial intelligence refers to the ability of machines to independently replicate typical human intellectual processes. 10 Artificial intelligence has various applications in the medical field, encompassing image processing, computer vision, machine learning (ML), artificial neural networks (NNET), convolutional NNETs, and deep learning.11,12 Among them, ML algorithm plays crucial roles in assisting diagnosis and predicting prognosis by processing a large amount of complex medical data.13,14 LUO, MA et al have applied ML and deep learning to esophageal and gastric varices in patients with cirrhosis.15,16 The clinical utility of ML within the realm of artificial intelligence is increasingly attracting clinicians’ attention, and it is also applied to clinical models of various diseases, including stomach cancer. The present study aimed to explore the differences between the clinical model established by the ML algorithm and the traditional logistic regression (LR) model in predicting lymph node metastasis in patients with gastric cancer.
Materials and Methods
A total of 369 patients who underwent radical gastrectomy in the Department of General Surgery of the Affiliated Hospital of Xuzhou Medical University (Xuzhou, China) from March 2016 to November 2019 were enrolled as the training group, and 123 patients who underwent radical gastrectomy in the Department of General Surgery of Jining First People's Hospital (Jining, China) were enrolled as the verification group (Figure 1). The inclusion criteria were summarized as follows: (a) patients with primary gastric cancer who were initially diagnosed in two hospitals and were treated with concurrent surgery; (b) confirmation of lymph node metastasis by imaging and pathology; (c) obtaining the maximum tumor diameter, nerve or vascular invasion, and the depth of tumor invasion from the postoperative pathology. Other indicators were achieved from medical records and preoperative blood tests; (d) anti-tumor therapies, such as radiotherapy and chemotherapy were not performed preoperatively; and (e) the existence of complete clinical data. The exclusion criteria were summarized as follows: (a) Combination with other malignant tumors; (b) the presence of other infectious diseases, blood system diseases, autoimmune diseases, and other disease complications that might affect inflammatory indicators preoperatively; (c) currently receiving or having history of recently receiving anti-inflammatory or immunosuppressive therapy; (d) Preoperative transfusion treatment; (e) severe liver and kidney insufficiency; and (f) Incomplete clinical data. The reporting of this study conforms to TRIPOD guidelines. 17

The study flowchart.
Observational Indicators
Clinical data, such as name, age, gender, and other clinicopathological data, including blood routine parameters, tumor location, maximum tumor diameter, depth of invasion, and the presence or absence of lymph node metastasis, were collected from all patients. These data were gathered in the morning on an empty stomach on the day after admission using the Sysmex XE-2100 Automatic blood analyzer and associated reagents to determine neutrophil count, platelet count, monocyte count, lymphocyte count, and carcinoembryonic antigen (CEA) level in the blood. The pan-immune-inflammation value (PIV) and CEA level were also utilized to establish clinical prediction models. PIV was calculated as follows: (neutrophil count × platelet count × monocyte count)/lymphocyte count.
Statistical Analysis
Continuous variables were expressed as mean ± standard deviation, and categorical variables were presented as ratio. LR was employed to analyze the independent risk factors associated with lymph node metastasis in gastric cancer patients. This analysis allowed for the calculation of odds ratios (ORs) and their corresponding 95% confidence intervals (CIs). An OR greater than 1 indicated that the variable was a positive risk factor affecting the outcome, while an OR less than 1 suggested that the variable was a negative risk factor influencing the outcome. Statistical significance was defined as a P-value of less than 0.05. The statistical analysis and modeling procedures were carried out using SPSS 20.0 software (IBM, Armonk, NY, USA) and R-Studio 25.0 software (R Foundation for Statistical Computing, Vienna, Austria). Several packages were utilized to train models and draw relevant graphs, with the caret packages applied for training and validating ML models. In addition to the fundamental linear model (linear LR), 7 ML models were fitted, including LR, random forest (RF), gradient boosting machine (GBM), decision tree (DT), support vector machine (SVM), naive Bayes (NB), and NNET, as illustrated in Figure 2.

Evaluation of predictive performance of each model based on AUC value.
The training dataset was combined with the validation dataset, and 7 ML algorithms were employed to establish the prediction model. LR is a classification algorithm designed to establish a relationship between a feature and the probability of a specific outcome. Rather than using LR for estimating class probability, it employs S-shaped functions for modeling.18,19 DT is primarily utilized for classification tasks. It begins at the root node to split the dataset based on the most informative feature, creating decision points that segment the data into distinct classes. 20 RF is an extension of the DT method and functions as an ensemble approach. It generates multiple DTs, with the majority vote from these trees determining the final class prediction of the model.21,22 NNET is a ML algorithm inspired by biological NNETs. Artificial NNETs consist of interconnected nodes that communicate through connections.23,24 SVM classifies data by defining boundaries that separate classes. The optimization process aims to maximize the margin between these class boundaries. While SVMs mainly outperform LR, their computational complexity may lead to longer training time during model development.25,26 GBM is a boosting technique that serves as a numerical optimization algorithm for constructing additive models that minimize loss functions.27,28 NB is a straightforward classification algorithm that calculates the probability of each category's occurrence given the item to be classified. The item is assigned to the category with the highest probability.29,30
Performance evaluation of the model involved various metrics, including accuracy, recall, and other indicators. The primary indicator for predicting binary classification results was the area under the receiver operating characteristic curve (AUC-ROC). This metric varies from 0 to 1, with higher values signifying a superior performance. Additionally, for models with two outcomes, the area under the accuracy-recall curve was utilized, illustrating the trade-off between true accuracy and positive predicted values, and the F1 score, defined as the harmonic mean of recall and accuracy. The model underwent 10-fold cross-validation on the training set to assess its performance on the test set. According to the optimal model, a network estimator was developed to facilitate disease prediction using patient data. This estimator enables surgeons to assess the risk of lymph node metastasis in gastric cancer patients.
Results
Baseline clinical data in the training group and the verification group
The comparison of clinical data between the two groups is shown in Table 1. The gender, tumor location, age, and surgical method exhibited no significant differences between the two groups (P > .05). In the training dataset, the proportion of total gastrectomy, neurovascular invasion, and maximum tumor diameter >5 cm in patients with lymph node metastasis were significantly higher than those in patients without lymph node metastasis (P < .05). In the verification dataset, the number of patients who aged >60 years old, neurovascular invasion, and maximum tumor diameter >5 cm in patients with lymph node metastasis were significantly greater than those in patients without lymph node metastasis (P < .05).
Comparison of Clinical Data Between the two Groups.
CEA, carcinoembryonic antigen; PIV, pan-immune-inflammation value.
The results of Mann-Whitney U test revealed that there were no statistically significant differences in the depth of infiltration, PIV, and CEA level between the two groups (P > .05). It was found that the depth of infiltration and CEA level in patients with lymph node metastasis were significantly higher than those in patients without lymph node metastasis (P < .05). In the training dataset, the infiltration depth, PIV, and CEA level in patients with lymph node metastasis were significantly greater than those in patients without lymph node metastasis (P < .05).
LR analysis of influence on lymph node metastasis
Table 2 presents the results of univariate LR analysis of factors influencing lymph node metastasis. A binary LR model was established, with the presence of lymph node metastasis as the dependent variable (yes = 1, no = 0). Gender, age, surgical method, degree of tumor invasion, tumor location, nerve vessel invasion, maximum tumor diameter, PIV, NWR, and CEA level were considered as independent variables (inclusion criterion 0.05, exclusion criterion 0.10). The findings indicated significant associations between the surgical approach, degree of tumor invasion, nerve vessel invasion, maximum tumor diameter, PIV, CEA level, and the occurrence of lymph node metastasis (P < .05). Table 3 presents the results of multifactor LR analysis regarding lymph node metastasis. In this analysis, lymph node metastasis was considered as the dependent variable (yes = 1, no = 0), and a binary LR model was established using the entry method. The independent variables included surgical approach, degree of tumor invasion, neurovascular invasion, maximum tumor diameter, PIV, and CEA level, with an inclusion criterion of 0.05 and an exclusion criterion of 0.10. The findings indicated that the degree of tumor invasion, neurovascular invasion, and maximum tumor diameter demonstrated statistical significance (P < .05). These factors were identified as risk factors influencing the occurrence of lymph node metastasis in patients (OR > 1). Specifically, a higher degree of tumor invasion, the presence of neurovascular invasion, and a maximum diameter exceeding 5 cm were associated with an elevated risk of lymph node metastasis in patients. Evaluation of predictive performance of each model
Single Factor Logistic Regression Affecting Lymph Node Metastasis.
CEA, carcinoembryonic antigen; PIV, pan-immune-inflammation value; OR, odds ratio; CI, confidence interval.
Multiple Logistic Regression Factors Affecting Lymph Node Metastasis.
CEA, carcinoembryonic antigen; PIV, pan-immune-inflammation value; OR, odds ratio; CI, confidence interval.
In order to compare the predictive performance of the 7 ML-based models, this study employed 10-fold cross-validation and utilized the AUC value, validated on the test dataset, as the primary metric for assessing the model's performance. As shown in Table 4 and Figure 2, GBM model exhibited the best performance in predicting the occurrence of lymph node metastasis in gastric cancer patients, with an average AUC of 0.927. In this study, the feature importance (as shown in Figure 3) was developed based on the GBM model. Feature importance enables the visualization of the model's internal results, highlighting the significance of specific variables within the model. By inputting clinical characteristics of patients with gastric cancer and lymph node metastasis, clinicians can predict the risk of lymph node development in those patients (Figure 4).

Feature importance.

A developed web-based risk estimator.
Prediction Performance Evaluation of Each Model.
DT, decision tree; RF, random forest; SVM, support vector machine; GBM, gradient boosting machine; NB, naive Bayes.
Discussion
As a result of the limited early detection of gastric cancer, over 50% of patients are diagnosed at advanced stages or with metastasis. At present, surgery is the main method for the treatment of gastric cancer, and lymph node metastasis is regarded as the main factor affecting the stage, grade, and survival rate of gastric cancer.31,32 Therefore, early prediction of the occurrence of lymph node metastasis is vital. To date, several scholars have concentrated on lymph node metastasis in gastric cancer, while few studies have developed tools to provide accurate predictions. Therefore, the development of precise predictive models is essential to facilitate collaborative decision-making for clinicians and patients. The continuous advancement of artificial intelligence in the field of clinical research has led to the introduction of innovative approaches.
ML uses computer algorithms to learn complex relationships or patterns among data from a large amount of data, and conducts a large number of operations by training existing algorithms to identify data, and iteratively changes algorithms to achieve the best performance, thus producing a model that links multiple variables with target variables. 33 Specifically, supervised ML identifies relationships between input and output data (ie, computers learn from patient data), thus allowing predictions of outcomes based on input data. In addition, ML contributes to a paradigm shift inherent in healthcare, where computers learn from patient data without having to be specifically programed to accomplish tasks. Its advantage is that it has the advantages of high capability, objectivity, and repeatability when processing large data sets, and the data is reliable. 34 It also has the potential to improve the quality of early diagnosis, identify disease progression, and can increase the likelihood of predicting orthopedic patient-specific outcomes, such as outcome scores, risk of complications, and survival of implants. 35 These advantages can facilitate decision-making information sharing between clinicians and patients and facilitate effective planning and rational use of health care services. 36 In addition, the model can be retrained over time to improve the prediction accuracy. 37
ML represents an evolving frontier in the field of medicine, drawing substantial resources to connect computer science and statistical analysis with medical challenges. ML has the capacity to effectively handle extensive, diverse, and intricate medical data. Consequently, the implementation of ML techniques in medicine is widely regarded as the cornerstone of future endeavors in biomedical research, personalized medicine, and computer-aided diagnosis.38,39 Specifically, the operational framework of ML involves development of algorithms to execute numerous tasks, refining the algorithms iteratively to optimize performance. Ultimately, this process yields a model that establishes connections between multiple variables and target outcomes. In the present study, clinical data were collected, and ML algorithms were employed to develop a model for assessing the risk of lymph node metastasis in gastric cancer. By leveraging multiple variables, clinicians can employ this AI-driven approach to select more efficacious treatment strategies.40–43
In this study, in addition to some clinicopathological data, hematological indicators, namely the immunoinflammatory factors (PIV and CEA), were utilized to develop the prediction model. PIV is a novel blood-based biomarker that integrates different subsets of peripheral blood immune cells, neutrophils, platelets, monocytes, and lymphocytes. As PIV has the potential to comprehensively represent patients’ immunity and systemic inflammation, it may potentially serve as a robust predictor in advanced cancer patients undergoing cytotoxic chemotherapy, immunotherapy, and targeted therapy. It has been previously demonstrated that PIV is mainly dependent on neutrophil-to-lymphocyte ratio, platelet-to-lymphocyte ratio, lymphocyte-to-monocyte ratio, and other indicators in predicting cancer prognosis. 44 CEA is a widely used serum tumor marker in clinical practice, particularly in the early screening of various types of cancer, and its elevation level is also regarded as an independent risk factor for poor prognosis of gastric cancer. 45 Development of a model based on combination of clinicopathological data with hematological suggestions can better reflect the physiological and pathological changes of patients with gastric cancer during the disease, making the model more representative.
The results of the traditional logic algorithm indicated that surgical method, degree of tumor invasion, nerve vessel invasion, maximum tumor diameter, PIV, and CEA level were the influential factors of lymph node metastasis in patients with gastric cancer. These factors were imported into the multivariate LR model. The greater degree of tumor invasion, the presence of nerve vessel invasion, and the largest tumor diameter > 5 cm were the independent influential factors of lymph node metastasis in gastric cancer patients. Using ML, seven models were established for comparative analysis, utilizing the AUC as the benchmark for assessment. The outcomes were summarized as follows: the AUC for the DT model was 0.824, the RF model yielded an AUC of 0.923, the AUC for SVM was 0.721, and the GBM model demonstrated an AUC of 0.927. The NB model's AUC stood at 0.914, while the NNET model's AUC reached 0.907. The results of the seven models indicated that the GBM model displayed the most reliable performance, while SVM exhibited the least promising results. Furthermore, a feature importance table was developed based on the highly effective GBM model, which highlighted that factors, such as nerve or vascular invasion, CEA level, maximum tumor diameter, PIV, age, and tumor site were significant contributors to the occurrence of lymph node metastasis.
Utilizing the top-performing GBM model as a basis, a network-based risk estimator was developed, as well as feature importance assessment. The feature importance analysis served to underscore the significance of specific indicators within the model, thereby offering insight into the model's structure. Meanwhile, the network risk estimator directly computed the likelihood of lymph node metastasis in gastric cancer patients based on their clinical data. This web-based tool is user-friendly with a straightforward design, rendering it accessible for healthcare practitioners. It serves as a valuable asset in the diagnosis and treatment, highly supporting clinicians.
Through a comparative analysis of the proposed ML model and the conventional logistic model, commonalities and distinctions were assessed between them. The convergence between these models is evident in their shared findings, highlighting the significance of factors, such as nerve or vascular invasion, maximum tumor diameter, and the extent of tumor invasion as influential factors of lymph node metastasis. Nevertheless, the divergence is apparent in the ability of ML to discern the predictive potential of additional indicators for lymph node metastasis through a more precise and intricate computation. For instance, the feature importance analysis underscored that parameters, including PIV, CEA level, surgical approach, and tumor location should not be disregarded when predicting lymphatic metastasis.
The conventional logistic model was traditionally developed by conducting univariate analysis, followed by the inclusion of variables that exhibited statistical significance in the univariate analysis into the multivariate analysis to enhance the model's robustness. However, it is noteworthy that data with a P-value exceeding 0.05 in the univariate analysis can still exhibit significance when considered in the multivariate analysis. Consequently, traditional logistic modeling may be prone to inaccuracies in the final model. In contrast, the clinical prediction model established using ML could overcome this limitation through meticulous calculations. These models not only demonstrated their performance by evaluating the AUC, but also the model's dependability could be assessed through the Kappa value.
Advantages and Limitation
This study included 369 patients from the Affiliated Hospital of Xuzhou Medical University for internal validation and 123 patients from the Jining NO.1 People's Hospital for external validation. The model developed using ML algorithms not only demonstrated superior performance, but also exhibited enhanced accuracy and reliability in its external applicability. However, retrospective studies are inherently prone to subjective and selection biases. Furthermore, while this is a two-center study, additional institutions should be involved to further validate the external applicability of the model.
Conclusions
In conclusion, this study proposed a computational model through ML algorithms, providing physicians with the capability for real-time risk assessment of patients and aiding in personalized diagnosis and treatment. Compared with traditional LR, ML models are associated with more precise computational capabilities and direct clinical utility through advanced algorithms, emphasizing their substantial potential in clinical practice.
Footnotes
Acknowledgements
The authors thank the Affiliated Hospital of Xuzhou Medical University and Jining First People's Hospital for their support of this study; We thank all staff members involved in this study.
Authors’ Contributions
Tong Lu and Yu Fang designed the study and wrote the manuscript. Tao Li and Chong Chen analyzed the data. Haonan Liu collected the data. Miao Lu and Daqing Song revised the manuscript.
Availability of Data and Materials
The datasets used and analyzed during the current study are available from the corresponding author on reasonable request.
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Ethics Approval and Consent to Participate
The risk posed by the study to subjects does not exceed the minimum risk. The study protocol was approved by the Ethics Committees of the Affiliated Hospital of Xuzhou Medical University (grant number XYFY2021-KL145-01) and Jining First People's Hospital (JNRM-L62). All methods were conducted following relevant guidelines and regulations. The Ethics Committees of the Affiliated Hospital of Xuzhou Medical University and Jining First People's Hospital waived the requirement for informed consent.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
