Aneurysm rupture risk prediction device based on stacking and CTGAN enhanced data
By using CTGAN to generate pseudo-samples and stacking models, the diversity and scale of the training dataset are enhanced, and a heterogeneous model pool is constructed. This addresses the inaccuracy of intracranial aneurysm rupture risk assessment tools under the problems of data scarcity and imbalance, and achieves more efficient prediction performance and interpretability.
Patent Information
- Application Number
- CN202510907823.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-11-14
AI Technical Summary
Existing intracranial aneurysm rupture risk assessment tools are insufficient in capturing complex feature interactions, and machine learning methods face the problems of data scarcity and imbalance, affecting the accuracy of prediction results.
CTGAN is used to generate pseudo-samples to enhance the diversity and scale of the training set. A heterogeneous model pool containing random forest, LightGBM, logistic regression and support vector machine is constructed, and the prediction performance is optimized by stacking strategy. Logistic regression is used as a meta-model for weighted summation to obtain the final prediction result.
It significantly improves the accuracy and reliability of aneurysm rupture risk prediction, alleviates the class imbalance problem, and enhances the model's generalization ability and interpretability.
Smart Images

Figure CN120954694A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical data processing technology, and in particular to an aneurysm rupture risk prediction device based on stacked and CTGAN-enhanced data. Background Technology
[0002] The PHASES score, a commonly used tool for assessing the risk of intracranial aneurysm rupture, proposes using age, hypertension, history of subarachnoid hemorrhage (SAH), aneurysm size, aneurysm location, and geographic region as indicators of rupture risk. Risk factors for aneurysm rupture include aneurysm size, morphology, A1 dominance, patient age, and medical history. These factors interact, increasing the difficulty of assessing the risk of aneurysm rupture.
[0003] Machine learning, as a method for building predictive models of aneurysm rupture risk that has emerged in recent years, has received increasing attention. Two-layer feedforward artificial neural networks have been used to predict the rupture risk of anterior communicating artery aneurysms, achieving relatively ideal results. Support vector machines, random forests, and multilayer perceptrons have also been applied to predict aneurysm rupture risk. Classification trees, by recursively dividing the dataset, construct a tree-like decision model that clearly demonstrates the impact of different features on the classification results; random forests, on the other hand, are models composed of multiple classification trees. By combining the prediction results of multiple trees, they can effectively reduce the risk of overfitting and improve the model's generalization ability and prediction accuracy. These machine learning methods can handle massive amounts of clinical data, automatically mining complex patterns and associations within the data, thereby more accurately predicting the rupture risk of aneurysms and providing strong support for clinicians to develop personalized treatment plans.
[0004] However, current tools for assessing the risk of intracranial aneurysm rupture are insufficient in capturing complex feature interactions. Machine learning methods face the challenges of data scarcity and imbalance, which in turn affects the accuracy of predictions. Summary of the Invention
[0005] The main objective of this invention is to overcome the aforementioned deficiencies in the prior art and propose an aneurysm rupture risk prediction device based on stacked and CTGAN-enhanced data. By introducing CTGAN to generate pseudo-samples to enhance the diversity and scale of the training set, and by employing a stacking model stacking strategy to optimize prediction performance and improve prediction accuracy.
[0006] The present invention adopts the following technical solution:
[0007] A device for predicting the risk of aneurysm rupture based on stacked and CTGAN-enhanced data, characterized in that the device includes a processor configured to:
[0008] We acquired case data of patients with intracranial aneurysms, processed the case data, and converted it into numerical form and one-hot encoding as a training set.
[0009] The training set is input into the CTGAN framework. Through adversarial training between the generator and discriminator of the CTGAN framework, the generator learns the potential data distribution pattern. The stabilized generator is used to generate synthetic samples that mimic the training set. The synthetic samples are combined with the training set in proportion to form an enhanced dataset.
[0010] The dataset is divided into a training set and a validation set. A heterogeneous model pool containing random forest, LightGBM, logistic regression, and support vector machine is constructed, with logistic regression as the meta-model. The training set is used to train the four basic classifiers of the heterogeneous model pool. The validation set is input into the trained basic classifiers, and the prediction results are used as meta-features and input into the meta-model. The meta-model performs a weighted summation of the prediction results to obtain the final aneurysm rupture risk prediction result.
[0011] The case data includes clinical features, neuroimaging records, and follow-up files. Missing values in the case data are first processed, and outliers are detected and corrected. All features are divided into demographic features, clinical features, and morphological features, and each feature is converted into numerical form and one-hot encoding form.
[0012] The CTGAN framework employs fully connected networks in both the generator and the discriminator to comprehensively capture potential inter-column correlations in the data; the generator uses a conditional generator G(z,cond), which is represented as:
[0013]
[0014] Where z represents random noise, with dimension |z|, cond1 is the conditional vector, with dimension |cond|; h1, h2, and h3 represent the hidden representations within the network, and N c N d These represent the total number of continuous vectors and the total number of additional discrete variables, respectively. It is a scalar value and is generated by the activation function tanh. and These are the pattern indicator and discrete values, generated using Gumbel, which is the Gumbel-Softmax function; i represents the index of the category, i = 1, 2, 3…N, m i Represents the discrete label associated with category i, used to guide the generative model in generating samples of a specific category, |D i| is a discrete probability distribution, sampled using the Gumbel-Softmax distribution, BN(.) is batch normalization, ReLU(.) is the activation function, FC represents a fully connected layer, and all subscripts i (i = 1, 2, 3… N) mentioned in the formula represent the index of the category.
[0015] The discriminator adopts the PacGAN architecture, as shown below:
[0016]
[0017] Where r1…r 10 Each represents a vectorized representation of an entire row; cond j Let C be the conditional vector, with dimension denoted as |cond|. drop(.) represents regularization, tanh and leaky represent activation functions respectively, and C(·) represents the discriminator.
[0018] Using the random forest for the input samples in the training set, each decision tree generates a class prediction, and the final output class is the class with the highest prediction frequency among all decision trees, as shown in the following formula:
[0019]
[0020] denoted by , represents the final predicted category of the random forest for the input sample x, including whether the aneurysm has ruptured (0 indicates no rupture, 1 indicates rupture); c represents the possible category label, including ruptured or not ruptured; B represents the total number of decision trees in the random forest, which is a hyperparameter; hb(x) represents the predicted category of the b-th decision tree for the input sample x; I(·) is an indicator function, which has a value of 1 when the condition in parentheses is true, and 0 otherwise, and is used to determine whether the predicted category of the b-th decision tree for the input sample x is c.
[0021] The LightGBM iteratively trains the base classifier using a gradient boosting decision tree architecture. It calculates gradient information using numerical data of aneurysm morphological features and dynamically optimizes the selection of decision tree split nodes. In the sample selection of the training set, a gradient-based one-sided sampling strategy is introduced: high-gradient samples that contribute significantly to model optimization are prioritized, while low-gradient samples are randomly sampled to reduce computational complexity. For mutually exclusive sparse features in the training set, feature bundling technology is used to combine mutually exclusive sparse features into composite features, reducing the dimensionality of input features. By adjusting the decision tree depth, the number of leaf nodes, and the gradient sampling ratio, the training efficiency and prediction performance of the model on large-scale datasets are optimized.
[0022] The logistic regression first linearly combines the features of the samples in the input training set, and then calculates a linear prediction value for each sample by learning feature weights.
[0023] z = w1x1 + w2x2 + ... + w n x n +b
[0024] Where w1, w2, ..., w n These are the feature weights, representing the influence of each feature on predicting aneurysm rupture; x1, x2, ..., x n is the input feature value; b is the bias term; then the linear prediction value z is mapped to the probability space of (0,1) by the sigmoid function to obtain the probability σ(z) that the sample belongs to the rupture category:
[0025]
[0026] During training, the weight parameters are estimated by maximizing the likelihood function so that the predicted probability is as close as possible to the actual label. Finally, based on the set probability threshold, the probability is converted into a class label to predict the risk of aneurysm rupture.
[0027] The support vector machine constructs a maximum margin hyperplane to linearly separate ruptured and unruptured samples in the training set, and adjusts the generalization ability of the classification margin through regularization parameters. To address the nonlinear relationship between features and categories, a kernel function mapping is used to map the original features to an implicit high-dimensional space. A linearly separable hyperplane is constructed in the high-dimensional space using radial basis function kernels or polynomial kernels to capture the complex nonlinear relationships of morphological features. Support vectors are located based on the classification hyperplane. These support vectors include samples located at the maximum margin boundary or in misclassified regions, and their critical eigenvalues characterize the classification boundary sensitivity of aneurysm rupture risk. By adjusting the kernel function type, kernel parameters, and regularization parameters, the system adapts to medical datasets of different dimensions and complexities, optimizing classification performance and prediction efficiency in the high-dimensional feature space.
[0028] Using the meta-features as input data and the actual labels of the validation set as target variables, a logistic regression-based meta-model is trained to learn the mapping relationship between the meta-features and the target variables. The weight parameters are optimized through the model training process to establish a correlation measure between the prediction results of the basic classifier and the actual labels. The prediction results of the basic classifier are weighted and summed based on the weights obtained from training to generate the final aneurysm rupture risk prediction result.
[0029] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:
[0030] The device of this invention introduces CTGAN to generate synthetic samples, thereby amplifying training data, improving diversity, and significantly alleviating the class imbalance problem commonly found in clinical data; it constructs a heterogeneous model pool composed of multiple machine learning algorithms. In the stacking ensemble framework, k-fold cross-validation is first performed on each base model to obtain first-level prediction results, which are then used as meta-features input into a second-level learner. The second-level learner employs logistic regression to perform optimal weighted learning on the outputs of the base models, balancing numerical stability and interpretability.
[0031] This invention constructs a heterogeneous model pool comprising random forest, lightweight gradient booster, logistic regression, and support vector machine, and implements a stacked architecture for meta-learning. Logistic regression performs optimal weighting of the predictions of these basic models, significantly improving the generalization ability of the model in small sample scenarios while maintaining clinical interpretability, providing a new technical path for individualized rupture risk prediction.
[0032] This invention employs a stacked generalization method using stacked models, fully leveraging the strengths of each base model while reducing the inherent bias and variance issues of individual models. This further improves the accuracy and reliability of the model in predicting the risk of aneurysm rupture. Attached Figure Description
[0033] Figure 1 This is the main flowchart of the present invention;
[0034] Figure 2 ROC-AUC curves for different machine learning models;
[0035] Figure 3 Explanation and analysis diagram of individual predictions in the random forest model;
[0036] Figure 4 A summary diagram of SHAP for the Random Forest model;
[0037] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Detailed Implementation
[0038] The present invention will be further described below through specific embodiments.
[0039] See Figure 1 A device for predicting the risk of aneurysm rupture based on stacked and CTGAN-enhanced data, the device including a processor configured to:
[0040] S1 acquires continuous case data of patients with intracranial aneurysms, processes the case data, and converts it into numerical form and one-hot encoding as a training set.
[0041] Case data includes clinical features, neuroimaging records, and follow-up documents. Missing values in the case data were first processed, and outliers were detected and corrected. All features were categorized into demographic, clinical, and morphological characteristics, and each feature was converted into numerical and one-hot encoded forms. All diagnoses in the case data were confirmed by digital subtraction angiography (DSA) or high-resolution CT angiography (CTA), ensuring standardization of cohort diagnoses.
[0042] In this step, the case data is processed and converted into numerical form and one-hot encoded as the training set. Specific data cleaning includes missing value handling: using multiple imputation techniques to handle incomplete records; outlier detection: identifying and correcting abnormal measurements using Tukey's fences method; and feature encoding: transforming categorical variables using one-hot encoding.
[0043] In practical applications, demographic characteristics include basic information such as age and sex; clinical characteristics include key past medical histories such as alcohol consumption, hypertension, and diabetes, which are established risk factors in the pathogenesis of aneurysms; and validated scales such as the Glasgow Coma Scale (GCS) and Fisher classification, which record the clinical severity assessment at the initial visit. Morphological characteristics are extracted from image analysis to capture key indicators for assessing rupture risk, obtained through CTA / DSA measurements, such as aneurysm height, neck width, aspect ratio (AR), size ratio (SR), aneurysm width, inflow angle, and daughter aneurysms. See Table 1 for examples.
[0044] Table 1
[0045]
[0046] In Table 1, the coding rules for categorical variables are as follows: Smoking history / drinking history: 0 = none, 1 = yes; Breakdown status: 0 = not broken, 1 = broken.
[0047] S2 inputs the training set into the CTGAN framework. Through adversarial training between the generator and discriminator of the CTGAN framework, the generator learns the potential data distribution pattern. The stabilized generator generates synthetic samples that mimic the training set. The synthetic samples are then combined with the training set in proportion to form an enhanced dataset.
[0048] The limited sample size of the original dataset poses a challenge to directly training machine learning models, potentially leading to a decline in the model's generalization ability. CTGAN is a variant of GAN specifically designed for tabular data synthesis. It can generate synthetic data consistent with the data distribution while maintaining the key statistical characteristics of the original dataset. This invention uses CTGAN to generate training set samples, thereby expanding the training set and enhancing the diversity and scale of the training data.
[0049] First, the original training set is input into the CTGAN framework. Through adversarial training between the generator and discriminator, the model gradually learns the underlying data distribution patterns. After the generator stabilizes, synthetic samples that mimic the original training instances are generated. These generated samples not only retain the key features of the original data but also introduce controlled variability, enabling the model to better capture diverse data patterns during training, thereby enhancing generalization ability and robustness. The synthetic samples are then proportionally combined with the original training data to form an augmented dataset. This strategy effectively expands the amount of training data while reducing the risk of overfitting through controlled diversity injection, laying a solid foundation for subsequent model training.
[0050] Given the lack of local structure between columns in tabular data, the CTGAN framework employs fully connected networks in both the generator and discriminator to comprehensively capture potential inter-column correlations. Specifically, both the generator and discriminator contain two fully connected hidden layers. The generator uses a conditional generator G(z,cond) with batch normalization and ReLU activation functions, while the output layer employs a hybrid activation mechanism, as follows:
[0051]
[0052] Where z represents random noise with dimension |z|, cond1 is the conditional vector with dimension |cond|, h1, h2, and h3 represent the hidden representations within the network, and N c N d These represent the total number of continuous vectors and the total number of additional discrete variables, respectively. It is a scalar value and is generated by the activation function tanh. and These are the pattern indicator and discrete values, generated using Gumbel, a Gumbel-Softmax function that uses temperature plus noise to transform the discrete selection into a differentiable approximation. `i` represents the category index, i = 1, 2, 3…N, and `m`... i Represents the discrete label associated with category i, used to guide the generative model in generating samples of a specific category, |D i| is a discrete probability distribution, sampled using the Gumbel-Softmax distribution; BN(.) is batch normalization, ReLU(.) is the activation function, and FC represents a fully connected layer.
[0053] The discriminator, using the PacGAN architecture, is represented as follows:
[0054]
[0055] Where r1…r 10 Each represents a vectorized representation of an entire row; cond j Let be the condition vector, with dimension denoted as |cond|, j = 1, 2, 3…10; drop(.) represents regularization, leaky represents the activation function; C(·) represents the discriminator.
[0056] The model is trained using WGAN loss with gradient penalty and a learning rate of 2×10. -4 The Adam optimizer is used for optimization.
[0057] S3 divides the dataset into training and validation sets, constructs a heterogeneous model pool containing random forest, LightGBM, logistic regression, and support vector machine, and uses logistic regression as the meta-model. The training set is used to train the four basic classifiers of the heterogeneous model pool respectively. The validation set is input into the trained basic classifiers, and the prediction results are used as meta-features and input into the meta-model. The meta-model performs a weighted summation of the prediction results to obtain the final aneurysm rupture risk prediction result.
[0058] In this invention, a stacked generalization strategy is introduced to further improve the predictive performance of the model. Stacking is an ensemble learning method whose core idea is to combine the prediction results of multiple base learners to construct a more predictive model. The stacked architecture of this invention employs a two-layer learning strategy: the first layer integrates four base learners (random forest, lightGBM, logistic regression, and support vector classifier) from machine learning models such as random forest, XGBoost, LightGBM, gradient boosting decision tree, decision tree, logistic regression, and support vector machine, comprehensively capturing the heterogeneous expression of aneurysm morphology and clinical features; the second layer uses a parameter-optimized logistic regression meta-classifier for fine probability calibration. This hierarchical design effectively balances feature diversity and regularization constraints, achieving a synergistic performance improvement relative to each base model.
[0059] The first layer integrates four basic learners: Random Forest, LightGBM, Logistic Regression, and Support Vector Classifier. These four different models were chosen to fully leverage their respective strengths and capture the heterogeneous expression of aneurysm morphology and clinical features. Random Forest, an ensemble algorithm based on decision trees, effectively handles high-dimensional data and is robust to noise. It can capture the complex nonlinear relationships between various aneurysm features. LightGBM is an efficient gradient boosting decision tree algorithm with fast training speed and good predictive performance. It can automatically filter and combine features in the data and performs well in handling large-scale data and high-dimensional features, making it suitable for uncovering the complex correlation between aneurysm features and rupture risk. Logistic Regression is a classic linear classification algorithm; although the model is simple, it has good interpretability. It can capture the linear relationship between aneurysm features and rupture risk and achieves good results even with small-scale data. Support Vector Classifier (SVC) achieves classification by constructing a maximum margin hyperplane, and has strong capabilities in handling high-dimensional data and nonlinearly separable problems. It can effectively map aneurysm features to a high-dimensional space, thereby better distinguishing between ruptured and unruptured categories. The following provides a detailed explanation of each basic classifier:
[0060] Random forests are used for classification and regression, improving model accuracy and robustness by combining the predictions of multiple decision trees. For classification problems, random forests use a voting mechanism for prediction. Specifically, for input samples in the training set, each decision tree in a random forest generates a class prediction, and the final output class is the class predicted most frequently by all decision trees, as shown in the following formula:
[0061]
[0062] The final predicted category of the random forest for the input sample x is represented by , including whether the aneurysm has ruptured (0 indicates no rupture, 1 indicates rupture); c represents the possible category label, including ruptured or not ruptured; B represents the total number of decision trees in the random forest, which is a hyperparameter; hb(x) represents the predicted category of the b-th decision tree for the input sample x; I() is an indicator function, which has a value of 1 when the condition in parentheses is true, and 0 otherwise, and is used to determine whether the predicted category of the b-th decision tree for the input sample x is c.
[0063] In practical applications, the acquired case data is converted into a training set and used as input features for the random forest model. During training, the random forest algorithm automatically learns the relationship between these features and aneurysm rupture. By adjusting the algorithm's hyperparameters, such as the number of decision trees (B), the maximum depth of each tree, and the feature selection method, the model's performance can be optimized, thereby achieving accurate prediction of aneurysm rupture. Finally, given data from a new aneurysm patient, it can be input into the trained random forest model, which will calculate the risk of aneurysm rupture for that patient according to the above formula.
[0064] LightGBM iteratively trains the base classifier using a gradient boosting decision tree architecture. It calculates gradient information using numerical data of aneurysm morphological features and dynamically optimizes the selection of decision tree split nodes. In the sample selection of the training set, it introduces a gradient-based one-sided sampling strategy: prioritizing high-gradient samples that contribute significantly to model optimization and randomly sampling low-gradient samples to reduce computational complexity. For mutually exclusive sparse features in the training set, it uses feature bundling technology to combine mutually exclusive sparse features into composite features, reducing the dimensionality of input features. By adjusting the decision tree depth, the number of leaf nodes, and the gradient sampling ratio, it optimizes the model's training efficiency and prediction performance on large-scale datasets.
[0065] In practical applications, taking aneurysm height and neck width as examples, their numerical data are input into the LightGBM model. During the gradient-based decision tree construction process, the model calculates gradient information based on the values of these features to determine the contribution of each sample to model optimization. When sampling along the gradient side, samples with high gradients (i.e., those with a greater impact on model error) are preferentially retained, while samples with low gradients are randomly sampled. This ensures that the model focuses more on features and samples that have a greater impact on the prediction results. For mutually exclusive feature bundling, assuming that certain morphological features frequently appear mutually exclusively in the data (e.g., when a specific aneurysm morphological feature exists, other morphological features rarely appear), LightGBM combines these mutually exclusive features to form a new feature dimension, thereby reducing the dimensionality of the data while preserving the discriminative power of the original features. Through this processing, the model can more efficiently utilize the feature information in medical data, uncover patterns in the data, and achieve accurate prediction of aneurysm rupture risk.
[0066] Logistic regression is a classic supervised learning algorithm primarily used for binary classification tasks (it can also be extended to multi-class classification). Its core idea is to map linear predictions to a probability space (between 0 and 1) using a linear model combined with the sigmoid function, thereby modeling the class probabilities. Specifically, logistic regression first linearly combines the features of the samples in the input training set. These features include demographic characteristics (age, gender, with gender encoded one-hot), clinical characteristics (drinking history, hypertension, diabetes, etc., encoded binaryly; GCS score and Fisher classification as numerical data), and morphological characteristics (aneurysm height, neck width, etc., continuous numerical data; subaneurysms encoded binaryally). By learning feature weights, a linear prediction value is calculated for each sample, i.e.:
[0067] z = w1x1 + w2x2 + ... + w n x n +b
[0068] Where w1, w2, ..., w n These are the feature weights, representing the influence of each feature on predicting aneurysm rupture; x1, x2, ..., x n is the input feature value; b is the bias term; then the linear prediction value z is mapped to the probability space of (0,1) by the sigmoid function to obtain the probability σ(z) that the sample belongs to the rupture category:
[0069]
[0070] During training, the weight parameters are estimated by maximizing the likelihood function so that the predicted probability is as close as possible to the actual label. Finally, based on the set probability threshold (e.g., 0.5), the probability is converted into a class label to predict the risk of aneurysm rupture.
[0071] Support Vector Machines (SVC) construct a maximum margin hyperplane to linearly separate ruptured and unruptured samples in the training set, and adjust the generalization ability of the classification margin through regularization parameters. To address the nonlinear relationship between features and categories, kernel function mapping is used to map the original features to an implicit high-dimensional space. A linearly separable hyperplane is constructed in this high-dimensional space using radial basis function kernels or polynomial kernels to capture the complex nonlinear relationships of morphological features. Support vectors are located based on the classification hyperplane. These support vectors include samples located at the maximum margin boundary or in misclassified regions, and their critical eigenvalues characterize the classification boundary sensitivity of aneurysm rupture risk. By adjusting the kernel function type, kernel parameters, and regularization parameters, the system adapts to medical datasets of different dimensions and complexities, optimizing classification performance and prediction efficiency in the high-dimensional feature space.
[0072] In practical applications, SVC receives preprocessed medical data, i.e., the training set, including the aforementioned numerical and encoded features. When the data is linearly separable, SVC searches for a hyperplane that maximizes the margin between the two classes of samples (ruptured and unruptured), thereby improving the classification generalization ability. However, in actual aneurysm data, the relationship between features and classes is often non-linear. In this case, SVC uses kernel methods, such as radial basis function (RBF) kernels and multinomial kernels, to implicitly map the original features to a high-dimensional feature space, in which it searches for a hyperplane that can linearly separate the two classes of samples. For example, for morphological features such as aspect ratio (AR) and size ratio (SR), there may be complex non-linear relationships between them and aneurysm rupture. Kernel functions can effectively capture these relationships, achieving better classification results.
[0073] The key feature of Support Vector Conjecture (SVC) lies in its ability to solve linearly inseparable problems by implicitly mapping features through a kernel function, while achieving computational efficiency by relying solely on support vectors for prediction. Support vectors are samples located near the maximum margin boundary or those that are misclassified; they play a crucial role in determining the classification hyperplane. In aneurysm rupture prediction, these support vectors might be samples with critical feature values, such as aneurysm morphological features close to the rupture threshold or clinical indicators bordering on normal or abnormal. By adjusting hyperparameters such as the kernel function type, kernel parameters (e.g., the gamma value of the RBF kernel), and regularization parameters (C value), SVC can achieve efficient and accurate prediction of aneurysm rupture risk on medical datasets of varying sizes and complexities, performing particularly well in high-dimensional feature spaces and handling high-dimensional data such as aneurysm morphological features.
[0074] The preprocessed aneurysm dataset (including demographic, clinical, and morphological features) is divided into training and validation sets. Each base classifier is trained on the training set, learning its own model parameters. During training, each model fits the data according to its own algorithmic characteristics. For example, Random Forest optimizes the model by constructing multiple decision trees and using majority voting, LightGBM optimizes the model step by step using gradient boosting, Logistic Regression estimates parameters by maximizing the likelihood function, and SVC finds the maximum margin hyperplane. On the validation set, each base classifier makes predictions, and the prediction results (which can be class labels or probability values) are used as meta-features to form a new dataset, which serves as the input to the second-layer meta-model. For example, for a validation set containing n samples, the four base classifiers output the probability that each sample belongs to the rupture category, thus forming an n×4 meta-feature matrix.
[0075] Second layer: Training and calibration of the meta-model
[0076] Meta-model selection and optimization: Parameter-optimized logistic regression was adopted as the meta-classifier. Logistic regression was chosen because it is simple, efficient, and easy to interpret, and it can perform probability calibration on the prediction results of the base learner, integrating the prediction probabilities of different models into a more accurate final prediction probability.
[0077] Meta-classifier training: The meta-feature matrix generated in the first layer is used as input, and the actual labels of the corresponding validation set are used as the target variable to train the logistic regression meta-classifier. During training, the performance of the model is optimized by adjusting the parameters of the logistic regression (such as regularization parameters), enabling the meta-classifier to effectively learn the relationship between the prediction results of the base classifier and the actual labels. Specifically, the weight parameters are optimized during model training to establish a correlation metric between the prediction results of the base classifier and the actual labels. Based on the weights obtained during training, the prediction results of the base learners are weighted and combined to generate the final aneurysm rupture risk prediction result. In this process, the meta-model learns how to optimally combine the outputs of the base models, thereby achieving better predictive performance than a single model.
[0078] The role of probability calibration: When integrating the prediction results of the base classifiers, the logistic regression meta-classifier performs a weighted summation of the prediction probabilities of each base learner to obtain the final aneurysm rupture risk prediction result. This makes the final prediction probability more accurately reflect the true probability that the sample belongs to the rupture category. This probability calibration process can be seen as a confidence adjustment of the base classifier prediction results, determining the weight of each base learner in the final prediction based on its performance on the validation set, thereby improving the overall model's predictive performance.
[0079] In practical applications, when predicting aneurysm rupture, new samples are first preprocessed to extract relevant features, which are then input into four base classifiers to obtain the prediction probability for each classifier. These prediction probabilities are then used as meta-features and input into a logistic regression meta-classifier. The meta-classifier performs a weighted sum of these prediction probabilities based on weights learned during training, ultimately outputting the prediction probability that the sample belongs to the rupture category. Based on a set probability threshold (usually 0.5), the prediction probabilities are converted into class labels, thus achieving the prediction of aneurysm rupture risk.
[0080] This hierarchical design effectively balances feature diversity and regularization constraints. The diversity of the base classifiers allows the model to capture the complex relationship between aneurysm features and rupture risk from different perspectives, while the second-layer logistic regression meta-classifier achieves effective integration of feature diversity and regularization constraints by probabilistically calibrating the prediction results of the base learners, thus avoiding overfitting. Simultaneously, parameter optimization of the meta-classifier further improves the model's predictive performance, achieving a synergistic performance enhancement.
[0081] Application Examples
[0082] By plotting receiver operating characteristic (ROC) curves, individual prediction explanation analysis plots, and feature importance analysis (SHAP) plots, the classification performance of the machine learning model in the aneurysm rupture prediction task was comprehensively evaluated. These multi-dimensional performance analyses provide a clear visual representation of the model's performance at different thresholds and offer a deeper understanding of the model's decision-making mechanism and its dependence on key features.
[0083] Table 2
[0084]
[0085] See Table 2. Baseline characteristics of 240 patients with aneurysms (120 ruptured vs. 120 unruptured) were analyzed. Continuous variables were compared using independent samples t-tests, while categorical variables were analyzed using chi-square tests. The results showed that the mean age of the ruptured group was significantly lower than that of the unruptured group (56.12 ± 9.95 years vs. 59.27 ± 10.39 years; p = 0.018), and the gender distribution difference was statistically significant (males: 49.2% [59 / 120] vs. 33.3% [40 / 120]; p = 0.018). Regarding comorbidities, the prevalence of diabetes was higher in the unruptured group (29.2% [35 / 120] vs. 10.0% [12 / 120]; p<0.001), while a history of alcohol consumption was more common in the ruptured group (30.8% [37 / 120] vs. 18.3% [22 / 120]; p=0.036). Regarding morphological differences, the unruptured group had larger aneurysm height (7.43±4.42 mm vs. 5.91±2.43 mm), aneurysm neck width (4.84±2.87 mm vs. 3.35±1.35 mm), and aneurysm width (5.67±3.47 mm vs. 4.21±2.16 mm), while the ruptured group had a larger inflow angle (121.60±21.72 degrees vs. 108.47±20.01 degrees) and a higher incidence of daughter aneurysms (49.2% [59 / 120] vs. 5.0% [6 / 120]; both p<0.001). No significant differences were found in smoking history (p=0.144), prevalence of hypertension (p=1.000), or size ratio (SR) value (p=0.333).
[0086] To evaluate the performance of different machine learning models in predicting aneurysm rupture, ROC curves were plotted, and AUC was calculated as the primary evaluation metric. See also Figure 2The experimental results revealed significant performance differences among machine learning models in predicting aneurysm rupture. Logistic regression demonstrated excellent discriminative ability, with an AUC of 0.919, indicating its outstanding ability to distinguish between ruptured and unruptured cases. Stacked ensemble (AUC = 0.907) and support vector classifier (SVC, AUC = 0.899) showed strong classification capabilities, forming a high-performance cluster. Random forest (AUC = 0.882) and gradient boosting decision tree (GBDT, AUC = 0.873) achieved satisfactory results, but their performance was slightly inferior to the top-performing models. In contrast, XGBoost (AUC = 0.854) and LightGBM (AUC = 0.8963) showed reduced performance, which may be attributed to their tendency to overfit or limited feature representation capabilities when handling complex classification tasks. Decision tree (AUC = 0.704) performed the worst, possibly because its single splitting mechanism could not adequately capture the nonlinear interactions between morphological parameters.
[0087] ROC curve analysis further confirmed these findings: the logistic regression curve was closest to the optimal position in the upper left corner, maintaining a significantly higher true positive rate at a low false positive rate threshold. The implemented stacked architecture employed a two-layer learning strategy—the first layer integrated four base learners (random forest, LightGBM, logistic regression, and support vector classifier) to comprehensively capture the heterogeneous expression of aneurysm morphology and clinical features; the second layer used a parameter-optimized logistic regression meta-classifier for fine-tuned probability calibration. This hierarchical design effectively balanced feature diversity with regularization constraints, achieving synergistic performance improvements relative to the individual base models.
[0088] To elucidate the model's decision-making mechanism at the individual prediction level, a case-specific visualization method was employed. Figure 3 This study demonstrates the use of individualized prediction interpretation plots to analyze the feature contribution of representative cases, showcasing the decision-making mechanism of the random forest model at the individual prediction level. Red indicates increased risk, blue indicates decreased risk, and the width represents the probability of enhancement. This visualization reveals the importance and directional role of demographic factors, metabolic status, and aneurysm morphology parameters in the random forest classification results, providing a basis for subsequent feature selection and model optimization. The interpretation results not only validate the key variables identified in the baseline analysis but also suggest prioritizing and standardizing the recording of hemodynamic angles and aneurysm neck width in routine aneurysm assessments to further improve the performance and clinical interpretability of the random forest prediction model.
[0089] These explanatory diagrams provide transparent and intuitive insights into the reasoning process of the random forest model, significantly improving its interpretability in clinical scenarios. The visualizations clarify how specific morphological parameters (such as aneurysm neck width) and key clinical factors (such as diabetes status) work together in the ensemble voting of multiple decision trees to influence rupture risk prediction. This explanatory framework not only reaffirms the feature importance revealed by the baseline analysis but also points the way to optimizing clinical measurement procedures—prioritizing and standardizing the recording of hemodynamic parameters and aneurysm morphological features to achieve more robust and practical predictive performance in future feature engineering and random forest model iterations.
[0090] To elucidate the decision-making mechanism of the model in aneurysm rupture prediction, this invention also uses SHAP values to quantify feature importance. By measuring the marginal contribution of each feature to the model's prediction, SHAP values provide a global perspective on the influence of features across the entire dataset. Figure 4 In the diagram, the SHAP summary plot visually illustrates the direction and magnitude of the influence of key predictors in the random forest model. This approach reveals how morphological parameters and clinical factors jointly drive individual risk assessment while maintaining computational interpretability.
[0091] Figure 4 The impact of various features on the output of the random forest model is shown, and ranked by feature importance. The color gradient from purple (low) to yellow (high) represents the magnitude of the feature values. The cyst feature has the most significant impact on model predictions, with its SHAP values mainly concentrated in the positive region. This indicates a strong positive correlation between the presence of cysts and the model's predicted aneurysm rupture probability. The neck, height, and width features show a non-linear threshold effect on the model output: the increase or decrease in risk is more pronounced within specific size ranges. In contrast, smoking history and drinking history have a smaller predictive impact, with narrower SHAP value distributions. The limited range of SHAP values for these two features further confirms their relatively small contribution to the model's decision-making process.
[0092] In one embodiment, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the steps S1-S3 described above.
[0093] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0094] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this disclosure.
[0095] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0096] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.
Claims
1. A device for predicting the risk of aneurysm rupture based on stacked and CTGAN-enhanced data, characterized in that, The device includes a processor configured to: We acquired case data of patients with intracranial aneurysms, processed the case data, and converted it into numerical form and one-hot encoding as a training set. The training set is input into the CTGAN framework. Through adversarial training between the generator and discriminator of the CTGAN framework, the generator learns the potential data distribution pattern. The stabilized generator is used to generate synthetic samples that mimic the training set. The synthetic samples are combined with the training set in proportion to form an enhanced dataset. The dataset is divided into a training set and a validation set. A heterogeneous model pool containing random forest, LightGBM, logistic regression, and support vector machine is constructed, with logistic regression as the meta-model. The training set is used to train the four basic classifiers of the heterogeneous model pool. The validation set is input into the trained basic classifiers, and the prediction results are used as meta-features and input into the meta-model. The meta-model performs a weighted summation of the prediction results to obtain the final aneurysm rupture risk prediction result.
2. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, The case data includes clinical features, neuroimaging records, and follow-up files. Missing values in the case data are first processed, and outliers are detected and corrected. All features are divided into demographic features, clinical features, and morphological features, and each feature is converted into numerical form and one-hot encoding form.
3. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, The CTGAN framework employs fully connected networks in both the generator and the discriminator to comprehensively capture potential inter-column correlations in the data; the generator uses a conditional generator G(z,cond), which is represented as: Where z represents random noise, with dimension |z|, cond1 is the conditional vector, with dimension |cond|; h1, h2, and h3 represent the hidden representations within the network, and N c N d These represent the total number of continuous vectors and the total number of additional discrete variables, respectively. It is a scalar value and is generated by the activation function tanh. and These are the pattern indicator and discrete values, generated using Gumbel, which is the Gumbel-Softmax function; i represents the index of the category, i = 1, 2, 3…N, m i Represents the discrete label associated with category i, used to guide the generative model in generating samples of a specific category, |D i | is a discrete probability distribution, sampled using the Gumbel-Softmax distribution, BN(.) is batch normalization, ReLU(.) is the activation function, FC represents a fully connected layer, and all subscripts i (i = 1, 2, 3… N) mentioned in the formula represent the index of the category. The discriminator adopts the PacGAN architecture, as shown below: Where r1…r 10 Each represents a vectorized representation of an entire row; cond j Let C be the condition vector, with dimension denoted as |cond|. drop(.) represents regularization, tanh and leaky represent activation functions respectively, and C(·) represents the discriminator.
4. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, Using the random forest for the input samples in the training set, each decision tree generates a class prediction, and the final output class is the class with the highest prediction frequency among all decision trees, as shown in the following formula: denoted by , represents the final predicted category of the random forest for the input sample x, including whether the aneurysm has ruptured (0 indicates no rupture, 1 indicates rupture); c represents the possible category label, including ruptured or not ruptured; B represents the total number of decision trees in the random forest, which is a hyperparameter; hb(x) represents the predicted category of the b-th decision tree for the input sample x; I(·) is an indicator function, which has a value of 1 when the condition in parentheses is true, and 0 otherwise, and is used to determine whether the predicted category of the b-th decision tree for the input sample x is c.
5. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, The LightGBM iteratively trains the base classifier using a gradient boosting decision tree architecture. It calculates gradient information using numerical data of aneurysm morphological features and dynamically optimizes the selection of decision tree split nodes. In the sample selection of the training set, a gradient-based one-sided sampling strategy is introduced: high-gradient samples that contribute significantly to model optimization are prioritized, while low-gradient samples are randomly sampled to reduce computational complexity. For mutually exclusive sparse features in the training set, feature bundling technology is used to combine mutually exclusive sparse features into composite features, reducing the dimensionality of input features. By adjusting the decision tree depth, the number of leaf nodes, and the gradient sampling ratio, the training efficiency and prediction performance of the model on large-scale datasets are optimized.
6. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, The logistic regression first linearly combines the features of the samples in the input training set, and then calculates a linear prediction value for each sample by learning feature weights. z=w1x1+w2x2+…+w n x n +b Where w1, w2, ..., w n These are the feature weights, representing the influence of each feature on predicting aneurysm rupture; x1, x2, ..., x n is the input feature value; b is the bias term; then the linear prediction value z is mapped to the probability space of (0,1) by the sigmoid function to obtain the probability σ(z) that the sample belongs to the rupture category: During training, the weight parameters are estimated by maximizing the likelihood function so that the predicted probability is as close as possible to the actual label. Finally, based on the set probability threshold, the probability is converted into a class label to predict the risk of aneurysm rupture.
7. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, The support vector machine constructs a maximum margin hyperplane to linearly separate ruptured and unruptured samples in the training set, and adjusts the generalization ability of the classification margin through regularization parameters. To address the nonlinear relationship between features and categories, a kernel function mapping is used to map the original features to an implicit high-dimensional space. A linearly separable hyperplane is constructed in the high-dimensional space using radial basis function kernels or polynomial kernels to capture the complex nonlinear relationships of morphological features. Support vectors are located based on the classification hyperplane. These support vectors include samples located at the maximum margin boundary or in misclassified regions, and their critical eigenvalues characterize the classification boundary sensitivity of aneurysm rupture risk. By adjusting the kernel function type, kernel parameters, and regularization parameters, the system adapts to medical datasets of different dimensions and complexities, optimizing classification performance and prediction efficiency in the high-dimensional feature space.
8. The aneurysm rupture risk prediction device based on stacked and CTGAN enhanced data as described in claim 1, characterized in that, Using the meta-features as input data and the actual labels of the validation set as target variables, a logistic regression-based meta-model is trained to learn the mapping relationship between the meta-features and the target variables. The weight parameters are optimized during the model training process to establish a correlation metric between the prediction results of the basic classifier and the actual labels. The prediction results of the basic classifier are weighted and summed based on the weights obtained during training to generate the final aneurysm rupture risk prediction result.
Citation Information
Cited By
Enamel type craniopharyngeal tubuloma postoperative hypothalamic syndrome prediction system
CN121416093A
