Atrial fibrillation patient left atrium thrombus prediction method and system based on unbalanced data set
By employing a two-layer processing framework and feature selection technology, the data imbalance problem in the prediction model for left atrial thrombosis in patients with atrial fibrillation was resolved, improving prediction accuracy and efficiency, simplifying the clinical application process, and reducing costs.
Patent Information
- Application Number
- CN202511059150.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies for predicting left atrial thrombosis in atrial fibrillation patients suffer from insufficient accuracy due to imbalanced datasets, making it difficult to effectively assess the presence of left atrial thrombosis and increasing the risk of complications such as cardiac stroke.
A two-layer processing framework based on atrial fibrillation symptoms and self-sampling is adopted. It combines the nearest neighbor local anomaly factor algorithm with hybrid distance optimization and the adaptive synthetic sampling method with feature exchange improvement to construct a binary classification model with extreme gradient boosting algorithm and TrAdaBoost classifier. By combining data level and algorithm level, key features are selected for prediction.
It improves the accuracy of predicting left atrial thrombosis in patients with atrial fibrillation, simplifies the data collection and feature input process, reduces the cost and time of clinical judgment, and enhances the reliability of the prediction model.
Smart Images

Figure CN120998527A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of medical artificial intelligence, and in particular to a left atrial thrombus prediction method and system for atrial fibrillation patients based on an unbalanced data set. BACKGROUND
[0002] Atrial fibrillation (AF) is a common and serious cardiovascular disease, and its common treatment methods include drug therapy and radiofrequency catheter ablation therapy. When performing radiofrequency catheter ablation for treating atrial fibrillation, it is necessary to assess whether there is a left atrial thrombus (LAT) before the operation. If the left atrium cannot be accurately assessed and cleaned, it may lead to serious complications such as cardiogenic stroke. Therefore, accurately predicting the presence of left atrial thrombus is of great significance for developing a reasonable clinical anticoagulant therapy, reducing intraoperative risk, and improving treatment success rate.
[0003] However, in actual clinical practice, the occurrence probability of left atrial thrombus in atrial fibrillation patients is relatively low, resulting in a serious class imbalance problem in the patient data set used for prediction. For example, in China, about 2.7% of paroxysmal atrial fibrillation patients have left atrial thrombus, and the probability of continuous atrial fibrillation patients is 5.7%, and the probability of long-term continuous atrial fibrillation patients is 6.8%. Because the positive cases of left atrial thrombus are relatively few, the sample quantity is extremely unbalanced, which makes it difficult for standard classification prediction models to accurately affect the prediction effect. Therefore, how to improve the accuracy of left atrial thrombus prediction in atrial fibrillation patients based on unbalanced data sets is the key to improving the treatment effect of atrial fibrillation and reducing the complication and mortality rate. SUMMARY
[0004] In order to overcome the problem that the positive cases of left atrial thrombus are relatively few, the sample quantity is extremely unbalanced, which makes it difficult for standard classification prediction models to accurately affect the prediction effect in the prior art, the present application provides a left atrial thrombus prediction method and system for atrial fibrillation patients based on an unbalanced data set, which processes the left atrial thrombus class imbalance data set based on the atrial fibrillation condition and self-service sampling processing and the processing framework for balancing, effectively improves the classification effect for the class imbalance data set, improves the prediction accuracy of the classification prediction model, and on this basis, respectively constructs a prediction model from the data level and the algorithm level, combines the outputs of the data level and the algorithm level prediction model, captures the key features affecting the left atrial thrombus of atrial fibrillation patients, and accurately completes the left atrial thrombus prediction of atrial fibrillation patients by controlling the key features, which has great significance for doctors to evaluate the left atrial thrombus physical condition of atrial fibrillation patients before the operation.
[0005] According to an aspect of the present application, a left atrial thrombus prediction method for atrial fibrillation patients based on an unbalanced data set is provided, comprising:
[0006] Collect feature values of key features of the atrial fibrillation patient;
[0007] Input the feature values of the key features into the trained left atrial thrombus prediction model, and output the left atrial thrombus prediction result;
[0008] The training of the left atrial thrombus prediction model and the screening process of the key features are as follows:
[0009] The double-layer processing framework is used to balance the left atrial thrombus class imbalance dataset, and the training dataset of the transfer learning strategy is constructed based on the atrial fibrillation condition and self-service sampling processing of the left atrial thrombus class imbalance dataset; the double-layer processing framework includes: nearest neighbor local anomaly factor algorithm based on introduction of hybrid distance optimization and adaptive synthetic sampling method improved based on introduction of hybrid distance and feature exchange;
[0010] The left atrial thrombus prediction model is constructed, which includes a data level prediction model and an algorithm level prediction model; the data level prediction model is a binary classification model based on an extreme gradient boosting algorithm, and the algorithm level prediction model is a binary classification model with TrAdaBoost classifier as bagging base classifier;
[0011] The balanced left atrial thrombus class imbalance dataset is used to train the data level prediction model, and the training dataset is used to train the algorithm level prediction model, and the trained data level prediction model and the algorithm level prediction model are output, and the key features common to the trained data level prediction model and the algorithm level prediction model are screened according to the feature importance function.
[0012] As a further embodiment, the process of balancing the left atrial thrombus class imbalance dataset by the double-layer processing framework is as follows:
[0013] The nearest neighbor local anomaly factor algorithm based on introduction of hybrid distance optimization is used to remove noise data in the left atrial thrombus class imbalance dataset;
[0014] The adaptive synthetic sampling method improved based on introduction of hybrid distance and feature exchange is used to process the left atrial thrombus class imbalance dataset after noise removal, synthesize minority samples, and obtain a balanced class imbalance dataset.
[0015] As a further embodiment, the construction process of the training dataset is as follows:
[0016] The left atrial thrombus class imbalance dataset is divided into paroxysmal atrial fibrillation patient dataset and persistent, long-term atrial fibrillation patient dataset according to the atrial fibrillation condition, the paroxysmal atrial fibrillation patient dataset is taken as a source domain dataset, and is divided into a minority class sample point dataset and a majority class sample point dataset, the sampling number of the majority class sample points is calculated according to a preset minority class sample point ratio, a preset sampling number is set, and each time sampling is performed using a bootstrap sampling method to randomly sample the majority class sample points with replacement from the majority class sample point dataset to obtain a sub-dataset composed of the sampling number of majority class sample points, and the sub-dataset obtained by sampling is combined with the minority class sample point dataset to obtain a preset source domain sub-dataset, the results of all sampling processes are obtained, and a source domain sub-dataset corresponding to the sampling number is obtained;
[0017] The persistent, long-term atrial fibrillation patient dataset is taken as a target domain dataset, the target domain dataset is randomly divided into a target domain training set and a target domain test set based on feature space distribution, and the source domain sub-datasets are combined with the target domain training set, respectively, to form a sub-training set of the training dataset.
[0018] As a further implementation, the algorithm level prediction model is trained using the training dataset, each sub-training set trains a TrAdaBoost classifier, and all trained TrAdaBoost classifiers are combined to obtain a bagging classifier.
[0019] As a further implementation, the process of training the TrAdaBoost classifier by the sub-training set is as follows:
[0020] The sub-training set is input into the TrAdaBoost classifier, the initial weights of all samples in the source domain and the target domain in the sub-training set and the source domain weight update coefficient are set, the weighted source data and the target domain data are used to train the decision tree base classifier in the TrAdaBoost classifier to output the trained decision tree base classifier, and all trained decision tree base classifiers are combined into the final TrAdaBoost classifier by voting.
[0021] As a further implementation, the process of screening the key features is as follows:
[0022] The trained data level prediction model outputs the importance scores of the features according to the feature importance function, the features are sorted from high to low according to the importance scores, a preset number of high-score features focused by the data level are screened out, the algorithm level prediction model is processed in the same way, and the high-score features focused by the algorithm level are output;
[0023] The overlapping high-score features in the high-score features focused by the data level and the algorithm level are integrated as the key features of the prediction model.
[0024] According to another aspect of the present application, a left atrial thrombus prediction system for atrial fibrillation patients based on an unbalanced data set is provided, comprising:
[0025] a data acquisition module configured to acquire feature values of key features of the atrial fibrillation patients;
[0026] a left atrial thrombus prediction module for atrial fibrillation patients configured to input the feature values of the key features into the trained left atrial thrombus prediction model and output a left atrial thrombus prediction result;
[0027] The training of the left atrial thrombus prediction model and the screening process of the key features are as follows:
[0028] The left atrial thrombus class unbalanced data set is balanced using a double-layer processing framework, and a training data set of a transfer learning strategy is constructed based on the atrial fibrillation condition and self-service sampling processing of the left atrial thrombus class unbalanced data set; the double-layer processing framework comprises a nearest neighbor local anomaly factor algorithm based on the introduction of a hybrid distance optimization and a self-adaptive synthetic sampling method improved based on feature exchange and introduction of a hybrid distance;
[0029] A left atrial thrombus prediction model is constructed, which comprises a data level prediction model and an algorithm level prediction model; the data level prediction model is a binary classification model based on an extreme gradient boosting algorithm, and the algorithm level prediction model is a binary classification model taking a TrAdaBoost classifier as a bagging base classifier;
[0030] The balanced left atrial thrombus class unbalanced data set is used to train the data level prediction model, and the training data set is used to train the algorithm level prediction model, and the trained data level prediction model and the algorithm level prediction model are output; the key features common to the trained data level prediction model and the algorithm level prediction model are screened according to a feature importance function.
[0031] According to another aspect of the present application, an electronic device is provided, characterized by comprising a memory and a processor, the memory storing program instructions executed by the processor, and the processor invoking the program instructions to perform a left atrial thrombus prediction method for atrial fibrillation patients based on an unbalanced data set.
[0032] According to another aspect of the present application, a non-transitory computer readable storage medium is provided, characterized by storing computer instructions, the computer instructions causing the computer to perform a left atrial thrombus prediction method for atrial fibrillation patients based on an unbalanced data set.
[0033] Compared with the prior art, the atrial fibrillation patient left atrial thrombus prediction method based on the unbalanced data set has the beneficial effects that the left atrial thrombus class imbalance data set is processed based on the atrial fibrillation condition and the self-help sampling processing and the processing framework for balancing, the classification effect on the class imbalance data set is effectively improved, the prediction accuracy of the classification prediction model is improved, the prediction model is respectively constructed from the data level and the algorithm level, the output of the data level and the algorithm level prediction model is combined, the key features affecting the atrial fibrillation patient left atrial thrombus are captured, the atrial fibrillation patient left atrial thrombus prediction is accurately completed by controlling the key features, and the atrial fibrillation patient left atrial thrombus prediction has great significance for doctors to evaluate the left atrial thrombus physical condition of the atrial fibrillation patient before operation. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0035] Figure 1 is a flowchart of an atrial fibrillation patient left atrial thrombus prediction method based on an unbalanced data set in an embodiment of the present application;
[0036] Figure 2 is a method example flowchart of the atrial fibrillation patient left atrial thrombus prediction based on the unbalanced data set in the embodiment of the present application;
[0037] Figure 3 is a double-layer processing framework flowchart in the embodiment of the present application;
[0038] Figure 4 is a schematic diagram of a new sample step in a data enhancement process in which a hybrid distance is introduced and an adaptive synthetic sampling method based on feature exchange improvement is used in the embodiment of the present application;
[0039] Figure 5 is a balancing processing result schematic diagram of the double-layer processing framework on the unbalanced data set in the embodiment of the present application, taking a two-dimensional data set as an example;
[0040] Figure 6 is a transfer integrated model TrENS structure schematic diagram in the embodiment of the present application;
[0041] Figure 7 is a result schematic diagram of the atrial fibrillation patient left atrial thrombus possibility prediction using the screened 10 key features in the embodiment of the present application;
[0042] Figure 8 is an actual interface of an experimental example in the embodiment of the present application;
[0043] Figure 9is a structural schematic diagram of an atrial fibrillation patient left atrial thrombus prediction system based on an unbalanced data set in an embodiment of the present application.
[0044] Figure 10 is a structural schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0045] It should be noted that:
[0046] The terms "comprise" and "have" and any variations thereof in the specification and claims and the above drawings are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to the steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0047] The block diagrams shown in the drawings are only functional entities, which do not necessarily have to correspond to physically independent entities. That is, these functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices. The flowcharts shown in the drawings are only exemplary descriptions, which do not necessarily include all contents and operations / steps, and do not necessarily be executed in the order described. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to the actual situation.
[0048] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application. In addition, the technical features in each embodiment or single embodiment provided by the present application can be combined with each other to form new technical solutions, which are not restricted by the order of steps and / or structure composition mode, but must be based on the implementation by those skilled in the art. When the combination of technical solutions contradicts each other or cannot be implemented, it should be considered that the combination of technical solutions does not exist, and is not within the scope of protection required by the present application.
[0049] As shown in Figure 1 , Figure 2 , a left atrial thrombus prediction method for atrial fibrillation patients based on an unbalanced data set in an embodiment of the present application comprises:
[0050] Step 1, collecting feature values of key features of atrial fibrillation patients;
[0051] Step 2, inputting the feature values of the key features into the trained left atrial thrombus prediction model to output the left atrial thrombus prediction result;
[0052] The training of the left atrial thrombus prediction model and the screening process of the key features are as follows:
[0053] The double-layer processing framework is used to balance the left atrial thrombus class imbalance dataset, and the training dataset of the transfer learning strategy is constructed based on the atrial fibrillation condition and self-service sampling processing of the left atrial thrombus class imbalance dataset; the double-layer processing framework includes: the nearest neighbor local anomaly factor algorithm based on the introduction of mixed distance optimization and the self-adaptive synthetic sampling method based on the introduction of mixed distance and the improvement of feature exchange;
[0054] The left atrial thrombus prediction model is constructed, which includes a data level prediction model and an algorithm level prediction model; the data level prediction model is a binary classification model based on the extreme gradient boosting algorithm, and the algorithm level prediction model is a binary classification model with TrAdaBoost classifier as the bagging base classifier;
[0055] The balanced left atrial thrombus class imbalance dataset is used to train the data level prediction model, and the training dataset is used to train the algorithm level prediction model, to output the trained data level prediction model and the algorithm level prediction model; according to the feature importance function, the key features common to the trained data level prediction model and the algorithm level prediction model are screened.
[0056] As a specific embodiment, the acquisition process of the left atrial thrombus class imbalance dataset of the atrial fibrillation patient in step 2 includes: collecting relevant data of various atrial fibrillation patients in the hospital to obtain the left atrial thrombus class imbalance dataset of the atrial fibrillation patient, and preprocessing the dataset;
[0057] Specifically, the data inclusion criteria for determining the left atrial thrombus class imbalance data set in this application are: initial diagnosis of atrial fibrillation at admission and TEE examination result parameters. According to the type of atrial fibrillation of the patient, the data set of patients with paroxysmal atrial fibrillation (PAAF_LAT) (including 68520 cases of atrial fibrillation, of which 1589 cases had left atrial thrombus and 66931 cases did not have left atrial thrombus) and the data set of patients with persistent and long-term atrial fibrillation (PEAF_LAT) (including 15872 cases of atrial fibrillation, of which 922 cases had left atrial thrombus and 14950 cases did not have left atrial thrombus) are divided, both of which are class imbalance data sets, and each patient sample in the two data sets has 26 features including patient lifestyle, personal information, underlying conditions, examination results and medication, etc. The relevant data of various atrial fibrillation patients in the hospital are collected to obtain the left atrial thrombus class imbalance data set of atrial fibrillation patients, and the data set is preprocessed, including three steps of missing value processing, text feature recoding, feature screening and deletion.
[0058] Further, the double-layer processing framework in step 2 is as shown in Figure 3 The double-layer processing framework balances the left atrial thrombus class imbalance data set at the data level, and the process includes:
[0059] Step 2.1, based on the nearest neighbor local anomaly factor algorithm (MD-LOF) with mixed distance optimization, to remove noise data in the left atrial thrombus class imbalance data set;
[0060] Step 2.2, introduce mixed distance, adaptive synthetic sampling method (MDFE-ADASYN) based on feature exchange improvement, for processing the left atrial thrombus class imbalance data set after denoising, synthesizing minority samples, and obtaining a balanced class imbalance data set.
[0061] As a specific implementation, the specific implementation of step 2.1 includes the following sub-steps:
[0062] Step 2.1.1: Take any sample point in the class imbalance data set, calculate the mixed distance between the sample point and its kth nearest point, that is, the k-neighbor distance of the sample point.
[0063] Specifically, for the class imbalance data set , , the sample in the data set is denoted by subscript, a total of I samples, each sample point has classification features, ordered features, take any sample point , calculate the mixed distance between the sample point and its kth (k=5 in this embodiment) nearest point :
[0064] ;
[0065] where MD is the Manhattan distance of the categorical feature, used to describe the hybrid distance; is the value difference measure, is the distance of two sample points in the categorical feature space; ED is the Euclidean distance of the ordinal feature.
[0066] Step 2.1.2: Construct the k-distance neighborhood of the sample point with the k- nearest distance of the sample point as the radius and the sample point as the center, take any point in the k-distance neighborhood, compare the k-nearest distance of the point with the distance of the point to the center of the k-distance neighborhood, and select the larger value as the k-th reachable distance of the point to the center.
[0067] Specifically, construct the k-distance neighborhood of point with the k-nearest distance of point as the radius , take any point in , compare the k-nearest distance of point , the hybrid distance between point and point , and select the larger value as the k-th reachable distance of point to point . .
[0068] Step 2.1.3: Repeat step 2.1.2 until the reachable distances of all points in the k- distance neighborhood are calculated, and take the reciprocal of the average reachable distance of all points in the k-distance neighborhood as the local reachable density of the sample point in step 2.1.1.
[0069] Specifically, repeat step 2.1.2 until the reachable distances of all points in the k- distance neighborhood of point are calculated, and take the reciprocal of the average reachable distance of all points in the k-distance neighborhood of point as the local reachable density of point . .
[0070] Step 2.1.4: Calculate the ratio of the average local reachable density of all points in the k-distance neighborhood to the local reachable density of the sample point in step 2.1.1, which is the local anomaly factor of the sample point.
[0071] Specifically, calculate the ratio of the average local reachable density of all points in the k-distance neighborhood of point to the local reachable density of point , which is the local anomaly factor of point . Local anomaly factor of a local outlier factor :
[0072] ;
[0073] Step 2.1.5: Traverse the local anomaly factor of all sample points in the class imbalance data set, and mark the point as an outlier noise point when the local anomaly factor is greater than 1, and delete the point in the data set.
[0074] Specifically, the local anomaly factor of all sample points in the data set is calculated , , and the point is marked as an outlier noise point when the local anomaly factor is greater than 1 , and the point is deleted in the data set .
[0075] As a specific implementation, the specific implementation of step 2.2 includes the following sub-steps:
[0076] Step 2.2.1: For a class imbalance data set, based on the number of majority class samples, the number of minority class samples and the control positive and negative sample balance parameter, calculate the number of minority class samples that need to be synthesized.
[0077] Specifically, for an unbalanced data set , there are I' sample points, each sample point has classification features, ordered features, where the number of majority class samples is , the number of minority class samples is , and the control positive and negative sample balance parameter is , the number of minority samples that need to be synthesized G is calculated: .
[0078] Step 2.2.2: Randomly select a point in the minority class sample points of the class imbalance data set, calculate the number of majority class samples and the proportion in the k-nearest neighbor of the sample point based on the hybrid distance, get the new sample generation ratio near the minority class sample point, and calculate the number of new samples that need to be synthesized based on the sample point, repeat the step until all minority class samples are traversed.
[0079] Specifically, a minority class sample point is randomly selected, the number of majority class samples and the proportion in the k-nearest neighbor of the sample point are calculated based on the hybrid distance, and the new sample generation ratio of the minority class sample is obtained: , and the number of new samples that need to be synthesized based on is calculated : , repeat this step until all minority class samples are traversed.
[0080] Step 2.2.3: Take any minority class sample point, select the minority class sample closest to it in the mixed distance among its k neighbors, compare the classification features of the two, and exchange the classification features with different values in turn, while the ordered features are still synthesized into the ordered features of the new sample by random linear weighting. Repeat this step until all minority class sample points to be synthesized are traversed.
[0081] Specifically, among the k neighbors of the minority class sample , select the minority class sample closest to in the mixed distance, compare the classification features of the sample point to be synthesized and , exchange the classification features with different values in turn, while the ordered features are still synthesized into the ordered features of the new sample by random linear weighting. See Figure 4 for the introduction of the mixed distance, the improved adaptive synthesis sampling method based on feature exchange, and the synthesis of new samples in the data augmentation process. Repeat this step until all minority class sample points to be synthesized are traversed.
[0082] As a specific embodiment, see Figure 5 for the results of the balancing process of the non-balanced data set in the double-layer processing framework in this embodiment. Since each patient sample in the data set in this embodiment has 26 features, it is not convenient to display, so only a two-dimensional data set is used as an example to show the process.
[0083] See Figure 5 (a) for the original non-balanced data set, which is composed of majority class samples and minority class samples, and there are some sample points O1-O5 that deviate from the majority of the data in the data set. These noise samples will affect the determination of the class boundary by the classification model. See Figure 5 (b) for the results after processing by the MD-LOF (MD-LOF) (noise processing layer) based on the introduction of the mixed distance optimization nearest neighbor local outlier factor algorithm in step 2.1, which screens and removes the noise sample points O1-O5 in the original data set, eliminating the influence of noise samples on the data augmentation stage. See Figure 5 (c) for the results after processing by the MDFE-ADASYN (MDFE-ADASYN) (data augmentation layer) based on the introduction of the mixed distance and the improved adaptive synthesis sampling method based on feature exchange in step 2.2, which successfully expands the number of minority class samples within the boundary and improves the class imbalance of the data set.
[0084] As a specific embodiment, the left atrial thrombus imbalance dataset in step 2 is balanced using a double-layer processing framework, and then a data-level prediction model is trained using the balanced results: the extreme gradient boosting algorithm (XGBoost) is used as a binary classification model to determine whether the atrial fibrillation patient has left atrial thrombus at the data level. The PAAF_LAT dataset and the PEAF_LAT dataset after balancing are subjected to binary classification tasks, and the training set and the test set are divided in the ratio of 8:2. The best model parameters are obtained using the grid search method, including the maximum depth of the decision tree (max_depth), the learning rate (learning_rate), the post-pruning parameter (gamma), the number of trees (n_estimators), the random sampling of training samples (subsample), and the minimum leaf node sample weight and (min_child_weight). The specific hyperparameters for the two datasets are shown in Table 1.
[0085] Table 1 Model hyperparameters based on grid search method
[0086]
[0087] The F1 value, geometric mean score (G-mean), and area under the ROC curve (AUC) are used as classification effect evaluation indicators. The F1, G-mean, and AUC for the PEAF_LAT dataset classification are increased by 8.2%, 35%, and 9%, respectively. The F1, G-mean, and AUC for the PEAF_LAT dataset classification are increased by 24.8%, 31.1%, and 5.6%, respectively.
[0088] Further, in step 3, the construction process of the training dataset is as follows:
[0089] The paroxysmal atrial fibrillation patient dataset is used as the source domain dataset, which is divided into a minority class sample point dataset and a majority class sample point dataset. The number of majority class sample points is calculated according to the pre-set minority class sample point ratio, and the pre-set sampling times. In each sampling, the self-sampling method is used to randomly sample the majority class sample points from the majority class sample point dataset to obtain a sub-dataset, and the sub-dataset obtained by sampling is combined with the minority class sample point dataset to obtain a pre-set source domain sub-dataset. The results of all sampling processes are obtained, and the source domain sub-datasets corresponding to the sampling times are obtained.
[0090] The persistent and long-term atrial fibrillation patient dataset is used as the target domain dataset, which is randomly divided into a target domain training set and a target domain test set based on the feature space distribution. The source domain sub-datasets are combined with the target domain training set to form a sub-training set of the training dataset.
[0091] As a specific embodiment, the training data set includes a minority class proportion controllable training set and test set, and the construction process is as follows: set the minority class proportion in the source domain sub-data set to k, and after the feature space distribution alignment based on the feature selection method, divide the source domain data set into a LAT (left atrial thrombus) data set (1589 samples) and a non-LAT (no left atrial thrombus) data set (66931 samples) by taking PAAF_LAT as the source domain data set. Based on the bootstrap sampling method, N non-LAT sub-data sets (1589 x (1 / k-1) samples) are randomly sampled with replacement from the non-LAT data set, and then the N non-LAT sub-data sets are combined with the LAT data set to obtain N source domain sub-data sets.
[0092] At the same time, taking PEAF_LAT as the target domain data set, the target domain data is randomly shuffled and divided into a target domain training set and a target domain test set in an 8:2 ratio, and N source domain data sets are combined with the target domain training set to obtain N sub-training sets.
[0093] Further, since paroxysmal atrial fibrillation is the initial stage of persistent atrial fibrillation, the PAAF_LAT data set can help the PEAF_LAT data set in terms of insufficient minority class sample size affecting the classification effect. Therefore, the transfer learning algorithm TrAdaBoost is combined with the ensemble learning Bagging algorithm to construct a classification prediction model (TrENS) based on transfer learning and ensemble learning as an algorithm-level prediction model to optimize the binary classification results of the class imbalance atrial fibrillation patient data set in terms of left atrial thrombus. See Figure 6 , the structure diagram of the transfer ensemble model TrENS constructed in this embodiment, taking TrAdaBoost as the Bagging base classifier, using the TrAdaBoost algorithm to alleviate the class distribution skew in the target domain and the problem of insufficient training data, and using the improved Bagging algorithm to adjust the proportion of left atrial thrombus samples in the source domain data set.
[0094] Further, the algorithm-level prediction model in step 2 is trained using the training data set, each sub-training set is trained to obtain a TrAdaBoost classifier, and all trained TrAdaBoost classifiers are combined to obtain a bagging classifier.
[0095] As a specific embodiment, a TrAdaBoost classifier is learned on each sub-training set as a Bagging base classifier, and after training N base classifiers, the base classifiers are combined: the N base classifiers constructed by training are combined together, and the final prediction result is obtained through logical or rules. If any base classifier gives a positive response, the final positive class judgment is triggered.
[0096] Further, the process of training the sub-training set to train the TrAdaBoost classifier is as follows:
[0097] The sub-training set is input into the TrAdaBoost classifier, the initial weights of all samples in the source domain and the target domain in the sub-training set and the source domain weight update coefficient are set, the weighted source data and the target domain data are used to train the decision tree base classifier in the TrAdaBoost classifier, and the trained decision tree base classifier is output. All trained decision tree base classifiers are combined into the final TrAdaBoost classifier by voting.
[0098] As a specific implementation, the process of training the algorithm level prediction model using the training data set is as follows:
[0099] Based on the sub-training set, the TrAdaBoost model is trained as a Bagging base classifier: the initial weights of all samples in the source domain and the target domain input into the model are set, and the source domain weight update coefficient is set. Then, the decision tree weak classifier is trained based on the weighted source data and the target data, the classification error rate on the target domain is calculated, the target domain weight update coefficient is set according to the error rate, and the weights of all samples are updated. Repeat the iteration until the preset iteration number is reached or the classifier performance no longer improves significantly. All trained decision tree classifiers are combined into the final TrAdaBoost classifier by voting.
[0100] Specifically, the binary classification results of the algorithm level optimized atrial fibrillation patient data set with or without left atrial thrombus are optimized. The F1, G-mean and AUC of the PEAF_LAT data set classification results are improved by 6.9%, 34.2% and 4.9% respectively compared with the control group using the decision tree as the classification model.
[0101] Further, in step 2, the process of screening the key features is as follows:
[0102] For the trained data level and algorithm level prediction model, the feature importance function (feature_importance) in the tree model is used to output the importance score of the feature, and the high-score features are screened according to the importance score from high to low. The number of high-score features is pre-set. The overlapping high-score features in the high-score features focused by the data level and the algorithm level are integrated as the key features of the prediction model.
[0103] As a specific implementation, see Table 2 for comparison results of the importance of each feature screened from high to low in each scheme of step 4 in this embodiment. Scheme (1) refers to directly performing a classification task using an original data set by using an extreme gradient boosting algorithm. Scheme (2) refers to improving the class imbalance of the data set by using the double-layer processing framework proposed in step 2 of the present application, and then performing a classification task by using an extreme gradient boosting algorithm. Scheme (3) refers to performing a classification task by using an original data set by using the transfer integrated learning model proposed in step 3 of the present application.
[0104] Table 2 Comparison results of the importance of each feature screened from high to low in each scheme
[0105]
[0106] As can be seen from Table 2, only three common important features are present in the first 11 important features of schemes (2), (3) and scheme (1), which are anticoagulant drugs, CHA2DS2_VASc score (stroke risk score of atrial fibrillation) and BMI (body mass index). It is shown that the double-layer processing framework at the data level and the transfer integrated learning model at the algorithm level proposed in the present application both make certain adjustments to the focus of the data set, so that the prediction effect of left atrial thrombosis of atrial fibrillation patients based on the non-balanced data set is better.
[0107] At the same time, as can be seen from Table 2, the features that are more concerned in the training process of the classification model of scheme (2) and scheme (3) are almost identical, and there are 10 common important features among the 11 important features: anticoagulant drugs, CHA2DS2_VASc score, left atrial diameter, BMI, ejection fraction, INR (international normalized ratio), right atrial diameter, age, right ventricular diameter and left ventricular internal diameter at end diastole. Among the 10 common important features, three features are common important features of schemes (2), (3) and scheme (1), six features belong to examination results, including cardiac structure data and blood test data, and the last feature is “age”, which belongs to patient personal basic information. It is shown that the focus of the data set features of the schemes at the data level and the algorithm level proposed in the present application is extremely similar, and the above 10 common features can be considered as key features affecting the determination process of left atrial thrombosis of atrial fibrillation patients in this embodiment.
[0108] As a supplementary explanation, the reason for screening the key features here is that:
[0109] 26 features are all effective features, which play a role or more or less in determining whether the patient has left atrial thrombus. But in actual clinical application, if the original data set is input for judgment, 26 features of each patient need to be collected, and in busy clinical work, it is time-consuming and easy to make mistakes to collect and input the 26 data points completely, and some features (such as less commonly used laboratory indicators) may require additional tests, increasing the cost and time of the hospital and the patient. If only 10 key features can achieve similar judgment effect as 26 features, it will greatly simplify the data entry process, reduce workload, reduce the risk of model failure due to data missing or input errors, and make the entire prediction process faster, more efficient and lower cost.
[0110] The two schemes respectively start from the data level and the algorithm level, and to some extent solve the classification problem of unbalanced data set. In the results of the feature importance output of the two schemes, it is found that among the top 11 most important features, 10 of them coincide, while the remaining features are different in attention. This shows that both schemes will make some adjustments to the focus of the data set in the processing process, but the types of features that are more concerned are almost the same, indicating that the common features of the two schemes are the key influencing factors in the prediction process of left atrial thrombus in atrial fibrillation patients, so it is reliable to use these 10 key factors as input features in the actual clinical judgment of left atrial thrombus.
[0111] Further, in step 5, it further includes: when processing the key feature values of the to-be-tested atrial fibrillation patient, introducing the SHAP algorithm in the left atrial thrombus prediction model to quantify and visualize the influence of the key feature values on the prediction of left atrial thrombus.
[0112] As a specific implementation, the data level processing scheme is better than the algorithm level processing scheme in the final classification effect, so in step 5, the XGBoost model trained by the data set loaded through the double-layer processing framework is selected, and after inputting the key feature values of the to-be-tested atrial fibrillation patient, the possibility of the atrial fibrillation patient having or not having left atrial thrombus is obtained through the predict_proba function, and the SHAP (SHapley Additive exPlanations) algorithm is introduced to quantify and visualize the positive and negative effects of each feature in the current prediction. Please see Figure 7As shown in a result diagram of the left atrial thrombus possibility prediction of the atrial fibrillation patient by using the 10 key features screened in the embodiment, the atrial fibrillation patient has a 65.00% probability of having the left atrial thrombus and a 35.00% probability of not having the left atrial thrombus, and in general, the atrial fibrillation patient is very likely to have the left atrial thrombus, and the doctor should pay special attention. The four features that have the greatest impact on the result of the patient are "anticoagulant drug", "ejection fraction", "CHA2DS2_VASc score" and "right atrial diameter".
[0113] As a specific embodiment, the application sets an experimental example, loads 10 key features to the trained model, and inputs the patient key feature value example as shown in Table 3.
[0114] Table 3. Example of inputting patient key feature value
[0115]
[0116] The final result shows that the patient has a 27.41% probability of having the left atrial thrombus and a 72.59% probability of not having the left atrial thrombus, and finally suggests that the clinician judges that the patient does not have the left atrial thrombus. In this process, the SHAP value of each feature is calculated to reflect the influence degree of each feature on the final judgment result as shown in Table 4, which shows that the largest reason for judging that the patient does not have the left atrial thrombus is that the patient uses the anticoagulant drug, and the actual interface is as shown in Figure 8 .
[0117] Table 4. Example of key feature SHAP value
[0118]
[0119] The implementation basis of each embodiment of the application is that the processing is realized by the system with the processor function. Therefore, in engineering practice, the technical solutions and functions of each embodiment of the application are packaged into various modules. Based on this actual situation, on the basis of the above-mentioned embodiments, the embodiment of the application provides a left atrial thrombus prediction system for atrial fibrillation patients based on an unbalanced data set, which is used to execute one of the left atrial thrombus prediction methods for atrial fibrillation patients based on an unbalanced data set in the above-mentioned method embodiments.
[0120] Referring to Figure 9 , the system comprises:
[0121] The data acquisition module is configured to acquire feature values of key features of the atrial fibrillation patient; the left atrial thrombus prediction model of the atrial fibrillation patient is configured to input the feature values of the key features into the trained left atrial thrombus prediction model, and output a left atrial thrombus prediction result; the training of the left atrial thrombus prediction model and the screening process of the key features are as follows: a double-layer processing framework is used to balance the left atrial thrombus imbalance dataset, and a training dataset of a transfer learning strategy is constructed based on the atrial fibrillation condition and self-service sampling processing of the left atrial thrombus imbalance dataset; the double-layer processing framework comprises: a nearest neighbor local anomaly factor algorithm based on introduction of a hybrid distance optimization and a self-adaptive synthetic sampling method based on feature exchange improvement; a left atrial thrombus prediction model is constructed, the model comprises a data level prediction model and an algorithm level prediction model, the data level prediction model is a binary classification model based on an extreme gradient boosting algorithm, and the algorithm level prediction model is a binary classification model taking a TrAdaBoost classifier as a bagging base classifier; the data level prediction model is trained using the balanced left atrial thrombus imbalance dataset, and the algorithm level prediction model is trained using the training dataset, and the trained data level prediction model and the algorithm level prediction model are output, and the key features common to the trained data level prediction model and the algorithm level prediction model are screened according to a feature importance function.
[0122] It should be noted that the system embodiments provided by the present application are used to implement the methods in the above method embodiments, and are also used to implement the methods in other method embodiments provided by the present application, the difference is only that the corresponding function modules are set, and the principle is basically the same as that of the above system embodiments provided by the present application, as long as the person skilled in the art improves the modules in the above system embodiments on the basis of the above system embodiments, refers to the specific technical solutions in other method embodiments, obtains the corresponding technical means by combining technical features, and the technical solutions composed of these technical means, on the premise of ensuring the practicability of the technical solutions, the corresponding system class embodiments are obtained by improving the modules in the above system embodiments, and are used to implement the methods in other method class embodiments.
[0123] The method of the embodiment of the present application is realized by relying on an electronic device, and therefore it is necessary to introduce the related electronic device. For this purpose, the embodiment of the present application provides an electronic device, such as Figure 9As shown, the electronic device includes at least one processor, a communications interface, at least one memory, and a communications bus. The at least one processor, the communications interface, and the at least one memory communicate with each other through the communications bus. The at least one processor invokes a logic instruction in the at least one memory to execute all or part of the steps of the method provided in each of the foregoing method embodiments.
[0124] In addition, the logic instruction in the at least one memory described above is implemented in the form of a software function unit and sold or used as an independent product. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the part of the technical solutions is embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (a personal computer, a server, or a network device) to execute all or part of the steps of the method described in each of the method embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various storage program code media.
[0125] The system embodiments described above are merely illustrative. The units described as separate components are or are not physically separated, and the components displayed as units are or are not physical units, located in one place, or distributed to multiple network units. According to the actual selection, part or all of the modules achieve the purpose of the embodiment. Those skilled in the art can understand and implement without creative labor.
[0126] Those skilled in the art will appreciate that embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0127] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0128] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0129] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0130] Finally, it should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the technical solutions of the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified or equivalent replacements can be made to some or all of the technical features; and the modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present application.
Claims
1. A method for left atrial thrombus prediction in atrial fibrillation patients based on imbalanced datasets, characterized in that, The method comprises the following steps: collecting feature values of key characteristics of atrial fibrillation patients; inputting the feature values of the key characteristics into a trained left atrial thrombus prediction model to output a left atrial thrombus prediction result; the training of the left atrial thrombus prediction model and the screening process of the key characteristics are as follows: a double-layer processing framework is used to balance the left atrial thrombus imbalanced dataset, a transfer learning strategy training dataset is constructed based on the atrial fibrillation condition and self-sampling processing of the left atrial thrombus imbalanced dataset, and the double-layer processing framework comprises a nearest neighbor local anomaly factor algorithm based on introduction of a hybrid distance optimization and a self-adaptive synthetic sampling method based on feature exchange improvement; a left atrial thrombus prediction model is constructed, the model comprises a data level prediction model and an algorithm level prediction model, the data level prediction model is a binary classification model based on an extreme gradient boosting algorithm, and the algorithm level prediction model is a binary classification model taking a TrAdaBoost classifier as a bagging base classifier; the data level prediction model is trained using the balanced left atrial thrombus imbalanced dataset, and the algorithm level prediction model is trained using the training dataset, and the trained data level prediction model and the algorithm level prediction model are outputted, and key characteristics common to the trained data level prediction model and the algorithm level prediction model are screened according to a feature importance function.
2. The method for predicting left atrial thrombus in atrial fibrillation patients based on unbalanced dataset according to claim 1, characterized in that, the process of balancing the left atrial thrombus imbalanced dataset by using the double-layer processing framework is as follows: the nearest neighbor local anomaly factor algorithm based on introduction of a hybrid distance optimization is used to remove noise data in the left atrial thrombus imbalanced dataset; the self-adaptive synthetic sampling method based on feature exchange improvement is used to process the left atrial thrombus imbalanced dataset after noise removal, synthesize minority samples, and obtain a balanced imbalanced dataset.
3. The method for predicting left atrial thrombus in atrial fibrillation patients based on unbalanced dataset of claim 1, wherein, the construction process of the training dataset is as follows: the left atrial thrombus imbalanced dataset is divided into paroxysmal atrial fibrillation patient dataset and persistent and long-term atrial fibrillation patient dataset according to the atrial fibrillation condition, the paroxysmal atrial fibrillation patient dataset is taken as a source domain dataset and is divided into minority class sample point dataset and majority class sample point dataset, the sampling number of the majority class sample points is calculated according to a preset minority class sample point ratio, a preset sampling number is set, a self-sampling method is used to randomly sample the majority class sample points with replacement to obtain a sampling number of majority class sample points to form a sub-dataset each time, and the sub-datasets obtained by sampling are combined with the minority class sample point dataset to obtain a preset source domain sub-dataset, the results of all sampling processes are obtained, and a plurality of source domain sub-datasets corresponding to the sampling number are obtained; the persistent and long-term atrial fibrillation patient dataset is taken as a target domain dataset, the target domain dataset is randomly divided into target domain training set and target domain test set based on feature space distribution, and the source domain sub-datasets are combined with the target domain training set respectively to form sub-training sets of the training dataset.
4. The method for predicting left atrial thrombus in atrial fibrillation patients based on unbalanced dataset of claim 3, wherein, the algorithm level prediction model is trained using the training dataset, each sub-training set is used to train a TrAdaBoost classifier, and all the trained TrAdaBoost classifiers are combined to obtain a bagging classifier.
5. The method for predicting left atrial thrombus in atrial fibrillation patients based on unbalanced dataset of claim 4, wherein, The process of training the sub-training set to train the TrAdaBoost classifier is: Inputting the sub-training set into the TrAdaBoost classifier, setting the initial weights of all samples in the source domain and the target domain in the sub-training set and the source domain weight update coefficient, training the decision tree base classifier in the TrAdaBoost classifier using the weighted source data and the target domain data, outputting the trained decision tree base classifier, and combining all the trained decision tree base classifiers into the final TrAdaBoost classifier through voting.
6. The method for predicting left atrial thrombus in atrial fibrillation patients based on unbalanced dataset of claim 1, wherein, The screening process of the key features is: The trained data-level prediction model outputs the importance scores of the features according to the feature importance function, sorts the features according to the importance scores from high to low, screens a preset number of high-score features focused on the data level, processes the algorithm-level prediction model in the same way, and outputs high-score features focused on the algorithm level; Integrating the overlapping high-score features in the high-score features focused on the data level and the algorithm level as the key features common to the prediction model.
7. The method for predicting left atrial thrombus in atrial fibrillation patients based on unbalanced dataset of claim 1, wherein, Further comprising: When processing the feature values of the key features of the to-be-tested atrial fibrillation patient, introducing the SHAP algorithm into the left atrial thrombus prediction model to quantify and visualize the influence of the key feature values on the left atrial thrombus prediction.
8. A left atrial thrombus prediction system for atrial fibrillation patients based on an imbalanced dataset, characterized by, Comprising: A data acquisition module for acquiring feature values of key features of atrial fibrillation patients; An atrial fibrillation patient left atrial thrombus prediction module for inputting the feature values of the key features into the trained left atrial thrombus prediction model and outputting left atrial thrombus prediction results; The training of the left atrial thrombus prediction model and the screening process of the key features are: Balancing the left atrial thrombus class imbalanced dataset using a double-layer processing framework, processing the left atrial thrombus class imbalanced dataset based on atrial fibrillation conditions and bootstrap sampling to construct a training dataset for a transfer learning strategy; the double-layer processing framework includes a nearest neighbor local anomaly factor algorithm based on the introduction of a hybrid distance optimization and an adaptive synthetic sampling method improved based on feature exchange and introduction of a hybrid distance; Constructing a left atrial thrombus prediction model, which includes a data-level prediction model and an algorithm-level prediction model, the data-level prediction model being a binary classification model based on an extreme gradient boosting algorithm, and the algorithm-level prediction model being a binary classification model with a TrAdaBoost classifier as a bagging base classifier; Training the data-level prediction model using the balanced left atrial thrombus class imbalanced dataset, training the algorithm-level prediction model using the training dataset, outputting the trained data-level prediction model and the algorithm-level prediction model, and screening the key features common to the trained data-level prediction model and the algorithm-level prediction model according to a feature importance function.
9. An electronic device, comprising: The memory stores program instructions executed by the processor, and the processor invokes the program instructions to execute the method of any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, comprising: The non-transitory computer readable storage medium stores computer instructions, which cause the computer to execute the method of any one of claims 1 to 7.