A medical image lesion feature value anomaly elimination method
By integrating outlier detection models and weakly supervised learning methods, the relationship between features and labels is optimized, solving the problem of eliminating abnormal feature values of lesions in medical imaging and improving the accuracy of radiomics features and prognostic analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2023-08-21
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for eliminating abnormal lesion features in medical imaging lack effectiveness and generalizability, leading to a decrease in the accuracy of prognostic analysis.
A comprehensive outlier detection model combined with weakly supervised learning was adopted. Outliers were detected by density detection and statistical methods. The effectiveness of the model was verified by using an ensemble model and a classifier. The relationship between abnormal patient data and labels was corrected, representative features were selected, and a random forest model was constructed to eliminate abnormal lesion feature values.
The model improved the AUC values on both the training and test sets, demonstrating the effectiveness and generalization of the outlier detection model, reducing lesion feature anomalies, and improving the accuracy of prognostic analysis.
Smart Images

Figure CN117171683B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine learning and radiomics technology, specifically relating to a method for eliminating abnormal feature values of lesions in medical images. Background Technology
[0002] With the development of radiomics, extracting a large number of features from medical images and integrating these features with clinical data for prognostic analysis to assist clinicians in developing more precise individualized medical strategies has become increasingly common. The accuracy of prognostic analysis is crucial for doctors to formulate precise individualized medical strategies and thus extend patient survival. While the extracted radiomic features are undoubtedly very important for prognostic analysis, there are currently situations where inaccurate patient delineation or software extraction issues can lead to abnormalities in the extracted radiomic features. Eliminating these abnormalities and ensuring the accuracy of the data source is key to improving the accuracy of prognostic analysis.
[0003] While there are several methods for outlier detection, such as statistical outlier detection, clustering outlier detection, density outlier detection, and proximity outlier detection, it is essential to consider whether the outlier detection model is effective and whether it has generalization ability. Currently, there is no specific method to prove the effectiveness of outlier detection and thus achieve the goal of eliminating abnormal lesion feature values caused by inaccurate medical image delineation.
[0004] In view of this, it is necessary to design a method for eliminating abnormal feature values of lesions in medical imaging and to prove the effectiveness and generalization of the method in order to solve the above problems. Summary of the Invention
[0005] The purpose of this invention is to provide a method for eliminating abnormal feature values of lesions in medical imaging and to demonstrate the effectiveness and generalizability of the method.
[0006] To achieve the above objectives, this invention provides a method for eliminating abnormal feature values of lesions in medical imaging, the specific operation steps of which are as follows:
[0007] Step 1: Divide the dataset into training and test sets according to the proportions. Use an outlier detection model that combines density and statistics to fit and detect outliers on the training set, and use the training set fitting model to detect outliers on the test set data.
[0008] Step 2: Taking patients as a unit, count the number of abnormal features for each patient based on the training set data and the test set data, draw a distribution map of the number of abnormal features for each patient, and determine the threshold of abnormality based on the distribution map of the number of abnormal features. Patients with a number of abnormal features greater than the threshold are considered to have abnormal data, and patients with a number of abnormal features less than the threshold are considered to have normal data.
[0009] Step 3: Based on the training set data and the test set data, normal patients are divided into a normal patient training set and a normal patient test set;
[0010] Step 4: Label the normal patient training set and abnormal patient data in the training set data and the normal patient training set and abnormal patient data in the test set data. Using the idea of weak supervision, which only uses the labels of the data part, that is, the labels of the normal patient training set, we first use the ensemble model to fit the relationship between the normal patient data and the labels, and then use the weight relationship learned from the normal patients to correct the relationship between the abnormal patient data and the labels to obtain the corrected labels.
[0011] Step 5: Merge the normal patient training set and the abnormal patient training set in the training set data and the test set data respectively to form the original training set. Merge the normal patient training set with the data corrected by weak supervision to form the corrected training set. The normal patient test set is used as the corresponding test set.
[0012] Step 6: For both the training and test sets, use a selected model plus a classifier. Compare the performance of the model fitted to the original training set on the test set with the performance of the model fitted to the corrected training set on the test set to determine the effectiveness of anomaly detection. Use the area under the curve (AUC) as an indicator to evaluate the predictive ability of the model fitted to the weakly supervised training set and the model fitted to the original training set. If the AUC of the model fitted to the weakly supervised training set on the test set is better than that of the model fitted to the original training set on the test set, then the comprehensive anomaly detection method is effective. In subsequent analysis, reducing anomalous features will mitigate the abnormal lesion feature values caused by inaccurate delineation in medical images.
[0013] As a further improvement of the present invention, in step 1, the comprehensive outlier detection model includes two methods for detecting outliers: the LOF algorithm based on density detection and the interquartile range algorithm based on statistics. The value is determined to be an outlier only when both the LOF algorithm based on density detection and the interquartile range algorithm based on statistics determine that the value is an outlier; otherwise, it is a normal value.
[0014] As a further improvement to the present invention, the LOF algorithm mainly includes the following steps:
[0015] Step 1.1: Calculate the k nearest neighbors. For each point i, find the set N(i) of its k nearest neighbor points;
[0016] Step 1.2: Calculate the reachability distance. For points i and j, define the reachability distance from point j to i as dist(i, j);
[0017] Step 1.3: If point j is not among the k nearest neighbors of point i, then point j and point i are not neighbors, and in this case dist(i, j) is defined as infinity;
[0018] Step 1.4: Calculate the local reachability density. For point i, define its local reachability density as lrd(i), which represents the reciprocal of the average reachability distance of point i, i.e.: lrd(i) = 1 / (sum(dist(i,j) / k),j∈N(i));
[0019] Step 1.5: Calculate the local anomaly factor. For point i, define its local anomaly factor LOF(i), which represents its density ratio relative to its neighboring points. Specifically, it is defined as the ratio of the density of the neighbors around point i to the density of point i itself, i.e.: LOF(i) = sum(lrd(j) / lrd(i), j∈N(i)) / k;
[0020] Step 1.6: Identify outliers. According to the definition of LOF, the larger the LOF value, the more likely the point is to be an outlier. For each point i, if LOF(i) is greater than a certain threshold, then the point is considered an outlier.
[0021] As a further improvement of the present invention, the interquartile range algorithm mainly includes the following steps:
[0022] Step 1.7: Sort the data by size;
[0023] Step 1.8: Calculate the first quartile Q1, median Q2, and third quartile Q3 of the dataset;
[0024] Step 1.9: Calculate the interquartile range (IQR): IQR = Q3 - Q1;
[0025] Step 1.10: Calculate min_bound (the minimum value exceeding the lower limit): min_bound = Q1 - 1.5IQR;
[0026] Step 1.11: Calculate max_bound (the maximum value exceeding the upper limit): max_bound =
[0027] Q3+1.5IQR;
[0028] Step 1.12: Check if the data is within the range of min_bound and max_bound. If it is not within this range, it is considered an outlier.
[0029] As a further improvement of the present invention, in step 4, the ensemble model is a random forest model based on decision trees. Its principle is to first construct multiple different decision trees to form a random forest. When building the random forest, the construction of each decision tree needs further optimization, including the following steps:
[0030] Step 4.1: Perform feature selection. For each decision tree, a subset of features needs to be selected from all features in the training set for construction. The features selected for each decision tree should be different. Randomly select a subset of features from each decision tree for evaluation and selection.
[0031] Step 4.2: Build a decision tree. Each decision tree consists of a series of nodes, and each node corresponds to a feature. The data is divided by the feature, and the same process is continued in the child nodes. Set the maximum depth or minimum number of leaf nodes of the decision tree.
[0032] Step 4.3: Perform sample sampling. Since the random forest algorithm involves multiple decision trees, using the same training set on different trees will lead to model errors. Therefore, it is necessary to sample the training set with or without replacement to generate multiple different sample sets. After fitting, first calculate the average impurity. Calculate the frequency with which each feature is used to split the dataset in the random forest, and calculate the average impurity accordingly. The lower the impurity, the greater the information content of the feature, and the greater its contribution to data classification or regression.
[0033] Step 4.4: Calculate feature importance. Sort all features by calculating the average impurity of each feature to determine the importance of each feature. Select representative features based on feature importance, reconstruct the random forest, fit the representative features with the labels, and use the fitted weight information to correct the relationship between abnormal patient features and labels to obtain the corrected data.
[0034] As a further improvement of the present invention, in step 6, the screening model, such as the wrapper model, can integrate three models, glment, xgboost, and ranger, to screen features, select some features, use a classifier to fit the training set and predict the test set, and calculate the AUC of the test set to indicate the classification effectiveness.
[0035] Beneficial effects:
[0036] In the training set of this experiment, the AUC of the modified training set on the test set was 8 percentage points higher (0.08) than that of the original data on the test set. In the test set of this experiment, the AUC of the modified training set on the test set was 15 percentage points higher (0.15) than that of the original data on the test set. It can be seen that the modified training set outperforms the original data on both the training and test sets. Therefore, it can be proved that the outlier detection model is effective and has good generalization ability. When outlier detection is effective, the model can achieve the goal of eliminating abnormal lesion feature values in medical imaging by reducing the abnormal lesion feature value data. Attached Figure Description
[0037] Figure 1 This is an overall framework diagram of the present invention;
[0038] Figure 2 This is a flowchart of the outlier detection model in this invention;
[0039] Figure 3 This is a flowchart of the weakly supervised overall model of the present invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] It should be emphasized that, in describing this invention, various formulas and constraints are distinguished by consistent reference numerals, but it is not excluded that different reference numerals may be used to identify the same formulas and / or constraints. The purpose of this arrangement is to more clearly illustrate the features of this invention.
[0042] This invention provides a method for eliminating abnormal feature values of lesions in medical imaging. First, a comprehensive outlier detection model is established based on density and statistical detection methods. Then, a weakly supervised learning method is used to learn the relationship between normal data features and labels to correct the relationship between abnormal data and labels. Finally, the effectiveness of the outlier detection is verified by comparing the corrected data on the training set and the test set to see if it is more effective than the uncorrected data.
[0043] As attached Figure 1 As shown, in one embodiment, a method for eliminating abnormal lesion feature values caused by inaccurate delineation of medical images mainly includes the following steps:
[0044] Step 1: In one embodiment, the patient dataset comes from a hospital in Nanjing and is then extracted into a patient feature dataset using the software 3Dslicer. The patient feature dataset is divided into training and test sets according to a set ratio. A comprehensive outlier detection model is used to perform fitting detection on the training set data and outlier detection on the test set data.
[0045] Step 2: Taking patients as a unit, count the number of abnormal features for each patient in both the training and test sets, plot the distribution of the number of abnormal features for each patient, and determine the threshold for abnormality based on the distribution of the number of abnormal features. Patients with data greater than the threshold are considered to have abnormal data, while those with data less than the threshold are considered to have normal data.
[0046] Step 3: In the weakly supervised model for correcting outliers, the normal patient feature data is divided into a normal patient training set and a normal patient test set for the training set and test set respectively (the normal patient test set does not participate in the correction process, ensuring that the test set data will not be leaked).
[0047] Step 4: In the weakly supervised model for correcting outliers, the weakly supervised model is used for both the training and test sets. The weakly supervised model only uses the labels of the data portion (the labels of the normal patient training set). First, the ensemble model is used to fit the relationship between the data and labels of the normal patient training set. The weight relationship learned from the normal patient training set data is then used to correct the relationship between the data and labels of the outliers, resulting in the corrected labels.
[0048] Step 5: In the weakly supervised model for correcting outliers, for both the training set and the test set, the training set data of normal patients and the data of outliers are merged to form the original training set. The training set data of normal patients and the data corrected using weak supervision are merged to form the corrected training set. The test set of normal patients is used as the corresponding test set (the test set does not participate in the weakly supervised training correction process, so there is no data leakage).
[0049] Step Six: For both the training and test sets, use a filtered model and classifier. Compare the performance of the model fitted to the original training set on the test set with the performance of the model fitted to the corrected training set on the test set to determine the effectiveness of the anomaly detection model. In radiomics, AUC is commonly used as an indicator to evaluate the predictive ability of binary classification models. If, in both the training and test sets, the AUC of the model fitted to the weakly supervised training set is superior to the AUC of the model fitted to the original training set on the test set, then the anomaly detection method is effective and has a certain degree of generalization.
[0050] As attached Figure 2As shown, in one embodiment, in step one, the anomaly detection model specifically refers to a comprehensive outlier detection model that combines density-based algorithms (such as the LOF algorithm) and statistical algorithms (such as the interquartile range algorithm). Only when both algorithms consider the feature value of the position to be abnormal will the position be determined as abnormal data, thus avoiding the error of a single anomaly detection algorithm.
[0051] The density-based algorithm employs the LOF algorithm. Its implementation involves first calculating the k nearest neighbors, and then, for each point i, finding its set N(i) of k nearest neighbors. Next, the reachability distance is calculated: for points i and j, the reachability distance from point j to i is defined as dist(i, j), where dist(i, j) represents the distance between points i and j. If point j is not within the k nearest neighbors of point i, then point j and point i are not neighbors, and dist(i, j) is defined as infinity. Then, the local reachability density is calculated: for point i, its local reachability density is defined as lrd(i), representing the reciprocal of the average reachability distance of point i, i.e., lrd(i) = 1 / (sum(dist(i, j) / k), j∈N(i)). Finally, the local anomaly factor is calculated: for point i, its local anomaly factor LOF(i) is defined, representing its density ratio relative to its neighboring points. Specifically, it is defined as the ratio of the density of the neighbors surrounding point i to the density of point i itself, i.e.: LOF(i) = sum(lrd(j) / lrd(i), j∈N(i)) / k. Finally, outliers are identified: according to the definition of LOF, the larger the LOF value, the more likely the point is to be an outlier. For each point i, if LOF(i) is greater than a certain threshold, the point is considered an outlier.
[0052] The statistical data filtering algorithm uses the interquartile range algorithm, which first sorts the data by size.
[0053] Calculate Q1 (first quartile), Q2 (median), and Q3 (third quartile) for the dataset.
[0054] Calculate the IQR (interquartile range): IQR = Q3 - Q1
[0055] Calculate min_bound (the minimum value exceeding the lower limit): min_bound = Q1 - 1.5IQR
[0056] Calculate max_bound (the maximum value exceeding the upper limit): max_bound = Q3 + 1.5IQR.
[0057] Check if the data is within the range of min_bound and max_bound. If it is not within this range, it is considered an outlier.
[0058] As attached Figure 3 As shown, in one embodiment, in step four, the ensemble learning model in the weakly supervised model for correcting outliers is a random forest model based on decision trees. First, multiple different decision trees are constructed to form a random forest. When building the random forest, the construction of each decision tree needs further optimization, including the following aspects: First, feature selection: For each decision tree, a subset of features from all features in the training set needs to be selected for construction. To obtain better generalization performance, the features selected for each decision tree should be as different as possible. Typically, some features are randomly selected from each decision tree for evaluation and selection. Second, decision tree construction: Each decision tree consists of a series of nodes, each corresponding to a feature. The data is divided using this feature, and the same process continues in the child nodes. To avoid overfitting, parameters such as the maximum depth or minimum number of leaf nodes of the decision tree can be set. Next, sample sampling: Since the random forest algorithm involves multiple decision trees, using the same training set on different trees may lead to model errors. Therefore, it is necessary to sample the training set with or without replacement to generate multiple different sample sets. After fitting, the average impurity is calculated first. This involves determining the frequency with which each feature is used to split the dataset in the random forest, and then calculating the average impurity accordingly. Lower impurity indicates a greater information content for the feature, contributing more to data classification or regression. Next, feature importance is calculated by ranking all features based on their average impurity to determine the importance of each feature. Representative features are then selected based on their importance, and the random forest is reconstructed. These representative features are then fitted to the labels, and the fitted weights are used to correct the relationship between the abnormal patient features and the labels. This results in the corrected data.
[0059] In one embodiment, the screening model in step six, such as the wrapper model, can integrate three models—glment, XGBoost, and ranger—to screen features, select a subset of features, use a classifier to fit the training set and predict the test set, and calculate the AUC of the test set to indicate the classification effectiveness.
[0060] In summary, in the training set of this experiment, the AUC of the modified training set on the test set was improved by eight percentage points (0.08) compared to the AUC of the original data on the test set. In the test set of this experiment, the AUC of the modified training set on the test set was improved by fifteen percentage points (0.15) compared to the AUC of the original data on the test set. It can be seen that the modified training set outperforms the original data on both the training and test sets. Therefore, it can be proved that the outlier detection model is effective and has good generalization ability. When outlier detection is effective, the model can eliminate the abnormal lesion feature values caused by inaccurate delineation in medical images by reducing the abnormal lesion feature value data.
[0061] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for eliminating abnormal feature values of lesions in medical imaging, characterized in that, The specific steps are as follows: Step 1: Divide the dataset into training and test sets according to the proportions. Use an outlier detection model that combines density and statistics to fit and detect outliers on the training set, and use the training set fitting model to detect outliers on the test set. The comprehensive outlier detection model includes two methods: the LOF algorithm based on density detection and the interquartile range algorithm based on statistics. Only when both the LOF algorithm based on density detection and the interquartile range algorithm based on statistics determine that a feature value in the feature data is an outlier is the value identified as an outlier; otherwise, it is considered a normal value. Step 2: Taking patients as a unit, count the number of abnormal features for each patient based on the training set data and the test set data, draw a distribution map of the number of abnormal features for each patient, and determine the threshold of abnormality based on the distribution map of the number of abnormal features. Patients with a number of abnormal features greater than the threshold are considered to have abnormal data, and patients with a number of abnormal features less than the threshold are considered to have normal data. Step 3: Based on the training set data and the test set data, normal patients are divided into a normal patient training set and a normal patient test set; Step 4: For the normal patient training set and abnormal patient data in the training set and the normal patient training set and abnormal patient data in the test set, the idea of weak supervision is used. Weak supervision only uses the labels of the data part, that is, the labels of the normal patient training set. First, the ensemble model is used to fit the relationship between the normal patient data and the labels. The weight relationship learned from the normal patients is used to correct the relationship between the abnormal patient data and the labels to obtain the corrected labels. Among them, the ensemble model is a random forest model based on decision trees, which is optimized through feature selection, decision tree construction, sample sampling and calculation of feature importance. Step 5: Merge the normal patient training set and the abnormal patient training set in the training set data and the test set data respectively to form the original training set. Merge the normal patient training set with the data corrected by weak supervision to form the corrected training set. The normal patient test set is used as the corresponding test set. Step 6: For both the training and test sets, use a selected model plus a classifier. By comparing the performance of the model fitted to the original training set on the test set with the performance of the model fitted to the corrected training set on the test set, the effectiveness of the comprehensive anomaly detection method is determined. The area under the ROC curve of the model, represented as AUC, is used as an indicator to evaluate the predictive ability of the model fitted to the weakly supervised training set and the model fitted to the original training set. If the AUC of the model fitted to the weakly supervised training set on the test set is better than that of the model fitted to the original training set on the test set, then the comprehensive anomaly detection method is effective. In subsequent analysis, the abnormal features will be reduced to mitigate the situation where inaccurate delineation of lesion feature values in medical images causes abnormalities.
2. The method for eliminating abnormal feature values of medical imaging lesions according to claim 1, characterized in that: The LOF algorithm includes the following steps: Step 1.1: Calculate the k nearest neighbors. For each point i, find the set N(i) of its k nearest neighbor points; Step 1.2: Calculate the reachability distance. For points i and j, define the reachability distance from point j to i as dist(i, j); Step 1.3: If point j is not among the k nearest neighbors of point i, then point j and point i are not neighbors, and in this case dist(i, j) is defined as infinity; Step 1.4: Calculate the local reachability density. For point i, define its local reachability density as lrd(i), which represents the reciprocal of the average reachability distance of point i, i.e.: lrd(i) = 1 / (sum(dist(i,j) / k), j∈N(i)). Step 1.5: Calculate the local anomaly factor. For point i, define its local anomaly factor LOF(i), which represents its density ratio relative to its neighboring points. Specifically, it is defined as the ratio of the density of the neighbors around point i to the density of point i itself, i.e.: LOF(i) = sum(lrd(j) / lrd(i), j∈N(i)) / k. Step 1.6: Identify outliers. According to the definition of LOF, the larger the LOF value, the more likely the point is to be an outlier. For each point i, if LOF(i) is greater than a certain threshold, then the point is considered an outlier.
3. The method for eliminating abnormal feature values of medical imaging lesions according to claim 1, characterized in that: The interquartile range algorithm includes the following steps: Step 1.7: Sort each feature value in the feature data by size; Step 1.8: Calculate the first quartile Q1, median Q2, and third quartile Q3 of the dataset; Step 1.9: Calculate the interquartile range (IQR): IQR = Q3 - Q1; Step 1.10: Calculate the minimum value for outlier detection, min_bound: min_bound = Q1 - 1.5IQR; Step 1.11: Calculate the maximum value for outlier detection, max_bound: max_bound = Q3 + 1.5IQR; Step 1.12: Check if the data is within the range of min_bound and max_bound. If it is not within this range, it is considered an outlier.
4. The method for eliminating abnormal feature values of medical imaging lesions according to claim 1, characterized in that: In step 4, the ensemble model is a random forest model based on decision trees. Its principle is to first construct multiple different decision trees to form a random forest. When building the random forest, further optimization of each decision tree is required, including the following steps: Step 4.1: Perform feature selection. For each decision tree, a subset of features needs to be selected from all features in the training set for construction. The features selected for each decision tree should be different. Randomly select a subset of features from each decision tree for evaluation and selection. Step 4.2: Build a decision tree. Each decision tree consists of a series of nodes, and each node corresponds to a feature. The data is divided by the feature, and the data is further divided in the child nodes. Set the maximum depth or minimum number of leaf nodes for the decision tree. Step 4.3: Perform sample sampling. Since the random forest algorithm involves multiple decision trees, using the same training set on different trees will lead to model errors. Therefore, it is necessary to sample the training set with or without replacement to generate multiple different sample sets. After fitting, first calculate the average impurity. Calculate the frequency with which each feature is used to split the dataset in the random forest, and calculate the average impurity accordingly. The lower the impurity, the greater the information content of the feature, and the greater its contribution to data classification or regression. Step 4.4: Calculate feature importance. Sort all features by calculating the average impurity of each feature to determine the importance of each feature. Select representative features based on feature importance, reconstruct the random forest, fit the representative features with the labels, and use the fitted weight information to correct the relationship between abnormal patient features and labels to obtain the corrected data.
5. The method for eliminating abnormal feature values of medical imaging lesions according to claim 1, characterized in that: In step 6, the screening model wrapper model integrates three models, glment, xgboost, and ranger, to screen features, select some features, use a classifier to fit the training set and predict the test set, and calculate the AUC of the test set to indicate the classification effectiveness.