Cervical cancer prediction method based on adaptive KNN noise recognition
By using adaptive KNN noise recognition and oversampling algorithms in cervical cancer prediction, the problems of multiple data characteristics and noise are solved, the prediction accuracy and efficiency are improved, and the mortality rate is reduced.
Patent Information
- Application Number
- CN202411711931.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-04
AI Technical Summary
The existing cervical cancer prediction methods have high calculation costs and low prediction accuracy due to the large number of data characteristics and the presence of noise.
The noise recognition method based on adaptive KNN is used to process missing values, analyze and standardize the cervical cancer data set, determine the adaptive k value through kernel density estimation, identify and delete the noise data, and oversample it using SMOTE and BorderlineSMOTE algorithms to balance the data set.
It improves the accuracy and efficiency of cervical cancer prediction, reduces new noise generated in synthetic data, and reduces the mortality rate caused by cervical cancer.
Smart Images

Figure CN119560135A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of bioinformatics, and in particular relates to a cervical cancer prediction method based on adaptive KNN noise recognition. Background Art
[0002] Cervical cancer is a common malignant tumor. Due to the abnormal mutation process of pathological cells, they proliferate and replicate uncontrollably, accumulate abnormal cells, and produce fatal tumors. If cervical cancer is not detected in the early stage, this cancer is fatal. Cervical cancer prediction aims to achieve a high accuracy rate in the prediction of cervical cancer, helping patients obtain the best prediction results in the early stages of cervical cancer through clinical records, thereby reducing the overall mortality rate of women caused by cervical cancer.
[0003] The prediction of cervical cancer is currently mainly achieved through some algorithms in machine learning, such as support vector machines, decision trees, and random forests. However, the existing public cervical cancer datasets have a large number of data features and a large number of missing values, which leads to high computational costs, and the presence of noise leads to low accuracy when using the model for prediction. For example, W. Wu et al. used a dataset collected by the University Hospital of Caracas, which has 32 features and 4 dependent variables. Due to the large number of features, they improved the SVM method to obtain SVM-RFE. This method first applies SVM to each feature, completes the training process, and eliminates features with weak correlation, thereby reducing the amount of calculation. R. Alsmariy et al. developed a machine learning model that includes many machine learning algorithms, namely logistic regression, decision trees, ensemble methods, and random forests. Their ensemble method achieved a ROC-AUC value of 98.49% with the help of synthetic minority oversampling technology. Riham Alsmariy et al. cleaned the data by ignoring missing values and interpolating using the decision tree method in the preprocessing stage, and then used the SMOTE algorithm to oversample to balance the data. After balancing the data set, the PCA technique was used to reduce the number of features. Through ten-fold cross validation, it was found that this method improved the accuracy and AUC indicators.
[0004] The above analysis shows that in the process of cervical cancer prediction, data preprocessing has a significant impact on the subsequent prediction results. In the process of data collection and statistics, the data collectors prevent privacy leakage or other reasons, which leads to a lot of data noise in the data. If these noise data cannot be removed before data processing, the accuracy of the prediction results will be greatly affected. At this time, the adaptive KNN algorithm can be used to identify noise data, but because the KNN algorithm uses a fixed K value to detect the surrounding neighbors, when the data distribution is uneven, the fixed K value will reduce the accuracy of classification. Summary of the invention
[0005] The purpose of the present invention is to provide a cervical cancer prediction method based on adaptive KNN noise recognition, which solves the problem of low prediction accuracy of existing cervical cancer prediction methods.
[0006] The technical solution adopted by the present invention is: a cervical cancer prediction method based on adaptive KNN noise recognition, comprising the following steps:
[0007] Step 1, obtain the cervical cancer dataset from the UCI database;
[0008] Step 2: Process missing values and create new target features for the acquired cervical cancer dataset to obtain a corrected cervical cancer dataset;
[0009] Step 3: Perform feature correlation analysis and standardization on the data in the modified cervical cancer dataset to obtain a standardized cervical cancer dataset;
[0010] Step 4: Use adaptive KNN-based noise recognition to classify the data in the normalized cervical cancer dataset, then use a class-based hybrid sampling algorithm to oversample, integrate the sampled data, and split it into a training set and a test set using a ten-fold cross-validation method;
[0011] Step 5: Input the training set into SVM or RF for classification training, and then predict the test set to obtain the prediction results.
[0012] The present invention is also characterized in that:
[0013] The cervical cancer dataset in step 1 includes 32 features of the patient's demographic information, habits, and historical medical records. The 32 features include four target features: colposcopy, iodine test, thin-layer liquid-based cytology, and cervical biopsy. In all four target features, '0' represents the healthy population and '1' represents the patient population.
[0014] Step 2 specifically includes the following steps:
[0015] Step 2.1, process the missing values in the acquired cervical cancer data set. First, replace the missing values displayed by '?' in the data set with Nan values. Second, delete some columns with more than 50% missing data. Finally, fill in the data for some columns with less than 50% missing data.
[0016] Step 2.2: Add a new label column as a new target feature in the data set. The new target feature is a judgment strategy: as long as the diagnosis result of the four target features is '1', the corresponding woman is considered to be a cervical cancer patient, otherwise the corresponding woman is considered not to be sick.
[0017] The method of data filling in step 2.1 includes filling in 0 for the missing data in the same group of features with less than 50% missing data and the features of the same patient; the remaining features are filled in with the mode.
[0018] Step 3 specifically includes the following steps:
[0019] Step 3.1: Perform feature correlation analysis on the data in the modified cervical cancer dataset. First, delete some columns with the same values. Then use the Pearson correlation coefficient to analyze the relationship between each feature and the incidence. Select the features with a low correlation with the disease outcome, i.e., |r|<0.2, and delete them. The Pearson correlation coefficient calculation formula is:
[0020]
[0021] in, represents the standard score of the data in the patient characteristics, represents the mean value of the data in the patient characteristics, σ X represents the standard deviation of the data in the patient characteristics, Y represents whether the patient is sick, n represents the total number of patients, and i represents the sample number, which is used to process the data of each patient one by one;
[0022] Step 3.2: Standardize the data in the corrected cervical cancer dataset. The calculation formula is:
[0023]
[0024] Among them, X represents the data in patient characteristics, represents the mean value of the data in the patient characteristics, σ represents the standard deviation of the data in the patient characteristics, X * Represents the data obtained after standardization.
[0025] Step 4 specifically includes the following steps:
[0026] Step 4.1: Perform local density estimation on each data point in the normalized cervical cancer dataset. The kernel density estimation formula is:
[0027]
[0028] in, is the estimated density at point x; h is the bandwidth parameter, which controls the smoothness of the kernel function; K is the Gaussian kernel function; n represents the total number of patients; i represents the sample number, which is used to process the data of each patient one by one;
[0029] Step 4.2: Based on local density Determine the adaptive k value, record the nearest k neighbors for each data point, and record the neighbors' indexes and labels;
[0030]
[0031] Then, each data point is classified by the two defined indicators of maj_ratio and min_ratio. When the neighbor of a data point is 0, it is marked as an outlier. In the majority class, if maj_ratio>95%, the data point is marked as a safe point, if min_ratio>75%, the data point is marked as a noise point, and the rest of the data points are marked as boundary points. In the minority class, if min_ratio>95%, the data point is marked as a safe point, if maj_ratio>75%, the data point is marked as a noise point, and the rest of the points are marked as boundary points.
[0032]
[0033]
[0034] Among them, majority_count represents the number of majority classes in the neighbors of the non-diseased data point; minority_count represents the number of minority classes in the neighbors of the diseased data point; total_neighbors represents the total number of neighbors of the data point;
[0035] Step 4.3: Delete the data labeled as outliers and noise points, and use the SMOTE algorithm to oversample the data labeled as safe points. The formula for balancing data using the SMOTE oversampling method is:
[0036] x new =x i +λ×(x nm -x i )
[0037] Among them, x i is a sample of the non-diseased class, x nm is x i A non-diseased neighbor sample, λ is a random value, λ∈[0,1];
[0038] The BorderlineSMOTE algorithm is used to oversample the data labeled as boundary points. The formula for balancing the data using the BorderlineSMOTE oversampling method is:
[0039] x new =x b +λ×(x nm -x b )
[0040] Among them, x b is the non-diseased sample in the boundary area, x nm is xb A non-diseased neighbor sample, λ is a random value, λ∈[0,1];
[0041] Step 4.4: Combine the results of the separate sampling into a complete data set to obtain balanced data, and then use the ten-fold cross-validation method to split it into a training set and a test set.
[0042] In step 5, the training set is input into SVM for classification training, and then the test set is predicted. For the binary classification problem, the SVM formula is as follows:
[0043] The SVM classifier constructs a decision function, expressed as:
[0044] f(x)=W T X+b
[0045] Among them, X represents the data in the patient's characteristics, W represents the weight vector, which determines the direction of the hyperplane, b represents the bias term, and f(x) is used to determine the category to which the data point X belongs, that is, whether it is sick.
[0046] In step 5, the training set is input into RF for classification training, and then the test set is predicted. For the binary classification problem, the RF formula is as follows:
[0047]
[0048] Where I(·) is the indicator function. Then I=1; otherwise I=0.
[0049] The beneficial effects of the present invention are as follows: the cervical cancer prediction method based on adaptive KNN noise recognition of the present invention adaptively determines the K value by using kernel density estimation (KDE). In the process of identifying noise, KNN is identified through neighborhood information, and uses the adjacent sample information of a certain sample to identify noise, which can more effectively identify noise data and can also reasonably divide the data. When balancing the data through oversampling, the new noise generated in the synthetic data is reduced, and the prediction accuracy in cervical cancer prediction is higher, thereby reducing the mortality rate of women caused by cervical cancer. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of the cervical cancer prediction method based on adaptive KNN noise recognition of the present invention;
[0051] Figure 2 It is a comparison diagram of data distribution before and after removing noise from a data set in the present invention;
[0052] Figure 3 This is a comparison diagram of data distribution after sampling using the SMOTE algorithm before and after denoising in the present invention;
[0053] Figure 4 This is a comparison chart of the G-mean of multiple classification models on four different data sets using the imbalanced data processing method proposed in the present invention;
[0054] Figure 5 This is a comparison chart of the F1 scores of multiple classification models on four different data sets using the imbalanced data processing method proposed in the present invention;
[0055] Figure 6 This is a comparison chart of the recall of multiple classification models on four different data sets using the imbalanced data processing method proposed in the present invention;
[0056] Figure 7 is the ROC curve of each classification method in the present invention on the cervical cancer data set without any preprocessing and processed by the SMOTE algorithm;
[0057] Figure 8 is the ROC curve of each classification method in the present invention processed by Kmeans-SMOTE and LR-SMOTE algorithms on the cervical cancer data set;
[0058] Fig. 9 It is the ROC curve of each classification method in the present invention after being processed by the preprocessing method in the present invention. DETAILED DESCRIPTION
[0059] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0060] The present invention provides a cervical cancer prediction method based on adaptive KNN noise recognition, such as Figure 1 As shown, the specific implementation steps are as follows:
[0061] Step 1: Obtain the cervical cancer dataset from the UCI database.
[0062] Step 2: Process missing values and create new target features for the acquired cervical cancer dataset to obtain a corrected dataset.
[0063] Step 3: Perform feature correlation analysis and standardization on the corrected cervical cancer data to obtain a normalized data set.
[0064] Step 4: Use adaptive KNN-based noise recognition to classify the normalized cervical cancer data, then use a category-based hybrid oversampling algorithm to integrate the sampled data, use a ten-fold cross-validation method, and split it into a training set and a test set.
[0065] Step 5: Input the training set into SVM (support vector machine) or RF for classification training, and then predict the test set to obtain the prediction result.
[0066] Through the above-mentioned method, the present invention can predict cervical cancer according to specific indicators in the early stage of the patient, improve the accuracy and efficiency of the prediction, and effectively reduce the mortality rate caused by the untimely discovery of cervical cancer. First, the cervical cancer data set is preprocessed; the data set obtained after preprocessing is standardized, and then each data point in the data set is subjected to local density estimation. The density value of each point is calculated using kernel density estimation, and these density values reflect the sample distribution around the point; the k value is determined based on the local density, the nearest k neighbors are found, and the index and label of the neighbors are recorded. Each data point is classified by the defined indicators, and it is divided into a safe part, a boundary part, a noise part and an outlier part, and the noise part data and the outlier part of the minority class and the majority class samples are deleted to avoid the problem of noise propagation; different sampling algorithms are used for sampling the remaining boundary points and safe points, and then the synthesized samples are integrated, and the balanced data is classified using traditional classifiers support vector machines and random forests; finally, it is compared with other methods for processing unbalanced data to verify the feasibility of the method. The unbalanced data processing method in the present invention is mainly used in the field of data mining, and is of great significance to disease prediction, fraud detection, medical detection, etc., and the present invention can effectively improve the accuracy of cervical cancer prediction.
[0067] Example 1
[0068] The cervical cancer dataset of the present invention is preferably collected at the "Hospital Universitariode Caracas" in Caracas, Venezuela. The dataset includes demographic information, habits, and historical medical records of 858 patients. It includes 32 features such as the number of sexual partners of women, the age of first sexual intercourse, smoking, whether they carry human papillomavirus (HPV), and whether they have cancer. Among the 32 features, four target features are included, and '0' is used to represent healthy people and '1' is used to represent patient populations. Due to privacy issues, some patients decided not to answer certain questions, so there are a large number of missing values in the dataset.
[0069] Example 2
[0070] The present invention processes missing values and creates new target features on the acquired cervical cancer dataset to obtain a corrected dataset, and the following scheme is preferred:
[0071] Step 2.1, handle missing values in the data set. Missing values in the data set are displayed as '? '. First, replace them with Nan values. Then, it is found that there are a large number of missing data in some columns, such as more than 50%. Large-scale missing columns are almost useless in subsequent predictions, so they are deleted. Some columns are only missing a small part of the data, such as less than 50%. To analyze the specific meaning of the data, different methods are used to fill in the missing data. For example, the number of sexual partners, First sexual intercourse, and Number of pregnancies are filled with the mode. For features such as Smokes, Smokes (years), Hormonal Contraceptives (years), IUD, and IUD (years), by observing the characteristics of the data, it is found that the number of missing values in these features is roughly the same, that is, the same patients have missing values in the same group of features, so it is inferred that these missing values are because the patients do not have such features, so they are filled with 0.
[0072] Step 2.2, since the data set has 4 target features (the last four columns of the data). Hinselmann (colposcopy), Schiller (iodine test), Citology (thin layer liquid-based cytology), and Biopsy (cervical biopsy) respectively show the results of whether the disease is present using different diagnostic methods. In order to avoid errors caused by differences in multiple disease results, a synthetic diagnostic strategy is selected, with whether the disease is present as the overall result for judgment: that is, as long as 1 (greater than or equal to 1) appears in the diagnosis result, the woman is considered to be diagnosed with cervical cancer, otherwise she is considered not to be ill (0). A new label column is added to the data set as a new target feature. Table 1 shows some feature names of the data set and their meanings.
[0073] Table 1 Some feature names of the dataset and their meanings
[0074] Column Name Field Type Explanation of meaning Age Numerical age Number of sexual partners Numerical Number of sexual partners First sexual intercourse Numerical Age of first sexual intercourse Number of pregnancies Numerical Number of pregnancies Smokes Boolean smoke Hormonal Contraceptives Boolean Hormonal contraceptives IUD Boolean Intrauterine device IUD (years) Numerical Intrauterine device (year) STDs Boolean sexually transmitted diseases STDs(number) Numerical STDs (number) STDs:condylomatiosis Boolean STDs: Genital warts STDs: cervical condylomatosis Boolean STDs: Cervical warts STDs: vaginal condylomatosis Boolean STDs: Vaginal warts Dx:Cancer Boolean Dx: Cancer Dx:HPV Boolean Dx:HPV Hinselmann Numerical Colposcopy: Target characteristics Schiller Numerical Iodine Experiment: Target Characteristics Biopsy Numerical Cervical Biopsy: Target Characteristics
[0075] Example 3
[0076] The present invention performs feature correlation analysis and standardization processing on the corrected cervical cancer data to obtain a standardized data set, and selects the following scheme:
[0077] Step 3.1, feature correlation analysis. Through analysis, it can be found that the values of some columns are all the same and have no effect on the results, so they are directly deleted. Then the Pearson correlation coefficient is used to analyze the relationship between each feature and the incidence, and the features with low correlation with the disease results (i.e. |r| < 0.2) are screened and deleted. The Pearson correlation coefficient is calculated as follows:
[0078]
[0079] in, represents the standard score of the data in the patient characteristics, represents the mean value of the data in the patient characteristics, σ X represents the standard deviation of the data in the patient characteristics, Y represents whether the patient is sick, n represents the total number of patients, and i represents the sample number, which is used to process the data of each patient one by one.
[0080] Step 3.2: Standardize the patient characteristics in the data set using the formula:
[0081]
[0082] Among them, X represents the data in patient characteristics, represents the mean value of the data in the patient characteristics, σ represents the standard deviation of the data in the patient characteristics, X * Represents the data obtained after standardization.
[0083] Example 4
[0084] The present invention uses adaptive KNN-based noise recognition to classify the normalized cervical cancer data, and then uses a category-based hybrid algorithm to oversample, integrates the sampled data, uses a ten-fold cross-validation method, and divides it into a training set and a test set. The following scheme is preferred:
[0085] Step 4.1: Perform local density estimation on each data point in the normalized data set. The formula for kernel density estimation is:
[0086]
[0087] in, is the estimated density at point x; h is the bandwidth parameter, which controls the smoothness of the kernel function; K is the kernel function, and the Gaussian kernel function is selected here. The formula of the Gaussian kernel function is:
[0088]
[0089] Step 4.2: Adaptive k value selection based on local density To determine the k value, the higher the density in the data set, the smaller the k value; conversely, the lower the density, the larger the k value, to ensure that enough neighbors are considered. For each data point record, find the nearest k neighbors and record the neighbors' indexes and labels. Then classify each data point by the two defined indicators of maj_ratio and min_ratio. When the neighbor of a data point is 0, it is marked as an outlier. In the majority class, if maj_ratio>95%, the point is marked as a safe point, if min_ratio>75%, the point is marked as a noise point, and the rest are marked as boundary points. In the minority class, if min_ratio>95%, the point is marked as a safe point, if maj_ratio>75%, the point is marked as a noise point, and the rest are marked as boundary points. The following are the calculation formulas for k value, maj_ratio and min_ratio:
[0090]
[0091]
[0092]
[0093] Among them, majority_count represents the number of majority classes in the neighbors of the non-diseased data point; minority_count represents the number of minority classes in the neighbors of the diseased data point; total_neighbors represents the total number of neighbors of the point. The pseudo code of the adaptive KNN denoising algorithm is shown in Table 2:
[0094] Table 2 Pseudo code of adaptive KNN denoising algorithm
[0095]
[0096]
[0097] Step 4.3: Delete the data labeled as outliers and noise points, sample the remaining data points according to their labels, oversample the data marked as safe points using the SMOTE algorithm, and oversample the data points marked as border points using the BorderlineSMOTE algorithm. The formulas for balancing data using the SMOTE and BorderlineSMOTE oversampling methods are:
[0098] x new =x i +λ×(x nm -x i )
[0099] Among them, x iis a sample of the non-diseased class, x nm is x i is a non-diseased neighbor sample, λ is a random value, λ∈[0,1].
[0100] x new =x b +λ×(x nm -x b )
[0101] Among them, x b is the non-diseased sample in the boundary area, x nm is x b A non-diseased neighbor sample of , λ is a random value, λ∈[0,1]. The pseudo code of the category-based mixed sampling algorithm is shown in Table 3:
[0102] Table 3 Pseudocode of category-based hybrid sampling algorithm
[0103]
[0104] Step 4.4: Combine the results of the separate sampling into a complete data set, that is, obtain balanced data, and then use the ten-fold cross-validation method to split it into a training set and a test set.
[0105] Example 5
[0106] The present invention inputs the training set into SVM (support vector machine) or RF for classification training, and then predicts the test set to obtain the prediction result. The following scheme is preferred:
[0107] The training sets are input into the SVM model for training, and then the test sets are predicted to obtain the prediction results. For the binary classification problem, the SVM formula is as follows:
[0108] The SVM classifier constructs a decision function, expressed as
[0109] f(x)=W T X+b
[0110] Where X represents the data in the patient's characteristics, W represents the weight vector that determines the direction of the hyperplane, b represents the bias term, and f(x) is used to determine the category to which the data point X belongs, that is, whether it is sick or not.
[0111] The training sets are input into the RF model for training, and then the test sets are predicted to obtain the prediction results. For the binary classification problem, the RF formula is as follows:
[0112]
[0113] Where I(·) is the indicator function. Then I=1; otherwise I=0.
[0114] Example 6
[0115] The trained prediction model is used to test the test data. After obtaining the output results, the recall rate, F1 score, G-mean and AUC are used as evaluation criteria to evaluate the results. To verify the effectiveness of the present invention, the following unbalanced data sets are used. The Risk_factors_cervical_cancer data set contains 858 sample data, 756 of which are majority class sample data, 102 of which are minority class data, and the imbalance ratio is 7.41. The PIMA data set contains 768 sample data, 500 of which are majority class sample data, 268 of which are minority class data, and the imbalance ratio is 1.87. The Glass0 data set contains 214 sample data, 144 of which are majority class sample data, 70 of which are minority class data, and the imbalance ratio is 2.05. The Haberman data set contains 306 sample data, 225 of which are majority class sample data, 81 of which are minority class data, and the imbalance ratio is 2.78.
[0116] The above data sets are sampled using the ADKEN method of the present invention and SMOTE, Kmeans-SMOTE, and LR-SMOTE, and the data sets that have not been processed by the imbalanced processing are classified using the support vector machine and random forest. The data are denoised and divided, including dividing the data and sampling according to different types of data. The effect diagram before and after denoising is shown in the figure below. Figure 2 As shown, from Figure 2 It can be seen that after denoising, the boundaries between the majority class and the minority class are clearer, which can reduce the noise introduced by subsequent sampling. Figure 3 This is the result of oversampling the original data using the SMOTE algorithm and the result of oversampling the denoised data using the SMOTE algorithm. After comparison, it can be found that the boundaries between the minority class and the majority class are still clear after sampling the denoised data, which can effectively improve the accuracy of classification.
[0117] The G-mean of the classification results is as follows Figure 4 As shown by Figure 4It can be seen that the G-mean scores of the present invention on the four data sets are generally better than other methods and can better handle the problem of unbalanced data. Among them, on the Risk_factors_cervical_cancer data set, the data set processed by the present invention is classified by support vector machine, and the G mean score is 74.7% higher than the method without any processing, and 14.6%-26.6% higher than other methods; on the PIMA data set, the data set processed by the present invention is classified by support vector machine, and the G mean score is 19% higher than the method without any processing, and 8.1%-14.4% higher than other methods; on the Glass0 data set, the data set processed by the present invention is classified by support vector machine, and the G mean number is 15.5% higher than the method without any processing, which is 1.2% and 0.9% higher than the SMOTE algorithm and Kmeans-SMOTE algorithm, respectively, and slightly worse than the LR-SMOTE algorithm by 0.4%; on the Haberman data set, the data set processed by the present invention is classified by support vector machine, and the G mean is 29.2% higher than the method without any processing, which is 8.9%-27.4% higher than other methods; the F1 score and Recall of the classification results are as follows: Figure 5 and Figure 6 shown.
[0118] Figure 7 , Figure 8 and Fig. 9 The results of AUC changes on Risk_factors_cervical_cancer dataset are as follows: unprocessed classification using SVM and RF classifiers, classification using SMOTE after SMOTE sampling, classification using SVM and RF classifiers after Kmeans-SMOTE sampling, classification using SVM and RF classifiers after LR-SMOTE sampling, and classification using SVM and RF classifiers after AKDEN sampling. It can be seen from these result graphs that the noise recognition method based on adaptive KNN outperforms the existing imbalanced data processing methods in terms of AUC, recall rate, F1 score and G-mean, indicating that the algorithm is effective and stable.
Claims
1. A cervical cancer prediction method based on adaptive KNN noise recognition, characterized in that: The following steps are involved: Step 1: Obtain the cervical cancer dataset from the UCI database; Step 2: Process missing values and create new target features for the acquired cervical cancer dataset to obtain a corrected cervical cancer dataset; Step 3: Perform feature correlation analysis and standardization on the data in the modified cervical cancer dataset to obtain a standardized cervical cancer dataset; Step 4: Use adaptive KNN-based noise recognition to classify the data in the normalized cervical cancer dataset, then use a class-based hybrid sampling algorithm to oversample, integrate the sampled data, and split it into a training set and a test set using a ten-fold cross-validation method; Step 5: Input the training set into SVM or RF for classification training, and then predict the test set to obtain the prediction results.
2. The cervical cancer prediction method based on adaptive KNN noise recognition according to claim 1, characterized in that: The cervical cancer dataset in step 1 includes 32 features of the patient's demographic information, habits, and historical medical records. The 32 features include four target features: colposcopy, iodine test, thin-layer liquid-based cytology, and cervical biopsy. In the four target features, '0' is used to represent a healthy population, and '1' is used to represent a patient population.
3. The cervical cancer prediction method based on adaptive KNN noise recognition as claimed in claim 2, characterized in that: The step 2 specifically includes the following steps: Step 2.1, process the missing values in the acquired cervical cancer data set. First, replace the missing values displayed by '?' in the data set with Nan values. Second, delete some columns with more than 50% missing data. Finally, fill in the data for some columns with less than 50% missing data. Step 2.2: Add a new label column as a new target feature in the data set. The new target feature is a judgment strategy: as long as the diagnosis result of the four target features is '1', the corresponding woman is considered to be a cervical cancer patient, otherwise the corresponding woman is considered not to be sick.
4. The cervical cancer prediction method based on adaptive KNN noise recognition as claimed in claim 3, characterized in that: The method of filling in the data in step 2.1 includes filling in 0 at the missing part when there are less than 50% missing data in the same group of features and the features belong to the same patient; The remaining features were filled using the mode.
5. The cervical cancer prediction method based on adaptive KNN noise recognition according to claim 1, characterized in that: The step 3 specifically comprises the following steps: Step 3.1: Perform feature correlation analysis on the data in the modified cervical cancer dataset. First, delete some columns with the same values. Then use the Pearson correlation coefficient to analyze the relationship between each feature and the incidence. Select the features with a low correlation with the disease outcome, i.e., |r|<0.2, and delete them. The Pearson correlation coefficient calculation formula is: in, represents the standard score of the data in the patient characteristics, represents the mean value of the data in the patient characteristics, σ X represents the standard deviation of the data in the patient characteristics, Y represents whether the patient is sick, n represents the total number of patients, and i represents the sample number, which is used to process the data of each patient one by one; Step 3.2: Standardize the data in the corrected cervical cancer dataset. The calculation formula is: Among them, X represents the data in patient characteristics, represents the mean value of the data in the patient characteristics, σ represents the standard deviation of the data in the patient characteristics, X * Represents the data obtained after standardization.
6. The method for predicting cervical cancer based on adaptive KNN noise recognition according to claim 1, characterized in that: The step 4 specifically comprises the following steps: Step 4.1: Perform local density estimation on each data point in the normalized cervical cancer dataset. The kernel density estimation formula is: in, is the estimated density at point x; h is the bandwidth parameter, which controls the smoothness of the kernel function; K is the Gaussian kernel function; n represents the total number of patients; i represents the sample number, which is used to process the data of each patient one by one; Step 4.2: Based on local density Determine the adaptive k value, record the nearest k neighbors for each data point, and record the neighbors' indexes and labels; Then, each data point is classified by the two defined indicators of maj_ratio and min_ratio. When the neighbor of a data point is 0, it is marked as an outlier. In the majority class, if maj_ratio>95%, the data point is marked as a safe point, if min_ratio>75%, the data point is marked as a noise point, and the rest of the data points are marked as boundary points. In the minority class, if min_ratio>95%, the data point is marked as a safe point, if maj_ratio>75%, the data point is marked as a noise point, and the rest of the points are marked as boundary points. Among them, majority_count represents the number of majority classes in the neighbors of the non-diseased data point; minority_count represents the number of minority classes in the neighbors of the diseased data point; total_neighbors represents the total number of neighbors of the data point; Step 4.3: Delete the data labeled as outliers and noise points, and use the SMOTE algorithm to oversample the data labeled as safe points. The formula for balancing data using the SMOTE oversampling method is: x new =x i +λ×(x nm -x i ) Among them, x i is a sample of the non-diseased class, x nm is x i A non-diseased neighbor sample, λ is a random value, λ∈[0,1]; The BorderlineSMOTE algorithm is used to oversample the data labeled as boundary points. The formula for balancing the data using the BorderlineSMOTE oversampling method is: x new =x b +λ×(x nm -x b ) Among them, x b is the non-diseased sample in the boundary area, x nm is x b A non-diseased neighbor sample, λ is a random value, λ∈[0,1]; Step 4.4: Combine the results of the separate sampling into a complete data set to obtain balanced data, and then use the ten-fold cross-validation method to split it into a training set and a test set.
7. The method for predicting cervical cancer based on adaptive KNN noise recognition according to claim 1, characterized in that: In step 5, the training set is input into the SVM for classification training, and then the test set is predicted. For the binary classification problem, the SVM formula is as follows: The SVM classifier constructs a decision function, expressed as: f(x)=W T X+b Among them, X represents the data in the patient's characteristics, W represents the weight vector, which determines the direction of the hyperplane, b represents the bias term, and f(x) is used to determine the category to which the data point X belongs, that is, whether it is sick.
8. The method for predicting cervical cancer based on adaptive KNN noise recognition according to claim 1, characterized in that: In step 5, the training set is input into RF for classification training, and then the test set is predicted. For the binary classification problem, the RF formula is as follows: Where I(·) is the indicator function. Then I=1; otherwise I=0.
Citation Information
Patent Citations
Unbalanced data classification oversampling method, device and equipment and medium
CN108647728A
Unbalanced ensemble classification method based on data partition hybrid sampling
CN111091201A
Density-based unbalanced data hybrid sampling algorithm
CN113378987A
Improved SMOTE method based on random undersampling
CN114970704A
Unbalanced data hybrid sampling algorithm with two-step noise filtering
CN116126939A
Cited By
Accurate early warning auxiliary diagnosis model system based on high-risk HPV positive
CN120748693A