Inclusion criteria: Patients listed on Shaoxing People’s Hospital inpatient database from January 2019 to August 2021; 545 stroke patients were selected, of which 348 patients were combined with cognitive impairment.
Exclusion criteria: Patients with cognitive impairment before stroke; patients with other diseases that affect their cognitive function seriously.
Data collection: Three types of characteristic data of the patient population are collected, including demographic (e.g. age, gender, education and body mass index [BMI]), medical history (e.g. smoking, drinking, hypertension, diabetes, hyperlipidaemia and past stroke histories) and examination and inspection data (e.g. fibrinogen, high sensitivity C-reactive protein [CRP], blood uric acid and blood homocysteine, stroke side and location).
Term of machine learning in this study: Post-stroke patients have a high risk of cognitive impairment. In the past, screening was mainly conducted on the basis of the location of stroke and combined with some cognitive rating scales (e.g. MMSE and MoCA). Currently, no model tool is available to predict the risk of PSCI. Given that a doctor’s judgement of a certain disease is based on years of clinical experience, clinical symptoms and signs, including a comprehensive judgement of various examination and test indicators, it is highly dependent on the inspector’s own literacy with poor stability. The core idea of machine learning is to transform existing information into intelligent decision-making algorithm. It can build a compound model on the decision tree algorithm and conduct random, competitive, resampling self-lift; thus, it can process massive data, especially suitable for massive, multidimensional, multi-feature data generated by clinical medicine. Therefore, we employ machine learning methods to extract physiological measurements that are key to the risk of PSCI and propose models for accurate prediction. Before introducing our model, we begin with some terminologies from machine learning. (1) Features: measurable attributes of objects. In our experiment, the physiological and psychological measurements of patients after stroke are regarded as input features. (2) Tags: known values for training. In our experiment, patients with cognitive impairment are labelled ‘1’, whereas those without cognitive impairment are labelled ‘0’. (3) Over fitting: a phenomenon where a model is too complex to accurately predict invisible data. (4) The loss function: a function that maps the value of a random event or its related random variables to non-negative real numbers to represent the ‘risk’ or ‘loss’ of the random event. It is used to express the gap between the results produced by the model and the expected results. We hope to avoid over fitting and data loss during training.
Our model input: The physiological measurements of patients after stroke can be expressed by vector X = {X1, X2, ..., XD} t. Each item of X describes a physiological measurement (e.g. age, gender and BMI). We show that the prediction of the risk of cognitive impairment in post-stroke patients is Y, and the model output is based on Y’s extensive and DL. Measure set X = {X1, ..., Xn}, where Xi is the physiological measurement of our model output. This study proposes a hybrid model combining XGBoost [72] and DNN [73] to predict the risk of cognitive impairment in post-stroke patients and conducts some experiments to evaluate this performance. The experiment is a cognitive impairment probability prediction model based on the collected real data of post-stroke patients. Details of our datasets and experiments will be described in the next section.
Overview Of The Prediction Model
Our hybrid model is used to predict the risk of cognitive impairment in patients after stroke. The structure of the model is illustrated in Fig. 1. Specifically, our model must consider all possible factors and should be able to select some factors that really play important roles for avoiding the interference of irrelevant factors. Therefore, we select XGBoost, which is a powerful decision tree enhancement system and can conduct feature transformation. In this way, important characteristic factors can be selected from a large number of factors. Then, DNN uses these transformed features to predict the risk.
The input variables of the model come from the demographic and sociological parameters and physiological measurements of stroke patients, which are preprocessed by eliminating abnormal data. These original features are used to train the boost decision tree by using XGBoost, which can handle features in different patterns and missing values. It is suitable for managing multidimensional big data. A new tree is established as a tree integration model to fit the residual training process of the previous tree. On each node of the tree, a feature is used to divide the instance set into 2, and XGBoost can use the exact greedy algorithm to find the best segmentation. Each instance becomes a leaf of each tree. We use their leaves as a new feature XM to train DNN. The enhanced decision tree in Fig. 1 is taken as an example. It comprises two trees and six leaves. For example, four leaves are found on the left tree and two leaves on the right tree. Given a physiological measurement of stroke patients, if it falls on the third leaf of the left tree and the second leaf of the right tree, then it will be encoded as XM = [0, 0, 1, 0, 0, 1], where the ith digit indicates whether the instance is on the ith leaf. Through this method, the high-dimensional input features are transformed into representative binary features. After the transformed features are obtained, DNN is trained for prediction.
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQYAAAByCAYAAACx8X9fAAAKzUlEQVR4nO2dP5KjOhfFD1+9pdgTdM0K8ArsSTrqtDMI7WSyL5zsJRDaWacTddKwAnsFXQ6M9qIXCIGw8D8MRuDzq6KqTWOkexFHV1cCe1JKCUIIMfhf3xUghLgHhYEQYkFhIIRYUBgIIRYUBkKIBYWBEGJBYSCEWFAYCCEWFAZCiAWFgRBiQWEghFhQGAghFhQGQogFhYEQYkFhIIRYUBgIIRYUB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B+N+/6s+fPzBJwzsfQe6fyXJrr5Rsq3cdue9GS4/5jQFhzvP7MsqMz0Oflegc+m6IeFJKxlmEkAocShBCLCgMhBALCgMhxILCQAixoDAQQiwoDIQQCwoDIcSCwkAIsaAwEEIsKAyEEAsKAyHEgsJACLGgMBBCLCgMhBALCgMhxILCQAixoDAQQiwoDIQQi/8AS2eBl+nn47QAAAAASUVORK5CYII=)
where \({{w}}_{{d}}^{\left[{l}+1\right]}\)is a matrix of parameters, b is the bias and g(z) = max (0, z) (ReLU) is the activation function. \({{a}}_{{d}}^{\left[{l}\right]}\)is the input of DNN xM, that is, the transformed feature. To prevent from over fitting the model, we apply L2 regularisation to the weight (W) of all layers. The model prediction is as follows:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAAA+CAYAAAD556RpAAAIjklEQVR4nO2cvXLqOheGX585V7LHUDC5ArNn1xvSpMp8XTpTQpMuZbo0dgld2lRpYjdfufEVZChiz74VnUKW/wEbbNmE95nxTAL+0ZKlV9JaSxhCCAFCCNHAP30XgBByPVBwCCHaoOAQQrRBwSGEaIOCQwjRBgWHEKINCg4hRBsUHEKINig4hBBtUHAIIdqg4BBCtEHBIYRog4JDCNEGBYccJXKnMAxDHgu/17L4CyMpi46inGu77vIOHQoOqYftQQgBsZ7J/yMX07gjTd2odHq2o50sUvEzsvefrQWECOFY5fOMPUdV+RqRtb2h3ZXlvWIoOOQ0zCVe4150MzZzX0XuFPMNYDkhQseCNRmVLo/c6UEh8hcGjNEKQZ2yhDsEsOEJgTAuk+WEEMKDXVG+szjT7mvn374LQC6XcBcAsJDvVxE+3uTn97cmTHOLbcP7+gsD73cC4WSK0eq45ERfn7CcV8wA+Dt5vhKDiWVjPGtYgCN0Zfc1QMEhJ+LjfQPAusetGugjF9NkVhJgNTKw8wTWDTv8bC0wAxB91TvfXKrOHZcpEQMTy+262cOP0p3d1wCXVOQ0oi98AsDNGMnCwlxiGzqwgMTvobXTqTJlxaCrZwzJ7guCgkNOI9whA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fv363cj4JDCNnLz58/IYTAjx8/WrkfBYcQspe/f//CMAz8+vWrlfsx05gQog3OcAgh2qDgEEK0QcEhhGiDgkMI0QYFhxCiDQoOIUQbFBxCiDYoOIQQbVBwCCHaoOAQQrTxHz1dnH+ou8v4AAAAAElFTkSuQmCC)
where y is the binary classification label of cognitive impairment in stroke patients, and x is the converted feature. σ (•) is a sigmoid function, \({{a}}_{{d}}^{\left[{l}{f}\right]}\) is the last activation of the neural network, \({{w}}_{{d}}^{\left[{l}{f}+1\right]{T}}\) is the weight applied to \({{a}}_{{d}}^{\left[{l}{f}\right]}\) and b is the bias. To train the neural network, we use the loss function of the existing label cognitive impairment risk data of stroke patients to be defined as the cross entropy of predicting the fracture risk, and the label is as follows:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAAA9CAYAAABLChfbAAAFmklEQVR4nO3bvVLyTBQH8H/eS3HAgvEKgmMt2lh5CaGExs7y6WxCKd3TWtkIN6C5AofCZLyV8xYkh3xnsySAPv/fTJoAm7Nn15OPjY6ICIiIAPx37ACI6HSwIBCRYkEgIsWCQESKBYGIFAsCESkWBCJSLAhEpFgQiEixIBCRYkEgIsWCQESKBYGIFAsCESkWBCJSLAhEpFgQiEixIBCRYkEgIsWCQESKBYGIFAsCEamjFYRoMYbjOIVtuj5WRFvrqYPxIjL98i728QKGv+o5rgiL8WHyWIxpe2zHaZHDRjX9OVD+s/3suo9V/TvcOGbIUa3EAwSAwFsdN5QklpZxrLw4fteX8GTiavubUHwXYn6IYvuah3hz/S6zUd2ffvOfPW5/fazqn92c3AcLgogkfxA2k6rfCWkfl4S+uMaTtk1BqIsp/qzzgiCV/ekv/1X97KmPVePVahz3x4IgIqHvCpD+g0jFBQjgih+KyMrTfcl3qyZk9mwS/z4jf4zid4tx7fZtc+Zl2sincBtD2bELGTAuCGUx5dsx/2Mxz3NVf+zyb5d7mz52MV7m47i/H1EQ8pdqZZt9PUli8CTTRFyZCwO/8komaXZCJvu230smUHpAk2PG+/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Ncf8x2ue/kWCc+Xo6IyOHKDxGdMt4yEJFiQSAixYJARIoFgYgUCwLRL/H+/g7HcXB9fW3dBgsC0S9xeXkJEcHZ2Zl1GywIRL/E9/c3HMfB1dWVdRt8D4GIFK8QiEixIBCRYkEgIsWCQESKBYGIFAsCESkWBCJSLAhEpFgQiEixIBCRYkEgIsWCQESKBYGIFAsCEan/AZ3xYIt9z2weAAAAAElFTkSuQmCC)
where y is the actual observation label, and p is the predicted risk of cognitive impairment. In our model, adaptive moment estimation (Adam) neural network is used for depth estimation [74].
Dataset Description
According to the International Statistical Classification of Diseases and Related Health Problems (10th Revision) [75], stroke patients diagnosed in this study include I64 stroke, I63 cerebral infarction, I67 ischemic stroke and I61 haemorrhagic stroke; cognitive impairment includes F01 vascular dementia and F06 vascular cognitive impairment. We collect the electronic medical records of stroke inpatients in the Geriatric Department and Rehabilitation Department of Shaoxing People’s Hospital from January 2019 to August 2021. A total of 545 stroke patients are recorded, of which 348 cases are complicated with cognitive impairment.
The 46 factors that may affect the risk of cognitive impairment in stroke patients are divided into three categories as characteristics, including demographic and sociological characteristics (e.g. age, occupation, education, gender and BMI), medical history characteristics (e.g. smoking, drinking, hypertension and previous stroke histories) and examination characteristics (e.g. fibrinogen, blood uric acid and blood homocysteine), as illustrated in Table 1. Demographic characteristics and most examination characteristics are continuous. A few examination features are absolute, such as the location of stroke. For example, the location after stroke is located in temporal lobe, basal ganglia and frontal lobe. All medical history features are labels. The medical history feature is marked as ‘1’, which indicates that the patient has a medical history. If no relevant medical history exists, then it is marked as ‘0’. For example, if a patient has a history of hypertension, then the label of hypertension is ‘1’, and if he has no history of hypertension, then the label is ‘0’. Lastly, after abnormal data are removed, the data of 545 stroke patients are extracted. Considering that many parameters exist, some parameters have null values in the patient statistics. The dataset is unbalanced (348:197). Thus, we perform oversampling and undersampling of patients with cognitive impairment after stroke. We firstly divide the dataset into training and test sets randomly, and then, we oversample and undersample the two sets.
Table 1
Demographics of the major explanatory variables in 545 stroke patients combined with cognitive impairment [76, 77]
Variables
|
Cognitive Impairment
|
N0(n = 197)
|
Yes(n = 348)
|
Age
Gender
|
67.86 (29–93)
|
63.29 (25–94)
|
Male
|
134
|
212
|
Female
|
59
|
136
|
Occupation
|
|
|
Farmer
|
32
|
71
|
Worker
|
1
|
3
|
Staff
|
59
|
72
|
Merchant
|
11
|
25
|
Retire
|
55
|
106
|
Education
|
|
|
Elementary school or below
|
79
|
127
|
Junior high school
|
53
|
93
|
High school
|
14
|
37
|
Undergraduate
|
18
|
17
|
Master degree or above
|
0
|
1
|
Smoking history
|
|
|
Yes
|
54
|
89
|
No
|
141
|
261
|
Drinking history
|
|
|
Yes
|
55
|
93
|
No
|
143
|
254
|
Hypertension
|
|
|
Yes
|
157
|
267
|
No
|
42
|
79
|
Diabetes
|
|
|
Yes
|
78
|
133
|
No
|
117
|
217
|
Hyperlipidemia
|
|
|
Yes
|
72
|
124
|
No
|
127
|
222
|
Previous Stroke
|
|
|
Yes
|
25
|
52
|
No
|
174
|
294
|
Accompanied by Depression
|
|
|
Yes
|
21
|
53
|
No
|
178
|
293
|
Cerebral infarction
|
|
|
Yes
|
138
|
204
|
No
|
59
|
144
|
Cerebral hemorrhage
|
|
|
Yes
|
59
|
144
|
No
|
138
|
204
|
Left Lesion
|
|
|
Yes
|
111
|
111
|
No
|
86
|
237
|
Right Lesion
|
|
|
Yes
|
60
|
179
|
No
|
137
|
169
|
Stroke Site
|
|
|
Basal ganglia
|
101
|
195
|
Frontal lobe
|
26
|
98
|
Parietal lobe
|
29
|
81
|
Thalamus
|
13
|
28
|
Lateral ventricle
|
59
|
69
|
Subarachnoid space
|
0
|
8
|
Occipital lobe
|
8
|
31
|
Brain stem
|
25
|
13
|
Semi-oval area
|
17
|
32
|
Outer capsule
|
1
|
6
|
Inner capsule
|
2
|
9
|
Cerebellum
|
13
|
15
|
Island leaves
|
1
|
12
|
Radiation crown
|
2
|
2
|
Corpus callosum
|
3
|
6
|
Temporal lobe
|
28
|
97
|
BMI
|
23.13(15.92–32.88)
|
22.70(14.3-38.81)
|
Fibrinogen
|
3.45(1.86–7.88)
|
3.65(0.81–9.27)
|
High-sensitive CRP
|
10.26(0.11–261.1)
|
15.27(0.06-177.67)
|
Blood uric acid
|
295.83(0.32–853.2)
|
287.40(2.76–726.2)
|
Blood homocysteine
|
12.15(3.67–53.41)
|
12.12(0.54–71.85)
|
Evaluation Metrics And Benchmarks
The matching indicators, which describe the prediction and reality related to us, have four types: (1) true positive (TP) is the positive sample in reality and prediction; (2) false positive (FP) is the negative sample and predicted to be a positive sample; (3) true negative (TN) is the negative sample in prediction and negative in reality; (4) false negative (FN) is negative in prediction and positive in reality.
In our study, we use the indicators such as accuracy, precision, recall, F1 score and area under curve (AUC) to evaluate the performance of the model: (1) accuracy represents the ratio of the number of samples correctly classified by the classifier to the total number of samples for a given test dataset, that is, the ratio of the correctly predicted patients to all patients; (2) precision refers to the proportion of positive samples in the predicted results; (3) recall rate refers to the proportion of the actual positive samples and the predicted positive samples; (4) F1 score is the harmonic mean of accuracy and recall. The formula is as follows:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQIAAADkCAYAAABzJSp7AAATs0lEQVR4nO2dP3KrvtvFD+/8lmKn8GQFeAX2bVylvZ0o7Sbdt0yXBkrT3TaVm8AKzAo8Lgx70VsIgQCB7QTb2D6fGc0kCCQg0UHPH4QjpZQghDw1/3frEyCE3B4KASGEQkAIoRAQQkAhIISAQkAIAYWAEAIKASEEFAJCCCgEhBBQCAghoBAQQkAhIISAQkAIAYWAEAIKASEEFAJCCCgEhBBQCEhfxB4cx7GUKYIs3ycLMO2q/20fRvteXDum2EBsUAhIL2SHHVw/hZQRBACIKP/5FS+jfKfREv8JAHDhpxIy9eEiweqzPkhjeNMAdX042kfRPhBu8jZnCwi48N9nl7jsh4FCQHphtNxiuxwB8QYhAHcyBjDDWq5RDsEMhx0A9w1/Rm0t/aaPDIedgBAAwg1iAMgO2P2wv2eCQkB6JVMjHW+2kZd94ysB8PqCEY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Lc1Be9auV9d/7okczgwyCPIvRasxGUlSyG4WMIiEBVwohpJ/mDk1XSFHU5Y7P1JdufqxymOaO0khUHKNmXeq7xXko27Z0rkaiavfqzFDrfrr9/FzVedbPveu682vvtKt/ct/6uTfNY0pHsrof9WzW/jNSKQQPR8c/dCQa27XzSQ1ELQSmY6oWOcmjI7b9q3X1rqsOLh19qe9b2a/ennWQ5PXWvlvS1a3Otp/ctx7ujfUadbu1Nhq/9weF4OFo/4eORDNk2TXwKk/j8oD2AVUbqCX5P3CtogjFFttr+9Xaq5+PfbbQcV9+OCNovW993JvOa6yf07FZz8+hj+DRyA7YAZb3H2Jsdj6quU8ZDjsUHuj4c4UELt7+jNT+IQBhc5CVqdLp2xf+Wu1yIxlLrzQ8GSP2PATBFNMgw2ydp3rrc63tV7GuswAflfOpnl+mLgQvCOD9ZLWqs+5bj/cmP2YyRrnyklhgFnvwAnVOxf3Iar+ff5Xt9C4t5GZUk51qSUuRaJ+WFglWzQSp5jS/mhhVrTfrzKdzOUUXUfM8ywdcdb/GNZlPwtr5HY+vt88Ifnzfer43EFHtjdb6/Wjen77gcuZPQuxNcXivveQUe3DmO/ip/eUn0nLfHhCaBs9AFuBj94Y/tX9mNZ0mrbTct0eEQvAEZN9fwNufRiZauk8AJPj65grQNtru2yNC04AQwhkBIYRCQAgBhYAQAgoBIQQUAkIIKASEEFAICCGgEBBCQCEghIBCQAgBhYAQAgoBIQQUAkIIKASEEFAICCGgEBBCQCEghIBCQAgBhYAQAgoBIQQUAkIIKASEEFAICCGgEBBCQCEghIBCQAgBhYAQAgoBIQQUAkIIKASEEAD/D5zfj/5GvBDrAAAAAElFTkSuQmCC)
Our combined model is as follows:
XGBoost is a weak set prediction model, typical classification and decision tree. It uses the random forest algorithm for reference and supports column and row samplings, which can reduce not only the risk of over fitting but also the number of calculations.
DNN: It has several hidden layers, also known as multi-layer perceptron. According to the locations of different layers, the neural network layer in DNN can be divided into input, hidden and output layers. Moreover, layers are completely connected with each other. In this experiment, we only use the deep part of the model as a paragraph.
Experimental Settings
All original input features, including categorical and continuous features, are used as input to improve the decision tree, and they are transformed. The maximum number of trees is set to 400 and is trained with L2 regularisation parameter of 1. After a thermal coding, the transformed features are input into DNN. Two hidden layers can be found in the neural system. To avoid over fitting, the network and L2 regularisation are added to the model. Moreover, we use the Adam method as the optimiser of the neural network and set the parameters of the adaptive learning rate, as presented in Table 2.
Table 2
Parameters of neural network
Size of Hidden
Layers
|
L2Regularization
strength
|
Train
steps
|
[30, 10]
|
100
|
400
|
The ratio of the training set to the test set is about 4:1. We use the synthetic minority oversampling technique to generate minor categories in the training and test sets. Then, we perform undersampling by deleting the Tomek link in the generated data to avoid oversampling. Lastly, the training set is about 400, and the test set is about 100. The benchmark parameters are illustrated in Table 3. For XGBoost, the parameters are the same, as used in the hybrid model; for DNN, the parameters are adjusted accordingly because the DNN used in the hybrid model has only two layers, and the regularisation strength and performance in the original input characteristics are poor.
Table 3
Method
|
Parameters
|
XGBoost
|
Max number of trees = 400
|
DNN
|
Hidden layers size=[300,300,30],L2 Regularization Strength = 2
|