Explanatable nuclear magnetic resonance image classification method and system based on XGBoost classification tree
By combining XGBoost classification trees with multimodal image feature scoring rules and particle swarm optimization algorithm, the problems of accuracy and interpretability of multimodal nuclear magnetic resonance image feature classification are solved, and efficient image feature classification and decision path interpretation are achieved.
Patent Information
- Application Number
- CN202511021343.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-07
AI Technical Summary
Existing multimodal MRI image feature classification methods suffer from several drawbacks: feature extraction relies heavily on human experience and is highly subjective; it is difficult to fully utilize the relationships between multidimensional features; classification accuracy is limited by the completeness of preset rules; deep learning models lack interpretability; and traditional methods struggle to integrate complex relationships.
We employ an XGBoost-based classification tree approach, combining multimodal image feature scoring rules with particle swarm optimization (PSO) algorithm to optimize model hyperparameters. Through multidimensional image feature scoring and decision path interpretation, we improve the accuracy and interpretability of feature classification.
This method improves the accuracy and interpretability of multimodal nuclear magnetic resonance image feature classification. By optimizing hyperparameters through particle swarm optimization, it reduces subjectivity, enhances the flexibility of feature representation, and improves the model's classification performance and interpretability.
Smart Images

Figure CN120912960A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing, more particularly, to an interpretable magnetic resonance image classification method and system based on XGBoost classification tree. BACKGROUND
[0002] As an important medical imaging technology, magnetic resonance imaging (MRI) technology can provide rich multi-modal image information, including T2-weighted imaging, T1-weighted imaging, enhanced imaging, diffusion-weighted imaging and other sequences. These different sequence image data contain multi-dimensional feature information, such as signal intensity, enhancement degree, diffusion characteristics, etc. How to effectively and accurately classify these complex multi-modal image features is an important technical problem in the field of medical image processing.
[0003] In practical applications, three-dimensional abdominal magnetic resonance imaging data has the characteristics of high dimensionality and high complexity. Different types of tissue structures exhibit similar feature manifestations in multi-modal MRI images, resulting in significant overlap between features, which poses a significant technical challenge to accurate classification. Traditional image feature classification methods mainly rely on manually set rules and thresholds to classify and distinguish multi-dimensional features such as signal intensity contrast between target and reference regions, enhancement degree changes between different phases, fat signal characteristics, enhancement patterns, and diffusion characteristics.
[0004] Existing multi-modal image feature scoring systems provide classification references by quantifying the above image features, but this method has the following technical problems: first, the feature extraction and scoring process relies on human experience, and there is strong subjectivity and inconsistency; second, it is difficult to fully utilize the complex relationships between multi-dimensional features; third, the classification accuracy is limited by the completeness of the pre-set rules.
[0005] Artificial intelligence technology has shown significant advantages in image feature classification, but existing methods have obvious technical limitations: deep learning models have excellent classification performance, but lack interpretability and are difficult to understand the decision-making process of the model; traditional machine learning methods have some interpretability, but it is difficult to effectively integrate the complex relationships of multi-modal features. In particular, for multi-modal magnetic resonance image features with high similarity and complexity, existing classification techniques have deficiencies in both accuracy and interpretability.
[0006] Therefore, it is necessary to design an interpretable magnetic resonance image feature classification method based on XGBoost classification tree to solve the above technical problems. SUMMARY
[0007] In order to solve the problems of accuracy and interpretability of multi-modal magnetic resonance image feature classification, the application provides an interpretable magnetic resonance image classification method and system based on XGBoost classification tree, which combines multi-modal image feature scoring rules with XGBoost model, and optimizes model hyperparameters by using particle swarm optimization algorithm PSO, thereby improving the accuracy and interpretability of feature classification.
[0008] One aspect of the application provides an interpretable magnetic resonance image classification method based on XGBoost classification tree, comprising: S1, obtaining a three-dimensional abdominal magnetic resonance imaging data set, and extracting multi-dimensional image features of a target region; S2, based on multi-modal image feature scoring rules, rating the multi-dimensional image features of each sample, and calculating the comprehensive feature score of each sample according to the rating result as the standardized feature score data; in the application, the multi-modal image feature scoring rule is preferably the CCLS classification criterion; S3, splicing the multi-dimensional image features and the corresponding standardized feature score data to obtain spliced features; S4, taking the spliced features as input, optimizing the hyperparameters of the XGBoost model by using the particle swarm algorithm PSO, and using the optimized XGBoost model to classify the spliced features to obtain a classification result containing a decision path.
[0009] Further, the three-dimensional abdominal magnetic resonance imaging data set comprises: a T2 weighted image, a cortex medulla enhancement image, an in-phase T1 weighted image, an anti-phase T1 weighted image, a delay enhancement image, an arterial enhancement image, a diffusion weighted image DWI and an apparent diffusion image ADC.
[0010] Further, S2, as the standardized feature score data, comprises: quantitatively processing and hierarchically encoding the multi-dimensional image features of each sample to obtain a quantized feature vector Vi; and performing weighted calculation on the quantized feature vector Vi to obtain the comprehensive feature score of each sample.
[0011] Further, the quantitatively processing and hierarchically encoding the multi-dimensional image features of each sample to obtain a quantized feature vector V i comprises: obtaining the pixel signal intensity values of the target region and the reference region in the T2 weighted image, calculating the signal intensity ratio RT2 of the two, and mapping RT2 to three discrete levels according to a preset threshold: when RT2<0.8, it is marked as level 1, when 0.8≤RT2≤1.2, it is marked as level 2, and when RT2>1.2, it is marked as level 3, to obtain a feature vector v1; in the application, the reference region is preferably a renal cortex region;
[0012] extracting the signal intensity value CMP target of the target region in the cortex medulla enhancement image target, the signal intensity value of the reference region in the cortex medulla phase enhanced image CMP ref and the signal intensity value of the reference region in the unenhanced image Pre ref , calculate the enhancement degree index:
[0013] According to the calculation result, map P enhance to three levels: P enhance <40% is marked as level 1, 40%≤P enhance ≤70% is marked as level 2, and P enhance >70% is marked as level 3, to obtain the feature vector v2;
[0014] Extract the average signal intensity values S in and S out of the target region in the in-phase T1 weighted image and the anti-phase T1 weighted image, calculate the standard deviations σ in and σ out of the two, when the condition (S in -S out )>(σ in +σ out ) is met, output the binary label 1, otherwise output the label 0, to obtain the feature vector v3;
[0015] Extract the signal intensity distribution matrices M cm and M delay of the same target region in the cortex medulla phase enhanced image and the delay phase enhanced image respectively, calculate the enhancement difference value ΔS(i,j)=M delay (i,j)-M cm (i,j) for each pixel position (i,j), when there is a pixel set that meets the condition M cm (i,j)>T high and M delay (i,j)<T low , or M cm (i,j)<T low and M delay (i,j)>T high , output the binary label 1, otherwise output the label 0, wherein T high and T low are preset high and low enhancement thresholds, to obtain the feature vector v4;
[0016] Extract the average signal intensity values S arterial and S delayed of the target region in the arterial phase enhanced image and the delay phase enhanced image, and extract the average signal intensity value Pre target of the target region in the unenhanced image, calculate the ratio When R phaseoutput a binary label 1 when S
[0017] extracting signal intensity values S 2 and apparent diffusion coefficient values S DWI in the target region of the DWI image (b = 800 s / mm ADC output a binary label 1 when S DWI exceeds a preset high signal threshold T DWI,high and S ADC is lower than a preset low signal threshold T ADC,low , otherwise output a label 0, to obtain a feature vector v6.
[0018] constructing a quantitative feature vector V = [v1, v2, v3, v4, v5, v6], where v1 is the T2 signal intensity level value, v2 is the enhancement degree level value, and v3 to v6 are binary labels of signal intensity change feature, enhancement inversion feature, phase enhancement ratio feature, and diffusion characteristics, respectively.
[0019] Further, the quantitative feature vector Vi is calculated by weighting to obtain the comprehensive feature score of each sample, including: constructing a quantitative feature vector V = [v1, v2, v3, v4, v5, v6]; mapping the quantitative feature vector V to an integer score value of 1 to 5, wherein the integer score value represents the feature significance level; specifically, first, according to v1 (T2 signal intensity level), the samples are divided into three categories: high signal (level 3), equal signal (level 2), and low signal (level 1), each category is further combined with v2 (enhancement degree level: obvious enhancement > 70% corresponds to level 3, moderate enhancement 40-70% corresponds to level 2, and mild enhancement < 40% corresponds to level 1) for comprehensive evaluation, and the binary features (signal intensity change feature, enhancement inversion feature, phase enhancement ratio feature, and diffusion characteristics) of v3 to v6 are integrated to establish a mapping relationship between feature combination and score value: when v1 = 3 and v2 = 3 and v3 to v6 are all 1, the score value is 5; when v1 = 3 and v2 ≥ 2 and at least 3 of v3 to v6 are 1, the score value is 4; when v1 ≥ 2 and v2 ≥ 2 and at least 2 of v3 to v6 are 1, the score value is 3; when v1 ≥ 1 and v2 ≥ 1 and at least 1 of v3 to v6 is 1, the score value is 2; and the rest of the cases are assigned a score value of 1; the integer score value is converted to a continuous value in the interval of 0 to 1 through linear transformation, and the conversion formula is: Score = (score value - 1) / 4, which is used as the comprehensive feature score of each sample.
[0020] Further, S4, obtaining a classification result containing a decision path, comprising: constructing an objective function of an XGBoost model; the objective function comprises a cross-entropy loss function and a regularization loss function; performing global search in the hyperparameter space of the XGBoost model by using a particle swarm optimization algorithm PSO to obtain an optimal hyperparameter combination; optimizing the XGBoost model according to the optimal hyperparameter combination; and classifying the spliced features by using the optimized XGBoost model to output a classification result containing a decision path. The objective function expression is as follows: wherein, represents the cross-entropy loss function, and Ω(f) represents the regularization loss function.
[0021] Further, the cross-entropy loss function expression is as follows:
[0022] wherein, i represents a sample index, N represents a total number of samples, y i is a true label of the i-th sample, taking a value of 0 or 1; p i is a prediction probability of the i-th sample by the model.
[0023] Further, the sample belonging to the target image feature probability expression is as follows: wherein, f(x i ) represents a prediction value of the sample x i by the model.
[0024] Further, the regularization loss function expression is as follows: wherein, γ represents a weight for controlling the number of leaf nodes, T represents a total number of leaf nodes, λ represents a regularization coefficient of the weight, and w j represents a weight of the j-th leaf node.
[0025] Compared with the prior art, the application has the following advantages:
[0026] The multi-modal nuclear magnetic resonance image contains complex imaging feature information, and the prior art usually quantizes the features by using a fixed scoring rule, which is difficult to adapt to the feature differences and complex feature distribution of different samples. The application standardizes the multi-modal image feature scoring rule and maps it to a continuous value in the interval of 0 to 1, effectively enhancing the flexibility and adaptability of feature representation.
[0027] The application innovatively uses the scoring rule as prior knowledge and splices it with the original multi-dimensional image features to construct a knowledge-guided feature space. This feature fusion strategy fully utilizes the advantages of prior knowledge and data-driven methods, so that the XGBoost classification model can learn complex patterns in the data and retain the explainability based on rules.
[0028] By using particle swarm optimization (PSO) to globally optimize the hyperparameters of the XGBoost model, the subjectivity and local optimization problem of manual parameter tuning are avoided, and the classification performance of the model is significantly improved. At the same time, the decision tree structure of the XGBoost model itself makes the classification process transparent and traceable, and each classification decision can be explained through the decision path, meeting the requirement of explainability of the classification results. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 is a flowchart of an explainable magnetic resonance image classification method based on an XGBoost classification tree according to the present application;
[0030] Figure 2 is a flowchart based on the CCLS classification criterion in the present application;
[0031] Figure 3 is a CCLS modified classification tree obtained by XGBoost in the present application;
[0032] Figure 4 is a comparison diagram of the first fold ROC curve of CCLS and the XGBoost modified CCLS on the target region in the present application;
[0033] Figure 5 is a comparison diagram of the second fold ROC curve of CCLS and the XGBoost modified CCLS on the target region in the present application;
[0034] Figure 6 is a comparison diagram of the third fold ROC curve of CCLS and the XGBoost modified CCLS on the target region in the present application;
[0035] Figure 7 is a comparison diagram of the fourth fold ROC curve of CCLS and the XGBoost modified CCLS on the target region in the present application;
[0036] Figure 8 is a comparison diagram of the fifth fold ROC curve of CCLS and the XGBoost modified CCLS on the target region in the present application;
[0037] Figure 9 is a first fold feature modification importance diagram obtained by XGBoost in the present application;
[0038] Figure 10 is a second fold feature modification importance diagram obtained by XGBoost in the present application;
[0039] Figure 11 is a third fold feature modification importance diagram obtained by XGBoost in the present application;
[0040] Figure 12This is the fourth feature importance map modified by XGBoost in this application;
[0041] Figure 13 This is the fifth feature importance map obtained through XGBoost in this application. Detailed Implementation
[0042] The present application will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0043] Example 1
[0044] This application includes the following steps:
[0045] S1, Feature extraction of three-dimensional abdominal magnetic resonance imaging data;
[0046] Based on prior knowledge and the definition criteria of the kidney region, feature selection was performed on the original three-dimensional peritoneal magnetic resonance imaging data, such as feature selection on T2 and DWI modalities. The target region was found by screening slices, and the target and surrounding renal cortical tissue were selected. The intensity values of the corresponding positions were measured and compared to form effective features that distinguish the target. At the same time, the presence of phenomena such as diffusion restriction and micro-fat in the radiomics features was observed and recorded.
[0047] S2, combining the CCLS scoring rules, based on the image features obtained in step S1, the target image feature rating and likelihood score are obtained;
[0048] like Figure 2 The diagram illustrates the feature scoring process based on the CCLS classification criterion. The multidimensional image features of each sample are quantized and hierarchically encoded: the signal intensity ratio RT2 between the target region and the reference region is calculated based on the T2-weighted image, and mapped to a three-level discrete rank value according to preset thresholds (RT2<0.8, 0.8≤RT2≤1.2, RT2>1.2), resulting in the feature vector v1; the enhancement index P is calculated based on the corticomedullary enhancement image. enhance According to the preset interval (P) enhance <40% , 40% ≤ P enhance ≤70%, P enhance >70%) is mapped to three discrete level values to obtain feature vector v2; the signal intensity change features of in-phase and out-of-phase T1 weighted images, the enhancement reversal features of cortico-medullary phase and delayed phase enhanced images, the enhancement ratio features of arterial phase and delayed phase, and the diffusion characteristics of DWI / ADC are calculated respectively. Binary labels are generated according to the corresponding judgment criteria to obtain feature vectors v3 to v6.
[0049] A quantitative feature vector V = [v1, v2, v3, v4, v5, v6] is constructed, and a mapping relationship between feature combinations and score values is established: when v1 = 3 and v2 = 3 and v3 to v6 are all 1, a score value of 5 is assigned, indicating that all features present high significance; when v1 = 3 and v2 ≥ 2 and at least 3 of v3 to v6 are 1, a score value of 4 is assigned; when v1 ≥ 2 and v2 ≥ 2 and at least 2 of v3 to v6 are 1, a score value of 3 is assigned; when v1 ≥ 1 and v2 ≥ 1 and at least 1 of v3 to v6 is 1, a score value of 2 is assigned; and the rest is assigned a score value of 1;
[0050] The integer score value is converted into a continuous value in the interval of 0 to 1 through linear transformation, and the conversion formula is: Score = (score value - 1) / 4, to obtain a standardized comprehensive feature score. The score reflects the comprehensive significance degree of multi-dimensional image features, and the closer the value is to 1, the higher the significance of the feature combination, and the closer the value is to 0, the lower the significance of the feature combination. For example, in the embodiment, when the target region presents high T2 signal intensity (v1 = 3), obvious enhancement (v2 = 3), significant signal intensity change (v3 = 1), existence of enhancement reversal (v4 = 1), high phase enhancement ratio (v5 = 1) and diffusion limitation (v6 = 1), a score value of 5 is obtained, and the converted comprehensive feature score is 1.0, indicating that the image feature combination of the sample has the highest significance.
[0051] For example, in the embodiment, the target image features include three categories of high enhancement type image features, medium enhancement type image features and low enhancement type image features, which correspond to different imaging performance modes. The high enhancement type image features usually present multiple features such as T2 high signal, obvious enhancement in cortex and medulla, existence of signal intensity change, enhancement reversal, high phase enhancement ratio and diffusion limitation; the medium enhancement type image features present some but not all of the features; and the low enhancement type image features do not present the above features or only present individual features. Through the method, accurate classification and quantitative evaluation of different enhancement type image features can be realized.
[0052] S3, combining the target image features extracted in step S1 and the CCLS likelihood score obtained in step S2 as the overall input features;
[0053] First, the CCLS likelihood score of each user is taken as a new image numerical feature x ccls The original image features x image are spliced with them user by user to form a new feature set X New The new features are taken as the input of the model.
[0054] S4, input the spliced features into XGBoost for classification training, use particle swarm optimization algorithm PSO for optimization, and perform data-driven classification rule correction;
[0055] Based on the data set obtained in step S3 as the input of the model, the model is trained through a composite loss function composed of a cross-entropy loss function and a regularization loss function, and the model hyperparameters are optimized based on the particle swarm optimization algorithm PSO, so as to realize accurate diagnosis of the target image features.
[0056] S401, for a given abdominal cavity data set which includes N extracted three-dimensional abdominal cavity magnetic resonance image multi-modal target features. Each set of features is represented by a pair and y i , wherein, represents the spliced features, y i is 0 or 1 representing the true class. The prior loss function for diagnosing the target image features is defined as: wherein, is a cross-entropy loss function, and Ω(f) is a regularization loss function.
[0057] Further, the cross-entropy loss function used is calculated by iterative optimization of the model prediction error, aiming to significantly reduce the prediction error and thus improve the prediction accuracy of the model. In specific implementation, a loss function in the form of a second-order Taylor expansion is used to perform accurate gradient optimization of the model prediction. This method not only improves the classification effect based on a data-driven method, but also guarantees the interpretability of the model. The specific form is as follows:
[0058] wherein, the i-th sample, there are N samples in total, and n represents the total number of samples, represents a cross-entropy loss function, y i is the true label of the i-th sample, taking values of 0 or 1. represents the probability that the sample belongs to the target image features, f(x i ) represents the predicted value of the model for the sample x i .
[0059] Further, the regularization loss function adopted aims to reduce the risk of overfitting and improve the generalization ability of the model by considering the fitting error and complexity of the model. In model training, the regularization term can suppress overly complex model structures and reduce unnecessary noise effects, thereby enhancing the prediction stability of the model for unknown data. Specifically, the regularization objective function not only effectively constrains the gradient of misclassification, making the optimization direction more accurate, but also limits the model complexity (such as the number of leaf nodes and weights) to ensure that the model captures key features of the data without overfitting the training data. In addition, the introduction of the regularization term also improves the adaptability of the model to different data sets, significantly reduces the error rate, and enhances the confidence prediction ability for new data. The specific form is as follows:
[0060] where γ represents the weight controlling the number of leaf nodes, T represents the total number of leaf nodes. λ represents the regularization coefficient of the weight, w j represents the weight of the jth leaf node.
[0061] Further, in the specific gradient boosting tree, the form of the loss function can be further represented by the second-order Taylor expansion as follows:
[0062] where, represents the first derivative (gradient) of the loss function, represents the second derivative of the loss function.
[0063] S402, combine the corresponding loss function and particle swarm optimization algorithm to train the XGBoost model and obtain the modified decision tree. According to the five-fold cross-validation principle, all data is equally divided into five parts, and training and testing are performed five times to obtain the decision tree model for each fold. In each training and testing, four parts of the three-dimensional abdominal cavity image data, i.e., 80%, are selected for training, and the remaining 20% of the image data are tested.
[0064] Further, in the XGBoost model training process, the particle swarm optimization algorithm is used for optimization. The goal is to find the best combination of hyperparameters by searching the hyperparameter space globally, thereby improving the performance of the model. Specifically, the particle swarm optimization algorithm optimizes hyperparameters (learning rate, maximum depth, and sub-sample sampling ratio) to enable the model to accurately fit the training data while reducing the risk of overfitting and improving the generalization ability of the model. Through exploration of the hyperparameter space, the particle swarm optimization algorithm can continuously adjust the position of particles in each generation, thereby effectively improving the prediction accuracy and stability of the XGBoos model. At the same time, the particle swarm optimization algorithm also introduces randomness in the optimization process, helping the model maintain good adaptability when facing complex data and avoiding excessive dependence on specific training data patterns.
[0065] Furthermore, this method plays a crucial role in balancing the model's fitting and generalization abilities, enabling XGBoost to not only capture key features when processing image data such as target image features, but also enhance its predictive capabilities for new user data. The introduction of particle swarm optimization makes the XGBoost model more robust, effectively handling various uncertainties and providing more accurate classification results.
[0066] S403, output the prediction result based on the obtained corrected decision tree. It should be noted that there is a certain negative correlation between the number of decision trees and model interpretability; as the number of decision trees increases, model complexity increases, and interpretability decreases accordingly. To balance model performance and interpretability, this application tested the impact of the number of decision trees on model performance through comparative experiments.
[0067] Example 2
[0068] S1, Feature extraction of three-dimensional abdominal magnetic resonance imaging data;
[0069] Based on the prior knowledge of clinicians and the definition criteria of the kidney region, feature selection was performed on the original three-dimensional peritoneal magnetic resonance imaging data, such as feature selection on T2 and DWI modalities. The location of lesions was found by screening slices, and the tumor and surrounding renal cortical tissue were selected. The intensity values of the corresponding locations were measured and compared to form effective features to distinguish tumors. At the same time, the presence of radiomic features such as diffusion restriction and micro-fat was observed and recorded.
[0070] S2, combining the CCLS scoring rules, and based on the image features obtained in step S1, the rating and likelihood score of clear cell renal cell carcinoma are obtained;
[0071] like Figure 2 The diagram illustrates the feature scoring process based on the CCLS classification criteria. The CCLS scoring rules specifically utilize the imaging features obtained in step S1 (including T2 signal intensity, corticomedullary enhancement, presence of microfat, segmental enhancement reversal, arterial / delayed phase enhancement ratio, and diffusion restriction) to grade and assign values to each indicator. The scoring range is typically 1 to 5 points, with higher values indicating a greater likelihood of clear cell renal cell carcinoma. Specifically, if the lesion exhibits typical features such as high T2 signal intensity with significant enhancement, positive microfat, enhancement reversal, and significant diffusion restriction, it is more likely to receive a score of 4 or 5, suggesting a high suspicion or near-confirmation of clear cell renal cell carcinoma. Conversely, if the overall features are atypical, the score will be lower, requiring further clinical and imaging examinations. The grading score can be converted into a likelihood value, indicating the probability that the grading would be classified as clear cell renal cell carcinoma.
[0072] S3, combine the tumor image features extracted in step S1 with the CCLS likelihood scores obtained in step S2 as the overall input features;
[0073] First, the CCLS likelihood score of each user is taken as a new image numerical feature x ccls The original image feature x image is then spliced with it on a user-by-user basis to form a new feature set X New The new feature is taken as the input of the model.
[0074] S4, input the spliced features to XGBoost for classification training, and use the particle swarm optimization algorithm to optimize and correct the data-driven classification rules.
[0075] Based on the data set obtained in step S3 as the input of the model, the model is trained through a composite loss function composed of a cross-entropy loss function and a regularization loss function, and the model hyperparameters are optimized based on the particle swarm optimization algorithm to achieve accurate diagnosis of renal clear cell carcinoma.
[0076] S401, for a given abdominal cavity data set which includes N extracted three-dimensional abdominal cavity magnetic resonance image multi-modal target features. Each set of features is represented by a pair and y i , where represents the spliced features, y i is 0 or 1 representing the true class. The prior loss function of the diagnostic target image feature is defined as: where is the cross-entropy loss function, and Ω(f) is the regularization loss function.
[0077] Further, the cross-entropy loss function adopted is calculated by iterative optimization to significantly reduce the prediction error, thereby improving the prediction accuracy of the model. In specific implementation, a loss function in the form of a second-order Taylor expansion is used to accurately optimize the gradient of the model's prediction. This method not only improves the classification effect based on a data-driven method, but also ensures the interpretability of the model. The specific form is as follows:
[0078] where the i-th sample has N samples, n represents the total number of samples, represents the cross-entropy loss function, y i is the true label of the i-th sample, taking values of 0 or 1. represents the probability that the sample belongs to the target image feature, f(x i ) represents the predicted value of the model for the sample x i .
[0079] Further, the regularization loss function adopted aims to reduce the risk of overfitting and improve the generalization ability of the model by considering the fitting error and complexity of the model. In model training, the regularization term can suppress the overly complex model structure and reduce unnecessary noise effects, thereby enhancing the prediction stability of the model for unknown data. Specifically, the regularization objective function not only effectively constrains the gradient of misclassification, making the optimization direction more accurate, but also limits the model complexity (such as the number of leaf nodes and weights) to ensure that the model captures key features of the data without overfitting the training data. In addition, the introduction of the regularization term also improves the adaptability of the model to different data sets, significantly reduces the error rate, and enhances the confidence prediction ability for new data. The specific form is as follows:
[0080] where γ represents the weight controlling the number of leaf nodes, T represents the total number of leaf nodes. λ represents the regularization coefficient of the weight, w j represents the weight of the jth leaf node.
[0081] Further, in the specific gradient boosting tree, the form of the loss function can be further represented by the second-order Taylor expansion as follows:
[0082] where, represents the first derivative (gradient) of the loss function, represents the second derivative of the loss function.
[0083] S402, combine the corresponding loss function and particle swarm optimization algorithm to train the XGBoost model and obtain the modified decision tree. According to the five-fold cross-validation principle, all data are equally divided into five parts, and training and testing are performed five times to obtain the decision tree model of each fold. Among them, in each training and testing, four parts of the three-dimensional abdominal cavity image data, i.e. 80%, are selected for training, and the remaining 20% of the image data are tested.
[0084] Further, in the XGBoost model training process, the particle swarm optimization algorithm is adopted for optimization. The goal is to find the best combination of hyperparameters by searching the hyperparameter space globally, thereby improving the performance of the model. Specifically, the particle swarm optimization algorithm optimizes the hyperparameters (learning rate, maximum depth, and sub-sample sampling ratio) to enable the model to accurately fit the training data while reducing the risk of overfitting and improving the generalization ability of the model. Through exploration of the hyperparameter space, the particle swarm optimization algorithm can continuously adjust the position of the particles in each generation, thereby effectively improving the prediction accuracy and stability of the XGBoos model. At the same time, the particle swarm optimization algorithm also introduces randomness in the optimization process, helping the model to maintain good adaptability when facing complex data and avoiding excessive dependence on specific training data patterns.
[0085] Further, the method plays a key role in balancing the fitting ability and generalization ability of the model, enabling XGBoost to not only capture key features but also enhance the prediction ability for new case data when dealing with medical image data such as renal clear cell carcinoma. The introduction of the particle swarm optimization algorithm makes the XGBoost model more robust and can effectively handle various uncertainties to provide more accurate classification results.
[0086] S403, output a prediction result according to the obtained modified decision tree. It should be particularly noted that there is a certain negative correlation between the number of decision trees and the model interpretability. With the increase of the number of decision trees, the model complexity is improved, and the corresponding interpretability is reduced. To balance the model performance and interpretability, the present application tests the influence of the number of decision trees on the model performance through comparative experiments.
[0087] Further, Figure 3 The CCLS modified classification tree structure trained by the XGBoost algorithm is shown. The hierarchical structure of the decision tree is fully shown in the figure, including the root node, internal node and leaf node. Each decision node is marked with specific judgment conditions and branch rules, such as the key judgment threshold "skin medulla period ≤2", "ADER ≥1.5", etc. The leaf node gives the final classification result and confidence. Based on 2 and 12 decision trees, the test results are shown in Tables 1 and 2, using ACC and AUC as evaluation indexes. Experimental data show that the explainable target image feature classification and correction method based on XGBoost classification tree proposed in the present application can achieve better performance compared with the uncorrected CCLS scoring rule. Adjusting the number of decision trees of XGBoost can obtain different classification results, and the more the number, the better the classification effect. Specifically, when the number of decision trees is 12, the average accuracy of the model on the test set reaches 87.14%, and the AUC value is 91.05%, which is significantly improved compared with the model performance of 2 decision trees.
[0088] Table 1 Precision comparison of corrected CCLS and uncorrected CCLS when the number of decision trees is 2
[0089]
[0090]
[0091] Table 2 Precision comparison of corrected CCLS and uncorrected CCLS when the number of decision trees is 12
[0092] Model Fold1 Fold2 Fold3 Fold4 Fold5 Avg XGBoost (acc / auc) 81.81 / 83.83 84.85 / 90.98 90.91 / 96.11 93.75 / 96.83 84.38 / 87.50 87.14 / 91.05 CCLS (acc / auc) 75.75 / 80.45 78.78 / 89.09 87.87 / 91.29 93.75 / 96.82 78.13 / 85.31 82.85 / 88.59
[0093] Figures 4 to 8The performance difference between the modified method and the original CCLS classification criterion is intuitively displayed by the ROC curve comparison chart. The chart contains the ROC curves of each fold of five-fold cross-validation and the average curve, and marks the AUC value and other key indicators. The experimental data shows that the average AUC of the method reaches 0.94, which is significantly improved compared with the original CCLS method.
[0094] Figures 9 to 13 The feature importance ranking result output by the XGBoost model is displayed. The chart adopts a bar chart form, arranges the features according to the feature gain value from high to low, and clearly shows the contribution of each feature to the classification result. Among them, the T2 signal intensity and micro fat content and other features show higher diagnostic value.
[0095] The above has described the application creation and its implementation mode in a schematic manner, which is not restrictive, and the application can be realized in other specific forms without departing from the spirit or essential characteristics of the application. The embodiment shown in the drawings is only one of the embodiments of the application creation, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired thereby, without departing from the spirit of the application, similar structural forms and embodiments can be designed without creative design, which shall belong to the protection scope of the application. In addition, the word "comprising" does not exclude other elements or steps, and the word "one" before an element does not exclude the inclusion of "multiple" elements. The words "first", "second" and the like are used to indicate names, and do not mean any specific order.
Claims
1. An interpretable magnetic resonance image classification method based on XGBoost classification trees, characterized in that, The method comprises the following steps: S1, acquiring a three-dimensional abdominal magnetic resonance imaging data set, and extracting multi-dimensional image features of a target region; S2, based on a multi-modal image feature scoring rule, rating the multi-dimensional image features of each sample, and calculating a comprehensive feature score of each sample as standardized feature score data according to the rating results; S3, splicing the multi-dimensional image features and the corresponding standardized feature score data to obtain spliced features; S4, taking the spliced features as input, optimizing the hyperparameters of the XGBoost model using the particle swarm optimization (PSO) algorithm, and using the optimized XGBoost model to classify the spliced features to obtain a classification result containing a decision path.
2. The interpretable magnetic resonance image classification method based on the XGBoost classification tree according to claim 1, wherein the three-dimensional abdominal magnetic resonance imaging data set comprises a T2-weighted image, a cortex-medulla enhancement image, an in-phase T1-weighted image, an anti-phase T1-weighted image, a delay enhancement image, an arterial enhancement image, a diffusion-weighted image (DWI), and an apparent diffusion image (ADC).
3. The interpretable magnetic resonance image classification method based on the XGBoost classification tree according to claim 2, wherein S2 comprises the following steps: quantifying and hierarchically encoding the multi-dimensional image features of each sample to obtain a quantized feature vector Vi; performing weighted calculation on the quantized feature vector Vi to obtain a comprehensive feature score of each sample.
4. The interpretable magnetic resonance image classification method based on the XGBoost classification tree according to claim 3, wherein obtaining the quantized feature vector Vi comprises the following steps: based on the T2-weighted image, calculating a signal intensity ratio of the target region to a reference region, mapping the signal intensity ratio to a multi-level discrete level value according to a preset hierarchical threshold to obtain a feature vector v1; based on the cortex-medulla enhancement image, calculating an enhancement degree index of the target region relative to the reference region, mapping the enhancement degree index to a multi-level discrete level value according to a preset hierarchical interval to obtain a feature vector v2; respectively calculating signal intensity change features of the target region in the in-phase T1-weighted image and the anti-phase T1-weighted image, generating a binary label according to a preset judgment criterion to obtain a feature vector v3; respectively extracting signal intensity distribution features of the target region in the cortex-medulla enhancement image and the delay enhancement image, generating a binary label according to a preset inversion judgment criterion to obtain a feature vector v4; respectively extracting average signal intensities of the target region in the delay enhancement image and the arterial enhancement image, calculating the ratio of the two, and generating a binary label according to a preset threshold to obtain a feature vector v5; based on the diffusion-weighted image (DWI) and the apparent diffusion image (ADC), calculating the diffusion signal intensity and the apparent diffusion coefficient of the target region, and generating a binary label according to a preset judgment criterion to obtain a feature vector v6.
5. The interpretable magnetic resonance image classification method based on the XGBoost classification tree according to claim 3, wherein The comprehensive feature score of each sample is obtained, including: A quantitative feature vector V = [v1, v2, v3, v4, v5, v6] is constructed; The quantitative feature vector V is mapped to an integer score value of 1 to 5, wherein the integer score value represents the feature significance level; The integer score value is converted to a continuous value in the interval of 0 to 1 as the comprehensive feature score of each sample.
6. The interpretable magnetic resonance image classification method based on XGBoost classification tree according to claim 2, characterized in that: S4, obtaining a classification result containing a decision path, including: Constructing an objective function of the XGBoost model; the objective function includes a cross-entropy loss function and a regularization loss function; Using the particle swarm algorithm PSO to perform global search in the hyperparameter space of the XGBoost model to obtain an optimal hyperparameter combination; Optimizing the XGBoost model according to the optimal hyperparameter combination; Using the optimized XGBoost model to classify the spliced features and output a classification result containing a decision path. The objective function expression is as follows: wherein, represents a cross-entropy loss function, and Ω(f) represents a regularization loss function.
7. The interpretable magnetic resonance image classification method based on XGBoost classification tree according to claim 6, characterized in that: The cross-entropy loss function expression is as follows: where i represents a sample index, N represents a total number of samples, y i is a true label of the i-th sample, taking a value of 0 or 1; p i is a prediction probability of the model on the i-th sample.
8. The interpretable magnetic resonance image classification method based on XGBoost classification tree according to claim 7, characterized in that: The sample belongs to the target image feature probability expression is as follows: Wherein, f(x i ) is expressed as the predicted value of the model to the sample x i .
9. The interpretable magnetic resonance image classification method based on XGBoost classification tree according to claim 7, characterized in that: The regularization loss function expression is as follows: wherein γ represents a weight for controlling the number of leaf nodes, T represents the total number of leaf nodes; λ represents a regularization coefficient of the weight, w j represents the weight of the jth leaf node.
10. An interpretable magnetic resonance image classification system based on XGBoost classification trees, characterized in that, Including: A data acquisition module acquires a three-dimensional abdominal magnetic resonance imaging data set and extracts multi-dimensional image features of a target region; A feature scoring module rates the multi-dimensional image features of each sample based on multi-modal image feature scoring rules and calculates the comprehensive feature score of each sample as standardized feature score data according to the rating results; A feature splicing module splices the multi-dimensional image features with the corresponding standardized score data to obtain spliced features; A classification processing module takes the spliced features as input, optimizes the hyperparameters of the XGBoost model using the particle swarm algorithm PSO, and classifies the spliced features using the optimized XGBoost model to obtain a classification result containing a decision path.