Disease prediction method based on multi-label unbalanced data classification
By considering the weight of multi-label boundary samples in the multi-label imbalanced data classification, and combining the xgboost algorithm and improved asymmetric loss function, the problem of poor prediction performance of multi-label imbalanced data in the prior art is solved, achieving higher disease prediction accuracy and comprehensiveness.
Patent Information
- Application Number
- CN202411711726.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-27
AI Technical Summary
The prior art cannot fully consider the importance of multi-label boundary samples when processing multi-label imbalanced data, resulting in poor performance of models in the case of global and local imbalances, especially in the prediction of rare diseases.
A disease prediction method based on multi-label imbalanced data classification is proposed. By acquiring and preprocessing medical data, it is divided into cross-boundary samples, self-boundary samples and internal samples, the cross-boundary samples weights under each label are calculated, and combined with the xgboost algorithm and the improved asymmetric loss function, the model parameters are adjusted to improve prediction accuracy.
It significantly improves the comprehensiveness and accuracy of the disease prediction model, can more accurately predict the early state of rare diseases and multiple diseases, and has broad application prospects.
Smart Images

Figure CN119626546A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of disease prediction, and in particular relates to a disease prediction method based on multi-label imbalanced data classification. Background Art
[0002] In the medical field, especially in the field of disease prediction, a large amount of medical data is being generated and accumulated. These data contain a large number of features and samples and are valuable research materials. However, these data have a very serious imbalance problem. Since most classification algorithms are based on the assumption of balanced data, this is a common problem in most real classification tasks and has a significant impact on classifier performance. When training under an imbalanced dataset, the majority class tends to attract more attention, resulting in learner bias. In particular, when minority class samples (such as rare diseases or syndromes) are extremely scarce relative to majority class samples (such as common diseases or syndromes), the performance of disease prediction models will be seriously affected because they tend to ignore the characteristics of minority class samples.
[0003] The problem of unbalanced data is particularly prominent in the medical field. For example, in early cancer detection, the number of early cancer samples is far less than that of healthy samples, resulting in the model being unable to learn enough features to distinguish between healthy and diseased states. In addition, since each type of medical data has its own unique data distribution and feature set, the inconsistency between different data types also brings additional complexity to model training.
[0004] To overcome these problems, researchers have tried various techniques, such as resampling methods, which balance the dataset by artificially increasing the number of minority class samples or reducing the number of majority class samples. Although these methods can improve the recognition rate of minority classes to a certain extent, they often lead to overfitting or information loss. Another method is to adopt cost-sensitive learning, which solves the imbalance problem by assigning different error costs to different classes, but this requires expert knowledge to set appropriate cost parameters or calculate important samples through specific algorithms.
[0005] Many cost-sensitive algorithms have been proposed in recent years to solve the imbalance problem. However, most of them do not consider the boundary sample problem under multi-label data.
[0006] In summary, existing methods either fail to fully cope with the problem of multi-label imbalanced data, increase the weight of minority classes, and consider global imbalance, but fail to consider the importance of multi-label boundary samples. The local imbalance of boundary samples may be the opposite of the global imbalance, and local imbalance is not considered. Therefore, a new method is urgently needed that takes into account both global imbalance and local imbalance, so as to improve the accuracy and efficiency of disease model prediction. Summary of the invention
[0007] In view of the shortcomings of the prior art, the present invention proposes a disease prediction method based on multi-label imbalanced data classification, the method comprising: obtaining medical data to be predicted and preprocessing the medical data, inputting the preprocessed medical data into a trained disease prediction model for processing, and obtaining a disease prediction result;
[0008] The training process of the disease prediction model includes:
[0009] S1: Obtain medical data with multiple labels and preprocess them to obtain preprocessed medical data;
[0010] S2: Divide the medical data into cross-boundary samples, self-boundary samples and internal samples under each label;
[0011] S3: Calculate the weight of each cross-border sample under each label;
[0012] S4: The medical data under each label is sequentially input into the classifier chain combined with the base classifier of the xgboost algorithm for multi-label classification to obtain the disease prediction results under each label;
[0013] S5: Calculate the improved asymmetric loss based on the disease prediction results and the weights of the cross-boundary samples, adjust the model parameters based on the improved asymmetric loss, and obtain a trained disease prediction model.
[0014] Preferably, the process of preprocessing the medical data includes: removing medical data with missing values and single-value feature columns; normalizing the medical data and converting it into structured tabular data to obtain preprocessed medical data.
[0015] Preferably, the process of dividing medical data into cross-boundary samples, self-boundary samples and internal samples includes: using the k-nearest neighbor algorithm to classify the samples, for a single label, taking the k positive samples closest to the negative samples under the label as the self-boundary samples under the label; taking the negative samples closest to the self-boundary samples as cross-boundary samples; and taking other samples except self-boundary samples and cross-boundary samples as internal samples.
[0016] Preferably, the process of calculating the weight of cross-border samples includes:
[0017] The initial weight of the cross-border sample is calculated according to the distance between the cross-border sample and other samples; a weight threshold is set, and the initial weight of the cross-border sample is filtered according to the weight threshold to obtain the final weight of the cross-border sample.
[0018] Furthermore, the formula for calculating the initial weight of cross-border samples is:
[0019]
[0020] Among them, I c (x i ,j) represents the x of the cross-border sample under label j i The initial weight, k w Indicates the number of specified neighbors, x i represents the i-th cross-border sample, z represents the positive sample closest to the i-th cross-border sample under the j label, NN(x i ,j,k) represents the distance across the boundary sample x under label j i The most recent k-th positive sample, Indicates the distance across the boundary sample x under label j i The k-th most recent negative sample.
[0021] Furthermore, the initial weights of cross-border samples are filtered as follows:
[0022]
[0023] Among them, ω represents the weight of cross-border samples, I c (x i ,j) represents the x of the cross-border sample under label j i The initial weight of c Represents the weight threshold.
[0024] Preferably, the formula for calculating the improved asymmetric loss is:
[0025]
[0026] Among them, L Our_approach represents the improved asymmetric loss, L +cb represents the improved asymmetric loss of positive samples in each cross-boundary sample, L -cb represents the improved asymmetric loss of negative samples in each cross-boundary sample, p represents the classification probability, γ + Represents the parameter for adjusting the weight of positive samples, γ - Represents the parameter for adjusting the weight of negative samples, γ + and γ - They are all set artificially. Because there are few positive samples, in order to emphasize positive samples, γ is usually set - >γ + , ω represents the weight of cross-border samples, α represents the scaling parameter, and p m Represents the classification probability after screening, L +nb represents the improved asymmetric loss of positive samples among other samples, L -nb represents the improved asymmetric loss for negative samples among other samples.
[0027] The beneficial effects of the present invention are:
[0028] (1) Improvement of comprehensiveness and accuracy: By combining asymmetric loss and boundary samples of multi-label imbalanced data, the present invention fully considers the global imbalance and local imbalance of multi-label imbalanced data, thereby significantly improving the comprehensiveness and accuracy of the disease prediction model.
[0029] (2) Social value and application prospects: This method is not only technologically advanced, but also has significant social value. In particular, it can provide more accurate prediction results in the early prediction and estimation of rare diseases and multiple diseases, and has broad application prospects.
[0030] (3) End-to-end classification process: The present invention provides an end-to-end solution, from data preprocessing to the final classification result output. The entire process is efficient and reliable, and is easy to quickly deploy and apply in clinical environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a flow chart of the disease prediction model training in the present invention;
[0032] Figure 2 Schematic diagram of multi-label sample classification in the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] When faced with medical data analysis, especially in the context of multi-label imbalanced data, existing technologies often only consider the global imbalance between multiple labels, but do not fully consider the local imbalance at the label boundary. In response to these challenges, the present invention proposes a disease prediction method based on multi-label imbalanced data classification. By combining asymmetric loss and advanced theories of multi-label imbalanced data boundary samples, in-depth mining and comprehensive analysis of medical data are achieved, effectively solving the multi-label imbalance problem of medical data. The method includes the following contents:
[0035] Obtain the medical data to be predicted and preprocess it, input the preprocessed medical data into the trained disease prediction model for processing, and obtain the disease prediction result.
[0036] like Figure 1 As shown in Figure 1, the training process of the disease prediction model includes:
[0037] S1: Obtain medical data with multiple labels and preprocess them to obtain preprocessed medical data.
[0038] Obtain medical data with multiple labels, select public medical data sets as research objects, carefully select medical samples that have been identified as diseases, and implement a random undersampling strategy. This strategy aims to construct an unbalanced medical data set by reducing the number of diseased class samples to simulate the data imbalance that often occurs in the real world. The medical data includes minority medical samples and majority medical samples with multiple labels, which can be multiple symptoms of a disease or multiple diseases.
[0039] Preprocess medical data to optimize data quality, specifically:
[0040] Onehot encodes the feature values in the medical data and removes missing values to ensure that each sample in the data set is complete; removes single-value feature columns, which have no discernment for the learning algorithm; then normalizes the medical data and converts it into structured tabular data as a medical sample set to eliminate the bias that may be caused by features of different magnitudes and obtain preprocessed medical data.
[0041] S2: Divide the medical data into cross-boundary samples, self-boundary samples and internal samples under each label.
[0042] Sample classification is one of the cores of the present invention. By analyzing the relationship between each label sample and its neighbor nodes, the samples are divided into internal samples, self-boundary samples, and cross-boundary samples. The classified samples can be processed differently and given different weights, taking into account global imbalance and local imbalance.
[0043] Multi-label data is very different from single-label data. The boundary problem of multi-label data is much more complicated than that of single-label data. In a single-label data, each boundary sample must be at the boundary of the sample cluster. The boundary samples of the minority class can be directly weighted to improve the boundary classification ability. However, in multi-label data, the boundary sample of one label may be the internal sample of another label. The importance of boundary samples of different classes is different. Sample a may be a boundary sample of label A and an internal sample of label B at the same time. However, the imbalance degree of labels A and B is different. The importance of samples for classification cannot be weighted by simple label frequency. Therefore, it is necessary to classify multi-label samples in detail.
[0044] The present invention divides samples into: self-boundary samples, cross-boundary samples, and internal samples.
[0045] Self-boundary samples: samples close to their own label boundaries.
[0046] Cross-boundary samples: samples that are close to the boundaries of other labels.
[0047] Internal samples: samples that are not close to the boundary.
[0048] like Figure 2 As shown, the process of dividing medical data into cross-boundary samples, self-boundary samples and internal samples includes: using the k-nearest neighbor algorithm to classify the samples, for a single label, the k positive samples closest to the negative samples under the label are taken as the self-boundary samples under the label; the negative samples closest to the self-boundary samples are taken as cross-boundary samples; and the samples other than the self-boundary samples and cross-boundary samples are taken as internal samples.
[0049] S3: Calculate the weight of each cross-border sample under each label.
[0050] The present invention calculates the weight of each cross-border sample under each label based on the following principles:
[0051] The cross-border sample is a majority class. If the cross-border sample is far away from other majority class samples, and the minority class sample closest to it is closer to other minority class samples, the cross-border sample is given a larger weight. The present invention believes that if a majority class sample is in a sparse majority class sample cluster, it contains more information. If a majority class sample is close to a dense minority class sample cluster, it contains more information. Over-weighting cross-border samples may increase the impact of global imbalance and make the opposite minority samples more easily misclassified.
[0052] The weights of cross-border samples are calculated according to the principle, specifically:
[0053] The initial weight of the cross-border samples is calculated based on the distance between the cross-border samples and other samples:
[0054]
[0055] z=NN(x i ,j,1)
[0056] Among them, I c (x i ,j) represents the x of the cross-border sample under label j i The initial weight, k w Indicates the number of specified neighbors, x i represents the i-th cross-border sample, z represents the positive sample closest to the i-th cross-border sample under the j label, NN(x i ,j,k) represents the distance across the boundary sample x under label j i The most recent k-th positive sample, Indicates the distance across the boundary sample x under label j i The k-th most recent negative sample.
[0057] Considering that over-weighting cross-border samples may increase the impact of global imbalance, a weight threshold is set. If it is less than the threshold, increasing the weight of this sample will do more harm than good, so filtering is performed:
[0058]
[0059] Among them, ω represents the weight of cross-border samples, th c Represents the weight threshold.
[0060] S4: The medical data under each label is input into the classifier chain in turn combined with the base classifier of the xgboost algorithm for multi-label classification to obtain the disease prediction results under each label.
[0061] The present invention utilizes Classifier Chain (CC) combined with xgboost as a base classifier and modifies the default cross entropy loss to an improved asymmetric loss.
[0062] CC is a strategy for multi-label classification problems. Unlike traditional single-label classification, multi-label classification tasks require predicting multiple labels at the same time. Classifier chains can better capture these relationships by taking into account the dependencies between labels. Using a sequential label sequence, the xgboost binary classification model is used in turn, and the default cross entropy loss is modified to an improved asymmetric loss, which takes into account cross-border samples in multi-label imbalanced data.
[0063] The medical data under each label are sequentially input into the classifier chain combined with the base classifier of the xgboost algorithm for multi-label classification to obtain the disease prediction results under each label.
[0064] S5: Calculate the improved asymmetric loss based on the disease prediction results and the weights of the cross-boundary samples, adjust the model parameters based on the improved asymmetric loss, and obtain a trained disease prediction model.
[0065] The original asymmetric loss formula is as follows:
[0066]
[0067] The above formula can dynamically reduce the weight of negative samples and increase the weight of positive samples, which is equivalent to increasing the weight of minority classes in the imbalance problem. It takes into account the global imbalance, but does not take into account the importance of multi-label boundary samples. The local imbalance of boundary samples may be the opposite of the global imbalance. Some negative samples are boundary samples, which contain a large amount of information and should not be directly reduced in weight; some positive samples are boundary samples and their weight should be further increased.
[0068] The present invention improves ASL in this regard: internal samples and self-boundary samples are calculated in the ASL manner, and cross-boundary samples need to add a weight ω (derived from the above algorithm) that takes local imbalance into account on the basis of ASL. α is a scaling parameter, and ω can be scaled according to different data sets to achieve the best effect.
[0069] The formula for improving asymmetric loss is:
[0070]
[0071] Among them, L Our_approach represents the improved asymmetric loss, L +cb represents the improved asymmetric loss of positive samples in each cross-boundary sample, L -cb represents the improved asymmetric loss of negative samples in each cross-boundary sample, p represents the classification probability, γ + Represents the parameter for adjusting the weight of positive samples, γ - Represents the parameter for adjusting the weight of negative samples, γ + and γ - They are all set artificially. Because there are few positive samples, in order to emphasize positive samples, γ is usually set - >γ + , ω represents the weight of cross-border samples, α represents the scaling parameter, and p m It represents the classification probability after screening. When the probability p is lower than the artificially set threshold m, it is directly 0. +nb represents the improved asymmetric loss of positive samples among other samples, L -nb represents the improved asymmetric loss for negative samples among other samples.
[0072] Calculate the improved asymmetric loss and perform training based on the improved asymmetric loss, adjust the model parameters, stop training when the loss function converges or reaches the preset maximum number of iterations, save the optimal model parameters, and obtain a trained disease prediction model.
[0073] After the training is completed, the medical data to be predicted is obtained and preprocessed, and the preprocessed medical data is input into the trained disease prediction model for processing to obtain the disease prediction result.
[0074] In summary, the present invention takes into account both global imbalance and local imbalance, thereby improving the accuracy and efficiency of disease model prediction. The present invention predicts diseases by training models, which can help doctors assess the condition and predict the course of diagnosis and treatment, and help patients understand the progression of the disease.
[0075] The implementation of the present invention can be carried out on different hardware platforms, including but not limited to independent servers, cloud computing platforms or other high-performance computing devices. On these platforms, different artificial intelligence algorithms, such as deep learning networks, optimization algorithms, etc., can be deployed to implement the method of the present invention. These algorithms can quickly learn and extract valuable information from massive amounts of medical data, support medical decision-making, and play an important role in actual medical data processing scenarios.
[0076] Evaluation of the present invention:
[0077] In order to verify the effectiveness of the multi-disease prediction method based on multi-label imbalanced data classification disclosed in the present invention, this embodiment uses a public coronary heart disease syndrome dataset and two public multi-label imbalanced datasets for experiments, and the data information is shown in Table 1 Medical dataset information Table 1. The disease dataset is a coronary heart disease dataset, which focuses on the traditional Chinese medicine examination information of patients with different syndromes of coronary heart disease.
[0078] Table 1 Medical dataset information
[0079]
[0080] Four mainstream multi-label machine learning classifiers are selected for comparative experiments: multi-label K-nearest neighbor (ML-KNN), binary correlation (BR), random k-label set (RAKEL), and combined compactness and acyclicity (COCOA). ML-KNN is a multi-label classification algorithm that predicts labels through the K-nearest neighbor algorithm. It uses the relationship between labels to enhance classification performance. BR is the simplest multi-label classification method that decomposes the multi-label problem into multiple binary classification problems. Although it is simple and easy to understand, it ignores the correlation between labels and may lead to information loss. RAKEL is a multi-label classification method based on label sets. It randomly selects subsets of labels to build multiple classifiers to improve the accuracy and robustness of the model. In this way, it can capture the correlation between labels and improve the overall prediction effect. COCOA is a combinatorial optimization algorithm for multi-label learning. It aims to improve classification performance by selecting the most representative label combination. It considers the mutual exclusivity and dependency of label combinations to optimize the results of multi-label classification. Table 2 is the experimental results of the algorithm comparison experiment.
[0081] Table 2 Algorithm comparison experiment results
[0082]
[0083] The present invention aims to improve the accuracy of classification by considering the local imbalance factors in cross-border samples. Four comparison algorithms, namely multi-label K-nearest neighbor (ML-KNN), binary correlation (BR), random k-label set (RAKEL) and combined compactness and acyclicity (COCOA), and the method proposed in the present invention (marked as "ours") were used, and experiments were carried out on CHD49, scene, and yeast data respectively. From the experimental results, it can be seen that BR, as a classic multi-label classification method, is not ideal in most data sets and most indicators because it does not take into account the relationship between labels. ML-KNN performs better in data sets with a large number of samples than in data sets with a small number of samples. K-nearest neighbors need a large number of neighbors to reduce the pollution of noise samples and improve classification accuracy. COCOA captures the relationship between label combinations through combinatorial optimization and label acyclicity. It performs better in data sets with lower imbalance, and its performance decreases significantly in data sets with higher imbalance, indicating that it has some shortcomings in dealing with multi-label imbalance problems. RAKEL performs well in the global F1 value (OF1) in data sets with higher imbalance, but has limited improvement in data sets with higher local imbalance. The method proposed in the present invention has the best performance in almost all performance indicators, which shows that combining asymmetric focal loss and multi-label boundary sample algorithm is extremely effective in improving the model's ability to identify minority class samples.
[0084] At the same time, the present invention conducted an ablation test, see Table 3, which compares the performance of the CC+xgboost base classifier without the original ASL, the CC+xgboost base classifier with the original ASL, and the CC+xgboost base classifier with the ASL with boundary sample weights (the method of the present invention) on the above three data sets.
[0085] Table 3 Ablation experiment results
[0086]
[0087] Overall, by adding ASL to the classifier, the classification effect of the classifier on imbalanced data can be greatly improved. Calculating the weight of boundary samples can further improve the classification effect, especially for some data sets with large local imbalance. This difference shows that the consideration of local imbalance factors in boundary samples effectively improves the classification problem on the multi-label boundary. The significant improvement in recall rate and F1 score confirms the advantages of the present invention in dealing with the problem of multi-label class imbalance, which is particularly important for practical medical diagnosis applications, because in such applications, identifying all possible cases (i.e., improving recall rate) is usually more critical.
[0088] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A disease prediction method based on multi-label imbalanced data classification, characterized in that: include: Obtain the medical data to be predicted and preprocess it, input the preprocessed medical data into the trained disease prediction model for processing, and obtain the disease prediction result; The training process of the disease prediction model includes: S1: Obtain medical data with multiple labels and preprocess them to obtain preprocessed medical data; S2: Divide the medical data into cross-boundary samples, self-boundary samples and internal samples under each label; S3: Calculate the weight of each cross-border sample under each label; S4: The medical data under each label is sequentially input into the classifier chain combined with the base classifier of the xgboost algorithm for multi-label classification to obtain the disease prediction results under each label; S5: Calculate the improved asymmetric loss based on the disease prediction results and the weights of the cross-boundary samples, adjust the model parameters based on the improved asymmetric loss, and obtain a trained disease prediction model.
2. A disease prediction method based on multi-label imbalanced data classification according to claim 1, characterized in that: The process of preprocessing medical data includes: removing medical data with missing values and single-value feature columns; normalizing the medical data and converting it into structured tabular data to obtain preprocessed medical data.
3. The disease prediction method based on multi-label imbalanced data classification according to claim 1, characterized in that: The process of dividing medical data into cross-boundary samples, self-boundary samples and internal samples includes: using the k-nearest neighbor algorithm to classify the samples. For a single label, the k positive samples closest to the negative samples under the label are regarded as the self-boundary samples under the label; the negative samples closest to the self-boundary samples are regarded as cross-boundary samples; and other samples except self-boundary samples and cross-boundary samples are regarded as internal samples.
4. The disease prediction method based on multi-label imbalanced data classification according to claim 1, characterized in that: The process of calculating the weights of cross-border samples includes: The initial weight of the cross-border sample is calculated according to the distance between the cross-border sample and other samples; a weight threshold is set, and the initial weight of the cross-border sample is filtered according to the weight threshold to obtain the final weight of the cross-border sample.
5. The disease prediction method based on multi-label imbalanced data classification according to claim 4 is characterized in that: The formula for calculating the initial weights of cross-border samples is: Among them, I c (x i ,j) represents the x of the cross-border sample under label j i The initial weight, k w Indicates the number of specified neighbors, x i represents the i-th cross-border sample, z represents the positive sample closest to the i-th cross-border sample under the j label, NN(x i ,j,k) represents the distance across the boundary sample x under label j i The most recent k-th positive sample, Indicates the distance across the boundary sample x under label j i The k-th most recent negative sample.
6. The disease prediction method based on multi-label imbalanced data classification according to claim 4, characterized in that: Filtering the initial weights of cross-border samples is expressed as: Among them, ω represents the weight of cross-border samples, I c (x i ,j) represents the x of the cross-border sample under label j i The initial weight of c Represents the weight threshold.
7. The disease prediction method based on multi-label imbalanced data classification according to claim 1, characterized in that: The formula for calculating the improved asymmetric loss is: Among them, L Our_approach represents the improved asymmetric loss, L +cb represents the improved asymmetric loss of positive samples in each cross-boundary sample, L -cb represents the improved asymmetric loss of negative samples in each cross-boundary sample, p represents the classification probability, γ + represents the parameter for adjusting the weight of positive samples, γ - represents the parameter for adjusting the weight of negative samples, γ + and γ - They are all set artificially. Because there are few positive samples, in order to emphasize positive samples, γ is usually set - >γ + , ω represents the weight of cross-border samples, α represents the scaling parameter, and p m Represents the classification probability after screening, L +nb represents the improved asymmetric loss of positive samples among other samples, L -nb represents the improved asymmetric loss for negative samples among other samples.
Citation Information
Patent Citations
Disease prediction method of medical data based on label imbalance
CN115938567A
Multi-label and few-sample image classification method based on label embedding
CN116721279A
AUC-maximized high-accuracy classifier for imbalanced datasets
US10970650B1