A model training method for predicting anastomotic fistula after esophageal cancer resection
Patent Information
- Application Number
- CN202610098640.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-09-15
Smart Images

Figure CN122761084A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence-assisted clinical decision-making technology, and in particular to a model training method for predicting anastomotic leakage after esophagectomy. Background Technology
[0002] For predicting the risk of anastomotic leakage (AL) after minimally invasive esophagectomy (MIE), traditional prediction models often rely on clinical characteristics, but these models frequently suffer from insufficient performance validation. This deficiency leads to significant differences in the predictive power of the same AL risk factor across different studies, making it difficult to reach a unified consensus and accurately assess the probability of postoperative AL in patients.
[0003] Compared to traditional predictive models, machine learning methods, with their advantages of avoiding human bias and effectively capturing nonlinear relationships between clinical features, demonstrate higher accuracy and robustness in AL risk prediction, enabling more precise assessment of individual patients' AL risk. Several studies have employed machine learning methods to construct AL prediction models after MIE based on clinical features, all achieving good predictive performance. Meanwhile, although various preventative strategies for AL after MIE have been established in clinical practice, encompassing comprehensive preoperative patient screening and preparation, strict intraoperative procedures, and standardized postoperative care management, these strategies largely rely on empirical decision-making and lack precise risk prediction tools, further highlighting the urgent need to develop efficient AL prediction models.
[0004] However, existing machine learning models are still limited to single-dimensional clinical feature inputs, resulting in significant room for improvement in the predictive accuracy of machine learning models. Summary of the Invention
[0005] Therefore, it is necessary to provide a model training method for predicting anastomotic leakage after esophagectomy to address the aforementioned technical problems. The model trained using the method of this invention has high accuracy in predicting the probability of anastomotic leakage.
[0006] The following technical solution is adopted in this specification: This specification provides a model training method for predicting anastomotic leakage after esophagectomy, including: We acquire endoscopic images of samples and extract radiomics features from these images in multiple dimensions to capture the directional texture of the anastomotic region. The categories of radiomics features include morphology, first-order statistics, gray-level co-occurrence matrix, and gray-level run-length matrix. Color space features are extracted from the color space of the sample endoscopic images. The color space features include basic statistics and higher-order statistics. Higher-order statistics are used to reveal abnormal patterns in color distribution. Higher-order statistics include skewness, kurtosis, and entropy. Basic statistics are used to describe the overall color distribution of the sample endoscopic images. The gradients in the X and Y directions of the endoscopic image of the sample are calculated separately. The gradients in the X and Y directions are combined to obtain the gradient magnitude. The mean and variance of the gradient magnitude distribution are calculated to obtain the spatial gradient characteristics of the endoscopic image of the sample. Redundant features in radiomics features, color space features, and spatial gradient features are removed. The importance of these features is evaluated using a random forest algorithm to select the target feature set, and the target feature set is then balanced. The XGBoost model is trained using the target feature set after sample balancing until the loss between the predicted anastomotic leakage probability and the actual anastomotic leakage probability is minimized, thus obtaining a well-trained XGBoost model. The well-trained XGBoost model is then used to predict the probability of anastomotic leakage after esophagectomy.
[0007] Optionally, radiomics features of the endoscopic images of the samples are extracted from multiple dimensions, specifically including: Based on the PyRadiomics library, multiple categories of features are extracted from the endoscopic images of the samples; these features include morphology, first-order statistics, gray-level co-occurrence matrix, and gray-level run-length matrix. The radiomics features of the endoscopic images were obtained by sequentially performing multi-scale transformations on various categories of features through wavelet decomposition, Laplacian Gaussian filtering, and multi-directional Gabor filtering.
[0008] Optionally, acquiring endoscopic images of the sample includes: Acquire multiple endoscopic images; For each endoscopic image, the anastomosis region is marked to obtain the marked endoscopic image; Enhance pathological features in labeled endoscopic images; The pathological features were enhanced by Mixup data enhancement to obtain enhanced endoscopic images. All enhanced endoscopic images were identified as sample endoscopic images.
[0009] Optionally, pathological feature enhancement can be applied to the labeled endoscopic images, specifically including: For each labeled endoscopic image, yellow highlight spots are randomly added to the labeled anastomotic area to simulate exudate. Random perturbations were applied to the contour points of the anastomosis area to simulate the irregular shape of the fistula edge in clinical practice, resulting in simulated endoscopic images. A contrast-limited adaptive histogram equalization algorithm is used to enhance the local contrast of the simulated endoscopic image, resulting in an endoscopic image with enhanced pathological features.
[0010] Optionally, sample balancing is performed on the target feature set, specifically including: Identify similar target features of minority class target features within the target feature set based on the K-nearest neighbor algorithm; Based on similar target features, a target feature set after sample balancing is generated using a linear interpolation algorithm.
[0011] Optionally, the method further includes: During the training of the XGBoost model, the scale_pos_weight parameter is set; the scale_pos_weight parameter is adjusted in real time according to the sample distribution; the sample distribution is the ratio of the number of samples with anastomotic leakage to those without anastomotic leakage in the endoscopic images.
[0012] This specification provides a model training device for predicting anastomotic leakage after esophagectomy, comprising: The first feature extraction module is used to acquire endoscopic images of the sample and extract radiomics features of the endoscopic images of the sample from multiple dimensions to capture the directional texture of the anastomosis region; the categories of radiomics features include morphology, first-order statistics, gray-level co-occurrence matrix and gray-level run matrix; The second feature extraction module is used to extract color space features from the color space of the sample endoscopic image. The color space features include basic statistics and higher-order statistics. Higher-order statistics are used to reveal abnormal patterns in color distribution. Higher-order statistics include skewness, kurtosis, and entropy. Basic statistics are used to describe the overall color distribution of the sample endoscopic image. The third feature extraction module is used to calculate the gradient in the X direction and the gradient in the Y direction of the sample endoscope image respectively, synthesize the gradient in the X direction and the gradient in the Y direction to obtain the gradient magnitude, and calculate the mean and variance of the gradient magnitude distribution to obtain the spatial gradient features of the sample endoscope image. The filtering module is used to remove redundant features from radiomics features, color space features, and spatial gradient features. It uses the random forest algorithm to evaluate the importance of the features to filter the target feature set and performs sample balancing on the target feature set. The training module is used to train the XGBoost model using the target feature set after sample balancing until the loss between the predicted anastomotic leakage probability of the XGBoost model and the actual anastomotic leakage probability is minimized, thus obtaining a trained XGBoost model; the trained XGBoost model is used to predict the probability of anastomotic leakage after esophagectomy.
[0013] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described model training method for predicting anastomotic leakage after esophagectomy.
[0014] This specification provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described model training method for predicting anastomotic leakage after esophagectomy.
[0015] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects: In the model training method for predicting anastomotic leakage after esophagectomy provided in this specification, radiomics features of sample endoscopic images are extracted from multiple dimensions to capture the directional texture of the anastomotic region; basic and higher-order statistics are extracted from the color space of the sample endoscopic images, and these basic and higher-order statistics are determined as color space features; the gradients in the X and Y directions of the sample endoscopic images are calculated separately and then the gradient magnitudes are synthesized, and the mean and variance of the gradient distribution are statistically analyzed to obtain the spatial gradient features of the sample endoscopic images; redundancy in the radiomics features, color space features, and spatial gradient features is removed. The method employs a feature set selection process, prioritizing its importance. For the first time, it integrates multimodal features including radiomics, color space features, and spatial gradient features to accurately capture visual information related to AL (anechoic artery rupture) pathology, overcoming the limitations of single-feature models. The XGBoost model is trained using the balanced target feature set until the loss between the predicted and actual anastomotic leakage probabilities is minimized. This trained XGBoost model is then used to predict the probability of anastomotic leakage after esophagectomy. The model trained using this method demonstrates high accuracy in predicting anastomotic leakage. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 This is a schematic diagram of a model training method for predicting anastomotic leakage after esophagectomy, as provided in this specification. Figure 2 This invention provides a flowchart for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence. Figure 3 This is a schematic diagram of the input layer provided by the present invention; Figure 4 A schematic diagram of the data preprocessing and enhancement module provided by this invention; Figure 5 This is a schematic diagram of the multimodal feature extraction framework provided by the present invention; Figure 6 A schematic diagram of the dynamic feature selection mechanism provided by the present invention; Figure 7 A schematic diagram of the ensemble learning classifier provided by this invention; Figure 8 A schematic diagram of the interpretability analysis system provided by the present invention; Figure 9 A schematic diagram illustrating the importance of features provided by the present invention; Figure 10 This is a SHAP abstract diagram provided by the present invention; Figure 11 The model decision visualization diagram provided by this invention; Figure 12 This is a schematic diagram of the intelligent diagnostic platform for anastomotic fistula provided by the present invention; Figure 13 This is a schematic diagram of a model training device for predicting anastomotic leakage after esophagectomy, as provided in this specification. Figure 14 This is a schematic diagram of a computer device used in this specification to implement a model training method for predicting anastomotic leakage after esophagectomy. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this application.
[0019] Devices such as desktop computers, servers, and laptops are capable of executing the solutions described in this manual. For ease of explanation, the following description will focus on servers as the primary execution method.
[0020] Endoscopic examination has irreplaceable advantages in assessing esophageal atrophy (AL) after medial endoscopic intervention (MIE), specifically in its comprehensive value of early diagnosis, accurate grading, and guidance of treatment interventions. These advantages are difficult to achieve precisely with traditional imaging examinations such as contrast-induced swallowing tests or computed tomography (CT). In esophageal cancer patients undergoing MIE, performing endoscopy within 72 hours post-operation not only did not significantly increase the incidence of endoscopy-related adverse events, but also provided a basis for proactively preventing AL by guiding targeted postoperative care, ultimately effectively improving patient prognosis. This study not only validates the safety and clinical value of early postoperative endoscopy but also provides reliable preliminary evidence for using endoscopic images as core input data in AL prediction models.
[0021] This invention is an AL prediction model based on early endoscopic images within 72 hours after MIE, which focuses on achieving efficient exclusion of non-AL patients, providing a reliable auxiliary decision-making tool for clinicians, helping to optimize postoperative management strategies and reduce unnecessary clinical interventions.
[0022] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0023] Figure 1 This is a schematic diagram of a model training method for predicting anastomotic leakage after esophagectomy, as described in this specification. The method specifically includes the following steps: S101: Acquire sample endoscopic images and extract radiomics features from the sample endoscopic images in multiple dimensions to capture the directional texture of the anastomotic region; the categories of radiomics features include morphology, first-order statistics, gray-level co-occurrence matrix and gray-level run matrix.
[0024] In an exemplary embodiment, acquiring sample endoscopic images specifically includes: acquiring multiple endoscopic images; for each endoscopic image, annotating the anastomosis region to obtain an annotated endoscopic image; performing pathological feature enhancement on the annotated endoscopic image; performing Mixup data enhancement on the pathological feature enhanced endoscopic image to obtain an enhanced endoscopic image; identifying all enhanced endoscopic images as sample endoscopic images; and identifying all enhanced endoscopic images as sample endoscopic images.
[0025] In an exemplary embodiment, pathological feature enhancement of labeled endoscopic images specifically includes: for each labeled endoscopic image, randomly adding yellow highlight spots to the labeled anastomosis area to simulate exudate; applying random perturbation to the contour points of the anastomosis area to simulate the irregular shape of the fistula edge in clinical practice, thereby obtaining a simulated post-endoscopic image; and using a contrast-limited adaptive histogram equalization algorithm to enhance the local contrast of the simulated post-endoscopic image, thereby obtaining an endoscopic image with enhanced pathological features.
[0026] Specifically, Figure 2 This invention provides a flowchart for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence, such as... Figure 2 As shown, the present invention includes an input layer, a data preprocessing and enhancement module, a multimodal feature extraction framework, a dynamic feature selection mechanism, an ensemble learning classifier, an interpretable analysis system, and an intelligent diagnostic platform for anastomotic fistula.
[0027] Figure 3 This is a schematic diagram of the input layer provided by the present invention. The input data includes endoscopic images in RGB format and annotation information in JSON format. The processing of endoscopic images in this invention begins with precise annotation of the anastomosis region. Specifically, LabelMe software (version 3.16.2) is used, where resident physicians manually select and annotate all anastomosis regions included in the images, defining precise regions of interest for subsequent feature extraction and model training. After anastomosis annotation is completed, to further enhance the pathological features related to AL in the images, this invention designs a targeted pathological feature enhancement strategy to address the characteristics of endoscopic images, such as susceptibility to uneven lighting and low detail contrast. Figure 4 This is a schematic diagram of the data preprocessing and enhancement module provided by the present invention, as shown below. Figure 4 As shown, the enhancement strategy includes the following three aspects: (1) Randomly adding yellow highlight spots (BGR:0,255,255) within the labeled area to simulate exudate, thereby enhancing the model's ability to recognize the optical features of exudate; (2) Applying random perturbation (displacement range ±5 pixels) to the contour points to simulate the irregular shape of fistula edges commonly seen in clinical practice; (3) Using the Limit Contrast Adaptive Histogram Equalization (CLAHE) algorithm (parameters set to clipLimit=4.0, tileGridSize=(12,12)) to enhance the local contrast of the image and improve the visibility of details. This enhancement strategy effectively improves the model's sensitivity to key visual features of anastomotic fistulas while maintaining the normal anatomical structure.
[0028] Furthermore, this invention introduces the Mixup data augmentation method as an innovative image blending strategy: (1) sampling the blending coefficients from the Beta(0.4, 0.4) distribution. λ (1) Generate a smoothly transitioned mixed image; (2) Apply the enhancement with a 40% probability to preserve the original feature distribution while introducing sample diversity; (3) Use the standardized parameters of the ImageNet dataset for image preprocessing. The Mixup method generates new samples that conform to anatomical rationality through linear interpolation, which alleviates the class imbalance problem and makes the model decision boundary smoother, thereby improving the generalization ability.
[0029] In an exemplary embodiment, radiomics features of the endoscopic image of the sample are extracted from multiple dimensions, specifically including: extracting multiple categories of features of the endoscopic image of the sample based on the PyRadiomics library; the multiple categories of features include morphology, first-order statistics, gray-level co-occurrence matrix and gray-level run matrix; and performing multi-scale transformation on the multiple categories of features through wavelet decomposition, Laplacian Gaussian operator filtering and multi-directional Gabor filter in sequence to obtain the radiomics features of the endoscopic image of the sample.
[0030] Specifically, to comprehensively capture diagnostic information in endoscopic images and overcome the limitations of traditional single-feature extraction methods, this invention constructs a multimodal feature fusion framework that integrates three types of features: radiomics, color space, and edge gradient. Figure 5 This is a schematic diagram of the multimodal feature extraction framework provided by the present invention, as shown below. Figure 5 As shown, the multimodal feature extraction framework includes radiomics feature extraction, color space feature extraction, and spatial gradient feature extraction.
[0031] Radiomics Feature Extraction: Based on the PyRadiomics library, a multi-scale, multi-dimensional radiomics feature extraction workflow was established. First, seven categories of features were systematically extracted, including morphological features, first-order statistics, gray-level co-occurrence matrix (GLCM), and gray-level run-length matrix (GLRLM), totaling over 1500 image features. Second, wavelet decomposition, Laplacian of Gaussian (LoG) filtering, and multi-directional Gabor filters (with directional parameters) were used. θ Multi-scale transformations (set to 0, π / 4, π / 2, 3π / 4) were performed to effectively capture the directional texture of the anastomotic region. This workflow enhances the sensitivity to minute lesions through parameter optimization, thereby enabling the quantitative characterization of morphological abnormalities such as fistula edge irregularities and texture complexity.
[0032] S102: Extract color space features from the color space of the sample endoscopic images; color space features include basic statistics and higher-order statistics; higher-order statistics are used to reveal abnormal patterns in color distribution; higher-order statistics include skewness, kurtosis and entropy; basic statistics are used to describe the overall color distribution of the sample endoscopic images.
[0033] Color Space Feature Extraction: To fully utilize color information, this invention innovatively extracts higher-order statistics within the RGB, HSV, and LAB color spaces. In addition to basic statistics such as mean, standard deviation, and median to describe the overall color distribution, higher-order statistics such as skewness, kurtosis, and entropy are calculated to reveal abnormal patterns in color distribution. Furthermore, energy and range indices are used to quantify the dynamic range of color. This method can effectively identify pathologically related color patterns such as localized hyperbrightness caused by exudate or red shifts caused by inflammation, compensating for the shortcomings of traditional grayscale features in terms of color information loss.
[0034] S103: Calculate the gradient in the X direction and the gradient in the Y direction of the sample endoscopic image respectively, synthesize the gradient in the X direction and the gradient in the Y direction to obtain the gradient magnitude, and calculate the mean and variance of the gradient magnitude distribution to obtain the spatial gradient characteristics of the sample endoscopic image.
[0035] Spatial gradient feature extraction: The Sobel operator (kernel size 5×5) was used to extract the gradients in the X and Y directions of the image. After calculating the gradients in the X and Y directions respectively, their gradient magnitudes were synthesized, and the mean and variance of the gradient distribution were statistically analyzed. This process quantifies the edge sharpness and contour irregularity of the fistula region, enhances the characterization of key features such as blurred boundaries and complex morphologies, and effectively compensates for the limitations of radiomics in edge feature extraction.
[0036] S104: Remove redundant features from radiomics features, color space features, and spatial gradient features, evaluate their importance using the random forest algorithm to select the target feature set, and perform sample balancing on the target feature set.
[0037] To construct an efficient and robust prediction model, this invention employs a two-stage dynamic feature selection strategy. Figure 6 A schematic diagram of the dynamic feature selection mechanism provided by the present invention, such as... Figure 6 As shown, firstly, a variance thresholding method is applied to remove zero-variance features from radiomics features, color space features, and spatial gradient features to eliminate redundant variables lacking information. Then, a random forest algorithm is used to evaluate feature importance on the training set, further selecting the feature subset with the strongest discriminative power. This mechanism significantly improves computational efficiency while ensuring the model's discriminative performance, providing high-quality feature input for subsequent classifier construction.
[0038] To address the common class imbalance problem in medical imaging and meet the high reliability requirements of clinical decision-making, this invention constructs an end-to-end integrated learning framework consisting of four collaborative modules: sample balancing, model optimization, threshold adjustment, and multi-dimensional validation.
[0039] Figure 7 A schematic diagram of the ensemble learning classifier provided by this invention is shown below. Figure 7 As shown, the ensemble learning classifier includes sample balancing, XGBoost model configuration, and dynamic threshold optimization.
[0040] In an exemplary embodiment, sample balancing processing of the target feature set specifically includes: identifying similar target features of minority class target features within the target feature set based on the K-nearest neighbor algorithm; and generating a target feature set after sample balancing processing based on the similar target features using a linear interpolation algorithm.
[0041] Specifically, sample balancing: such as Figure 7 As shown, the sample balancing process employs the Synthetic Minority Over-sampling Technique (SMOTE) algorithm to alleviate class imbalance in the training data. Based on K-nearest neighbors (KNN), the algorithm utilizes this technique. k =5) The algorithm identifies similar instances of minority class samples in the feature space and synthesizes new samples that conform to the data distribution through linear interpolation. By dynamically calculating the number of synthesized samples, inter-class balance is achieved, which effectively improves the recall rate of the model for anastomotic leakage cases while maintaining the rationality of the samples.
[0042] S105: The XGBoost model is trained using the target feature set after sample balancing until the loss between the predicted anastomotic leakage probability of the XGBoost model and the actual anastomotic leakage probability is minimized, thus obtaining a trained XGBoost model; the trained XGBoost model is used to predict the probability of anastomotic leakage after esophagectomy.
[0043] In the XGBoost model, the depth of a single tree is set to a preset depth.
[0044] In an exemplary embodiment, during the training of the XGBoost model, the scale_pos_weight parameter is set; the scale_pos_weight parameter adjusts the decision boundary of the XGBoost model in real time according to the sample distribution; the sample distribution is the ratio of the number of samples with anastomotic leakage to those without anastomotic leakage in the endoscopic images of the samples.
[0045] Specifically, XGBoost model configuration: such as Figure 7 As shown, XGBoost was selected as the core classifier, and its main parameters were configured as follows: the maximum tree depth (max_depth=6) was set to balance the model's expressive power and interpretability; cover was used as the feature importance evaluation criterion to more accurately reflect the actual contribution of features in the model's prediction; the class weights were dynamically calculated to adjust the decision boundary in real time during training, so that the model could maintain high accuracy while its feature importance evaluation was more clinically consistent.
[0046] Dynamic Decision Threshold Adjustment: Based on the clinical practice's need for low tolerance for high-risk missed diagnoses, this invention reconstructs the classification decision mechanism. By maximizing the Youden index to determine the optimal threshold, this strategy prioritizes the model's sensitivity, thereby maximizing the identification of AL cases at an acceptable level of specificity.
[0047] Multi-dimensional validation: Internal validation employs 5-fold stratified cross-validation to ensure that the data distribution of each fold is consistent with the overall data, verifying the model's performance stability under the same data distribution. A prospective validation set is used to examine the model's performance changes over time, thereby assessing its temporal stability. Spatial generalization is achieved through multi-center external validation, verifying the model's transferability across data from different regions and medical institutions. Clinical comparison involves a blinded comparative experiment, comparing the model's predictions with the diagnostic results of endoscopists at different experience levels (experts, experienced physicians, and interns), measuring the model's clinical practical value from a practical clinical application perspective.
[0048] Figure 8 A schematic diagram of the interpretability analysis system provided by the present invention, such as Figure 8 As shown, the interpretability analysis system includes a feature importance diagram, a SHAP summary diagram, and a model decision visualization diagram.
[0049] Figure 9 This is a schematic diagram illustrating the importance of features provided by the present invention. Figure 10 The SHAP summary diagram provided by this invention, such as Figure 9 and Figure 10 As shown, interpretability was evaluated on the internal test set using Shapley Additive Explanations (SHAP) analysis and feature importance visualization. The results showed that the distribution of blue channel pixel values was the highest among all features. The top 10 features were color features, first-order statistical features, edge gradient features, and gray-level run-length matrix features—all radiomics-related features. The image texture variations and color anomaly patterns represented by these features are consistent with the clinical diagnostic logic of judging fistulas based on anastomotic region morphology and color, thus validating the rationality and clinical interpretability of the model's feature selection.
[0050] Figure 11 The model decision visualization diagram provided by this invention, such as Figure 11 As shown, the image contains four sets of contrasting images: the original endoscopic image, the anastomotic region segmentation mask, the SHAP value map, and its overlay with the original image. The SHAP value map highlights high-risk features in red, and the overlay of the original image shows that ALAIPS focuses on specific suspicious areas of the anastomosis.
[0051] The radiomics features, color space features, and spatial gradient features of the endoscopic image to be predicted are input into the trained XGBoost model to obtain the probability of anastomotic leakage.
[0052] This invention also provides an interpretability analysis system. To enhance the clinical credibility and practicality of the model, this invention constructs a transparent decision interpretation system to address the common black box problem in medical artificial intelligence models (AI). Figure 8 A schematic diagram of the interpretability analysis system provided by the present invention, such as Figure 8 As shown, the system integrates two methods: ① SHAP value analysis: Based on the Shapley value theory in game theory, the shap.TreeExplainer is used to quantify the marginal contribution of each feature to a single predicted sample. This analysis considers all possible combinations of feature subsets, ensuring the fairness and mathematical rigor of contribution allocation; ② Feature importance visualization: The "cover" importance inherent in the XGBoost model is used for visualization. This metric measures the number of samples covered by a feature across all tree split nodes, which better aligns with the enumeration-type distribution characteristics common in medical features, thus providing a more intuitive interpretation of global feature importance.
[0053] In one exemplary embodiment, in a multicenter dataset (975 patients, 1062 images), the model specificity reached 0.8512–0.9863, and the negative predictive value (NPV) reached 0.8090–0.9144, which can effectively exclude patients with non-anastomotic leakage (AL) and avoid excessive clinical intervention; the accuracy (0.801) is close to that of an endoscopy expert with 10 years of experience (0.835), and significantly better than that of a skilled physician (0.719) and an intern (0.597).
[0054] Figure 12 This is a schematic diagram of the intelligent diagnostic platform for anastomotic fistula provided by the present invention.
[0055] This invention has strong generalization ability: through a three-level system of "retrospective training + prospective validation + multi-center external validation", it covers three hospitals with different clinical experience, maintains stable performance in heterogeneous data environments, and adapts to the clinical needs of different medical scenarios.
[0056] This invention has outstanding clinical interpretability: based on SHAP value analysis and feature importance visualization, the core decision features (color space, texture, edge gradient) are consistent with the logic of clinicians judging AL through anastomosis morphology and color, thus solving the AI black box problem.
[0057] This invention is highly practical: it is developed based on conventional white light endoscopy images, requires no special equipment, and comes with a free access platform, allowing it to be directly integrated into the clinical workflow of primary hospitals, achieving a rapid closed loop of "image upload - risk prediction".
[0058] The advantages of this invention include: (1) Feature fusion innovation: For the first time, radiomics (1500+ texture features), color space (RGB / HSV / LAB higher-order statistics), edge gradient (Sobel operator) multimodal features are integrated to accurately capture visual information of AL-related pathology and make up for the limitations of single feature models.
[0059] (2) Improved validation system: A three-level validation strategy is adopted, and the sample size (975 cases) is the largest in the field, which effectively ensures the model’s external generalization ability and solves the reliability defects of existing single-center and small sample studies.
[0060] (3) Precise clinical positioning: Prioritize the optimization of specificity and NPV, rather than blindly pursuing sensitivity, in line with the core clinical need to quickly exclude low-risk populations, and avoid excessive testing (such as CT), antibiotic abuse and prolonged hospitalization in intensive care units (ICUs) due to false positives.
[0061] (4) High ease of use and universality: Based on conventional white light endoscopy (no special equipment such as narrow band imaging / fluorescence imaging is required), the operation threshold is low; the free platform supports rapid deployment, which can narrow the diagnostic gap between physicians of different years and hospitals of different levels.
[0062] Compared with existing prediction models, this invention has the following advantages: ① Compared with the construction of anastomotic fistula prediction models based on single clinical features, it incorporates important imaging data such as anastomotic endoscopic images; ② Compared with the quantification of anastomotic image information into classification information in the research published by our team, the image features extracted by radiomics and deep learning are more objective, and can also reduce the intermediate steps in the judgment of the prediction model.
[0063] When applying the model training method provided in this manual for predicting anastomotic leakage after esophagectomy, it is not necessary to follow the guidelines. Figure 1 The steps shown are executed in sequence. The specific execution order of each step can be determined as needed, and this manual does not impose any restrictions on it.
[0064] The above are one or more embodiments of this specification providing a model training method for predicting anastomotic leakage after esophagectomy. Based on the same idea, this specification also provides a corresponding model training device for predicting anastomotic leakage after esophagectomy, such as... Figure 13 As shown.
[0065] Figure 13This specification provides a schematic diagram of a model training device for predicting anastomotic leakage after esophagectomy, comprising: The first feature extraction module 1301 is used to acquire the endoscopic image of the sample and extract the radiomics features of the endoscopic image of the sample from multiple dimensions to capture the directional texture of the anastomosis region; the categories of radiomics features include morphology, first-order statistics, gray-level co-occurrence matrix and gray-level run matrix.
[0066] The second feature extraction module 1302 is used to extract color space features from the color space of the sample endoscopic image; the color space features include basic statistics and higher-order statistics; the higher-order statistics are used to reveal abnormal patterns in color distribution; the higher-order statistics include skewness, kurtosis and entropy; the basic statistics are used to describe the overall color distribution of the sample endoscopic image.
[0067] The third feature extraction module 1303 is used to calculate the gradient in the X direction and the gradient in the Y direction of the sample endoscopic image, synthesize the gradient in the X direction and the gradient in the Y direction to obtain the gradient magnitude, and calculate the mean and variance of the gradient magnitude distribution to obtain the spatial gradient features of the sample endoscopic image.
[0068] The filtering module 1304 is used to remove redundant features from radiomics features, color space features and spatial gradient features, evaluate the importance of the features using the random forest algorithm to filter the target feature set, and perform sample balancing on the target feature set.
[0069] Training module 1305 is used to train the XGBoost model using the target feature set after sample balancing until the loss between the predicted anastomotic leakage probability of the XGBoost model and the actual anastomotic leakage probability is minimized, thus obtaining a trained XGBoost model; the trained XGBoost model is used to predict the probability of anastomotic leakage after esophagectomy.
[0070] Specific limitations regarding the model training device for predicting anastomotic leakage after esophagectomy can be found in the limitations of the model training method for predicting anastomotic leakage after esophagectomy mentioned above, and will not be repeated here. Each module in the aforementioned model training device for predicting anastomotic leakage after esophagectomy can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0071] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1A model training method is provided for predicting anastomotic leakage after esophagectomy.
[0072] This instruction manual also provides Figure 14 The schematic diagram of the computer device shown is as follows: Figure 14 At the hardware level, the computer device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 A model training method is provided for predicting anastomotic leakage after esophagectomy.
[0073] It should be noted that the user information (including but not limited to the user's endoscopic images) and data (including but not limited to data used for analysis, data stored, and data displayed) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the acquisition, storage, use, and processing of user information comply with the relevant provisions of national laws and regulations.
[0074] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0075] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A model training method for predicting anastomotic leakage after esophagectomy, characterized in that, include: Acquire sample endoscopic images and extract radiomic features from the sample endoscopic images in multiple dimensions to capture the directional texture of the anastomotic region; The categories of radiomics features include morphology, first-order statistics, gray-level co-occurrence matrix, and gray-level run matrix; Color space features are extracted from the color space of the sample endoscopic images; the color space features include basic statistics and higher-order statistics; the higher-order statistics are used to reveal abnormal patterns in color distribution; the higher-order statistics include skewness, kurtosis, and entropy; the basic statistics are used to describe the overall color distribution of the sample endoscopic images. The gradients in the X and Y directions of the endoscopic image of the sample are calculated separately. The gradients in the X and Y directions are combined to obtain the gradient magnitude. The mean and variance of the gradient magnitude distribution are calculated to obtain the spatial gradient characteristics of the endoscopic image of the sample. Redundant features in radiomics features, color space features, and spatial gradient features are removed. The importance of these features is evaluated using a random forest algorithm to select the target feature set, and the target feature set is then balanced. The XGBoost model is trained using the target feature set after sample balancing until the loss between the predicted anastomotic leakage probability and the actual anastomotic leakage probability is minimized, thus obtaining a well-trained XGBoost model. The well-trained XGBoost model is then used to predict the probability of anastomotic leakage after esophagectomy.
2. The method for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence as described in claim 1, characterized in that, The multi-dimensional extraction of radiomics features from endoscopic images of samples specifically includes: Based on the PyRadiomics library, multiple categories of features are extracted from the endoscopic images of the samples; these features include morphology, first-order statistics, gray-level co-occurrence matrix, and gray-level run-length matrix. The radiomics features of the endoscopic images were obtained by sequentially performing multi-scale transformations on various categories of features through wavelet decomposition, Laplacian Gaussian filtering, and multi-directional Gabor filtering.
3. The method for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence as described in claim 1, characterized in that, Obtaining endoscopic images of the sample, specifically including: Acquire multiple endoscopic images; For each endoscopic image, the anastomosis region is marked to obtain the marked endoscopic image; Enhance pathological features in labeled endoscopic images; The pathological features were enhanced by Mixup data enhancement to obtain enhanced endoscopic images. All enhanced endoscopic images were identified as sample endoscopic images.
4. The method for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence as described in claim 3, characterized in that, The enhancement of pathological features in the labeled endoscopic images specifically includes: For each labeled endoscopic image, yellow highlight spots are randomly added to the labeled anastomotic area to simulate exudate. Random perturbations were applied to the contour points of the anastomosis area to simulate the irregular shape of the fistula edge in clinical practice, resulting in simulated endoscopic images. A contrast-limited adaptive histogram equalization algorithm is used to enhance the local contrast of the simulated endoscopic image, resulting in an endoscopic image with enhanced pathological features.
5. The method for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence as described in claim 1, characterized in that, The sample balancing process for the target feature set specifically includes: Identify similar target features of minority class target features within the target feature set based on the K-nearest neighbor algorithm; Based on similar target features, a target feature set after sample balancing is generated using a linear interpolation algorithm.
6. The method for predicting the probability of anastomotic leakage after esophagectomy using artificial intelligence as described in claim 1, characterized in that, The method further includes: During the training of the XGBoost model, the scale_pos_weight parameter is set; the scale_pos_weight parameter is adjusted in real time according to the sample distribution; the sample distribution is the ratio of the number of samples with anastomotic leakage to those without anastomotic leakage in the endoscopic images of the samples.
7. A model training device for predicting anastomotic leakage after esophagectomy, characterized in that, include: The first feature extraction module is used to acquire endoscopic images of the sample and extract radiomics features of the endoscopic images of the sample from multiple dimensions to capture the directional texture of the anastomosis region. The categories of radiomics features include morphology, first-order statistics, gray-level co-occurrence matrix, and gray-level run matrix; The second feature extraction module is used to extract color space features from the color space of the sample endoscopic image; the color space features include basic statistics and higher-order statistics; the higher-order statistics are used to reveal abnormal patterns in color distribution; the higher-order statistics include skewness, kurtosis and entropy; the basic statistics are used to describe the overall color distribution of the sample endoscopic image. The third feature extraction module is used to calculate the gradient in the X direction and the gradient in the Y direction of the sample endoscope image respectively, synthesize the gradient in the X direction and the gradient in the Y direction to obtain the gradient magnitude, and calculate the mean and variance of the gradient magnitude distribution to obtain the spatial gradient features of the sample endoscope image. The filtering module is used to remove redundant features from radiomics features, color space features, and spatial gradient features. It uses a random forest algorithm to evaluate the importance of the features to filter the target feature set and performs sample balancing on the target feature set. The training module is used to train the XGBoost model using the target feature set after sample balancing until the loss between the predicted anastomotic leakage probability of the XGBoost model and the actual anastomotic leakage probability is minimized, thus obtaining a trained XGBoost model; the trained XGBoost model is used to predict the probability of anastomotic leakage after esophagectomy.
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 6.
9. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 6.