###### Abstract  
Ischemic stroke lesion segmentation in MRI images represents significant challenges, particularly due to class imbalance between foreground and background pixels. Several approaches have been developed to achieve higher F1-Scores in stroke lesion segmentation under this challenge. These strategies include convolutional neural networks (CNN) and models that represent a large number of parameters, which can only be trained on specialized computational architectures that are explicitly oriented to data processing. This paper proposes a lightweight model based on the U-Net architecture that handles an attention module and the Generalized Dice Focal loss function to enhance the segmentation accuracy in the class imbalance environment, characteristic of stroke lesions in MRI images. This study also analyzes the segmentation performance according to the pixel size of stroke lesions, giving insights into the loss function behavior using the public ISLES 2015 and ISLES 2022 MRI datasets. The proposed model can effectively segment small stroke lesions with F1-Scores over 0.7, particularly in FLAIR, DWI, and T2 sequences. Furthermore, the model shows reasonable convergence with their 7.9 million parameters at 200 epochs, making it suitable for practical implementation on mid and high-end general-purpose graphic processing units. s +
Footnote †: journal: Medicalinterventions, reducing the risk of permanent brain damage and increasing the chances of recovery [5]. Consequently, the progress in research and innovative technologies is essential to aid in the detection and treatment of stroke and brain injury, primarily to mitigate its devastating effects on people of all ages. However, accurate detection and segmentation of strokes represent a challenge for radiologists because of the variability in the size and location of lesions in the brain [6]. Effective treatment mainly depends on factors such as the type of stroke, its location, and its extent. These factors are evaluated using diagnostic imaging modalities, such as Magnetic Resonance Imaging (MRI), Computed Tomography (CT), and angiography, where MRI stands out for its sensitivity and versatility [4]. The Fluid-Attenuated Inversion Recovery (FLAIR) sequence in MRI allows distinguishing between edema and cerebrospinal fluid. At the same time, Diffusion-Weighted Imaging (DWI) aids in the early detection of acute ischemic stroke by identifying areas of restricted water diffusion in the brain tissue [7]. The Apparent Diffusion Coefficient (ADC) map, derived from DWI, helps differentiate between acute and chronic ischemic lesions by quantifying the degree of water diffusion in tissues. Additionally, T1-weighted and T2-weighted MRI sequences provide detailed anatomical information, with T1-weighted images offering excellent contrast for normal brain anatomy and T2-weighted images being highly sensitive to pathological changes [8]. The effectiveness of stroke treatment is limited by the time it takes to obtain and interpret patient images. Radiologists face significant challenges in the manual analysis of MRI due to the complexity and variability of ischemic cerebrovascular lesions, leading to time-consuming and labor-intensive processes and the potential for human error [9]. Therefore, automatic segmentation techniques for detecting ischemic cerebrovascular lesions from MRI can significantly accelerate specialists' work, improve the diagnostic process, reduce the risk of diagnostic errors, and ensure more accurate and precise results. These techniques are integrated into Computer-Aided Diagnosis (CADx) systems, which usually employ machine-learning approaches to improve the segmentation and classification of cerebrovascular lesions [10] and evaluate the results using various well-known metrics, such as accuracy, precision, sensitivity, specificity, F1-Score, IoU, and Hausdorff Distance (HD), ensuring a performance that effectively aids medical personnel.