Brain Stroke Classification Using CT Scans with Transformer-Based Models and Explainable AI
Shomukh Qari, Maha A. Thafar
Abstract
Background & Objective: Stroke remains a leading cause of mortality and long-term disability worldwide, demanding rapid and accurate diagnosis to improve patient outcomes. Computed tomography (CT) scans are widely used in emergency settings due to their speed, availability, and cost-effectiveness. This study proposes an artificial intelligence (AI)-based framework for multiclass stroke classification (ischemic, hemorrhagic, and no stroke) using CT scan images from the Ministry of Health of the Republic of Turkey. Methods: We adopted MaxViT, a state-of-the-art Vision Transformer (ViT)-based architecture, as the primary deep learning model for stroke classification. Additional transformer variants, including Vision Transformer (ViT), Transformer-in-Transformer (TNT), and ConvNeXt, were evaluated for comparison. To improve model generalization and handle class imbalance, classical data augmentation techniques were applied. Furthermore, explainable AI (XAI) was integrated using Grad-CAM++ to provide visual insights into model decisions. Results: The MaxViT model with augmentation achieved the highest performance, reaching an accuracy and F1-score of 98.00%, outperforming the baseline Vision Transformer and other evaluated models. Grad-CAM++ visualizations confirmed that the proposed framework effectively identified stroke-related regions, enhancing transparency and clinical trust. Conclusions: This research contributes to the development of a trustworthy AI-assisted diagnostic tool for stroke, facilitating its integration into clinical practice and improving access to timely and optimal stroke diagnosis in emergency departments.