基于Transformer算法构建的缺血性脑卒中早期预测模型
An Early Prediction Model for Ischemic Stroke Based on the Transformer Algorithm
摘要: 目的:采用Transformer等7种机器学习算法构建缺血性脑卒中风险预测模型,筛选最优模型并进行可解释性分析,助力早期识别高风险人群。方法:采用Kaggle公开脑卒中数据集,纳入5110例患者,其中病发组249例、非病发组4860例。经填补缺失值、SMOTE平衡样本后,分别采用BP、RF、XGBoost、SVM、DNN、MLP、Transformer算法构建预测模型。通过五折交叉验证进行内部验证,以AUC、准确率、召回率、特异度、Brier分数评价模型性能,并采用SHAP算法对最优模型进行可视化解释。结果:Transformer模型的AUC为0.912、准确率0.771、召回率0.847、特异度0.766、Brier分数0.091,综合性能优于其他6种模型。SHAP分析显示,年龄、工作类型、BMI、心脏病是影响模型预测贡献度最高的特征。结论:基于Transformer算法构建的缺血性脑卒中早期预测模型具有较好的预测效能,结合SHAP可解释性分析可辅助临床识别高危因素,为Transformer算法在卒中流行病学分析中的适用性提供了初步依据。
Abstract: Objective: This study aimed to develop and compare seven machine learning algorithms, including Transformer, to build risk prediction models for ischemic stroke, identify the best-performing model, and perform interpretability analysis to support early detection of high-risk individuals. Methods: A publicly available Kaggle stroke dataset was used, comprising 5110 patients (249 with stroke, 4860 without). Missing values were imputed using random forests, and the dataset was balanced with SMOTE. Prediction models were built using BP, RF, XGBoost, SVM, DNN, MLP, and Transformer algorithms. Internal validation was conducted via five-fold cross-validation. Model performance was evaluated using AUC, accuracy, recall, specificity, and Brier score. SHAP was applied to interpret the best model visually. Results: The Transformer model achieved an AUC of 0.912, accuracy of 0.771, recall of 0.847, specificity of 0.766, and Brier score of 0.091, outperforming the other six models. SHAP analysis revealed that age, work type, BMI, and heart disease were the most influential features. Conclusion: The Transformer-based early prediction model for ischemic stroke shows strong predictive performance. Combined with SHAP for interpretability, it can help clinicians identify key risk factors and support early prevention strategies.
文章引用:张紫欣, 杨晓光, 李若然, 谢昊杰, 李桂玲. 基于Transformer算法构建的缺血性脑卒中早期预测模型[J]. 临床医学进展, 2026, 16(8): 221-232. https://doi.org/10.12677/acm.2026.1682788

参考文献

[1] 《中国脑卒中防治报告2021》概要[J]. 中国脑血管病杂志, 2023, 20(11): 783-793.
[2] Pan, Y.S., Jing, J., Chen, W.Q., et al. (2017) Risks and Benefits of Clopidogrel-Aspirin in Minor Stroke or TIA: Time Course Analysis of CHANCE. Neurology, 88, 1906-1911.
[3] 张倩, 魏朝洁, 黄宏汰, 等. 基于21个队列研究的中国缺血性脑卒中患者复发风险预测模型构建与验证[J]. 实用心脑肺血管病杂志, 2023, 31(2): 8-15.
[4] Aarnio, K., Haapaniemi, E., Melkas, S., Kaste, M., Tatlisumak, T. and Putaala, J. (2014) Long-Term Mortality after First-Ever and Recurrent Stroke in Young Adults. Stroke, 45, 2670-2676.
https://doi.org/10.1161/strokeaha.114.005648
[5] 莫秋红, 丁晓波, 李靓, 等. 基于可解释性机器学习模型的轻型缺血性卒中复发预测研究[J]. 中国卒中杂志, 2024, 19(8): 924-930.
[6] Muhammad, D. and Bendechache, M. (2024) Unveiling the Black Box: A Systematic Review of Explainable Artificial Intelligence in Medical Image Analysis. Computational and Structural Biotechnology Journal, 24, 542-560.
https://doi.org/10.1016/j.csbj.2024.08.005
[7] FEDESORIANO (2021) Stroke Prediction Dataset. Kaggle.
https://www.kaggle.com/datasets/fedesoriano/stroke-prediction-dataset
[8] 张晓琴, 程誉莹. 基于随机森林模型的成分数据缺失值填补法[J]. 应用概率统计, 2017, 33(1): 102-110.
[9] 马宝霖. 基于改进SMOTE算法的不平衡数据分类问题研究[D]: [硕士学位论文]. 长春: 长春工业大学, 2024.
[10] 聂茜, 邓光明. 基于Shapley值的分类预测模型变量筛选方法改进[J]. 统计与决策, 2023, 39(3): 38-42.
[11] Krittanawong, C., Kumar, A., Wang, Z., Baber, U. and Bhatt, D.L. (2020) Self-Employment and Cardiovascular Risk in the US General Population. International Journal of Cardiology Hypertension, 6, Article ID: 100035.
https://doi.org/10.1016/j.ijchy.2020.100035
[12] Wei, S.L. and Chiu, K.L. (2025) Impact of Body Mass Index on Recurrent Stroke in Stroke Survivors: An Updated Systematic Review and Meta-Analysis. Obesity Research & Clinical Practice, 19, 202-213.
https://doi.org/10.1016/j.orcp.2025.05.003
[13] Henning, R.J. (2021) Obesity and Obesity-Induced Inflammatory Disease Contribute to Atherosclerosis: A Review of the Patho-Physiology and Treatment of Obesity. American Journal of Cardiovascular Disease, 11, 504-529.
[14] Ghowsi, M., Qalekhani, F., Farzaei, M.H., Mahmudi, F., Yousofvand, N. and Joshi, T. (2021) Inflammation, Oxidative Stress, Insulin Resistance, and Hypertension as Mediators for Adverse Effects of Obesity on the Brain: A Review. BioMedicine, 11, 13-22.
https://doi.org/10.37796/2211-8039.1174
[15] Fransson, E.I., Nyberg, S.T., Heikkilä, K., Alfredsson, L., Bjorner, J.B., Borritz, M., et al. (2015) Job Strain and the Risk of Stroke. Stroke, 46, 557-559.
https://doi.org/10.1161/strokeaha.114.008019
[16] Zhang, F., Guo, Z., Wu, Y., Liu, H., Luo, Y., Sun, M., et al. (2017) Prevalence of Stroke and Associated Risk Factors: A Population Based Cross Sectional Study from Northeast China. BMJ Open, 7, e015758.
https://doi.org/10.1136/bmjopen-2016-015758
[17] 焉双梅, 洪渊, 张欢, 等. ESRS和SPI-II评分对急性缺血性脑卒中患者复发风险的评估作用[J]. 中风与神经疾病杂志, 2016, 33(11): 1002-1005.
[18] 李洁洁, 张雁儒, 李昊, 等. 机器学习在脑卒中预测中的研究进展[J]. 河南医学研究, 2022, 31(20): 3832-3835.
[19] Abedi, V., Avula, V., Chaudhary, D., Shahjouei, S., Khan, A., Griessenauer, C.J., et al. (2021) Prediction of Long-Term Stroke Recurrence Using Machine Learning Models. Journal of Clinical Medicine, 10, Article 1286.
https://doi.org/10.3390/jcm10061286
[20] Salih, A., Boscolo Galazzo, I., Gkontra, P., Lee, A.M., Lekadir, K., Raisi-Estabragh, Z., et al. (2023) Explainable Artificial Intelligence and Cardiac Imaging: Toward More Interpretable Models. Circulation: Cardiovascular Imaging, 16, e014519.
https://doi.org/10.1161/circimaging.122.014519
[21] 龙秀英, 曾倩, 李秋茹. 缺血性卒中复发危险因素分析及风险评估[J]. 中国现代神经疾病杂志, 2016, 16(7): 442-446.
[22] 邱星强, 潘艺梅, 任晓媛, 等. 急性脑卒中患者1年内继发性癫痫的危险因素分析及列线图预测模型构建[J]. 新疆医学, 2026, 56(4): 551-556, 578.
[23] Alkhanbouli, R., Matar Abdulla Almadhaani, H., Alhosani, F. and Simsekler, M.C.E. (2025) The Role of Explainable Artificial Intelligence in Disease Prediction: A Systematic Literature Review and Future Research Directions. BMC Medical Informatics and Decision Making, 25, Article No. 110.
https://doi.org/10.1186/s12911-025-02944-6