Acute ischemic stroke (AIS) is a leading cause of mortality and disability. Over the past several decades, researchers proposed multiple techniques to enhance the effectiveness of AIS diagnosis. Magnetic resonance imaging (MRI) and computed tomography (CT) are widely used for assessing and treating AIS. In recent years, healthcare centers have applied the deep learning–based technique to support physicians in identifying diseases at earlier stages. Recently, researchers have employed convolutional neural network (CNN)-based image classifiers to detect diseases using complex images. However, the models demand high computation resources for generating a reasonable outcome. Thus, this study intends to build a fine-tuned CNN model for identifying AIS from MRI and CT images. The proposed framework contains three phases: image enhancement, feature extraction, and fine-tuned detection model. Initially, the researcher applies an image colorization technique using generative adversarial networks. You only look once V7 is used to extract the images’ features. In the second phase, the authors employed the Aquila optimization algorithm for tuning the hyperparameters of the Residual Network with Split attention (ResNest) model. To evaluate the performance of the ResNest model, the authors utilized two benchmark datasets of brain MRI and CT images. The MRI datasets contain 1021 healthy and 955 unhealthy images, whereas the CT datasets comprise 1551 healthy and 950 unhealthy images. The findings reveal that the ResNest model outperforms the recent approaches. The model achieves an average accuracy and F1 score of 98.25 and 97.275, and 98.65 and 98.25, for the MRI and CT datasets, respectively. In addition, the ResNest model obtained a confidence interval score of [97.84-98.13] and [97.91-98.52] for the MRI and CT datasets, respectively. The study uniquely develops a lightweight application through a compelling data preprocessing and feature extraction technique. In addition, the fine-tuned ResNest model achieves a superior outcome with limited resources. Healthcare centers can implement this lightweight model for diagnosing AIS patients.