A disease prediction method based on multi-label imbalance data classification
By preprocessing and weighting multi-label imbalanced data, and combining the XGBoost algorithm with an improved asymmetric loss function, the problem of local imbalance in multi-label imbalanced data is solved, improving the accuracy and efficiency of disease prediction models and making them suitable for early prediction of rare diseases.
Patent Information
- Application Number
- CN202411711726.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Existing disease prediction models fail to adequately consider local imbalances when faced with multi-label imbalanced data, leading to the neglect of features of minority class samples and affecting the accuracy and efficiency of the models, especially in the prediction of rare diseases.
By preprocessing multi-label data into cross-boundary samples, self-boundary samples, and internal samples, and calculating the weight of cross-boundary samples under each label, the model parameters are adjusted by combining the XGBoost algorithm and an improved asymmetric loss function to improve the accuracy of the disease prediction model.
It significantly improves the comprehensiveness and accuracy of disease prediction models, especially providing more accurate prediction results in the early prediction of rare diseases and various diseases, and has broad application prospects.
Smart Images

Figure CN119626546B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of disease prediction, and particularly relates to a disease prediction method based on multi-label imbalanced data classification. BACKGROUND
[0002] In the medical field, especially in the aspect of disease prediction, a large amount of medical data is being generated and accumulated. These data contain a large number of features and samples, which 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, which has a non-negligible impact on the performance of the classifier. When training on imbalanced data sets, the majority class often attracts more attention, leading to bias in the learner. Especially in the case where the minority class samples (such as rare diseases or syndromes) are extremely rare compared to the majority class samples (such as common diseases or syndromes), the performance of the disease prediction model will be severely affected, as they tend to ignore the features of the minority class samples.
[0003] The problem of imbalanced data is particularly prominent in the medical field. For example, in early cancer detection, the number of early cancer samples is much smaller than that of healthy samples, leading the model to fail to learn enough features to distinguish between healthy and disease states. In addition, since each type of medical data has its own 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 data set by artificially increasing the minority class samples or reducing the majority class samples. Although this method can improve the recognition rate of the minority class to some extent, it often leads to overfitting or information loss. Another method is to use 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 these methods do not consider the problem of boundary samples under multi-label data.
[0006] In summary, existing methods either fail to adequately address the problem of multi-label imbalanced data, increase the weight of the minority class, consider global imbalance, but do not consider the importance of multi-label boundary samples, the local imbalance of boundary samples may be opposite to the global imbalance, and do not consider local imbalance. Therefore, there is an urgent need for a new method that considers both global and local imbalance to improve the accuracy and efficiency of disease model prediction. SUMMARY
[0007] In view of the deficiencies of the prior art, the present application provides a disease prediction method based on multi-label imbalanced data classification, which comprises the following steps: obtaining medical data to be predicted and preprocessing the medical data, inputting the preprocessed medical data into a trained disease prediction model for processing to obtain a disease prediction result.
[0008] The training process of the disease prediction model comprises the following steps:
[0009] S1: obtaining medical data with multiple labels and preprocessing the medical data to obtain preprocessed medical data;
[0010] S2: dividing the medical data into cross-boundary samples, self-boundary samples and internal samples under each label;
[0011] S3: calculating the weight of each cross-boundary sample under each label;
[0012] S4: inputting the medical data under each label into the base classifier of the classifier chain combined with the xgboost algorithm for multi-label classification to obtain a disease prediction result under each label;
[0013] S5: calculating an improved asymmetric loss according to the disease prediction result and the weight of the cross-boundary sample, adjusting the model parameters according to the improved asymmetric loss to obtain a trained disease prediction model.
[0014] Preferably, the process of preprocessing the medical data comprises: removing medical data with missing value and single value feature column; normalizing the medical data and converting the medical data into structured table data to obtain preprocessed medical data.
[0015] Preferably, the process of dividing the medical data into cross-boundary samples, self-boundary samples and internal samples comprises: using a k-nearest neighbor algorithm to classify the samples, for a single label, the k positive samples closest to the negative sample under the label are taken as the self-boundary samples under the label; the negative sample closest to the self-boundary sample is taken as the cross-boundary sample; and the other samples except the self-boundary samples and the cross-boundary samples are taken as the internal samples.
[0016] Preferably, the process of calculating the weight of the cross-boundary sample comprises:
[0017] calculating the initial weight of the cross-boundary sample according to the distance between the cross-boundary sample and other samples; setting a weight threshold, filtering the initial weight of the cross-boundary sample according to the weight threshold to obtain the final weight of the cross-boundary sample.
[0018] Further, the formula for calculating the initial weight of the cross-boundary sample is:
[0019]
[0020] wherein I c (x i ,j) represents the initial weight of x i under j label, k w represents the specified number of neighbors, x i represents the i-th cross-border sample, z represents the nearest positive sample to the i-th cross-border sample under j label, NN(x i ,j,k) represents the k-th nearest positive sample to the cross-border sample x i under j label, represents the k-th nearest negative sample to the cross-border sample x i under j label.
[0021] Further, filtering the initial weight of the cross-border sample is represented as:
[0022]
[0023] wherein ω represents the weight of the cross-border sample, I c (x i ,j) represents the initial weight of x i under j label, th c represents the weight threshold.
[0024] Preferably, the formula for calculating the improved asymmetric loss is:
[0025]
[0026] wherein L Our_approach represents the improved asymmetric loss, L +cb represents the improved asymmetric loss of the positive sample in each cross-border sample, L -cb represents the improved asymmetric loss of the negative sample in each cross-border sample, p represents the classification probability, γ + represents the parameter for adjusting the weight of the positive sample, γ - represents the parameter for adjusting the weight of the negative sample, γ + and γ - are artificially set, because the positive sample is rare, in order to emphasize the positive sample, γ - > γ + , ω represents the weight of the cross-border sample, α represents the scaling parameter, p m represents the filtered classification probability, L +nb represents the improved asymmetric loss of the positive sample in other samples, L -nb represents the improved asymmetric loss of the negative sample in other samples.
[0027] The beneficial effects of this invention are as follows:
[0028] (1) Improved comprehensiveness and accuracy: By combining asymmetric loss and boundary samples of multi-label imbalanced data, this invention fully considers the global 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 various diseases, and has broad application prospects.
[0030] (3) End-to-end classification process: This invention provides an end-to-end solution from data preprocessing to final classification result output. The entire process is efficient and reliable, and is easy to deploy and apply in clinical settings. Attached Figure Description
[0031] Figure 1 This is a flowchart of the disease prediction model training process in this invention;
[0032] Figure 2 This is a schematic diagram of multi-label sample classification in this invention. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] When analyzing medical data, especially in the context of multi-label imbalanced data, existing techniques often only consider the global imbalance among multiple labels, without fully taking into account the local imbalance at the label boundaries. To address these challenges, this invention proposes a disease prediction method based on multi-label imbalanced data classification. By combining advanced theories of asymmetric loss and boundary samples in multi-label imbalanced data, it achieves in-depth mining and comprehensive analysis of medical data, effectively solving the multi-label imbalance problem in medical data. The method includes the following:
[0035] The medical data to be predicted is acquired and preprocessed. The preprocessed medical data is then input into a trained disease prediction model for further processing to obtain the disease prediction results.
[0036] like Figure 1 As shown, the training process of the disease prediction model includes:
[0037] S1: Obtain medical data with multiple labels and preprocess it to obtain preprocessed medical data.
[0038] Obtain medical data with multiple labels, select a public medical data set as the research object, carefully select medical samples that have been determined to be diseases from it, and perform a random undersampling strategy. This strategy aims to construct an imbalanced medical data set by reducing the number of samples in the sick class, in order to simulate the data imbalance that often occurs in the real world. The medical data includes minority class medical samples and majority class medical samples, and has multiple labels, which can be multiple syndromes of a disease or multiple diseases.
[0039] Preprocess the medical data to optimize data quality, specifically:
[0040] Onehot encoding is performed on the feature values in the medical data, missing values are removed, and it is ensured that each sample in the data set is complete; single-value feature columns are removed, which have no discrimination for learning algorithms; then the medical data is normalized and converted into structured table data as the medical sample set, in order to eliminate the bias that may be caused by different magnitudes of features, to obtain preprocessed medical data.
[0041] S2: Divide the medical data into cross-border samples, self-border samples and internal samples under each label.
[0042] Sample classification is one of the cores of the present application, by the relationship between each label sample and neighbor node, the sample is divided into internal sample, self-border sample and cross-border sample. The classified samples can be processed differently, and are given different weights, considering global imbalance and local imbalance.
[0043] Multi-label data and single-label data are very different, and the boundary problem of multi-label data is much more complex than that of single-label data. In single-label, each boundary sample is definitely at the boundary of the sample cluster, and the boundary samples of the minority class can be directly weighted to improve the boundary classification ability, but in multi-label data, a boundary sample of one label may be an internal sample of another label, and 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, and the imbalance degrees of labels A and B are different, so the importance of the sample to classification cannot be weighted by simply labeling frequency. Therefore, detailed classification of multi-label samples is needed.
[0044] The present application divides the samples into self-border samples, cross-border samples and internal samples.
[0045] Self-border sample: sample close to the boundary of its own label.
[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: classifying samples using the k-nearest neighbor algorithm; for a single label, the k closest positive samples to the negative samples under that label are taken as self-boundary samples under that label; the negative samples closest to the self-boundary samples are taken as cross-boundary samples; and the other samples besides self-boundary samples and cross-boundary samples are taken as internal samples.
[0049] S3: Calculate the weights of each cross-boundary sample under each label.
[0050] This invention calculates the weight of each cross-boundary sample under each label based on the following principles:
[0051] Cross-class samples are considered majority class samples. If a cross-class sample is far from other majority class samples, while the nearest minority class sample is closer to other minority class samples, then the cross-class sample is given a larger weight. This invention posits that a majority class sample within a sparse majority class cluster contains more information, and a majority class sample near a dense minority class cluster contains more information. Overweighting cross-class samples may amplify the effects of global imbalance and make the opposite minority class samples more susceptible to misclassification.
[0052] The weights of samples crossing boundaries are calculated according to the following principles:
[0053] The initial weights of the cross-boundary samples are calculated based on their distances to other samples:
[0054]
[0055] z = NN(x) i ,j,1)
[0056] Among them, I c (x i (j) represents the x of the sample crossing the boundary under label j. i The initial weights, k w Indicates the specified number of neighbors, x i Let z represent the i-th cross-boundary sample, and z represent the nearest positive sample under label j to the i-th cross-boundary sample. NN(x) i (j,k) represents the distance from the cross-boundary sample x under label j. i The most recent k-th positive sample, This represents the distance x from the cross-boundary sample under label j. i The most recent k-th negative sample.
[0057] Considering that over-weighting the cross-boundary samples may increase the influence of global imbalance, a weight threshold is set, and if the weight of the sample is less than the threshold, the benefit of increasing the weight of the sample is greater than the harm, so filtering is performed:
[0058]
[0059] Wherein, ω represents the weight of the cross-boundary sample, th c represents the weight threshold.
[0060] S4: input the medical data under each label into the base classifier of the classifier chain combined with the xgboost algorithm in sequence to perform multi-label classification, and obtain the disease prediction result under each label.
[0061] The application utilizes the classifier chain (CC) combined with xgboost as a base classifier, and modifies the default cross-entropy loss into an improved asymmetric loss.
[0062] CC is a strategy for multi-label classification problems. Unlike traditional single-label classification, the multi-label classification task needs to predict multiple labels at the same time, and the classifier chain can better capture the relationship between the labels by taking the dependency between the labels into account. Sequential label sequences are adopted, and the binary classification model of xgboost is used in sequence, the default cross-entropy loss is modified into an improved asymmetric loss, and the cross-boundary samples in the multi-label imbalance data are considered.
[0063] S4: input the medical data under each label into the base classifier of the classifier chain combined with the xgboost algorithm in sequence to perform multi-label classification, and obtain the disease prediction result under each label.
[0064] S5: calculate the improved asymmetric loss according to the disease prediction result and the weight of the cross-boundary sample, adjust the model parameters according to the improved asymmetric loss, and obtain the 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 the minority class in the imbalance problem, and considers the global imbalance, but does not consider the importance of the boundary samples of the multi-label, and the local imbalance of the boundary samples may be opposite to the global imbalance. Part of the negative samples as boundary samples contain a large amount of information and should not directly reduce the weight; part of the positive samples as boundary samples should further increase the weight.
[0068] The present application improves the ASL in this regard: the internal samples and the self-boundary samples are calculated in the ASL manner, and the cross-boundary samples need to add a weight ω (derived from the algorithm above) considering local imbalance on the basis of ASL, and alpha is a scaling parameter that can scale ω for different data sets to achieve the best effect.
[0069] The improved asymmetric loss formula is:
[0070]
[0071] wherein L Our_approach represents the improved asymmetric loss, L +cb represents the improved asymmetric loss of the positive sample in each cross-boundary sample, L -cb represents the improved asymmetric loss of the negative sample in each cross-boundary sample, p represents the classification probability, and gamma + represents the parameter for adjusting the weight of the positive sample, gamma - represents the parameter for adjusting the weight of the negative sample, gamma + and gamma - are artificially set, because the positive sample is rare, in order to emphasize the positive sample, gamma - is usually set to be greater than gamma + , omega represents the weight of the cross-boundary sample, alpha represents the scaling parameter, p m represents the classification probability after screening, and the probability p is directly 0 when it is lower than the artificially set threshold m, L +nb represents the improved asymmetric loss of the positive sample in other samples, L -nb represents the improved asymmetric loss of the negative sample in other samples.
[0072] The improved asymmetric loss is calculated and the model parameters are adjusted according to the improved asymmetric loss, the training is stopped when the loss function converges or reaches the preset maximum iteration number, the optimal model parameters are saved, and a trained disease prediction model is obtained.
[0073] After the training is completed, the medical data to be predicted is obtained and preprocessed, the preprocessed medical data is input into the trained disease prediction model for processing, and the disease prediction result can be obtained.
[0074] In summary, the present application considers both global imbalance and local imbalance, thereby improving the accuracy and efficiency of disease model prediction. The present application can help doctors evaluate the disease condition and predict the diagnosis and treatment process, and help patients understand the disease development.
[0075] The implementation of the present application 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 methods of the present application. These algorithms can quickly learn and extract valuable information from massive medical data to support medical decision-making and play an important role in actual medical data processing scenarios.
[0076] The present application is evaluated:
[0077] In order to verify the effectiveness of the multi-disease prediction method based on multi-label imbalanced data classification disclosed in the present application, the present embodiment uses one public coronary heart disease syndrome data set and two public multi-label imbalanced data sets for experiments, and the data information is shown in Table 1. The disease data set is a coronary heart disease data set, which focuses on the TCM examination information of patients with different syndromes of coronary heart disease.
[0078] Table 1 Medical data set information
[0079]
[0080] Four mainstream multi-label machine learning classifiers are selected for comparative experiments: multi-label K nearest neighbor (ML-KNN), binary relevance (BR), random k label sets (RAKEL) and combined compactness and acyclicity (COCOA). ML-KNN is a multi-label classification algorithm that uses K nearest neighbor algorithm to predict labels, which uses the relationship between labels to enhance classification performance. BR is the simplest multi-label classification method, which decomposes multi-label problems into multiple binary classification problems. Although it is simple and easy to understand, it ignores the relevance between labels, which may lead to information loss. RAKEL is a multi-label classification method based on label sets, which 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, which aims to improve classification performance by selecting the most representative label combination, which considers the 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 application aims to improve the accuracy of classification by considering the local imbalance factors in cross-border samples. Four comparative algorithms, multi-label K-nearest neighbor (ML-KNN), binary relevance (BR), random k-set labeling (RAKEL) and combined compactness and acyclicity (COCOA), and the method proposed in the present application (labeled as "ours") are used, and experiments are carried out on CHD49, scene, 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 consider the relationship between labels. ML-KNN performs better in data sets with more samples than in data sets with fewer samples. K-nearest neighbor needs a large number of neighbors to reduce the pollution of noise samples and improve classification accuracy. COCOA captures the relationship between label combinations by combining optimization and label acyclicity, and performs better in data sets with lower imbalance, but performs significantly worse in data sets with higher imbalance, indicating that it has some shortcomings in dealing with multi-label imbalance problems. RAKEL performs well in global F1 value (OF1) in data sets with high imbalance, but has limited improvement in data sets with high local imbalance. The method proposed in the present application has almost the best performance in all performance indicators, which shows that the combination of asymmetric focal loss and multi-label boundary sample algorithm is extremely effective in improving the ability of the model to identify minority class samples.
[0084] Meanwhile, the present application carries out an ablation experiment, see Table 3, which compares the performance of the CC+xgboost base classifier without adding the original ASL, the CC+xgboost base classifier with the original ASL and the CC+xgboost base classifier with the boundary sample weight of the ASL (the method of the present application) 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 the imbalanced data can be greatly improved, and by calculating the boundary sample weight, the classification effect can be further improved, especially for some data sets with high local imbalance. This difference shows that the consideration of local imbalance factors in boundary samples effectively improves the classification difficulty on multi-label boundaries. The significant improvement in recall rate and F1 score confirms the advantages of the present application in dealing with multi-label class imbalance problems, which is particularly important for actual medical diagnosis applications, because in such applications, identifying all possible cases (i.e. improving recall rate) is usually more critical.
[0088] The above examples further illustrate the objects, technical solutions and advantages of the present application. It should be understood that the above examples are only preferred embodiments of the present application and are not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made to the present application within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A disease prediction method based on multi-label imbalanced data classification, characterized in that, include: Acquire the medical data to be predicted and preprocess it. Then, input the preprocessed medical data into the trained disease prediction model for further processing to obtain the disease prediction results. The training process for a disease prediction model includes: S1: Acquire medical data with multiple labels and preprocess it to obtain preprocessed medical data; S2: Divide medical data into cross-boundary samples, self-boundary samples, and internal samples under each label; S3: Calculate the weights of each cross-boundary sample under each label; S4: Input the medical data under each label into the base classifier of the classifier chain combined with the xgboost algorithm in sequence to perform multi-label classification and obtain the disease prediction results under each label; S5: Calculate the improved asymmetric loss based on the disease prediction results and the weights of cross-boundary samples. Adjust the model parameters according to the improved asymmetric loss to obtain the trained disease prediction model. The formula for calculating the improved asymmetric loss is: ; in, This indicates an improved asymmetric loss. This represents the improved asymmetric loss for positive samples in each cross-boundary sample. This represents the improved asymmetric loss for negative samples in each cross-boundary sample. Represents the classification probability. This parameter represents the parameter used to adjust the weights of positive samples. This parameter represents the parameter used to adjust the weights of negative samples. and These settings are all manually configured because positive samples are few and far between. To emphasize positive samples, settings are usually configured as follows: > , The weights of samples that cross boundaries are represented. This represents the scaling parameter. This represents the classification probability after filtering. This represents the improved asymmetric loss for positive samples among other samples. This represents the improved asymmetric loss for negative samples among other samples.
2. The 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 features; 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 classifying medical data into cross-boundary samples, self-boundary samples, and internal samples includes: classifying samples using the k-nearest neighbor algorithm; for a single label, the k closest positive samples to the negative samples under that label are taken as self-boundary samples under that label; the negative samples closest to the self-boundary samples are taken as cross-boundary samples; and other samples besides self-boundary samples and cross-boundary samples are taken 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 samples crossing boundaries includes: The initial weight of the cross-boundary sample is calculated based on its distance from other samples; a weight threshold is set, and the initial weight of the cross-boundary sample is filtered based on the weight threshold to obtain the final weight of the cross-boundary sample.
5. A disease prediction method based on multi-label imbalanced data classification according to claim 4, characterized in that, The formula for calculating the initial weights of samples crossing boundaries is: ; in, This indicates samples crossing boundaries under label j. The initial weights, Indicates the specified number of neighbors. This represents the i-th cross-boundary sample. This represents the closest positive sample under label j to the i-th cross-boundary sample. This indicates the distance between samples crossing the boundary under label j. The most recent k-th positive sample, This indicates the distance between samples crossing the boundary under label j. The most recent k-th negative sample.
6. A disease prediction method based on multi-label imbalanced data classification according to claim 4, characterized in that, The initial weights for filtering cross-boundary samples are expressed as follows: ; in, The weights of samples that cross boundaries are represented. This indicates samples crossing boundaries under label j. The initial weights, This represents the weight threshold.
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