LightGBM breast cancer prediction method and system based on WOA-SHAP feature selection

Through WOA-SHAP feature selection and LightGBM model optimization, the high misdiagnosis rate and low sensitivity problems of traditional breast cancer diagnosis were solved, and efficient and accurate detection of early breast cancer was achieved.

CN120674034APending Publication Date: 2025-09-19GUANGZHOU UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510760898.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Traditional breast cancer diagnostic technology has the risks of radiation exposure, high cost, high misdiagnosis and missed diagnosis rates, and especially insufficient sensitivity and specificity in the diagnosis of early breast cancer.

Method used

A LightGBM model based on WOA-SHAP feature selection was adopted. The whale optimization algorithm was used to fuse SHAP values ​​for feature selection. The particle swarm optimization algorithm was used to optimize hyperparameters to construct a breast cancer prediction system, including data preprocessing, feature selection, model training and evaluation.

Benefits of technology

The accuracy of early breast cancer detection is improved, the interference of noise and irrelevant features is reduced, and the training efficiency and performance of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120674034A_ABST
    Figure CN120674034A_ABST
Patent Text Reader

Abstract

The invention discloses a Light GBM breast cancer prediction method and system based on WOA-SHAP feature selection, and the method comprises the steps: extracting cell nucleus features in a digital image through a data set preprocessing module in the system, and carrying out the data preprocessing of a feature value; the data set division module divides the feature data set into a training set and a test set; the data set equalization module carries out equalization processing on the feature data set; the feature selection module performs feature selection on features by fusing SHAP values based on a whale optimization algorithm; the LightGBM model training module is used for training a LightGBM model on the basis of the feature subsets after feature selection; the LightGBM model optimization module optimizes hyper-parameters of the model based on a particle swarm optimization algorithm; the model evaluation module performs effect evaluation on the trained model; and the prediction module performs prediction based on the trained LightGBM model. According to the method, the most influential feature can be effectively identified, and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of LightGBM model prediction technology, and in particular to a LightGBM breast cancer prediction method and system based on WOA-SHAP feature selection. Background Art

[0002] Traditional breast cancer diagnostic techniques, such as mammography, ultrasound, and magnetic resonance imaging (MRI), despite their widespread clinical use, still have limitations, including radiation exposure, high costs, and high rates of misdiagnosis and missed diagnosis. Furthermore, the sensitivity and specificity of traditional techniques for diagnosing early-stage breast cancer, particularly in small tumors or in patients with high breast density, still need to be improved. Summary of the Invention

[0003] In order to overcome the defects and shortcomings of the existing technology, the present invention provides a LightGBM breast cancer prediction method and system based on WOA-SHAP feature selection. By combining WOA-SHAP for feature selection, the present invention can effectively identify the most influential features for breast cancer diagnosis, reduce the interference of noise and irrelevant features, and combine with the LightGBM model, which can process complex data patterns and improve the accuracy of early breast cancer detection.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] The present invention provides a LightGBM breast cancer prediction system based on WOA-SHAP feature selection, comprising: a data set preprocessing module, a data set partitioning module, a data set equalization module, a feature selection module, a LightGBM model training module, a LightGBM model optimization module, a model evaluation module, and a prediction module;

[0006] The data set preprocessing module is used to extract cell nucleus features in digital images and perform data preprocessing on feature values;

[0007] The data set partitioning module is used to partition the feature data set into a training set and a test set;

[0008] The data set equalization module is used to perform equalization processing on the feature data set;

[0009] The feature selection module is used to select features based on the whale optimization algorithm and the SHAP value;

[0010] The LightGBM model training module is used to train the LightGBM model based on the feature subset after feature selection;

[0011] The LightGBM model optimization module is used to optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm;

[0012] The model evaluation module is used to evaluate the effect of the trained LightGBM model;

[0013] The prediction module is used to input the features after feature selection into the trained LightGBM model for prediction and output the LightGBM model prediction results.

[0014] As a preferred technical solution, the data set preprocessing module is used to extract cell nucleus features in digital images and perform data preprocessing on feature values, specifically including:

[0015] Cell nucleus features were extracted from digital images of breast tumors obtained by fine needle aspiration. Real-valued features were calculated for each cell nucleus, and all feature values ​​were processed by minimum-maximum normalization method.

[0016] As a preferred technical solution, the feature selection module is used to select features based on the whale optimization algorithm and the SHAP value, specifically including:

[0017] Initialize the whale position matrix, where each individual whale represents a feature subset;

[0018] Calculate the fitness of the initial whale group;

[0019] The whale with the highest fitness in the current whale group is recorded as X*;

[0020] The hunting strategy of mobbing prey and spiraling movements simulates the searching and exploratory behavior of whales;

[0021] For each characteristic position of each whale individual, use the Sigmoid function to convert it to 0 or 1;

[0022] Calculate the fitness of each whale and update X* if there is a higher fitness;

[0023] Repeat the iteration until the feature subset corresponding to the maximum fitness is returned.

[0024] As a preferred technical solution, the fitness of the initial whale group is calculated, which is specifically expressed as:

[0025] fitness=α·SHAP Mean-β·MR-γ·L 2,1 (W)

[0026]

[0027] Among them, α, β, and γ represent the corresponding weight parameters, SHAP irepresents the SHAP value of the i-th feature, j represents a leaf node, F represents the leaf node set, S j is the feature subset that appears in leaf node j, P is S j A subset of L j is the path length from the root node to the leaf node j, W(|P|,j) represents the proportion of all subsets of P in the leaf node j, and represent the proportion of subsets including and excluding feature i, ν j is the output value of leaf node j, I represents the feature set, l represents the size of feature set I, MR represents the redundancy, and ρ(i,j) represents the feature f i and feature f j The Pearson correlation coefficient between i ,f j ) represents the feature f i and feature f j The covariance between Represents feature f i The standard deviation of Represents feature f j The standard deviation of L 2,1 (W) represents the regularization term, m represents the number of samples, and n represents the number of features selected by this whale.

[0028] As a preferred technical solution, a hunting strategy of besieging prey and spiraling motion is adopted to simulate the search and exploration behavior of whales, specifically including:

[0029] In the hunting strategy of mobbing prey:

[0030] A=2a·random(0,1)-a

[0031] Among them, a is a parameter that gradually decreases with iteration, and random(0,1) generates a random number between 0 and 1;

[0032] If |A|<1, then X(t+1)=X(t)-A·|C·X * (t)-X(t)|, C=2random(0,1), perform local search;

[0033] If |A|≥1, then X(t+1)=X rand -A·|C·X rand -X|, C=2random(0,1), perform global search;

[0034] In the spiral hunting strategy:

[0035] X(t+1)=|X *(t)-X(t)|·e bl ·cos(2πl)+X * (t), l = random(-1,1)

[0036] Among them, e bl is the exponential decay factor, cos(2πl) is the periodic motion used to generate the spiral, and b and l are the parameters that control the spiral.

[0037] As a preferred technical solution, the LightGBM model optimization module is used to optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm, specifically including:

[0038] Initialize the parameters of the particle swarm optimization algorithm;

[0039] Initialize the particle's position and velocity;

[0040] Calculate the fitness value of the particle. If the fitness value of the particle is greater than the personal best fitness value, update the historical best position of the particle. If the fitness value of the particle is greater than the global best fitness value, update the global best position.

[0041] Update particle velocity and particle position, and perform boundary check on particle position;

[0042] Iterate until the maximum number of iterations is reached and output the final global optimal position and fitness value.

[0043] As a preferred technical solution, initializing the position and velocity of the particle specifically includes:

[0044] For each particle, randomly initialize its position and velocity;

[0045] Calculate the fitness value of each particle;

[0046] Initialize each particle's personal best position and fitness value;

[0047] Set the global best position and fitness value.

[0048] As a preferred technical solution, the model evaluation module is used to evaluate the effect of the trained LightGBM model, specifically using the following indicators to evaluate the model:

[0049] Accuracy (the ratio of correctly classified samples to the total number of samples), Precision (the ratio of true positive samples in all positive predicted samples), Sensitivity (Recall), Specificity (the ratio of accurately predicted negative samples to the total number of actual negative samples), F-Measure (the harmonic mean of precision and Recall), and ROC curve.

[0050] As a preferred technical solution, the model evaluation module is used to evaluate the effect of the trained LightGBM model, and ten-fold cross validation is used to evaluate the effectiveness of the LightGBM model.

[0051] The present invention also provides a LightGBM breast cancer prediction method based on WOA-SHAP feature selection, which is provided with the above-mentioned LightGBM breast cancer prediction system based on WOA-SHAP feature selection, comprising the following steps:

[0052] Extract cell nucleus features from digital images and perform data preprocessing on feature values;

[0053] Divide the feature dataset into training and test sets;

[0054] Perform equalization on the feature data set;

[0055] Based on the whale optimization algorithm, SHAP value is integrated to perform feature selection;

[0056] Train the LightGBM model based on the feature subset after feature selection;

[0057] Optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm;

[0058] Evaluate the effect of the trained LightGBM model;

[0059] The features after feature selection are input into the trained LightGBM model for prediction, and the prediction results of the LightGBM model are output.

[0060] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0061] (1) By combining WOA-SHAP for feature selection, the present invention can effectively identify the most influential features for breast cancer diagnosis, reduce the interference of noise and irrelevant features, and combine with the LightGBM model, which can process complex data patterns and improve the accuracy of early breast cancer detection.

[0062] (2) The present invention uses SHAP value to evaluate the importance of features and introduces minimum redundancy constraint and L2,1 norm constraint to select the optimal feature subset. It is more sophisticated and efficient than traditional feature selection methods and can better reveal the relationship between features and breast cancer.

[0063] (3) By using the particle swarm optimization algorithm to optimize the hyperparameters of the LightGBM model, the present invention can find the optimal model configuration in a shorter time, thereby improving the efficiency and performance of model training. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 Schematic diagram of the overall architecture of the LightGBM breast cancer prediction system based on WOA-SHAP feature selection in the present invention;

[0065] Figure 2 Schematic diagram of the process of the LightGBM breast cancer prediction method based on WOA-SHAP feature selection of the present invention;

[0066] Figure 3 A schematic diagram of the implementation process of constructing a decision tree based on the histogram algorithm of the present invention;

[0067] Figure 4 This is a schematic diagram of the implementation process of the decision tree using the leaf growth strategy of the present invention. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0069] Example 1

[0070] like Figure 1 As shown, this embodiment provides a LightGBM breast cancer prediction system based on WOA-SHAP feature selection, including: a data set preprocessing module, a data set partitioning module, a data set equalization module, a feature selection module, a LightGBM model training module, a LightGBM model optimization module, a model evaluation module, and a prediction module;

[0071] In this embodiment, the data set preprocessing module is used to extract cell nucleus features in digital images and perform data preprocessing on the feature values;

[0072] Specifically, cell nucleus features were extracted from digital images of breast mass fine needle aspiration, real-valued features were calculated for each cell nucleus, and all feature values ​​were processed by minimum-maximum normalization method;

[0073] In this embodiment, the data set partitioning module is used to partition the feature data set into a training set and a test set;

[0074] In this embodiment, the data set equalization module is used to perform equalization processing on the feature data set;

[0075] In this embodiment, the feature selection module is used to perform feature selection based on the whale optimization algorithm and the SHAP value, specifically including:

[0076] Initialize the whale position matrix, where each individual whale represents a feature subset;

[0077] Calculate the fitness of the initial whale group, specifically expressed as:

[0078] fitness=α·SHAP Mean-β·MR-γ·L 2,1 (W)

[0079]

[0080] Among them, α, β, and γ represent the corresponding weight parameters, SHAP i represents the SHAP value of the i-th feature, j represents a leaf node, F represents the leaf node set, S j is the feature subset that appears in leaf node j, P is S j A subset of L j is the path length from the root node to the leaf node j, W(|P|,j) represents the proportion of all subsets of P in the leaf node j, and Represents the proportion of subsets including and excluding feature i, v j is the output value of leaf node j, I represents the feature set, l represents the size of feature set I, MR represents the redundancy, and ρ(i,j) represents the feature f i and feature f j The Pearson correlation coefficient between i ,f j ) represents the feature f i and feature f j The covariance between Represents feature f i The standard deviation of Represents feature f j The standard deviation of L 2,1 (W) represents the regularization term, m represents the number of samples, and n represents the number of features selected by this whale;

[0081] The whale with the highest fitness in the current whale group is recorded as X*;

[0082] The hunting strategy of mobbing and spiraling motion simulates the search and exploration behavior of whales, including:

[0083] In the hunting strategy of mobbing prey:

[0084] A=2α·random(0,1)-a

[0085] Among them, a is a parameter that gradually decreases with iteration, and random(0,1) generates a random number between 0 and 1;

[0086] If |A|<1, then X(t+1)=X(t)-A·|C·X * (t)-X(t)|, C=2random(0,1), perform local search;

[0087] If |A|≥1, then X(t+1)=X rand -A·|C·X rand -X|, C=2random(0,1), perform global search;

[0088] In the spiral hunting strategy:

[0089] X(t+1)=|X * (t)-X(t)|·e bl ·cos(2πl)+X * (t), l = random(-1,1)

[0090] Among them, e bl is the exponential decay factor, cos(2πl) is the periodic motion used to generate the spiral, and b and l are the parameters that control the spiral;

[0091] For each characteristic position of each whale individual, use the Sigmoid function to convert it to 0 or 1;

[0092] Calculate the fitness of each whale and update X* if there is a higher fitness;

[0093] Repeat the iteration until the feature subset corresponding to the maximum fitness is returned.

[0094] In this embodiment, the LightGBM model training module is used to train the LightGBM model based on the feature subset after feature selection;

[0095] In this embodiment, the LightGBM model optimization module is used to optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm, specifically including:

[0096] Initialize the parameters of the particle swarm optimization algorithm;

[0097] Initialize the position and velocity of the particle, including:

[0098] For each particle, randomly initialize its position and velocity;

[0099] Calculate the fitness value of each particle;

[0100] Initialize each particle's personal best position and fitness value;

[0101] Set the global best position and fitness value.

[0102] Calculate the fitness value of the particle. If the fitness value of the particle is greater than the personal best fitness value, update the historical best position of the particle. If the fitness value of the particle is greater than the global best fitness value, update the global best position.

[0103] Update particle velocity and particle position, and perform boundary check on particle position;

[0104] Iterate until the maximum number of iterations is reached, and output the final global optimal position and fitness value;

[0105] In this embodiment, the model evaluation module is used to evaluate the effect of the trained LightGBM model. Specifically, the following indicators are used to evaluate the model:

[0106] Accuracy (the ratio of correctly classified samples to the total number of samples), Precision (the ratio of true positive samples to all positive predicted samples), Sensitivity (Recall), Specificity (the ratio of accurately predicted negative samples to the total number of actual negative samples), F-Measure (the harmonic mean of precision and Recall), and ROC curve;

[0107] Ten-fold cross validation was used to evaluate the effectiveness of the LightGBM model;

[0108] In this embodiment, the prediction module is used to input the features after feature selection into the trained LightGBM model for prediction and output the prediction results of the LightGBM model.

[0109] Example 2

[0110] like Figure 2 As shown, this embodiment provides a LightGBM breast cancer prediction method based on WOA-SHAP feature selection, including the following steps:

[0111] S1: Obtain breast cancer data sample S and create a data set from the data sample, including:

[0112] S11: Collect breast cancer data samples, which include breast cancer feature data and a label indicating whether the patient has breast cancer. The size of the sample is sample size (N)*(number of features (M)+label value).

[0113] In this embodiment, features are extracted from digital images of fine needle aspiration (FNA) of breast masses, which describe the characteristics of cell nuclei. Ten real-valued features are calculated for each cell nucleus, including: radius (the average distance from the center to each point on the periphery), texture (standard deviation of grayscale values), perimeter, area, smoothness (local variation in radius length), compactness (perimeter^2 / area-1.0), concavity (severity of concave contour), concave points (number of concave contour), symmetry, and fractal dimension ("coastline approximation"-1). The average, standard error, and "worst" or maximum value (the average of the three maximum values) of the above features are calculated, resulting in 30 feature values, all of which are recoded to four significant digits.

[0114] S12: Perform minimum-maximum normalization on the data to normalize all eigenvalues ​​to the range between 0 and 1.

[0115] S2: Divide the feature dataset into training set and test set;

[0116] In this embodiment, the data set is divided into two parts, the training set T and the test set Test, in a ratio of 65:35;

[0117] S3: Use the Borderline Smote1 algorithm to balance the data set to alleviate the imbalance of the training set data and make the positive and negative label values ​​of the training set consistent;

[0118] In this embodiment, the Borderline Smote1 algorithm is synthesized based on the samples with a small number of label values ​​in the training set T, so that the values ​​of samples with or without breast cancer in the breast cancer data set are equal, and the data set T is obtained. B ;

[0119] S4: Based on the whale optimization algorithm, SHAP values ​​are integrated to perform feature selection. The specific steps include:

[0120] S41: Initialize the whale position matrix: randomly generate a whales (number of whales) * features (number of features M) whale group, each whale individual represents a feature subset, represented by a binary vector, 1 means the feature is selected, 0 means the feature is not selected;

[0121] S42: Calculate the fitness of the initial whale group:

[0122] fitness=α·SHAP Mean-β·MR-γ·L 2,1 (W)

[0123]

[0124] Among them, α, β, and γ represent the corresponding weight parameters respectively. SHAP Mean is introduced to select the features that have a greater contribution to model prediction. Redundancy (MR) is introduced to reduce the redundancy between features. The regularization term L is introduced. 2,1 (W) enables the model to be optimized on a limited feature set, thereby reducing overfitting and improving computational efficiency. i represents the SHAP value of the i-th feature, j represents a leaf node, F represents the set of leaf nodes, and each leaf node will contain an appropriate proportion of all possible subsets in the set F, S j is the feature subset that appears in leaf node j, P is S j A subset of l j is the path length from the root node to the leaf node j, W(|P|,j) represents the proportion of all subsets of P in the leaf node j, and Represents the proportion of subsets including and excluding feature i, v j is the output value of leaf node j, I represents the feature set, l represents the size of feature set I, MR represents the redundancy, and ρ(i,j) represents the feature f i and feature f j The Pearson correlation coefficient between i ,f j ) represents the feature f i and feature f j The covariance between Represents feature f i The standard deviation of Represents feature f j The standard deviation of L 2,1 (W) represents the regularization term, m represents the number of samples, and n represents the number of features selected by this whale;

[0125] S43: Record the whale with the highest fitness in the current whale group as X*;

[0126] S44: Start iteration, using two hunting strategies, mobbing and spiraling, to simulate the whale's search and exploration behavior;

[0127] (a) Besieging prey:

[0128] A=2a·random(0,1)-a

[0129] Here, a is a parameter that decreases with each iteration to help the whale converge to the target gradually. random(0,1) generates a random number between 0 and 1, which ensures that there is some randomness in the search process, making the search process less rigid.

[0130] If |A|<1, then X(t+1)=X(t)-A·|C·X * (t)-X(t)|, C=2random(0,1), perform local search, and the whale conducts detailed exploration around the current solution;

[0131] If |A|≥1, then X(t+1)=X rand -A·|C·X rand -X|, C=2random(0,1) performs global search, and the whale searches randomly in a larger range;

[0132] (b) Spiral motion:

[0133] X(t+1)=|X * (t)-X(t)|·e bl ·cos(2πl)+X * (t),l=random(-1,1)

[0134] Among them, e bl is the exponential decay factor, cos(2πl) is the periodic motion used to generate the spiral, and b and l are the parameters that control the spiral;

[0135] S45: Limit the position of whales: For each feature position of each whale individual, use the Sigmoid function to convert it to 0 or 1. That is, if the output of Sigmoid is greater than 0.5, the feature is selected at that position (the value is 1), otherwise the feature is not selected (the value is 0);

[0136] S46: Calculate the fitness of each whale. If there is a higher fitness, update X*.

[0137] S47: Repeat steps S43-S46 until the iteration ends, and return the feature subset T corresponding to the maximum fitness WOA-SHAP (sample size*(number of features(M WOA-SHAP ) + tag value).

[0138] S5: Train the LightGBM model based on the feature subset after feature selection, including:

[0139] S51: Input the feature subset T obtained in step S4 WOA-SHAP , build a decision tree:

[0140] like Figure 3 As shown in , a histogram-based algorithm is used to construct a decision tree, which discretizes the continuous feature values ​​into several intervals to reduce the amount of calculation. Figure 4As shown in Figure 2, the decision tree adopts a leaf growth strategy, that is, each time a leaf with the largest split gain is selected from all current leaves for splitting, which helps to reduce more losses;

[0141] S52: Gradient Boosting: In each iteration, a new decision tree is constructed to fit the residuals of the prediction results of all previous trees. The gradient boosting algorithm is used to optimize the loss function and continuously reduce the prediction error of the model.

[0142] S53: Model regularization: Avoid overfitting by adding L1 (Lasso regression) and L2 (Ridge regression) regularization terms.

[0143] S6: Optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm, including:

[0144] S61: As shown in Table 1 below, the hyperparameters that need to be optimized are determined based on the model obtained in step S5:

[0145] Table 1 Hyperparameters that need to be optimized

[0146]

[0147]

[0148] Initialize the parameters of the particle swarm optimization algorithm:

[0149] a. Initialize the number of particles N = 100

[0150] b. Set the maximum number of iterations max_iter = 10

[0151] c. Set the dimension of particle position d = 12

[0152] d. Set the initial velocity range of the particles to: lb = [0.01, 1, 2, 1, 10, 1, 0.5, 0.5, 0, 0, 0, 0], ub = [0.3, 10, 100, 1000, 300, 50, 1, 1, 80, 1, 1, 1];

[0153] e. Set the inertia weight w, learning factors c1 = 0.5 and c2 = 0.2;

[0154] S62: Initialize the position and velocity of the particle:

[0155] a. For each particle i, randomly initialize its position x i and speed v i

[0156] b. Calculate the fitness value f(x i );

[0157] c. Initialize each particle’s personal best position p best And the fitness value f(p best );

[0158] d. Set the global optimal position g best And the fitness value f(g best );

[0159] S63. Main loop: Iterate until the maximum number of iterations max_iter is reached;

[0160] a. For each particle i:

[0161] i. Calculate the fitness value of the particle f(x i );

[0162] ii. If the fitness value of the particle f(x i ) is greater than the individual's best fitness value f(p best ) is better, update the particle's historical best position p best =x i ;

[0163] iii. If the fitness value of the particle f(x i ) is greater than the global optimal fitness value f(g best ) is better, update the global best position g best =x i ;

[0164] b. For each particle i:

[0165] i. Update particle velocity:

[0166] v i :v i =w·v i +c1·rand1·(p best -x i )+c2·rand2·(g best -x i )

[0167] Among them, rand1 and rand2 are random numbers ranging from [0,1];

[0168] ii. Update particle position x i :

[0169] x i =x i +v i

[0170] iii. Perform boundary check on particle position. If x i If it exceeds the boundary, it will be restricted within the boundary;

[0171] S64: Output the final global optimal position g best (optimal LightGBM model hyperparameters) and fitness value f(g best )(Best LightGBM model cross-validation result);

[0172] S7: Evaluate the effectiveness of the trained model using the following indicators:

[0173] S71: Accuracy is defined as the ratio of the number of correctly classified samples to the total number of samples. It is a reliable indicator, especially when the categories of the target variable are close to balanced.

[0174]

[0175] S72: Precision represents the proportion of true positive samples in all positive prediction samples.

[0176]

[0177] S73: Recall, also known as sensitivity or true positive rate, measures the proportion of positive samples accurately identified among all actual positive samples. This metric is crucial for evaluating the model's ability to correctly classify positive instances.

[0178]

[0179] S74: Specificity refers to the ratio of accurately predicted negative samples to the total number of actual negative samples, reflecting the ability of the model to identify negative instances.

[0180]

[0181] S75: F-Measure represents the harmonic mean of precision and recall, which can balance these two indicators.

[0182]

[0183] S76: The Receiver Operating Characteristic (ROC) graphically displays the effectiveness of a classification model at different thresholds. The area under the curve (AUC) ranges from 0 to 1, concisely summarizing the model's performance. The higher the AUC value, the more effective the model.

[0184] S77: Cross-validation testing is an important statistical analysis strategy for evaluating models and is widely used in various classification challenges. This example implements ten-fold cross-validation to evaluate the effectiveness of machine learning models. The fundamental goal of this method is to split a dataset into smaller subsets to verify the model's effectiveness on unseen data. This process not only provides a more accurate estimate of model performance on new datasets but also enhances understanding of the model's stability and reliability.

[0185] S8: Apply the trained model to prediction to predict the probability of a patient suffering from breast cancer. Use a function to statistically analyze the model prediction results and output them to the user.

[0186] Specifically, the original data is input, and then the features selected by WOA-SHAP are sent to the trained LightGBM model for prediction. The results are counted and output to the user.

[0187] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A LightGBM breast cancer prediction system based on WOA-SHAP feature selection, characterized by: include: Dataset preprocessing module, data set partitioning module, data set balancing module, feature selection module, LightGBM model training module, LightGBM model optimization module, model evaluation module, and prediction module; The data set preprocessing module is used to extract cell nucleus features in digital images and perform data preprocessing on feature values; The data set partitioning module is used to partition the feature data set into a training set and a test set; The data set equalization module is used to perform equalization processing on the feature data set; The feature selection module is used to select features based on the whale optimization algorithm and the SHAP value; The LightGBM model training module is used to train the LightGBM model based on the feature subset after feature selection; The LightGBM model optimization module is used to optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm; The model evaluation module is used to evaluate the effect of the trained LightGBM model; The prediction module is used to input the features after feature selection into the trained LightGBM model for prediction and output the LightGBM model prediction results.

2. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 1, characterized in that The data set preprocessing module is used to extract cell nucleus features in digital images and perform data preprocessing on feature values, specifically including: Cell nucleus features were extracted from digital images of breast tumors obtained by fine needle aspiration. Real-valued features were calculated for each cell nucleus, and all feature values ​​were processed by minimum-maximum normalization method.

3. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 1, characterized in that The feature selection module is used to select features based on the whale optimization algorithm and the SHAP value, specifically including: Initialize the whale position matrix, where each individual whale represents a feature subset; Calculate the fitness of the initial whale group; The whale with the highest fitness in the current whale group is recorded as X*; The hunting strategy of mobbing prey and spiraling movements simulates the searching and exploratory behavior of whales; For each characteristic position of each whale individual, use the Sigmoid function to convert it to 0 or 1; Calculate the fitness of each whale and update X* if there is a higher fitness; Repeat the iteration until the feature subset corresponding to the maximum fitness is returned.

4. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 3, characterized in that Calculate the fitness of the initial whale group, specifically expressed as: fitness=α·SHAP Mean-β·MR-γ·L 2,1 (W) Among them, α, β, and γ represent the corresponding weight parameters, SHAP i represents the SHAP value of the i-th feature, j represents a leaf node, F represents the leaf node set, S j is the feature subset that appears in leaf node j, P is S j A subset of L j is the path length from the root node to the leaf node j, W(|P|,j) represents the proportion of all subsets of P in the leaf node j, and Represent the proportion of subsets including and excluding feature i, υ j is the output value of leaf node j, I represents the feature set, l represents the size of feature set I, MR represents the redundancy, and ρ(i,j) represents the feature f i and feature f j The Pearson correlation coefficient between i ,F j ) represents the feature f i and feature F j The covariance between Represents feature F i The standard deviation of Represents feature F j The standard deviation of L 2,1 (W) represents the regularization term, m represents the number of samples, and n represents the number of features selected by this whale.

5. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 3, characterized in that: The hunting strategy of mobbing and spiraling motion simulates the search and exploration behavior of whales, including: In the hunting strategy of mobbing prey: A=2a·random(0,1)-a Among them, a is a parameter that gradually decreases with iteration, and random(0,1) generates a random number between 0 and 1; If |A|<1, then X(t+1)=X(t)-A·|C·X * (t)-X(t)|, C=2random(0,1), perform local search; If |A|≥1, then X(t+1)=X rand -A·|C·X rand -X|, C=2random(0,1), perform global search; In the spiral hunting strategy: X(t+1)=|X * (t)-X(t)|·e bl ·cos(2πl)+X * (t),l=random(-1,1) Among them, e bl is the exponential decay factor, cos(2πl) is the periodic motion used to generate the spiral, and b and l are the parameters that control the spiral.

6. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 1, characterized in that The LightGBM model optimization module is used to optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm, specifically including: Initialize the parameters of the particle swarm optimization algorithm; Initialize the position and velocity of the particle; Calculate the fitness value of the particle. If the fitness value of the particle is greater than the personal best fitness value, update the historical best position of the particle. If the fitness value of the particle is greater than the global best fitness value, update the global best position. Update particle velocity and particle position, and perform boundary check on particle position; Iterate until the maximum number of iterations is reached and output the final global optimal position and fitness value.

7. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 6, characterized in that: Initialize the position and velocity of the particle, including: For each particle, randomly initialize its position and velocity; Calculate the fitness value of each particle; Initialize each particle's personal best position and fitness value; Set the global best position and fitness value.

8. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 1, characterized in that: The model evaluation module is used to evaluate the effect of the trained LightGBM model. Specifically, the following indicators are used to evaluate the model: Accuracy (the ratio of correctly classified samples to the total number of samples), Precision (the ratio of true positive samples in all positive predicted samples), Sensitivity (Recall), Specificity (the ratio of accurately predicted negative samples to the total number of actual negative samples), F-Measure (the harmonic mean of precision and Recall), and ROC curve.

9. The LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to claim 1, characterized in that: The model evaluation module is used to evaluate the effect of the trained LightGBM model, and ten-fold cross validation is used to evaluate the effectiveness of the LightGBM model.

10. A LightGBM breast cancer prediction method based on WOA-SHAP feature selection, characterized in that: A LightGBM breast cancer prediction system based on WOA-SHAP feature selection according to any one of claims 1 to 9 is provided, comprising the following steps: Extract cell nucleus features from digital images and perform data preprocessing on feature values; Divide the feature dataset into training and test sets; Perform equalization on the feature data set; Based on the whale optimization algorithm, SHAP value is integrated to perform feature selection; Train the LightGBM model based on the feature subset after feature selection; Optimize the hyperparameters of the LightGBM model based on the particle swarm optimization algorithm; Evaluate the effect of the trained LightGBM model; The features after feature selection are input into the trained LightGBM model for prediction, and the prediction results of the LightGBM model are output.

Citation Information

Cited By

  • Biomarker auxiliary screening system based on radiomics conjoint analysis

    CN121259814A

  • Biomarker assisted screening system based on radiomics joint analysis

    CN121259814B