<figure><img src="image_1.png" /></figure>

HAL
open science

# Explainable AI for early malaria detection using stacked-LSTM and attention mechanisms

Adil Gaouar, Souaad Hamza Cherif, Abdellatif Rahmoun, Mostafa El Habib Daho

► To cite this version:

Adil Gaouar, Souaad Hamza Cherif, Abdellatif Rahmoun, Mostafa El Habib Daho. Explainable AI for early malaria detection using stacked-LSTM and attention mechanisms. Informatics in Medicine Unlocked, 2025, 57, pp.101667. 10.1016/j.imu.2025.101667. hal-05228534

HAL Id: hal-05228534

https://hal.univ-brest.fr/hal-05228534v1

Submitted on 28 Aug 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

# Explainable AI for early malaria detection using stacked-LSTM and attention mechanisms

Adil Gaouar<sup>a,*</sup>, Souaad Hamza Cherif<sup>a</sup>, Abdellatif Rahmoun<sup>b</sup>, Mostafa El Habib Daho<sup>c,d ID,**</sup>

<figure><img src="image_4.png" /></figure>

## ARTICLE INFO

**Keywords:**

Malaria detection

Stacked-LSTM

Deep learning

Explainable AI

Grad-CAM

LIME

Model interpretability

## ABSTRACT

Malaria remains a global public health challenge, affecting more than 247 million people and causing 619,000 deaths worldwide in 2024 (according to WHO). Rapid diagnosis is essential for effective treatment and to improve patients' chances of survival. In this study, we propose an interpretable deep learning framework for accurate malaria diagnosis using blood smear images. Also, We evaluate and compare several baseline deep learning (DL) models (fundamentals), customized VGG-16 and VGG-19, as well as newer DL models such as Vision Transformer (ViT) and MobileNet, and, for the first time, a stacked long-short-term memory network (stacked-LSTM) with an attention mechanism for automatic detection of malaria from blood smear images. These models were trained and validated on a publicly available dataset of over 27.000 labeled blood smear images. The comparative and statistical study conducted in this research showed us that the proposed Stacked-LSTM model with attention mechanism outperformed all other approaches, achieving a classification accuracy (0.9912), sensitivity, specificity, precision, F1 score (0.9911), and area under the curve (AUC) superior to all other models. Despite their solid performance, these models are often considered "black boxes" due to their lack of transparency in the decision-making process, which poses significant challenges in medical applications and fields where human life is at stake. To address this, we have integrated explainable AI (XAI) techniques, namely Grad-CAM and LIME, to improve the model's interpretability. Our results demonstrate the complementary value of combining high-performance deep learning models with XAI methods to enhance trust and certainty in AI-assisted medical diagnosis, suggesting that our model can support early and interpretable malaria detection in clinical environments.

## 1. Introduction

Artificial intelligence (AI) has become a transformative technology across multiple domains due to its ability to solve complex problems efficiently. In particular, machine learning (ML), deep learning (DL) or, as we saw more recently, quantum machine learning (QML), which presents opportunities for future advances in processing high-dimensional healthcare data and improving clinical outcomes [1], have significantly advanced AI-driven medical diagnostics, enabling automated disease detection and classification [2]. However, despite their success, Deep Neural Networks (DNNs) are often criticized for their lack of transparency, making them difficult to interpret. This "black-box" nature raises concerns about their adoption in high-stakes applications such as healthcare, where decision-making must be explainable and trustworthy. In response to these concerns, researchers have focused on

Explainable AI (XAI), a field dedicated to enhancing the interpretability of machine learning models. In the healthcare sector, explainability is not just desirable but essential, as AI-generated decisions directly impact patient diagnoses and treatment plans. Ethical and legal frameworks, such as the General Data Protection Regulation (GDPR) in the European Union (EU), reinforce this need by granting medical professionals and patients the right to understand automated medical decisions [3]. Ensuring transparency in AI-based diagnostics fosters trust among healthcare professionals, supports regulatory compliance, and facilitates collaboration between clinicians and AI systems.

Malaria, a mosquito-borne disease caused by Plasmodium parasites, remains a major global health threat despite ongoing eradication efforts. Microscopic analysis of blood smear images is the gold standard for malaria diagnosis, but it is labor-intensive and requires expert

<footnote><sup>a</sup> University Abou Bekaid, Tlemcen, Algeria</footnote>

<footnote><sup>b</sup> École supérieure en informatique - Sidi Bel Abbès, Algeria</footnote>

<footnote><sup>c</sup> LaTIM UMR 1101, Inserm, Brest, France</footnote>

<footnote><sup>d</sup> University of Western Brittany, Brest, France</footnote>

<footnote>* Corresponding author.</footnote>

<footnote>** Corresponding author at: University of Western Brittany, Brest, France.
E-mail addresses: adil.gaouar@univ-tlemcen.dz (A. Gaouar), mostafa.elhabibdaho@univ-brest.fr (M. El Habib Daho).</footnote>
interpretation. AI models, particularly DNNs, have demonstrated potential in automating malaria detection. However, for these models to be effectively integrated into medical workflows, they must not only achieve high accuracy but also provide interpretable explanations for their predictions.

To enhance transparency and trust in malaria detection systems, this study integrates model performance analysis with explainability. The key contributions of this work include:

* Demonstrating the effectiveness of a Stacked-LSTM model with an attention mechanism for medical image classification and complex computer vision tasks.

* Early Malaria detection.

* A comparative evaluation of five deep learning models—VGG-16, VGG-19, Stacked-LSTM, Vision Transformer (ViT), and MobileNetV2—for malaria detection using blood smear images.

* An assessment of two XAI methods, Gradient-weighted Class Activation Map (Grad-CAM) and Local Interpretable Model-agnostic Explanations (LIME), to interpret and explain the predictions made by the Stacked-LSTM classifier.

These explainability techniques allow us to analyze how the model makes decisions and identify the regions of interest influencing its predictions. This approach aims to improve the interpretability of AI models and ensure their reliable application in critical healthcare settings.

The remainder of this paper is organized as follows: Section 2 presents a review of related works. In Section 3, we outline the proposed methodology, detailing the entire processing workflow. Section 4 discusses the experimental results, and Section 5 concludes the paper with insights and future perspectives.

## 2. Related works

Rapid diagnostic tests (RDTs) have been widely adopted for their ability to provide quick, portable results in malaria diagnosis. These tests detect specific antigens of malaria parasites, allowing immediate diagnosis in field settings. However, their accuracy can vary depending on environmental conditions, parasite density, and the disease stage. Moreover, the emergence of parasite strains with deletions in the hrp2 and/or hrp3 genes can significantly compromise RDT reliability, limiting their effectiveness in certain regions [4].

Microscopic examination of blood smears remains the gold standard for malaria diagnosis due to its high reliability and capability for detailed parasite identification. It allows visualization of parasites directly within red blood cells, enabling accurate species determination and quantification of parasite load. Despite these advantages, microscopy can be resource-intensive, requiring specialized equipment and skilled technicians, conditions challenging to meet consistently, especially in resource-limited regions. These constraints motivate the integration of AI approaches into microscopy workflows, aiming to maintain diagnostic accuracy while reducing the dependency on manual expertise and improving diagnostic speed and efficiency.

AI, particularly through advancements in machine learning and deep learning, has significantly transformed the diagnosis of infectious diseases, including malaria. By automating the detection and classification of malaria parasites from medical images, AI-driven systems have increased both the speed and accuracy of diagnosis [5], enhancing clinical decision-making and patient outcomes.

The rapid growth of AI in medicine is attributed to its capability to process large-scale datasets efficiently and to identify complex patterns often undetectable by the human eye [6,7]. AI applications have already demonstrated remarkable successes in diagnosing diseases such as cancer [8], diabetic retinopathy [9] and cardiovascular conditions [10], laying a solid foundation for similar advancements in malaria detection [11].

Recent research on malaria detection has explored various methods, ranging from the binary classification of the presence of malaria in blood smears to more specific tasks such as distinguishing between Plasmodium species.

In developing countries, where human resources and medical infrastructure may be limited, AI offers low-cost and accessible solutions for diagnosing malaria. AI can be integrated into mobile devices, making quick and accurate diagnoses even in remote areas. These mobile systems reduce the need for specialized expertise and train local laboratory technicians to perform effective analyses [12]. This accessibility and speed are essential for managing malaria outbreaks and improving the effectiveness of diagnostic and treatment campaigns [13].

AI-based computer-aided diagnostic systems (CAD-AI) support clinicians and laboratory technicians in decision-making. These systems provide real-time analysis results, allowing healthcare professionals to focus on data interpretation rather than image raw analysis. Thus, AI reduces human errors, improves diagnostic quality, and helps standardize practices in medical environments [14]. Integrating CAD-AI systems also ensures greater efficiency in processing large amounts of data from malaria tests, which is crucial in regions with a high disease incidence [15].

AI is not limited to merely improving existing tools; it allows for rediscovering diagnostic and care processes in limited resource contexts, thereby contributing to more effective disease control [16]. On the other hand, AI-driven segmentation algorithms facilitate the precise delineation of tumors and nanoparticle distributions in hybrid imaging modalities, improving the detection of malignant lesions or ROIs with increased specificity and sensitivity, as demonstrated by the work carried out by Chow et al. [17].

DNNs, Convolutional Neural Networks (CNNs), and Recurrent Neural Networks (RNNs) have shown impressive performance in detecting malaria from blood smear images. A relevant study conducted by Kassim et al. [6] demonstrates an advanced Mask R-CNN model for detecting parasites in blood smear images. Mask R-CNN combines object detection (localization of parasites) with finer segmentation, allowing each parasite to be located with a precise mask for each instance. Combined with ResNet50, a DNN can extract more detailed features from images. The architecture of Mask R-CNN relies on two main networks: one for object detection and another for generating segmentation masks for each object instance (In this case, each parasite). This process allows the parasite's localization and better delineates its shape in the image, improving diagnostic accuracy and enhancing the localization and identification of parasites in the images. The authors designed four pipelines starting from a simple model based on Mask R-CNN detection and added three other classifiers, each in a separate pipeline, to discriminate between P. vivax, P. falciparum, and uninfected patients. Although the first three pipelines demonstrated good performance, the fourth pipeline, presented in their framework named PlasmodiumVF-Net, performed the best and allowed for the identification of Plasmodium species with an accuracy of 0.9776.

Minarno et al. [18] developed a CNN model designed to classify malaria-infected blood smear images. Their architecture consists of three convolutional layers coupled with two fully connected layers. To enhance the model's generalizability and prevent overfitting, they incorporated max pooling operations, batch normalization, and a dropout mechanism with a rate of 0.1. The input images were standardized to a resolution of 64 × 64 pixels during training. The resulting model demonstrated a classification accuracy of 0.96, making it a promising approach for rapid malaria diagnosis in resource-limited settings.

Another original work, due to its technique, is that of Rajaraman et al. [19], who used a modified CNN network to analyze blood smears and detect Plasmodium falciparum with an accuracy of 0.9520. The CNN architecture employed in malaria detection utilizes three convolutional layers followed by two fully connected layers. The model processes input images of dimension 100 × 100 × 3 pixels, where each convolutional layer applies 3 × 3 filters with a stride of 2 pixels.
The first two convolutional layers each consist of 32 filters, while the third layer comprises 64 filters. Rectified Linear Unit (ReLU) activation functions are used to enhance non-linearity, and an optimal weight initialization strategy further supports effective training [20]. To summarize feature maps efficiently, 2 × 2 max-pooling layers with a stride of 2 pixels are employed. The final pooled feature map is fed into a fully connected layer with 64 neurons, followed by another fully connected layer linked to a Softmax classifier. A dropout layer with a rate of 0.5 is incorporated to mitigate overfitting [21]. The model optimization leverages stochastic gradient descent (SGD) [22] with Nesterov momentum [23], while hyperparameter tuning is performed using a randomized grid search [24] to improve generalization.

To enhance malaria parasite classification accuracy, Amin et al. [25] proposed a multi-step pipeline that integrates convolutional neural networks with a support vector machine (SVM). The approach begins with a bilateral filtering technique to improve image quality. Features are then extracted using two strategies: a shape-based descriptor, namely the Pyramid Histogram of Oriented Gradients (PHOG), and deep feature extraction utilizing ResNet-50 and ResNet-18 networks. The extracted features, initially comprising 2300 dimensions, undergo a selection process using the Generalized Normal Distribution Optimization (GNDO) method, reducing them to 498 key features. These refined features are subsequently classified using an SVM, achieving an impressive accuracy of 0.99 when tested on a malaria microscopy dataset.

Wisit et al. [26] proposed a hybrid deep learning model that combines convolutional neural networks (CNNs) with k-nearest neighbors (KNN) for malaria detection. In this approach, the CNN component is responsible for learning high-level features from input images and generating feature maps, which are then passed to a KNN classifier for final decision-making. The feature representation extracted from the CNN's fully connected layer serves as input to the KNN, enabling an efficient and robust classification process. This hybrid model effectively leverages the strengths of CNNs for feature extraction and KNN for classification, making it suitable for processing medical image data, including malaria parasite detection [27].

The YOLO (You Only Look Once) model is used in real-time detection applications. In their research on detecting the malaria pathogen using a dataset of thick blood smear microscopic images captured with a mobile phone, the authors [28] developed two custom models, the first with three layers YOLO-mp-3l and the second with four layers YOLO-mp-4l. They achieved the best scores with an average precision measure (Average-Precision mAP) of 0.9399 and 0.9407, respectively, surpassing the standard YOLOv4, which obtained 92.56% for the same measure. They were also able to streamline their models for fast and optimal execution with a size of 21.8 Mb for YOLO-mp-3l and 25.4 Mb for YOLO-mp-4l, which is significantly better than the standard YOLOv4 with a size of 244 Mb, thus proving their capability to operate on low-resource devices.

Deep learning models incorporating recurrent architectures such as LSTM networks have also demonstrated substantial improvements in malaria image classification. Pereira-Ferrero et al. [29] introduced a feature augmentation technique leveraging rank-based manifold learning to refine LSTM model performance. This method assigns contextual similarity weights to training samples, leading to an accuracy improvement of up to 20% in image classification tasks. The approach combines convolutional feature extraction with LSTM-based sequence modeling, demonstrating its potential in medical image analysis where temporal dependencies and feature enhancement play a critical role.

Due to their conceptual limitations and inability to capture long dependencies, the CNNs have integrated the attention mechanisms, which allow them to dynamically adjust weights based on input features, in order to improve their non-local modeling capability [30–32]. Inspired by this line of research, many researchers have made significant efforts to propose models with attention variants in the field of medical imaging [33–37]. Although these attention mechanisms allow for the modeling of the complete contextual information of the image,

the computational complexity of these approaches generally grows quadratically with respect to the spatial size, which implies an intensive computational load, making them inefficient in the case of medical images that are dense in pixel resolution [38]. Moreover, despite the fact that combining the attention mechanism with the convolution operation leads to systematic performance gains, these models inevitably suffer from constraints in learning long-range interactions. The original Transformer [32] was first applied to the task of machine translation as a new attention-driven building block and has demonstrated impressive performance across a wide range of tasks, including natural language processing (NLP), machine translation, text classification, and question answering. The success of Transformers has led to this technique being widely applied in modern computer vision (CV) models, giving rise to Vision-Transformers (ViTs) [39]. The ViTs quickly established themselves as viable alternatives to CNNs in various tasks such as image recognition [39], object detection [40], image segmentation [41], video understanding [42], and image super-resolution [43]. As the central piece of the Transformer, the self-attention mechanism has the ability to model the relationships between the elements of a sequence, thus learning long-range interactions.

The Vision Transformer (ViT) is an innovative neural architecture that has revolutionized computer vision by using self-attention techniques from natural language processing and adapting them to visual data. ViT segments images into fixed-size patches, integrating them linearly before passing them to a transformer encoder [44,45]. This innovative method facilitates comprehensive learning of image properties. By allowing exchanges between patches in both directions, the ViT captures extended dependencies, which enhances its ability to represent the broader context of images. The exceptional success of ViT has not only pushed the boundaries of image classification but has also spurred advancements in various computer vision tasks, unveiling new avenues for research in artificial intelligence and practical applications [46,47]. The authors in [48] for efficient skin cancer classification proposed a two-level architecture. The first level involves data augmentation techniques to increase the number of samples present in the HAM10000 dataset. In the second layer, the authors exploited the efficiency of medical vision transformers (MVT) used in medical image processing to design an MVT-based model for skin cancer classification. A large version of the Vision Transformer model was used, combined with an MLP head at its output. We recorded an accuracy of 0.96, a sensitivity of 0.96, an F1 score of 0.97, and an accuracy of 0.96. In [49], a new ViT model for skin cancer classification was presented. The method was based on transfer learning by leveraging a pre-trained ViT model and fine-tuning it with the HAM10000 dataset. The fine-tuning process was carried out by integrating a classification segment into the final segment of the encoder transformer, consisting of a flattened layer and two batch normalizations, separated by a dense layer activated by GeLU. The experiment achieved an accuracy of 0.94, surpassing all the compared techniques. Just like in [50], a pre-trained ViT fine-tuned with an MLP on the HAM10000 was used. However, a method based on contrastive learning was implemented. Contrastive learning relies on a specific loss function to decrease the similarity between samples of the same class while increasing the similarity between samples of distinct classes. This model achieved an accuracy rate of 0.94.

The explainability of intelligent models is crucial for doctors to understand and validate the decisions of AI systems. Techniques like Grad-CAM, LIME, or Shapley Additive exPlanations (SHAP) are increasingly used to make these models more transparent and accessible. These techniques allow for decoding the decisions of AI models, which is essential for ensuring their clinical acceptance [51].

According to Islam et al. [12], a network based on the Grad-CAM method was used to explain the decisions made by a transformer model for malaria diagnosis. This AI model not only predicts the presence of Plasmodium but also visualizes which parts of the image were most influential in the decision, thereby improving transparency and clinicians' trust in the results. This explanation process has been combined with
Transformer networks to improve the model's accuracy, particularly when parasites are visible under low contrast [52].

Rajab et al. [51] investigated explainable AI techniques for malaria diagnosis, employing SHapley Additive exPlanations (SHAP) and Local Interpretable Model-Agnostic Explanations (LIME) to enhance transparency in machine learning predictions. They evaluated several classification algorithms, including Extreme Gradient Boosting, K-means, K-Nearest Neighbors, Support Vector Machines (SVMs), Decision Trees, Logistic Regression, Random Forest, Naïve Bayes, AdaBoost, and Explainable Boosting Machines (EBM). Among these, Random Forest and EBM achieved the highest accuracy (0.84). Logistic Regression, after fine-tuning with GridSearchCV, reached an accuracy of 0.81. The study further employed k-fold cross-validation with XGBoost to ensure robust model evaluation, highlighting the role of explainability techniques in increasing clinicians' trust in AI-based malaria diagnostic systems.

Traditional supervised learning models often require a large number of features, resulting in high computational costs and reduced interpretability. To address this issue, Khan et al. [13] introduced a feature selection strategy designed to minimize the dimensionality of malaria diagnostic datasets while maintaining classification accuracy. Their approach focuses on extracting only the most relevant features, significantly improving computational efficiency and interpretability. The study observed that malaria-infected red blood cells exhibit distinctive ring-shaped structures, while uninfected cells do not. By leveraging this morphological characteristic, the proposed method efficiently identifies infected cells, providing a streamlined yet highly accurate approach to malaria detection.

One of the most original approaches for detecting malaria and typhoid is the one proposed by Attai et al. [53]. The originality of this study lies not only in the use of XAI, such as LIME, but especially in the application of LLMs, including Generative Pretrained Transformer (GPT), to facilitate the elucidation of diagnostic results for healthcare professionals. Indeed, chatbots, based on AI-driven conversational agents that are widespread in online interactions, have found considerable use in healthcare and improving customer services [54]. The work presented by Chow et al. [55] summarizes the general characteristics that healthcare professionals expect from a medical chatbot very well. These features include accurate information retrieval, symptom evaluation, and diagnostic support to help understand and treat health problems. Additionally, the chatbot should offer treatment advice, medication information, and appointment booking assistance, thereby providing a comprehensive healthcare experience. The results indicated that the Random Forest (RF) model outperformed the performance of the other evaluated models, achieving an F1 score of 0.7145; furthermore, significant features were found using LIME graphs, while ChatGPT 3.5 showed a comparative advantage over the models of large language. The research combines RF, LIME, and GPT to develop a mobile application to improve interpretability and transparency in diagnosing malaria and typhoid. Despite its encouraging results, the dataset's quality limits the system's effectiveness. Moreover, although LIME and GPT improve transparency, they can complicate real-time implementation due to their computational requirements and the need for an Internet connection to ensure relevance and accuracy.

## 3. Material and methods

The approach proposed in this study includes a pipeline consisting of three main steps. The first involves data pre-processing, which prepares blood smear images for analysis. The second step focuses on classification. It allows us to test and compare the results of five different models, namely, VGG-16, VGG-19, MobileNetV2, ViT and Stacked-LSTM, with an attention mechanism. As we will see in Section 3.2, these models have been customized to detect malaria cases with high accuracy. Finally, the third step compares the results using two explainability techniques, Grad-CAM and LIME, to interpret and understand the decisions made. This methodology was proposed to combine both solid classification performance and increased transparency, thus offering a robust and interpretable framework for malaria detection.

<figure><img src="image_5.png" /><figcaption>Fig. 1. Example images from the NIH-NLM - Malaria dataset. (a) represents a blood smear, (b) represents a healthy red blood cell, and (c) represents an infected red blood cell. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 2. Example images describing the different species of the Plasmodium parasite. (a) P. Falciparum, (b) P. Vivax, (c) P. Ovale, and (d) P. Malariae.</figcaption></figure>

### 3.1. Dataset

The dataset used in this study, publicly available on the National Library of Medicine website, contains 27,558 images of Giemsa-stained blood smears, photographed at a 100x magnification in the RGB color space with a very high resolution of 3024 × 3024 pixels [6]. They were provided in JPG format and a filter was then applied to eliminate acquisition noise. The images thus obtained are of high quality, as can be seen in Figs. 1 and 2. The dataset is well-balanced, with an equal number of images representing infected and non-infected cells. The data collection process involved several steps, including the collection of blood samples from individuals infected with *Plasmodium falciparum* and *Plasmodium vivax*, as well as uninfected individuals, at various locations, such as the Chittagong Medical College Hospital in Bangladesh and Bangkok, Thailand. This diverse and balanced dataset ensures effective model training for both classes, providing a solid foundation for malaria detection [6,19,56,56-60].

Four species of Plasmodium are involved in the spread of malaria, as shown in Fig. 3. Plasmodium falciparum, the most pathogenic species responsible for fatal cases of malaria, is predominant in Africa. Plasmodium vivax, coexisting with P. falciparum, has been identified in temperate zones. In West Africa, the presence of P. ovale can be observed, a parasite that is not fatal but causes relapses approximately four to five years after the initial infection. Finally, on a global scale (with an uneven distribution), the presence of P. Malariae is observed, which, although not fatal, carries a risk of relapse that can occur up to twenty years after the first infection. Relapses are associated with the persistent presence of the parasite in the liver in a latent state (hypnozoite). Cases of direct transmission of this disease between individuals are rare. They can manifest, for example, when there is sharing of contaminated syringes or through transplacental transmission during pregnancy [61].

As illustrated in Fig. 3, the life cycle of the Plasmodium parasite begins when an infected female Anopheles mosquito bites a human host, introducing sporozoites into the bloodstream. These sporozoites rapidly migrate to the liver, where they invade hepatocytes and undergo asexual replication. Over the course of approximately 7 to 10 days post-infection, they proliferate within liver cells without triggering any noticeable symptoms. 8 to 30 days after infection, a fever develops. It may be accompanied by weakness, headaches, muscle pain, vomiting, diarrhea, and/or coughing. Fever accompanied by tremors,
<figure><img src="image_7.png" /><figcaption>Fig. 3. Example of images that describe different species of plasmodium and their development stages.</figcaption></figure>

cold sweats, and intense perspiration may occur cyclically due to the different phases of the parasite cycle. More serious symptoms may occur, such as breathing difficulties, bleeding, jaundice, extreme fatigue, and convulsions. In some cases, infected red blood cells can obstruct the blood vessels that supply the brain, which can be fatal. In the human bloodstream, merozoites invade red blood cells (erythrocytes), where they multiply until the host cells rupture. This process leads to the release of new merozoites, which then invade other erythrocytes, perpetuating the infection cycle. Each time the parasites spread and attack new blood cells, periodic fevers appear as a clinical symptom of the disease. However, a subset of the infected red blood cells diverges from this asexual replication cycle. Instead of continuing multiplication, some merozoites differentiate into sexual-stage forms known as gametocytes, which circulate within the bloodstream. When a mosquito feeds on an infected individual, it ingests these gametocytes, which then mature into sexual cells called gametes within the mosquito's gut. The fertilized female gametes develop into motile ookinetes, which penetrate the midgut lining and transform into oocysts on the external surface. Inside the oocysts, thousands of sporozoites form. Once the oocyst ruptures, these sporozoites migrate to the salivary glands of the mosquito. The transmission cycle resumes when the mosquito bites another human, injecting sporozoites into the new host and initiating another infection [40]. To confirm or exclude a diagnosis of malaria, a blood sample must be analyzed using parasitological tests. The standard test consists of microscopic examination of blood smears (thin and thick blood smears). A great deal of training and experience is required to analyze blood smears properly, particularly to interpret thick smears, identify parasite species, and quantify parasitemia. The absence of experienced personnel can limit the precision of malaria diagnosis, and,

in the majority of cases, malaria cannot be diagnosed during the first hours after the patient has been infected with the conventional method. This is why we want to screen and detect the parasite early (within the first few hours of contamination) by analyzing blood smear images with our intelligent models, before it develops and becomes contagious. On the one hand, to prevent its spread within the population and, on the other hand, to ensure that the individual starts treatment before his or her health deteriorates or his prognosis becomes life-threatening [62].

### 3.1.1. Data preprocessing

In this study, the dataset was divided into three subsets to rigorously evaluate model performance: 50% for training, 20% for validation, and 30% for testing. This split ensures a balanced distribution for robust training and reliable evaluation.

A series of preprocessing steps were applied to infected and uninfected cell images to prepare the data for machine-learning models. First, images were loaded from the dataset and resized to 224 × 224 pixels to match the model's input requirements. Data augmentation techniques, including random cropping, rotations of 45° and 75°, and Gaussian blurring with a 10 × 10 kernel, were applied to enhance dataset diversity and prevent overfitting. Each image was assigned a label: 1 for infected cells and 0 for uninfected cells. These augmentation techniques were applied to the images used for the CNN-based models, VGG-16 and VGG-19, and the proposed Stacked-LSTM with attention mechanism ensuring balanced representation across the dataset.

For the proposed Stacked-LSTM model with attention mechanism, an extra preprocessing pipeline was adopted. The augmented images underwent grayscale conversion to reduce computational complexity
<figure><img src="image_8.png" /><figcaption>Fig. 4. Otsu thresholding segmentation and ROI detection from blood smear images. (A) Input image. (B) Final segmentation mask and ROI detection. (C) Segmentation results are superposed on the original image.</figcaption></figure>

by eliminating colorimetric information, achieved using the perceptual luminance model:

$$Grayscale = 0.299 \cdot R + 0.587 \cdot G + 0.114 \cdot B \quad (1)$$

With R, G, and B the three channels of the color image. Note that these coefficients are based on the perceptual luminance model and give more weight to green, as the human eye is more sensitive to this color.

Following grayscale conversion, threshold segmentation was applied using the Otsu method, which binarized the images and effectively separated the objects (cells) from the background (as shown in Fig. 4). Subsequently, regions of interest (ROIs) were detected based on contour and shape analysis, enabling the identification of Plasmodium parasites at various developmental stages. This selective approach reduces noise by focusing solely on relevant areas.

The extracted ROIs were then resized uniformly to 50 × 50 pixels. Each ROI image was subsequently divided into smaller patches of 5 × 5 pixels to construct a sequence that serves as the input for the LSTM layers. This approach converts spatial data into sequential representations, facilitating the capture of spatial dependencies and enhancing the interpretability of the model's decision-making process.

## 3.2. Proposed approach

### 3.2.1. Models explainability

XAI techniques have emerged to address the transparency challenge in machine learning, particularly for high-stakes healthcare applications where interpretability is essential for clinical acceptance, ethical accountability, and regulatory compliance. These methods facilitate a deeper understanding of model decisions, crucial for tasks such as automated malaria detection.

The terms interpretability and explainability are often used interchangeably in the AI literature, yet they refer to distinct concepts. Interpretability denotes the extent to which a model's decision-making process is inherently understandable without requiring external tools or modifications [63]. Transparent models, such as linear regression and decision trees, exhibit this property by design.

Explainability, by contrast, refers to the use of additional techniques to elucidate the internal workings of complex models, particularly those lacking intrinsic transparency, such as DNNs [64]. Explainability methods, including feature attribution, saliency maps, and surrogate models, enable clinicians and researchers to analyze AI-generated outputs, facilitating model validation and fostering trust in medical AI systems.

XAI methods are broadly classified into model-specific and model-agnostic techniques. Model-specific methods leverage internal model structures, as seen with gradient-based approaches like Grad-CAM, which visualizes important image regions influencing CNN predictions. Model-agnostic methods, such as LIME, operate independently of the model architecture by approximating model behavior locally using interpretable surrogate models.

XAI methods can also be categorized based on their granularity into global or local approaches. Global methods, like SHAP, provide insights into the overall behavior of a model across datasets, while local methods, such as Grad-CAM and LIME, explain individual predictions by identifying specific influential input features.

In this study, Grad-CAM and LIME were employed to enhance the interpretability of the proposed Stacked-LSTM model with an attention mechanism for malaria detection. Grad-CAM is used to visualize the regions of an image that most influenced the model's decision. As shown in Fig. 5, Grad-CAM calculates the gradients of the target class concerning the feature maps of the final convolutional layer and then uses these gradients to generate a heatmap. The heatmap highlights the regions of the input image that have the most significant impact on the model decision, offering global visualization and helping to interpret which parts of the image contributed to a specific classification result [65].

In contrast, LIME explains individual predictions by approximating the model's behavior with a simpler, interpretable surrogate model. This technique generates perturbed versions of the input data to determine which data features have affected a specific prediction, subsequently making the decision process more transparent [66]. Here, we use LIME to improve the interpretability of a deep-learning model for classifying malaria cells. LIME generates super-pixels by perturbing the input image and examining the effect of these perturbations on the model's output. The visual explanation highlights important parts in the image (e.g., the cell's shape, texture, or color) responsible for the model's decision. Such transparency is crucial for validating predictions and confirming that the model focuses on biologically relevant features, especially for medical applications such as malaria.

Using these complementary techniques allowed comprehensive analysis of model behavior. Grad-CAM provided an overall understanding of image regions considered significant by the model, whereas LIME offered detailed, localized interpretations, pinpointing precise features driving each decision. Integrating these methods demonstrated the robustness and reliability of the proposed model and confirmed its focus on biologically relevant image features essential for accurate malaria diagnosis.

### 3.2.2. Classification models

CNNs' main advantage is their ability to learn representations and extract features from visual data. In this way, these models tend to require a minimal level of preprocessing compared to other image classification algorithms [29]. In this study, we used five well-established deep learning models. Initially, we tested the VGG-16 and VGG-19 models for the classification of images of infected and non-infected cells. The two models, VGG-16 and VGG-19, are CNNs that have been widely adopted for image classification tasks due to their efficient and straightforward architecture and are distinguished by their use of small convolutional filters (3 × 3), which are stacked in a deep architecture to capture complex visual patterns [67].

Although the first two models gave us notable performances, we thought it would be very interesting to test a lightweight deep model
<figure><img src="image_9.png" /><figcaption>Fig. 5. Flowchart of Grad-Cam and LIME model's.</figcaption></figure>

that can be used on resource-limited devices (smartphones, connected microscopes, Raspberry Pi, etc.) and that also presents a good compromise between accuracy and model size, which is crucial for medical applications where latency and computational power may be limited. Moreover, malaria detection is often needed in regions with limited access to electricity or expensive equipment. These motivations led us to design a lightweight and efficient classification architecture based on MobileNetV2, a deep convolutional network optimized for resource-constrained environments [68]. MobileNetV2 is designed to be lightweight thanks to its architecture based on depthwise convolutions and inverted residual blocks, allowing for a significant reduction in the number of parameters while maintaining good generalization performance. This leads to fast inference even on resource-limited devices.

We employed transfer learning by using pre-trained weights from the ImageNet dataset and fine-tuning them for our specific task. This allowed us to leverage the pre-trained feature extraction capabilities of VGG-16 and VGG-19, improving training efficiency and model performance. Both models were chosen for their ability to extract detailed hierarchical features, making them particularly effective for complex tasks like malaria cell detection.

Although CNN models have made excellent advances, primarily supported by their deep features, a significant obstacle remains related to the lack of contextual information in such representations. Indeed, these representations often lie on manifolds in a high-dimensional space [69], where the pairwise formulation of the similarity measure is insufficient to reveal the intrinsic relationship between the images. Our work focuses on finding a more efficient representation of features in such a context by considering the contextual similarity relationships defined by the extracted features. To achieve this goal, we have begun to test ViTs, which are gradually revolutionizing medical imaging by providing innovative solutions where traditional CNNs show limitations, such as their ability to capture subtle patterns (micro-calcifications, cellular anomalies) through multi-head attention or their ability to preserve long-distance spatial relationships, crucial for complex anatomical structures or large images, unlike CNNs, which cannot do so. After that, we used RNNs, specifically Stacked-LSTM networks. The LSTM networks proposed by Hochreiter and Schmidhuber [70] were a key moment for RNNs, as they allowed the learning of dependencies over much more extended periods of time, solving the problem of vanishing gradient inherent in basic RNNs during the backpropagation process [71].

A key innovation of Long Short-Term Memory (LSTM) networks is their ability to regulate information flow through specialized gates. This gating mechanism enables LSTMs to retain and update their internal state over extended sequences, making them particularly effective for

<figure><img src="image_10.png" /><figcaption>Fig. 6. Architecture of an LSTM cell.</figcaption></figure>

capturing long-range dependencies in data. As illustrated in Fig. 6, an LSTM unit consists of three primary gates: the input gate, forget gate, and output gate. These components play a crucial role in controlling the cell state $c_t$ and hidden state $h_t$ [72,73]. Specifically, the gates determine the amount of information retained from the input, the portion of prior information to discard, and the extent of new information integrated into the cell.

The mathematical representation of the LSTM cell update process is given as follows:

$$ \dot{i}_t = \sigma(\omega_{iX}x_t + \omega_{ih}h_{t-1} + b_i) \qquad (2) $$

$$ \mathbf{f}_t = \sigma(\omega_{xf}\mathbf{X}_t + \omega_{hf}\mathbf{h}_{t-1} + \mathbf{b}_f) \qquad (3) $$

$$ \mathbf{o}_t = \sigma(\omega_{xo}\mathbf{X}_t + \omega_{ho}\mathbf{h}_{t-1} + \mathbf{b}_o) \qquad (4) $$

$$ \tilde{c}_t = \tanh(\omega_{gx}\mathbf{x}_t + \omega_{gh}\mathbf{h}_{t-1} + \mathbf{b}_g) \qquad (5) $$

$$ c_t = f_t \odot c_{t-1} + i_t \odot \tilde{c}_t \qquad (6) $$

$$ \mathbf{h}_t = o_t \odot \tanh(c_t) \qquad (7) $$

where:

$i_t$ is the input door.

$f_t$ is the forget door.

$o_t$ is the output door.

$\tilde{c}_t$ is the output door.

$c_t$ is the state cell.

$h_t$ is the hidden state.

$\sigma$ is the sigmoid function.

$\tanh$ is the hyperbolic tangent function.

$\odot$ denotes element-wise multiplication.

There are several architectures based on LSTMs, such as bidirectional LSTMs (Bi-LSTM), which process sequences in both forward and backward directions, allowing the LSTM network to capture the context of both the past and the future [74]. Stacked-LSTM networks represent another architecture that is based on stacking LSTM layers. The stacked LSTM integrates external recurrence by connecting multiple LSTM layers in such a way that the outputs of one layer represent the input of the next LSTM layer. This deep architecture offers us the possibility to learn and capture much more complex patterns and sequences at different levels of abstraction from the input data. In fact, while the
lower layers can capture local patterns and short-term dependencies, the upper layers, on the other hand, can capture more abstract features and long-term dependencies [59].

In this study, we chose to experiment with Stacked-LSTM equipped with an attention mechanism to detect and classify malaria from blood smear images. In the majority of works using LSTMs in the field of image classification, researchers precede this classification with a feature extraction step based on CNNs [14,16,29,75,76]. Although such an approach has yielded good results in terms of accuracy and precision, their training times are relatively slow, and, from a computational point of view, they are costly and complex, adding a layer of opacity to the so-called “black box models”, making them non-interpretable and difficult to explain approaches. Since our main goal is not only to achieve good performance but also, above all, to present models that are as interpretable and explainable as possible, with a very short learning time, we preferred to avoid the use of CNNs. Since LSTMs process temporal sequences and telescopic medical images do not present such sequences, we transformed the ROIs obtained in the image-preprocessing step into 5 × 5 pixel image patches in order to organize them into a spatial sequence. To do this, we performed positional coding, as done in transformers, using the following formulas:

$$PE_{(x,y,2i)} = \sin \left( \frac{x}{10000^{\frac{2i}{d}}} \right) \qquad (8)$$

$$PE_{(x,y,2i+1)} = \cos \left( \frac{x}{10000^{\frac{2i}{d}}} \right) \qquad (9)$$

$$PE_{(x,y,2j)} = \sin \left( \frac{x}{10000^{\frac{2j}{d}}} \right) \qquad (10)$$

$$PE_{(x,y,2j+1)} = \cos \left( \frac{x}{10000^{\frac{2j}{d}}} \right) \qquad (11)$$

where:

* (x, y) are the coordinates of the patch in the grid.

* i and j iterate over the dimensions of the encoding vector.

* d is the dimension of the encoding vector.

This gives each patch a unique vector encoding its position in the image. The set of patches is then organized into a sequence according to their position. The objective is to provide each patch with information about its spatial position so that the first LSTM layer understands the spatial relationships when processing the sequence as if it were a temporal sequence that can be exploited by the first LSTM layer of our model, as shown in Fig. 7.

The first LSTM layer consists of 64 LSTM cells. It analyses the sequence of patches, their dependencies, and their spatial relationships, transforming each one into a rich and contextual representation and outputting a sequence of hidden states $h_t$. We obtain a sequence of representations $H = [h_1, h_2, ..., h_n]$, where n is the number of patches.

We applied a 50% dropout on the outputs obtained from the first LSTM layer to avoid overfitting and provide robustness to our model. The remaining sequences will be directed towards an attention layer, integrating an additive attention mechanism [77]. This attention mechanism plays a crucial role in malaria detection. It allows the model to focus on the most relevant areas of blood smear images, particularly the regions of interest (ROIs) detected by segmentation. This mechanism begins by extracting spatiotemporal features from the patches and calculating an attention vector for each, reflecting its importance and relevance for classification. The most influential patches (notably those that exhibit characteristics of the plasmodium) will be assigned a higher attention score. The importance score is calculated for each vector $h_t$ and is compared to a context vector $w$ learned by the model. We calculate an importance score $e_t$ for each patch:

$$e_t = score(h_t, w) = v^T \tanh(wh_t + b) \qquad (12)$$

where:

w and b are learned parameters.

$v^t$ is a learned weighting vector.

We then move on to the score normalization phase using the Softmax function, applying it to all importance scores to obtain attention weights $\alpha_t$:

$$\alpha_t = \frac{\exp(e_t)}{\sum_{j=1}^{n} \exp(e_j)} \qquad (13)$$

Normalization ensures that the attention weights $\alpha_t$ are between 0 and 1 and that their sum is equal to 1; this allows us to interpret the weights probabilistically. The extracted features are weighted by the attention vector $V_t$ giving more weight to important patches. Allowing the model to focus on important regions rather than treating all patches similarly. The vector $V_t$ is obtained by the weighted sum of all hidden states $h_t$:

$$v_t = \sum_{i=1}^{n} \alpha_i h_i \qquad (14)$$

The integration of the attention mechanism into our classifier was motivated by objectives related to prediction and classification, as well as by the increase in model transparency to make it more interpretable and explainable, thus allowing healthcare professionals to understand the obtained results fully. The first objective was achieved primarily by focusing the model on the attention regions. Indeed, this allowed us to reduce noise and increase classification accuracy, as well as computational complexity and training time, because we do not process the entire image but only specific attention regions. The second goal, to increase the transparency of the model, making it more interpretable and easier to explain, was achieved by using the visualization of the attention regions to understand which areas of the blood smear the model considers important. This visualization also allows us to explain why the model predicted the presence or absence of malaria by pointing to the relevant regions of interest. Similarly, experts can verify the model's decisions by analyzing these regions, giving them confidence in its predictions. Unlike the first LSTM layer, which receives a sequence of patches and produces a sequence of outputs, the second LSTM layer receives a single attention vector $V_t$ and does not produce any sequence. It acts as a final encoder that compresses this information into a unique image representation, integrating the contextual information extracted by the attention mechanism and producing a consistent global representation. This operation is comparable to the functioning of a recurrent LSTM in a single timestep, transforming the vector $V_t$ into a richer representation, producing an output that represents the final hidden state (Final $h_t$) used for classification. Similarly to the first LSTM layer output, we apply dropout to the second LSTM layer output, deactivating only 20% of the connections. The output will then be sent to the fully connected layer, equipped with a sigmoid function for binary classification: infected or not-infected. The final step of our pipeline concerns the explainability and visualization of the obtained results, thanks to XAI methods, Grad-CAM, and LIME.

## 4. Experiments and results

We carried out our experiments using Google Colab, a cloud-based platform that provides free access to GPUs, which was ideal for handling the computational demands of training and testing deep learning models. Google Colab supports Python and popular deep learning frameworks like TensorFlow and Keras, which we used to implement the VGG-16, VGG-19, MobileNetV2, ViT, and Stacked-LSTM models and the explainability techniques (Grad-CAM, LIME). This platform allowed us to efficiently process large datasets, perform model evaluations, and apply various interpretability methods, all while benefiting from its integration with Google Drive for easy data management and sharing. The cloud-based environment also facilitated collaboration and ensured the reproducibility of our experiments.
<figure><img src="image_11.png" /><figcaption>Fig. 7. Architecture of the proposed model combining Stacked-LSTM and attention mechanism.</figcaption></figure>

Training and evaluation of the aforementioned models were performed using a consistent set of fundamental hyperparameters to ensure a fair comparison. All images were resized to 224 x 224 pixels with three RGB channels to standardize input dimensions across models. Transfer learning was employed for VGG-16, VGG-19, and MobileNetV2 by initializing the networks with pretrained ImageNet weights, while ViT and the Stacked-LSTM models processed sequential representations derived from the input images. Training was performed using a batch size of 32 across all models, optimizing parameters with the Adam optimizer at a learning rate of 0.0001. The binary cross-entropy loss function was used to address the binary classification task, and training was conducted over 100 epochs with early stopping (patience = 5) to prevent overfitting. Regularization techniques were also applied, with dropout mechanisms incorporated into the network layers to enhance generalization. Activation functions were carefully selected: ReLU was used in the intermediate layers of the VGG models, while sigmoid activation was applied to the output layers of all models to produce probability scores.

Beyond these common hyperparameters, model-specific configurations were introduced to tailor the architectures to their respective learning paradigms. For the convolutional models, VGG-16 and VGG-19, the dense layers included a 50% dropout rate to mitigate overfitting. These models leveraged their deep convolutional feature extraction capabilities, followed by fully connected layers for classification.

Regarding the MobileNetV2 model, we used it as a feature backbone, disabling its original classification head and replacing it with a classification head added on top of MobileNetV2. That is to say, we configured and used it solely as a feature extractor, without the original classification layers; the Global Average Pooling 2D layer allowed us to reduce each feature map to an average value, while decreasing the number of parameters; then a 30% Dropout was applied twice to limit overfitting; the Dense layer composed of 64 neurons, ReLU is a fully connected layer used for learning abstract representations; finally, we used an output layer represented by a Sigmoid function composed of a single neuron for binary classification producing a probability for the “Infected” vs. “Uninfected” classes. The entire set of layers in the model was designed to maintain a good balance between lightness, performance, robustness, and computational efficiency.

The Vision Transformer (ViT) model, designed in our study, represents a lightweight model adapted to binary classification of red blood cell images into infected and uninfected classes. Unlike the presented CNN model, the ViT model leverages the self-attention mechanism to capture long-range dependencies and contextual relationships between image regions. Each input image is resized to 224 x 224 pixels

and partitioned into fixed-size, non-overlapping patches of 16 x 16 pixels. These patches are flattened and linearly projected into a lower-dimensional embedding space (dimension 64), forming a sequence of 196 tokens. Positional embeddings are added to each patch token to preserve the spatial information lost during flattening. This enables the model to distinguish patch locations within the image's 2D structure. The encoded patches are passed through a stack of four Transformer blocks. Each block consists of Layer Normalization, Multi-Head Self-Attention (MHSA) with 4 heads, Residual connections, and a two-layer feed-forward neural network (MLP) with GELU activation and dropout. These Transformer blocks enable the model to learn complex interactions between distant patches, thus improving its ability to detect global patterns characteristic of malaria-infected cells. Instead of using the conventional (CLS) token used in original ViT implementations, we aggregate the information from all patches using a GlobalAverage-Pooling1D layer. This is followed by a fully connected layer with 128 neurons (ReLU activation) and a final sigmoid-activated dense layer that outputs the probability of infection.

In contrast, the Stacked-LSTM model, designed to capture temporal dependencies in feature representations, incorporated sequential processing. Each LSTM layer consisted of 64 LSTM cells, and the input sequence was structured into 50 time steps per instance. Regularization was applied differently in this architecture, with a 50% dropout rate in the first LSTM layer and a reduced 20% dropout rate in the second LSTM layer to maintain a balance between feature retention and overfitting prevention. Unlike the VGG models, where ReLU activations dominated intermediate layers, the Stacked-LSTM model relied on a sigmoid activation function in its fully connected output layer to generate classification probabilities.

## 4.1. Classification results

In this study, we first compared the performance of our proposed model, Stacked-LSTM with an attention mechanism, against two commonly used CNN models (VGG-16 and VGG-19) for the malaria classification task. Subsequently, an ablation study was conducted to assess the impact of the attention mechanism by comparing the performance of our model with and without attention.

Table 1 summarizes the performance of these models on the malaria dataset. The proposed Stacked-LSTM with an attention mechanism achieved the highest accuracy of 0.9912, surpassing VGG-16 and VGG-19, which achieved accuracy scores of 0.9802 and 0.9601, respectively. The results highlight the significant improvement provided by incorporating the LSTM network enhanced with the attention mechanism, achieving superior values across accuracy, sensitivity, specificity, precision, F1-score, and AUC compared to traditional CNN architectures.
<table><caption>**Table 1**
Performance comparison between VGG models and the proposed Stacked-LSTM with an attention mechanism for malaria detection.</caption><thead><tr><th>Model</th><th>Accuracy</th><th>Sensitivity</th><th>Specificity</th><th>Precision</th><th>F1 score</th><th>AUC</th></tr></thead><tbody><tr><td>VGG-16</td><td>0.9802</td><td>0.9839</td><td>0.9765</td><td>0.9763</td><td>0.9801</td><td>0.9780</td></tr><tr><td>VGG-19</td><td>0.9601</td><td>0.9681</td><td>0.9521</td><td>0.9528</td><td>0.9604</td><td>0.9588</td></tr><tr><td>ViT</td><td>0.9509</td><td>0.9273</td><td>0.9746</td><td>0.9734</td><td>0.9498</td><td>0.9503</td></tr><tr><td>MobileNet-V2</td><td>0.9303</td><td>0.9475</td><td>0.9132</td><td>0.9160</td><td>0.9315</td><td>0.9258</td></tr><tr><td>Stacked-LSTM with Attention</td><td><strong>0.9912</strong></td><td><strong>0.9867</strong></td><td><strong>0.9956</strong></td><td><strong>0.9959</strong></td><td><strong>0.9911</strong></td><td><strong>0.9912</strong></td></tr></tbody></table>

<figure><img src="image_12.png" /><figcaption>**Fig. 8.** Confusion matrix for VGG-16 model.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>**Fig. 10.** Confusion matrix for MobileNet-V2 model.</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>**Fig. 9.** Confusion matrix for VGG-19 model.</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>**Fig. 11.** Confusion matrix for ViT model.</figcaption></figure>

Additionally, to further illustrate model performance, Figs. 8 and 9 present the confusion matrices for the VGG models. VGG-16 (Fig. 8) accurately classified 4068 uninfected and 4034 infected samples, with 98 false positives and 66 false negatives, demonstrating high precision and sensitivity. However, it leaves room for improvement in reducing false negatives.

In contrast, VGG-19 (Fig. 9) correctly identified 3935 uninfected and 4001 infected samples but misclassified 198 uninfected as infected and 132 infected as uninfected, suggesting lower specificity.

MobileNetV2 (Fig. 10) is designed for mobile and edge devices, and prioritizes efficiency and speed. This is confirmed by its confusion

matrix, which shows that this model was able to classify 3775 infected cases and 3915 uninfected cases. However, we also note that it has the highest number of FN cases = 217, which is enormous in such a field, since it has an FN rate = 5.25%. However, it misclassified 359 uninfected cases as infected, confirming its low specificity and precision.

The Transformer-based model (Fig. 11) correctly classified 4022 cases as infected and 3840 cases as uninfected, confirming its high specificity and precision. While it misclassified 105 healthy individuals as infected, this shows that ViT is fairly conservative in positive predictions. However, misclassifying 301 infected cases wrongly predicted as uninfected represents a high FN rate (7.27%), translating his low sensitivity.
<table><caption>**Table 2**
Ablation study highlighting the performance enhancement provided by integrating an attention mechanism into the Stacked-LSTM model.</caption><thead><tr><th>Model</th><th>Accuracy</th><th>Sensitivity</th><th>Specificity</th><th>Precision</th><th>F1 score</th><th>AUC</th></tr></thead><tbody><tr><td>Stacked-LSTM (No Attention)</td><td>0.9758</td><td><strong>0.9877</strong></td><td>0.9644</td><td>0.9638</td><td>0.9815</td><td>0.9761</td></tr><tr><td>Stacked-LSTM with Attention</td><td><strong>0.9912</strong></td><td>0.9867</td><td><strong>0.9956</strong></td><td><strong>0.9959</strong></td><td><strong>0.9911</strong></td><td><strong>0.9912</strong></td></tr></tbody></table>

<figure><img src="image_16.png" /><figcaption>**Fig. 12.** Confusion matrix for Stacked-LSTM without attention mechanisms.</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>**Fig. 13.** Confusion matrix for Stacked-LSTM with attention mechanisms.</figcaption></figure>

To demonstrate the contribution of the attention mechanism, we conducted an ablation study. Table 2 presents the comparative results for the Stacked-LSTM model with and without attention.

The ablation study confirms the critical role of the attention mechanism in enhancing the model performances. Specifically, accuracy increased from 0.9758 to 0.9912, while specificity, precision, F1 Score and AUC saw notable improvements. These results underline the attention mechanism's capability to efficiently focus on critical regions, enhancing the model's precision and reducing false positives, making the model more robust and effective for clinical applications.

Figs. 12 and 13 further illustrate this performance difference using confusion matrices. The Stacked-LSTM model without attention (Fig. 12) classified 4000 true negatives and 4067 true positives but misclassified 50 false positives and 150 false negatives. These errors indicate that while the model captures temporal dependencies well, it still lacks precise focus on the most relevant features.

In contrast, the Stacked-LSTM model with attention (Fig. 13) significantly improved classification, correctly identifying 4115 uninfected and 4078 infected samples while reducing false positives to 18 and false negatives to 55. This substantial reduction in misclassifications demonstrates the attention mechanism's ability to emphasize critical regions in the input sequence, thereby improving model robustness.

### 4.1.1. Statistical study

#### Decision Curve Analysis (DCA)

A useful technique for assessing the clinical utility of machine learning models is decision curve analysis, or DCA. In accordance with the clinical context, it balances true positive and false positive outcomes by quantifying the net benefit across a range of threshold probabilities. This section evaluates all deep learning models that have been presented and used to classify malaria from blood smear images in our study. The most commonly used evaluation parameters have been examined in a way that is easy for doctors to understand. They have also been calculated and used in a practical way to interpret and evaluate the results of the model [78]. Comparing the clinical decision support potential of six models—VGG-16, VGG-19, Stacked-LSTM with Attention, Stacked-LSTM without Attention, Vision Transformer (ViT), and MobileNetV2—is the goal of the DCA-curve analysis displayed in

Fig. 14. A threshold probability range of 0.01 to 0.99 is used to analyze the net benefit. The Stacked-LSTM with Attention (Green Curve) exhibits robustness and high clinical utility, maintaining outstanding performance at low, medium, and high thresholds while displaying the highest net benefit across all threshold probabilities. Sequential modeling and attention mechanisms enable this architecture to capture intricate spatial patterns and dependencies, making it perfect for high-stakes clinical applications where reducing false negatives is crucial. Although the VGG-19 (Orange Dashed Curve) performs consistently across thresholds and offers strong clinical support in mid-threshold scenarios, it has a slightly lower net benefit than the Stacked-LSTM with attention model. It also offers a useful trade-off between sensitivity and precision. According to standard metrics, VGG-16 (Blue Solid Curve) performs slightly better than VGG-19 (accuracy = 0.9802, AUC = 0.9765). Despite its high accuracy, its DCA curve indicates a somewhat lower net benefit, indicating that its usefulness in clinical decision-making is more threshold-sensitive. Although it performs well, a Stacked-LSTM without Attention (Red Dashed Curve) is not as good as its attention-enhanced counterpart. His DCA curve illustrates its limitations in cases that are difficult to categorize by displaying diminishing benefits at higher thresholds. With an AUC of 0.9503, the ViT model (Purple Dashed-Dotted Curve) exhibits a moderate net benefit across thresholds. It achieves good results in early thresholds (sensitive detection), but its benefit rapidly declines at thresholds above 0.6, suggesting sensitivity but reduced resilience, likely as a result of the small dataset size. Lastly, the lowest net benefit is shown by MobileNetV2 (Brown Dotted Curve), which is clearly above the 0.5 threshold. Its DCA curve indicates a higher false positive impact, despite having a respectable accuracy of 0.9303 and an F1 score of 0.9315. The models above the “Treat all” and “Treat none” reference lines have positive clinical utility, according to the clinical decision impact. The most promising option for incorporation into automated malaria diagnostic pipelines and the most suitable for critical applications, such as early diagnosis in endemic areas, is the Stacked-LSTM with attention model, which has been shown to outperform other models. ViT and MobileNetV2 should be used with caution due to their instability at mid-to-high thresholds, whereas VGG-based models continue to be reliable.
<figure><img src="image_18.png" /><figcaption>Fig. 14. Combined DCA curves. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>Fig. 15. Combined Precision-Recall curves.</figcaption></figure>

Precision-Recall Curve

This analysis report analyses the Precision-Recall performance of
our six deep learning models for the detection of malaria from blood
smear images. As we can see in Fig. 15, the models are compared
using Average Precision (AP) scores and their ability to maintain high
precision across all recall levels (0.0 to 1.0).

The key findings of this analysis highlight the Stacked-LSTM with
Attention model, which achieves an AP score of 0.9956 and shows that

the attention mechanism dynamically focuses on infected cell regions,
highly minimizing false negatives and making it clinically ideal for
settings that require both high sensitivity (recall) and reliability (pre-
cision), maintaining near-perfect precision even at high recall, which
makes it the best overall. On the other hand, the Stacked-LSTM model
without attention, with AP = 0.9879, shows a good compromise. How-
ever, we note that the lack of fine attention leads to minor decreases
in precision for recall values greater than 0.8. In fact, the absence
of an attention mechanism may result in a marginal decrease in the
model's ability to focus on key features, leading to a drop in preci-
sion at higher recall rates. CNN-based models, VGG-16 and VGG-19,
are robust models, slightly outperformed by LSTM-based models, but
still reliable. Paradoxically, VGG-16 outperforms VGG-19 (AP: 0.9763,
0.9528, respectively), suggesting that depth alone does not guarantee
better performance for this task. The VGG-19 model (AP = 0.9528)
shows a noticeable drop in precision at higher recall. In contrast, VGG-
16 (AP = 0.9763) demonstrates a high and stable precision throughout
most of the recall range. Clinically, the VGG-16 classifier has fewer FNs
(FN = 98) than the VGG-19 model (FN = 198), which makes it more
suitable for clinical utility. The Transformer model (AP = 0.9734) gives
good results, but is computationally heavier than the LSTMs and does
not offer any apparent advantages. It is also slightly less stable than the
VGG-16 model. The drop in precision at high recall values suggests that
more suitable pre-training or more data are needed to generalize well.
MobileNetV2 (AP = 0.9160) is considered the least performant model.
Although lightweight and suitable for embedded devices, it struggles
to maintain high precision as the recall increases. As we can see in
Fig. 15, the precision of this model collapses to 0.85 at recall = 0.6,
making it unsuitable for clinical use. We consider this model unsuitable
for high-stakes diagnostic tasks. Finally, we can affirm that the stacked-
LSTM with attention mechanism emerges as the most reliable model
for malaria detection tasks, combining high precision (AP > 0.99) and
clinical interpretability. The significant performance gap between the
top and bottom models (8% difference in AP) highlights the importance
of model selection for this medical application. CNNs and ViT are viable
alternatives, but require careful tuning to match their performance.

Statistical Comparison of Models based on McNemar's test

The Table 3 presents pairwise comparisons between our deep learn-
ing models (VGG-16, VGG-19, Stacked-LSTM with and without atten-
tion mechanism, ViT, and MobileNetV2) trained to classify malaria
from blood smear images. The evaluation primarily focuses on false
negatives (FN)—the most critical error type in clinical diagnostics—as
they represent missed infections. The metrics derived from McNemar's
test, odds ratios (OR), and 95% Confidence Interval (CI) are ap-
plied to confusion matrices and are intended to assess whether one
model significantly outperforms another in reducing FN cases. These
statistical tests are complementary. In fact, McNemar's test answers the
question: Is there a statistically significant difference?. However,
the odds ratio and confidence interval answer the question: What is the
magnitude and reliability of the difference? Reporting all three (p-
value, OR, and CI) gives a complete picture, i.e., significance, direction,
and magnitude of the model comparison. The columns Modèle 1 and
Modèle 2 represent the two models being compared. A p-value column
shows the result of McNemar's test. It evaluates whether there is a
significant difference in classification errors (specifically discordant
pairs) between the two models; if the p-value is <0.05, that indicates
a statistically significant difference. The Odds Ratio OR (FN2/FN1)
column compares the FNs of Model 2 to Model 1. If OR <1, Model 2 has
fewer FNs (better), but if OR >1, Model 2 has more FNs (worse). The IC
95% column demonstrates the 95% Confidence Interval of the odds
ratio. If the interval does not include 1, the difference is statistically
significant. Finally, the FN Reduction column indicates the percent
reduction in FN when using Model 2 instead of Model 1. If we obtain
a positive value, that implies FN reduction (improvement); in contrast,
if this value is negative, it suggests an increase in FN (deterioration).
<table><caption>**Table 3**
Summary of McNemar's test comparing pairs of models.</caption><thead><tr><th>Model 1</th><th>Model 2</th><th>p-value</th><th>OR (FN2/FN1)</th><th>IC 95%</th><th>FN reduction</th></tr></thead><tbody><tr><td>VGG-19</td><td>VGG-16</td><td>0.000000</td><td>0.50</td><td>[0.38, 0.68]</td><td>49.6%</td></tr><tr><td>MobileNetV2</td><td>VGG-16</td><td>0.000017</td><td>0.31</td><td>[0.23, 0.40]</td><td>69.3%</td></tr><tr><td>ViT</td><td>VGG-16</td><td>0.000000</td><td>0.22</td><td>[0.17, 0.29]</td><td>77.8%</td></tr><tr><td>Stacked-LSTM without Attention</td><td>VGG-16</td><td>0.000000</td><td>0.44</td><td>[0.33, 0.59]</td><td>55.6%</td></tr><tr><td>MobileNetV2</td><td>VGG-19</td><td>0.000006</td><td>0.61</td><td>[0.49, 0.76]</td><td>39.0%</td></tr><tr><td>ViT</td><td>VGG-19</td><td>0.000000</td><td>0.44</td><td>[0.36, 0.54]</td><td>56.0%</td></tr><tr><td>Stacked-LSTM without Attention</td><td>VGG-19</td><td>0.000000</td><td>0.88</td><td>[0.70, 1.11]</td><td>11.9%</td></tr><tr><td>VGG-16</td><td>Stacked-LSTM with Attention</td><td>0.000000</td><td>0.84</td><td>[0.59, 1.19]</td><td>16.4%</td></tr><tr><td>VGG-19</td><td>Stacked-LSTM with Attention</td><td>0.000000</td><td>0.42</td><td>[0.31, 0.58]</td><td>57.9%</td></tr><tr><td>MobileNetV2</td><td>Stacked-LSTM with Attention</td><td>0.000258</td><td>0.26</td><td>[0.19, 0.34]</td><td>74.3%</td></tr><tr><td>ViT</td><td>Stacked-LSTM with Attention</td><td>0.000553</td><td>0.19</td><td>[0.14, 0.25]</td><td>81.5%</td></tr><tr><td>Stacked-LSTM without Attention</td><td>Stacked-LSTM with Attention</td><td>0.000000</td><td>0.37</td><td>[0.27, 0.50]</td><td>62.9%</td></tr></tbody></table>

The results reveal significant differences in false negative (FN) rates, with critical implications for malaria diagnosis. The key findings of this analysis demonstrate the superiority of Stacked-LSTM with Attention model reducing false negatives (FN) by 57.9% compared to VGG-19 (OR = 0.42, 95% CI[0.31-0.58]), by 16.4% compared to VGG-16 (OR = 0.84), by 81.5% compared to ViT (OR = 0.19), and by 74.3% compared to MobileNetV2 (OR = 0.26). To highlight the impact of attention mechanisms, we have compared the Stacked-LSTM with attention with its version without attention. This comparison has shown an important FN reduction = 62.9% and an OR = 0.37.

At this stage, we can confirm the exceptional performance of a Stacked-LSTM with attention, especially as all comparisons show an OR < 1 and a P-value near 0, confirming its statistical superiority. From a clinical point of view, our stacked-LSTM with attention model presents significantly fewer cases of missed malaria, which is essential to prevent serious complications.

The CNN model comparison shows that the VGG-16 is notably better than VGG-19 and reduces FN by 49.6% (OR = 0.50, 95%, CI[0.38-0.68]). The VGG-16 and VGG-19 reduce FN by 77.8% (OR = 0.22) and 56% (OR = 0.44) in comparison with ViT, implying that these CNN models are clinically more efficient and confident.

These statistics consider MobileNetV2 the worst model because it increases the FN cases between 39% and more than 74% compared to other models.

## 4.2. Comparison with state-of-the-art

This study's performance results were compared with several state-of-the-art approaches for malaria detection from microscopic blood smear images, as summarized in Table 4. This comparative analysis demonstrates that the proposed Stacked-LSTM with attention mechanism achieved superior performance relative to other models evaluated on the same NIH-NLM dataset. Specifically, earlier CNN-based approaches by Rajaraman et al. [19], such as pre-trained VGG-16 and ResNet-50 architectures, achieved competitive accuracy rates of around 0.9510. Subsequent ensemble learning methods further improved this performance to an accuracy of approximately 0.9650 [56]. Customized CNN methods by Yang et al. [5] initially reached an accuracy of 0.8180, which was significantly improved by incorporating iterative global minimum screening (IGMS) techniques to 0.9346 [57], highlighting the potential of targeted feature selection methods. However, another CNN-based approach utilizing a cascading YOLO based on YOLOv2 by Yang et al. [58] showed a relatively lower accuracy of 0.7922, demonstrating challenges in single-pass detection models for small parasite detection.

Hybrid approaches that combine segmentation and classification tasks, such as Mask R-CNN variants (PlasmodiumVF-Net and RBCNet), also demonstrated promising results. Kassim et al. [6] achieved an accuracy of 0.90 with PlasmodiumVF-Net, while their RBCNet pipeline utilizing U-Net and Faster R-CNN improved accuracy to 0.9776 [60]. These results underscore the effectiveness of multi-stage approaches by explicitly isolating and analyzing regions of interest.

<table><caption>**Table 4**
Comparative performance table between our models and the fundamental models using the same dataset.</caption><thead><tr><th>Author(s)</th><th>Model(s) used</th><th>Accuracy</th></tr></thead><tbody><tr><td>Rajaraman et al. [19]</td><td>VGG-16, ResNet-50, Xception, Inception-V3, DenseNet-121, Simple CNN</td><td>0.9510</td></tr><tr><td>Rajaraman et al. [56]</td><td>Ensemble deep neural networks</td><td>0.9650</td></tr><tr><td>Yang et al. [5]</td><td>Android application and customized CNN</td><td>0.8180</td></tr><tr><td>Yang et al. [57]</td><td>Iterative Global Minimum Screening (IGMS) and Customized CNN</td><td>0.9346</td></tr><tr><td>Yang et al. [58]</td><td>Cascading YOLO based-on YOLOv2</td><td>0.7922</td></tr><tr><td>Yu et al. [79]</td><td>MalariaScreener: a smartphone-based system and customized CNN</td><td>0.9870</td></tr><tr><td>Kassim et al. [6]</td><td>PlasmodiumVF-Net Mask R-CNN and ResNet50</td><td>0.90</td></tr><tr><td>Kassim et al. [60]</td><td>RBCNet pipeline, U-Net and Faster R-CNN</td><td>0.9776</td></tr><tr><td rowspan="2">Koirala et al. [28]</td><td>YOLO-mp-3l</td><td>0.9020</td></tr><tr><td>YOLO-mp-4l</td><td>0.9632</td></tr><tr><td rowspan="5">Current study</td><td>VGG-16</td><td>0.9802</td></tr><tr><td>VGG-19</td><td>0.9601</td></tr><tr><td>ViT</td><td>0.9509</td></tr><tr><td>MobileNet-V2</td><td>0.9303</td></tr><tr><td>Stacked-LSTM with attention mechanism</td><td><strong>0.9912</strong></td></tr></tbody></table>

Embedded and mobile-device-based solutions demonstrated notable potential as well. The MalariaScreener system achieved an impressive accuracy of 0.9870 [79], validating the feasibility of deploying malaria detection systems on mobile platforms. Similarly, lightweight YOLO models by Koirala et al. [28] achieved accuracies of 0.9020 (YOLO-mp-3l) and 0.9632 (YOLO-mp-4l), illustrating the trade-offs between model complexity and performance in real-time applications.

In comparison, our proposed two-stage approach, involving initial segmentation of regions of interest (ROIs) followed by classification using a Stacked-LSTM with an attention mechanism, achieved the highest accuracy of 0.9912, surpassing the performance of previous methods evaluated on the same dataset. This superior performance is attributed to the model's capability to effectively capture and emphasize relevant spatial and contextual features within blood smear images. The attention mechanism significantly contributed by selectively highlighting critical regions, effectively reducing false positives and negatives, and thus enhancing diagnostic reliability.

Additionally, our results show considerable improvements over standard CNN architectures like VGG-16 (0.9802) and VGG-19 (0.9601), further confirming the advantages of integrating recurrent neural networks with attention mechanisms for complex visual tasks.

## 4.3. Explainability and visualization results

In this section, we evaluated the explainability of the Stacked-LSTM classifier with an attention mechanism using two methods, Grad-CAM
<figure><img src="image_20.png" /><figcaption>**Fig. 16.** Example for Grad-Cam and LIME result for infected and uninfected image. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)</figcaption></figure>

and LIME, applied to the test set. Fig. 16 below illustrates a representative example of the results obtained for the interpretability of an image of an infected and non-infected cell. LIME identified a specific region for the infected cell by highlighting a yellow small circle corresponding to the parasite. This demonstrates LIME's ability to isolate critical features influencing the model's prediction. Grad-CAM also highlighted this key region, marking it with intense red and yellow hues to signify its high importance in the model's decision. However, Grad-CAM also revealed activations in adjacent areas, which appear in blue and purple, indicating lesser relevance. Other parts of the cell, particularly on the left, were marked in red and yellow, reflecting significant activations, although less precise than those detected by LIME. For the non-infected cell, LIME primarily highlighted the cell's outline in yellow, suggesting that the model focused on the edges to make its decision. On the other hand, Grad-CAM displayed a broader distribution of activations: the areas at the top and bottom of the cell were marked in red and yellow, while the central regions, on the left and right, appeared in blue and purple. This broader activation pattern indicates that Grad-CAM captures more general areas of interest, while LIME provides a more targeted and specific interpretation. These results highlight the similarities and differences between the two explainability methods. Both techniques identify influential regions for predictions, but their approaches differ: LIME provides a localized and precise interpretation, making it well-suited for analyzing specific features, while Grad-CAM offers a global perspective by visualizing activations across the entire image. Both methods converge on the parasitic region for the infected cell, although Grad-CAM also highlights additional activations in the surrounding areas. For the non-infected cell, Grad-CAM reveals more diffuse activations, while LIME focuses explicitly on the contours of the cell. In conclusion, the combined use of Grad-CAM and LIME provides a complementary interpretation of the decisions made by the Stacked-LSTM with attention mechanism model. Grad-CAM provides an overview by visualizing the activations across the image, while LIME adds local granularity by identifying the most influential features. This complementarity enhances our understanding of the model's decision-making mechanisms and validates its robustness and reliability in the context of malaria detection.

## 5. Conclusion, limitations and perspectives

In this study, we evaluated standard CNN architectures, achieving notable accuracy with VGG-16 (0.9802) and VGG-19 (0.9601) for malaria detection from microscopic blood smear images. More significantly, we introduced a novel approach using a Stacked-LSTM model

enhanced with an attention mechanism, which outperformed traditional CNNs, reaching an accuracy of 0.9912. The attention mechanism effectively increased performance by enabling the model to prioritize critical spatial regions within the image sequences.

To enhance the transparency of our proposed model and facilitate its clinical acceptance, we employed Explainable AI methods, particularly Grad-CAM and LIME, to visualize and interpret model decisions. Grad-CAM provided global visualizations of regions influencing model predictions, while LIME generated detailed and localized pixel-level explanations. This complementary use of XAI techniques significantly enhanced the interpretability of our model, allowing healthcare professionals to trust and validate AI-generated diagnoses with greater confidence.

While our model has demonstrated excellent performance on the benchmark dataset, there are several limitations to consider. First, the dataset is not from a multi-center clinical environment, which limits generalizability. Second, although attention mechanisms improve model interpretability, their integration into real-time clinical workflows may require lightweight alternatives and validating their robustness on diverse clinical datasets, and considering real-time deployment scenarios, particularly on mobile or edge devices. Future work will include validation across diverse clinical settings and the deployment of a mobile-compatible inference engine. Additionally, recent advances in ViT and LLM-based models represent promising directions for further improving performance and interpretability in medical image analysis tasks. Despite these limitations, the model presents a promising tool for early and interpretable malaria screening from blood smears.

## CRediT authorship contribution statement

**Adil Gaouar:** Writing – original draft, Software, Methodology, Investigation, Formal analysis, Data curation. **Souaad Hamza Cherif:** Writing – review & editing, Software, Methodology, Investigation, Formal analysis, Conceptualization. **Abdellatif Rahmoun:** Writing – review & editing, Validation, Supervision, Resources, Project administration. **Mostafa El Habib Daho:** Writing – review & editing, Validation, Supervision, Project administration, Conceptualization.

## Ethical statement

This study utilizes publicly available data from the NIH-NLM-Thin Blood Smears Pf dataset, which was collected following ethical guidelines. The dataset was obtained from malaria patients at Chittagong Medical College Hospital, Bangladesh, and was de-identified before public release. The Institutional Review Board (IRB) at the National Library of Medicine (NLM), National Institutes of Health (NIH), approved the study (IRB#12972). No additional ethical approval was required for our study, as no direct patient interaction or new data collection was involved.

## Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

## References

[1] Chow JCL. Quantum computing and machine learning in medical decision-making: A comprehensive review. Algorithms 2025;18:156. http://dx.doi.org/10.3390/a18030156.

[2] Pervez K, Sohail SI, Parwez F, Zia MA. Towards trustworthy AI-driven leukemia diagnosis: A hybrid hierarchical federated learning and explainable AI framework. Inform Med Unlocked 2025;2025:101618. http://dx.doi.org/10.1016/j.imu.2025.101618.

[3] Ortigossa ES, Gonçalves T, Nonato LG. Explainable artificial intelligence (XAI)—From theory to methods and applications. IEEE Access 2024;12:80799–846. http://dx.doi.org/10.1109/ACCESS.2024.3409843.
[4] Kong A, Wilson SA, Yong AH, Nace D, Rogier E, Aidoo M. HRP2 and HRP3 cross-reactivity and implications for HRP2-based RDT use in regions with Plasmodium falciparum hrp2 gene deletions. Malar J 2021;20:207. http://dx.doi.org/10.1186/s12936-021-03739-6.

[5] Yang H, Zhang Y, Zhang Y. Automated malaria detection using YOLO for P. vivax parasite identification in thin blood smear images. IEEE Access 2020;8:195104-14. http://dx.doi.org/10.1109/ACCESS.2020.3034866.

[6] Kassim YM, Palaniappan K, Yang F, Poostchi M, Palaniappan N, Maude RJ, et al. [Dataset] clustering-based dual deep learning architecture for detecting red blood cells in malaria diagnostic smears. IEEE J Biomed Infal 2021;25:1735-46. http://dx.doi.org/10.1109/JBHI.2020.3034863.

[7] Li Y, El Habib Daho M, Conze PH, Zeghlache R, Le Boité H, Tadayoni R, et al. A review of deep learning-based information fusion techniques for multimodal medical image classification. Comput Biol Med 2024;177:108635. http://dx.doi.org/10.1016/j.compbiomed.2024.108635.

[8] Eisemann N, Bunk S, Mukama T, Baltus H, Elsner SA, Gomille T, et al. Nationwide real-world implementation of AI for cancer detection in population-based mammography screening. Nat Med 2025. http://dx.doi.org/10.1038/s41591-024-03408-6.

[9] El Habib Daho M, Li Y, Zeghlache R, Le Boité H, Deman P, Borderie L, et al. Discover: 2-D multiview summarization of optical coherence tomography angiography for automatic diabetic retinopathy diagnosis. Artif Intell Med 2024;149:102803. http://dx.doi.org/10.1016/j.artmed.2024.102803.

[10] Lilda SD, Jayaparvathy R. Enhancing cardiovascular disease classification in ECG spectrograms by using multi-branch CNN. Comput Biol Med 2025;186:109737. http://dx.doi.org/10.1016/j.compbiomed.2025.109737.

[11] Amin J, Anjum MA, Ahmad A, Sharif MI, Kadry S, Kim J. Microscopic parasite malaria classification using best feature selection based on generalized normal distribution optimization. PeerJ Comput Sci 2024;10:e1744. http://dx.doi.org/10.7717/peerj-cs.1744.

[12] Islam MR, Nahiduzzaman M, Goni MOF, Sayeed A, Anower MS, Ahsan M, et al. Explainable transformer-based deep learning model for the detection of malaria parasites from blood cell images. Sens 2022;22:4358. http://dx.doi.org/10.3390/s22124358.

[13] Khan A, Gupta KD, Venugopal D, Kumar N. Cidmp: Completely interpretable detection of malaria parasite in red blood cells using lower-dimensional feature space. In: Int jt conf neural netw. IJCNN, Glasgow, UK; 2020, p. 1-8. http://dx.doi.org/10.1109/IJCNN48605.2020.9284834.

[14] Alanazi AF, Alaeerjan MA. Bi-LSTM network for classification of medical images: Application in malaria diagnosis. Comput Mater Contin 2023;73:1019-35. http://dx.doi.org/10.32604/cmc.2023.022462.

[15] Qadri AM, Raza A, Eid F, Abualigah L. A novel transfer learning-based model for diagnosing malaria from parasitized and uninfected red blood cell images. Decis Anal J 2023;9:100352. http://dx.doi.org/10.1016/j.dajour.2023.100352.

[16] Kim D, Lee Y, Chin K, Mago PJ, Cho H, Zhang J. Implementation of a long short-term memory transfer learning (LSTM-TL)-based data-driven model for building energy demand forecasting. Sustain 2023;15:2340. http://dx.doi.org/10.3390/su15032340.

[17] Chow JCL. Nanomaterial-based molecular imaging in cancer: Advances in simulation and AI integration. Biomol 2025;15:444. http://dx.doi.org/10.3390/biom15030444.

[18] Minarno AE, Izzah TN, Munarko Y, Basuki S. Classification of malaria using convolutional neural network method on microscopic image of blood smear. JOIV Int J Inf Vis 2024;8:1469. http://dx.doi.org/10.6252/joiv.8.3.2154.

[19] Rajaraman S, Antani SK, Poostchi M, Silamut K, Hossain MA, Maude RJ. Pre-trained convolutional neural networks as feature extractors toward improved malaria parasite detection in thin blood smear images. PeerJ 2018;6:e4568. http://dx.doi.org/10.7717/peerj.4568.

[20] Shang W, Sohn K, Almeida D, Lee H. Understanding and improving convolutional neural networks via concatenated rectified linear units. In: Proc 33rd int conf mach learn. ICML 2016, vol. 48, Int Soc Mach Learn (ISML); 2016, p. 2217-25. http://dx.doi.org/10.48550/arXiv.1603.05201.

[21] Srivastava N, Hinton G, Krizhevsky A, Sutskever I, Salakhutdinov R. Dropout: A simple way to prevent neural networks from overfitting. J Mach Learn Res 2014;15:1929-58. http://dx.doi.org/10.5555/2627435.2670313.

[22] LeCun Y, Bengio Y, Hinton G. Deep learning. Nat 2015;521:436-44. http://dx.doi.org/10.1038/nature14539.

[23] Botev A, Lever G, Barber D. Nesterov's accelerated gradient and momentum as approximations to regularised update descent. In: Proc int jt conf neural netw. IJCNN 2017, 2017, p. 189-903. http://dx.doi.org/10.1109/IJCNN.2017.7966082.

[24] Bergstra J, Bengio Y. Random search for hyper-parameter optimization. J Mach Learn Res 2012;13:281-305. http://dx.doi.org/10.5555/2188385.2188395.

[25] Grignaffini F, Simeoni P, Alisi A, Frezza F. Computer-aided diagnosis systems for automatic malaria parasite detection and classification: A systematic review. Electron 2024;13(16):3174. http://dx.doi.org/10.3390/electronics13163174.

[26] Wisit L, Sako LU. Image classification of malaria using hybrid algorithms: convolutional neural network and method to find appropriate K for K-nearest neighbor. Indones J Electr Eng Comput Sci 2019;16:382-8. http://dx.doi.org/10.11591/ijeecs.v16.i1pp382-388.

[27] Zamil YK, Ali SA, Naser MA. Spam image email filtering using K-NN and SVM. Int J Electr Comput Eng 2019;9:245-54. http://dx.doi.org/10.11591/ijeec.v9i1.pp245-254.

[28] Koirala A, Jha M, Bodapati S, Mishra A, Chetty G, Sahu PK. Deep learning for real-time malaria parasite detection and counting using YOLO-mp. IEEE Access 2022;1. http://dx.doi.org/10.1109/ACCESS.2022.3208270.

[29] Pereira-Ferrero VH, Valem LP, Pedronette DCG. Feature augmentation based on manifold ranking and LSTM for image classification. Expert Syst Appl 2023;213:11895. http://dx.doi.org/10.1016/j.eswa.2022.118995.

[30] Ramachandran P, Parmar N, Vaswani A, Bello I, Levskaya A, Shlens J. Stand-alone self-attention in vision models. Adv Neural Inf Process Syst 2019;32. http://dx.doi.org/10.48550/arXiv.1906.05090.

[31] Bello I, Zoph B, Vaswani A, Shlens J, Le QV. Attention augmented convolutional networks. In: Proc IEEE/CVF int conf comput vis. 2019, p. 3286-95. http://dx.doi.org/10.48550/arXiv.1904.09925.

[32] Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, et al. Attention is all you need. Adv Neural Inf Process Syst 2017;30. http://dx.doi.org/10.48550/arXiv.1706.03762.

[33] Al-Shabi M, Shak K, Tan M. Procan: Progressive growing channel attentive non-local network for lung nodule classification. Pattern Recognit 2022;122:108309. http://dx.doi.org/10.1016/j.patcog.2021.108309.

[34] Sang DV, Chung TQ, Lan PN, Hang DV, Long D, Thuy NT. Ag-curesnest: A novel method for colon polyp segmentation. 2021, http://dx.doi.org/10.48550/arXiv.2105.00402, arXiv preprint arXiv:2105.00402.

[35] Yao C, Tang J, Hu M, Wu Y, Guo W, Li Q, et al. Claw u-net: A unet variant network with deep feature concatenation for scleral blood vessel segmentation. In: CAAI int conf artif intell. 2021, p. 67-78. http://dx.doi.org/10.1007/978-3-030-93049-3-6.

[36] Azad R, Asadi-Aghbolaghi M, Fathy M, Escalera S. Attention deelabv3+: Multi-level context attention mechanism for skin lesion segmentation. In: Eur conf comput vis. 2020, p. 251-66. http://dx.doi.org/10.1007/978-3-030-66415-2-16.

[37] Bozorgpour A, Azad R, Showkatian E, Sulaiman A. Multi-scale regional attention deelab3+: Multiple myeloma plasma cells segmentation in microscopic images. In: MICCAI workshop comput pathol. 2021, p. 47-56. http://dx.doi.org/10.48550/arXiv.2105.06238.

[38] Gonçalves T, Rio-Torto I, Teixeira LF, Cardoso JS. A survey on attention mechanisms for medical applications: are we moving towards better algorithms? IEEE Access 2022. http://dx.doi.org/10.1109/ACCESS.2022.3206449.

[39] Dosovitskiy A, Beyer L, Kolesnikov A, Weissenborn D, Zhai X, Unterthiner T, et al. An image is worth 16x16 words: Transformers for image recognition at scale. 2020, http://dx.doi.org/10.48550/arXiv.2010.11929, arXiv preprint arXiv: 2010.11929.

[40] Zhu X, Su W, Lu L, Li B, Wang X, Dai J. Deformable detr: Deformable transformers for end-to-end object detection. 2020, http://dx.doi.org/10.48550/arXiv.2010.04159, arXiv preprint arXiv:2010.04159.

[41] Chen J, Lu Y, Yu Q, Luo X, Adeli E, Wang Y, et al. Transunet: Transformers make strong encoders for medical image segmentation. 2021, http://dx.doi.org/10.48550/arXiv.2102.04306, arXiv preprint arXiv:2102.04306.

[42] Arnab A, Dehghani M, Heigold G, Sun C, Lučić M, Schmid C. Vivit: A video vision transformer. In: Proc IEEE/CVF int conf comput vis. 2021, p. 6836-46. http://dx.doi.org/10.1109/ICCV48922.2021.00676.

[43] Chen X, Wang X, Zhou J, Qiao Y, Dong C. Activating more pixels in image super-resolution transformer. In: 2023 IEEE/CVF conf comput vis pattern recognit. CVPR, IEEE; 2023, p. 22367-77. http://dx.doi.org/10.1109/cvpr52729.2023.02142.

[44] Qian S, Zhu Y, Li W, Li M, Jia J. What makes for good tokenizers in vision transformer? IEEE Trans Pattern Anal Mach Intell 2022;1-13. http://dx.doi.org/10.1109/TPAMI.2022.3231442.

[45] Ma J, Bai Y, Zhong B, Zhang W, Yao T, Mei T. Visualizing and understanding patch interactions in vision transformer. IEEE Trans Neural Netw Learn Syst 2023;1-10. http://dx.doi.org/10.1109/TNNLS.2023.3270479.

[46] Han K, Wang Y, Chen H, Chen X, Guo J, Liu Z. A survey on vision transformer. IEEE Trans Pattern Anal Mach Intell 2023;45:87-110. http://dx.doi.org/10.1109/TPAMI.2022.3152247.

[47] Al-Hammuri K, Gebali F, Kanan A, Chelvan IT. Vision transformer architecture and applications in digital health: a tutorial and survey. Vis Comput Ind Biomed Art 2023;6:14. http://dx.doi.org/10.1186/s42492-023-00140-9.

[48] Aladhadh S, Alsanea M, Aloraini M, Khan T, Habib S, Islam M. An effective skin cancer classification mechanism via medical vision transformer. Sens 2022;22:4008. http://dx.doi.org/10.3390/s22114008.

[49] Yang G, Luo S, Greer P. A novel vision transformer model for skin cancer classification. Neural Process Lett 2023. http://dx.doi.org/10.1007/s11063-023-11204-5.

[50] Xin C, Liu Z, Zhao K, Miao L, Ma Y, Zhu X. An improved transformer network for skin cancer classification. Comput Biol Med 2022;149:105939. http://dx.doi.org/10.1016/j.compbiomed.2022.105939.

[51] Rajab S, Nakatumba-Nabende J, Ggaliwango M. Interpretable machine learning models for predicting malaria. In: Proc ICSTSN. 2023, p. 1-6. http://dx.doi.org/10.1109/ICSTSN57873.2023.10151538.
[52] Goni MOF, Mondal MNI, Islam SR, Nahiduzzaman M, Islam MR, Anower MS. Diagnosis of malaria using double hidden layer extreme learning machine algorithm with CNN feature extraction and parasite inflator. IEEE Access 2023;11:4117–30. http://dx.doi.org/10.1109/ACCESS.2023.3234279.

[53] Attai K, Ekpenyong M, Amannah C, Asuquo D, Ajuga P, Obot O. Enhancing the interpretability of malaria and typhoid diagnosis with explainable AI and large language models. Trop Med Infect Dis 2024;9:216. http://dx.doi.org/10.3390/tropicalmed9090216.

[54] Chow JCL, Li K. Ethical considerations in human-centered AI: Advancing oncology chatbots through large language models. JMIR Bioinform Biotechnol 2024;5:e64406. http://dx.doi.org/10.2196/64406.

[55] Chow JCL, Wong V, Li K. Generative pre-trained transformer-empowered healthcare conversations: Current trends, challenges, and future directions in large language model-enabled medical chatbots. BioMedInformatics 2024;4:837–52. http://dx.doi.org/10.3390/biomedinformatics4010047.

[56] Rajaraman S, Jaeger S, Antani SK. Performance evaluation of deep neural ensembles toward malaria parasite detection in thin-blood smear images. PeerJ 2019;7:e6977. http://dx.doi.org/10.7717/peerj.6977.

[57] Yang F, Poostchi M, Yu H, Zhou Z, Silamut K, Yu J. Deep learning for smartphone-based malaria parasite detection in thick blood smears. IEEE J Biomed Heal Inf 2020. http://dx.doi.org/10.1109/JBHI.2019.2939121.

[58] Yang F, Quizon N, Yu H, Silamut K, Maude RJ, Jaeger S. Cascading YOLO: Automated malaria parasite detection for plasmodium vivax in thin blood smears. In: Proc SPIE 11314, med imaging 2020: Comput-aided diagn. vol. 11314, 2020, 113141Q. http://dx.doi.org/10.1117/12.2550143.

[59] Yu Y, Si X, Hu C, Zhang J. A review of recurrent neural networks: LSTM cells and network architectures. Neural Comput 2019;31:1235–70. http://dx.doi.org/10.1162/neco_a_01199.

[60] Kassim YM, Yang F, Yu H. Diagnosing malaria patients with plasmodium falciparum and vivax using deep learning for thick smear images. Diagn 2021;11:1994. http://dx.doi.org/10.3390/diagnostics1111994.

[61] Garrido-Cardenas JA, González-Cerón L, Manzano-Agugliaro F, Mesa-Valle C. Plasmodium genomics: an approach for learning about and ending human malaria. Parasitol Res 2019;118:535–48. http://dx.doi.org/10.1007/s00436-018-6127-9.

[62] Baer K, Klotz C, Kappe SHI, Schnieder T, Frevert U. Release of hepatic plasmodium yoelii merozoites into the pulmonary microvasculature. PLoS Pathog 2007;3:e171. http://dx.doi.org/10.1371/journal.ppat.0030171.

[63] Arrieta AB, Díaz-Rodríguez N, Del Ser J, Bennetot A, Tabik S, Barbado A. Explainable artificial intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI. Inf Fusion 2020;58:82–115. http://dx.doi.org/10.1016/j.inffus.2019.12.012.

[64] Doshi-Velez F, Kim B. Towards a rigorous science of interpretable machine learning. 2017, http://dx.doi.org/10.48550/arXiv.1702.08608, arXiv preprint arXiv:1702.08608.

[65] Selvaraju RR, Cogswell M, Das A, Vedantam R, Parikh D, Batra D. Grad-CAM: Visual explanations from deep networks via gradient-based localization. In: Proc IEEE int conf comput vis. 2017, p. 618–26. http://dx.doi.org/10.1109/ICCV.2017.74.

[66] Ribeiro MT, Singh S, Guestrin C. Why should I trust you? Explaining the predictions of any classifier. In: Proc 22nd ACM SIGKDD int conf knowl discovery data mining. 2016, p. 1135–44. http://dx.doi.org/10.1145/2939672.2939778.

[67] Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition. 2014, http://dx.doi.org/10.48550/arXiv.1409.1556, arXiv preprint arXiv:1409.1556.

[68] Zou Y, Wu L, Zuo C, Chen L, Zhou B, Zhang H. White blood cell classification network using MobileNetv2 with multiscale feature extraction module and attention mechanism. Biomed Signal Process Control 2025;99:106820. http://dx.doi.org/10.1016/j.bspc.2024.106820.

[69] Iscen A, Avrithis Y, Tolias G, Furon T, Chum O. Fast spectral ranking for similarity search. In: Proc IEEE comput soc conf comput vis. 2018, p. 7632–41. http://dx.doi.org/10.1109/CVPR.2018.00796.

[70] Hochreiter S, Schmidhuber J. Long short-term memory. Neural Comput 1997;9:1735–80. http://dx.doi.org/10.1162/neco.1997.9.8.1735.

[71] Lalapura VS, Amudha J, Satheesh HS. Recurrent neural networks for edge intelligence: A survey. ACM Comput Surv 2021;54:1–38. http://dx.doi.org/10.1145/3448974.

[72] Mienye ID, Sun Y. A deep learning ensemble with data resampling for credit card fraud detection. IEEE Access 2023;11:30628–38. http://dx.doi.org/10.1109/ACCESS.2023.3262020.

[73] Mienye ID, Sun Y. A machine learning method with hybrid feature selection for improved credit card fraud detection. Appl Sci 2023;13:7254. http://dx.doi.org/10.3390/app13127254.

[74] Kiperwasser E, Goldberg Y. Simple and accurate dependency parsing using bidirectional LSTM feature representations. Trans Assoc Comput Linguist 2016;4:313–27. http://dx.doi.org/10.1162/tacl_a_00101.

[75] Long F, Zhou K, Ou W. Sentiment analysis of text based on bidirectional LSTM with multi-head attention. IEEE Access 2019;7:141960–9. http://dx.doi.org/10.1109/ACCESS.2019.2942614.

[76] Lanjewar MG, Panchbhai KG, Patle LB. Fusion of transfer learning models with LSTM for detection of breast cancer using ultrasound images. Comput Biol Med 2024;169:107914. http://dx.doi.org/10.1016/j.compbiomed.2023.107914.

[77] Bahdanau D, Cho K, Bengio Y. Neural machine translation by jointly learning to align and translate. 2014, http://dx.doi.org/10.48550/arXiv.1409.0473, ArXiv preprint.

[78] Abbasian Ardakani A, Airom O, Khorshidi H, Bureau NJ, Salvi M, Molinari F. Interpretation of artificial intelligence models in healthcare: A pictorial guide for clinicians. J Ultrasound Med 2024;43:1789–818. http://dx.doi.org/10.1002/jum.16524.

[79] Yu H, Yang F, Rajaraman S, Ersoy I, Moallem G, Poostchi M. Malaria screener: a smartphone application for automated malaria screening. BMC Infect Dis 2020;20:825. http://dx.doi.org/10.1186/s12879-020-05453-1.