Full text
Contents lists available at ScienceDirect Computers in Biology and Medicine journal homepage: www.elsevier.com/locate/compbiomed Ensemble-based Convolutional Neural Networks for brain tumor classification in MRI: Enhancing accuracy and interpretability using explainable AI Luis Sánchez-Morenoa, A. Perez-Peñaa,b, L. Duran-Lopeza,b, Juan P. Dominguez-Moralesa,b,∗ aRobotics and Technology of Computers Lab., ETSII-EPS, Universidad de Sevilla, Av. Reina Mercedes s/n, Sevilla 41012, Spain bSCORE Lab, I3US. Universidad de Sevilla, Spain, Av. Reina Mercedes s/n, Sevilla 41012, Spain A R T I C L E I N F O Keywords: Brain tumor classification Deep learning Magnetic resonance imaging Transfer learning Computer-aided diagnosis Model interpretability Ensemble classifier A B S T R A C T Background: Accurate and efficient classification of brain tumors, including gliomas, meningiomas, and pituitary adenomas, is critical for early diagnosis and treatment planning. Magnetic resonance imaging (MRI) is a key diagnostic tool, and deep learning models have shown promise in automating tumor classification. However, challenges remain in achieving high accuracy while maintaining interpretability for clinical use. Methods: This study explores the use of transfer learning with pre-trained architectures, including VGG16, DenseNet121, and Inception-ResNet-v2, to classify brain tumors from MRI images. An ensemble-based classifier was developed using a majority voting strategy to improve robustness. To enhance clinical applicability, explainability techniques such as Grad-CAM++ and Integrated Gradients were employed, allowing visualization of model decision-making. Results: The ensemble model outperformed individual Convolutional Neural Network (CNN) architectures, achieving an accuracy of 86.17% in distinguishing gliomas, meningiomas, pituitary adenomas, and benign cases. Interpretability techniques provided heatmaps that identified key regions influencing model predictions, aligning with radiological features and enhancing trust in the results. Conclusions: The proposed ensemble-based deep learning framework improves the accuracy and interpretability of brain tumor classification from MRI images. By combining multiple CNN architectures and integrating explainability methods, this approach offers a more reliable and transparent diagnostic tool to support medical professionals in clinical decision-making. 1. Introduction Brain tumors are one of the most life-threatening health conditions worldwide, with gliomas, meningiomas, and pituitary adenomas being the most common types [1]. Early and accurate detection of these tumors is critical for effective treatment and prognosis. Magnetic resonance imaging (MRI) is one of the primary tools used in the diagnosis of brain tumors due to its ability to capture detailed images of soft tissues without exposing patients to harmful radiation. However, manual interpretation of MRI scans is time-consuming, error-prone, and requires significant expertise from radiologists [2]. This makes it challenging to ensure early diagnosis across large patient populations. Misclassification or late detection can lead to delayed or inappropriate treatments, affecting prognosis and survival rates. To address this, computer-aided diagnostic (CAD) systems have gained prominence in recent years, with Deep Learning (DL) techniques leading to significant breakthroughs in medical image analysis [3]. ∗Correspondence to: Escuela Técnica Superior de Ingeniería Informática, Av. Reina Mercedes s/n, Sevilla 41012, Spain. E-mail addresses: [email protected] (A. Perez-Peña), [email protected] (L. Duran-Lopez), [email protected] (J.P. Dominguez-Morales). The advent of DL has transformed multiple fields, including medical imaging, due to its ability to automatically extract meaningful features from complex data. Convolutional Neural Networks (CNNs) have become the standard approach for image classification tasks, showing outstanding performance in diagnosing and categorizing medical conditions from images, such as lung cancer, diabetic retinopathy, and brain tumors [4]. Convolutional Neural Networks (CNNs) have demonstrated notable efficacy in the classification of brain tumors. They achieve this by discerning complex patterns in MRI images, thus providing greater accuracy compared to conventional machine learning methods that depend significantly on manual feature extraction. However, training deep learning models typically requires large amounts of labeled data, which are not always available in medical contexts. In such cases, transfer learning has been widely adopted, where pre-trained networks https://doi.org/10.1016/j.compbiomed.2025.110555 Received 23 November 2024; Received in revised form 17 April 2025; Accepted 5 June 2025 Computers in Biology and Medicine 195 (2025) 110555 Available online 23 June 2025 0010-4825/© 2025 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC license ( http://creativecommons.org/licenses/bync/4.0/ ).
L. Sánchez-Moreno et al. such as VGG, ResNet, or DenseNet are fine-tuned on medical datasets to enhance model performance [5]. Despite the high accuracy achieved by CNN-based models, understanding the process through which these models make decisions remains a notable challenge. Medical professionals require not only accurate predictions, but also explanations for those predictions to trust the automated system. Explainable Artificial Intelligence (XAI) [6] has emerged as a response to this issue, aiming to provide insights into DL models by highlighting the features that most influenced the decisionmaking process. Techniques such as Gradient-weighted Class Activation Mapping (Grad-CAM) [7] and its variants allow visual interpretation of model predictions, making it easier for medical professionals to validate the results and increase their confidence in the diagnosis [8]. In brain tumor classification, these methods are extremely valuable in assisting clinicians by identifying the essential regions of the MRI scans responsible for the classification, thus bridging the gap between AI and clinical decision making [9]. This study is driven by the need for a robust and explainable system capable of classifying multiple types of brain tumors from MRI images with high accuracy. Existing approaches often focus on individual tumor types or lack sufficient explainability, limiting their clinical utility. To address these limitations, we propose an ensemble-based classifier that combines well-established CNN architectures VGG16 [10], DenseNet121 [11], and Inception-ResNet-v2 [12] and integrates explainable AI techniques, such as Grad-CAM++ [13], to provide a comprehensive and interpretable solution. By leveraging the strengths of these networks and offering visual explanations for the model’s decisions, we aim to enhance both the performance and reliability of automated brain tumor diagnosis. The remainder of this paper is organized as follows: Section 2 reviews the related work in brain tumor classification and XAI. Section 3 describes the methodology, including the dataset 3.1 and the Deep Learning framework 3.2. Section 4 presents the methods used in this work, including the CNN models used 4.1, the way transfer learning is applied 4.2, the ensemble of CNN models developed 4.3, the metrics used to evaluate the trained models 4.4, and XAI 4.5. Then, in Section 5, the experimental results are presented. Finally, Sections 6and 7 offer conclusions and directions for future work, together with the main conclusions and contributions of this paper. 2. Related work Deep learning, particularly CNNs, has significantly impacted medical image analysis. In brain tumor classification, CNNs have shown exceptional ability to extract relevant features from MRI scans, outperforming traditional machine learning methods [3,14]. Several studies have focused on the application of CNNs in this domain [15–18]. Sajjad et al. [15] proposed a transfer learning approach for multigrade brain tumor classification using VGG16. Their work demonstrated how transfer learning with pre-trained models significantly boosts performance, together with an extensive data augmentation when training data is limited, achieving 94.58% accuracy on glioma detection. Pereira et al. [16] introduced a deep CNN model for the automatic segmentation and classification of brain tumors in MRI images. They trained the CNN on patches rather than on whole images, which is a very common approach for dealing with super-resolution images such as cancer detection in histopathological images [19,20]. The authors were ranked first in the BRATS 2013 database. However, their model focused only on gliomas, limiting its generalization to other tumor types such as pituitary and meningioma. Deepak & Ameer [17] used GoogleNet pre-trained on ImageNet to classify MRI images into tumor types (glioma, meningioma, and pituitary). Their transfer learning approach achieved an accuracy of 98%, but did not consider normal or benign cases and did not explore the interpretability of the model. In their study, Jia and Chen [18] propose a deep learningbased approach for identifying and classifying brain tumors in MRI images. They enhance MRI quality by adjusting contrast to improve the signal-to-noise ratio and apply skull stripping to remove non-brain tissue. Morphological operations, including image binarization and erosion, isolate malignant tissue for more accurate segmentation. The classification is performed using an Extreme Learning Machine (ELM) with a Support Vector Machine (SVM), distinguishing only between benign and malignant tissues. Their method achieved an accuracy of 98.51%, showing promise for accurate brain tumor identification. In recent years, ensemble methods have gained attention for improving the robustness and accuracy of medical image classifiers by combining multiple CNN models. In particular, El Hamdaoui et al. [21] presented a high-precision brain tumor classification model using deep transfer learning and ensemble stacking to distinguish between highgrade glioma (HGG) and low-grade glioma (LGG) in MRI images. Seven CNN architectures were employed, and an ensemble approach was used, where the final classification was based on the CNN that achieved the highest prediction. The model achieved an accuracy of 98.06% and an F1 score of 98.62%. The authors in [22] present a robust ensemble-based approach that combines multiple classifiers to improve the accuracy of brain tumor diagnosis in MRI images. The classifiers were only trained with tumor and no tumor cases, achieving very high performance on this binary classification task. On the other hand, [23] presents an MRI-based computer-aided tool for brain tumor grading. Five different CNN models were used in an ensemble which, based on a majority voting, reported the tumor grade. Regarding explainability and interpretability in AI, it has become a crucial aspect to consider in healthcare, where understanding the decision-making process of models can help build trust with clinicians. Various explainability techniques, such as Grad-CAM and GradCAM++, have been introduced to provide insights into CNN-based models. The authors in [24] used Grad-CAM on a binary classification task to differentiate between MRI samples with tumor and without tumor. They also implemented an ensemble model with different classifiers, which achieved higher performance. A similar approach was followed in [25], where a novel xAI approach was considered, called numGradCAM, which provides additional information in the form of numerical focus levels for each heatmap region. A recent publication by Rahman et al. [26] presented a lightweight CNN to perform the classification between LGG and HGG, together with SHapley Additive exPlanations (SHAP) and Grad-CAM++ for the interpretability of the results. Recent advances in deep learning have brought attention to hybrid architectures that combine Convolutional Neural Networks (CNNs) with Vision Transformers (ViTs), aiming to leverage both local feature extraction and global context modeling for improved performance in medical image analysis. Models such as MedViT [27] and HRSTNet [28] demonstrated the effectiveness of integrating transformerbased modules into medical imaging pipelines, showing superior results in classification and segmentation tasks across multiple datasets. More recently, D-TrAttUnet [29] proposed a dual-decoder hybrid CNNTransformer framework tailored for subtle lesion segmentation, while BRAU-Net++ [30] introduced a bi-level routing attention mechanism embedded within a U-shaped architecture to enhance spatial detail preservation in segmentation. In the classification domain, Djoumessi et al. [31] presented a hybrid CNN-Transformer model for inherently interpretable medical image classification, generating localized evidence maps that offer visual insights into the decision-making process. 2.1. Main contributions Our work stands out from the existing literature in two main areas. Although many works focus on optimizing individual CNN models, our approach leverages an ensemble of VGG16, DenseNet121, and Inception-ResNet-v2. This combination results in improved accuracy, reaching 86.17%, which surpasses the performance of individual models. In the field of brain tumor classification, few studies have explored Computers in Biology and Medicine 195 (2025) 110555 2
L. Sánchez-Moreno et al. Table 1 Number of images present in the dataset used for each of the classes considered. Class Train Validation Test Glioma 1503 644 400 Meningioma 1513 648 421 Pituitary 1599 685 374 No tumor 1393 597 510 Total 6008 2574 1705 ensemble methods to this extent. In our case, we perform a multiclass classification task between four different labels, together with implementing different xAI algorithms. Differing from earlier studies that mainly focus on enhancing classification precision, we integrate Grad-CAM++ to offer detailed visual explanations for the predictions. This addresses a significant gap in the literature, where ensemblebased classifiers are often treated as black-box models. By providing explainability alongside improved performance, our method offers a more reliable and interpretable framework for clinical use. Most of the state-of-the-art works for brain tumor classification focus on only a few specific aspects of model performance, either by considering a limited number of tumor classes, using ensemble classifiers, or applying explainability methods. Although these approaches have individually contributed to advances in diagnostic accuracy and model interpretability, they typically do not integrate all these benefits into a single framework. As a result, current methods often lack a comprehensive approach that combines multiclass classification, ensemble techniques to enhance accuracy, and explainability features to provide insights into the model’s decision-making process. By integrating multiclass ensemble-based classsifiers with different explainability methods, we offer a comprehensive approach that ensures both precision and transparency, making it a novel contribution to the field of brain tumor classification in MRI images, delivering a robust, accurate, and interpretable solution. 3. Materials 3.1. Dataset Two different datasets were used for training the neural networks. There were the ‘‘Brain Tumor MRI Dataset’’1 and the ‘‘Brain Tumor Classification (MRI)’’2 dataset, which were obtained from Kaggle and combined together in order to increase the number of samples and the heterogeneity of the dataset. These datasets comprise MRI scans of the skull, classified into four categories: glioma, meningioma, healthy (no tumor), and pituitary adenoma. These categories correspond to the distinct classes that the model aims to detect. The distribution among these classes is approximately balanced, with each class containing nearly the same number of images. Specifically, these datasets combined contain a total of 7441 images for training and 1705 images for testing. Since no validation subset was present, a 30% of the images of each class was used to validate the models. Table 1 presents the distribution of the dataset for each of the sets and labels. Fig. 1 show some of the samples that can be found in the dataset. 1https://www.kaggle.com/datasets/masoudnickparvar/brain-tumor-mridataset. Retrieved June 20, 2025. 2https://www.kaggle.com/datasets/sartajbhuvaji/brain-tumorclassification-mri. Retrieved June 20, 2025. 3.2. Deep learning framework Tensorflow [32] and Keras [33] were used to train and evaluate the different models and to perform all the experiments presented. TensorFlow is an open-source machine learning framework developed by Google. It is designed to help developers and researchers create and deploy machine learning models, particularly deep learning models. TensorFlow provides a flexible and comprehensive ecosystem of tools, libraries, and community resources that make it easier to develop AI applications. On the other hand, Keras is a high-level deep learning API that runs on top of TensorFlow and provides an user-friendly interface. It is designed to enable fast experimentation and prototyping, allowing developers to create, train and evaluate custom deep learning models with minimal code. It has been widely used for many tasks, such as image recognition, natural language processing, and time series forecasting. 4. Methods 4.1. CNN models The CNN models that were used in this work were trained in a supervised manner. These models are DenseNet121 [11], InceptionResNet-v2 [12] and VGG16 [10], which are all implemented within the Keras Applications framework.3 These models consist of a total of 7’978’856, 55’813’192 and 138’357’544 trainable parameters, respectively. The three aforementioned models were selected due to their extensive applicability in diverse tasks and their robust feature extraction capabilities, as well as to evaluate models with different orders of magnitude in terms of complexity and amount of training parameters. The models were initialized with pre-trained weights from ImageNet [34] in order to speed up the model convergence during the training. The selection and exploration of hyperparameters during the training phase were conducted by assessing the model’s convergence on the validation set. For this purpose, the hyperparameters were explored using a Grid Search algorithm, that trained the models numerous times until converging and achieving the best configuration. This algorithm was conducted over learning rates (1−2, 1−3, 1−4), batch sizes (16, 32, 64, 128), and optimizers (SGD, Adam). The final configuration (batch size = 64, learning rate = 1−3, Adam optimizer4) yielded the best balance between training stability and validation accuracy across all models. The Adam optimizer was adjusted during training using the ReduceLROnPlateau5 callback from TensorFlow to guarantee a gradual reduction whenever the validation loss stabilized, using a patience of 5 and a factor of 0.1. Since the dataset was imbalanced, the compute_class_weight function6 from the sklearn.utils module was used to calculate class weights. These weights were incorporated into the loss function to mitigate the risk of overfitting to the classes that were more frequently represented. Other methods for managing classification problems with imbalanced data are presented in [35]. A dropout of 30% was chosen, which has been proved to be important during the training process in order to reduce overfitting and make the network find different paths to converge to the expected result. Training was carried out for 15 epochs per model, using TensorFlow’s EarlyStopping7 to avoid overfitting by stopping training if validation loss did not improve over several epochs. Model weights were 3https://keras.io/api/applications/. Retrieved June 20, 2025. 4https://keras.io/api/optimizers/adam/. Retrieved June 20, 2025. 5https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ ReduceLROnPlateau. Retrieved June 20, 2025. 6https://scikit-learn.org/stable/modules/generated/sklearn.utils.class_ weight.compute_class_weight.html. Retrieved June 20, 2025. 7https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ EarlyStopping. Retrieved June 20, 2025. Computers in Biology and Medicine 195 (2025) 110555 3
L. Sánchez-Moreno et al. Fig. 1. Samples for each of the classes considered. Images were randomly selected from the training set. saved at each epoch only when there was an improvement in validation loss. The number of epochs was chosen based on the aforementioned hyperparameter exploration, which confirmed that the models were not improving after 10–12 epochs, depending on the architecture. 4.2. Transfer learning Transfer learning is a machine learning strategy in which a model originally designed for a certain task is adjusted to serve as a foundational model for another purpose. This approach is especially useful in scenarios where there is limited labeled data available for the target task, but abundant labeled data in a related domain. Using pre-trained models, often established on extensive datasets such as ImageNet [34], allows transfer learning to preserve the general features learned in the original task and apply them to the new one with minimal additional training. This approach reduces the computational resources and time needed to develop a deep learning model from the ground up and improves the performance on the target task by utilizing pre-learned significant representations [36]. In the context of deep learning, transfer learning is commonly applied in image classification, natural language processing, and other fields that involve large, complex data. For instance, CNN architectures like VGG16, ResNet, and Inception, pre-trained on massive image datasets, are often fine-tuned or adapted for medical imaging tasks like tumor classification, where the available training data is relatively small. Instead of randomly initializing the weights, the model uses the pre-trained weights, only fine-tuning the later layers specific to the new problem. This approach has been shown to improve accuracy, convergence speed, and generalization across various tasks, making transfer learning a powerful tool in modern AI applications [37,38]. As mentioned in Section 4.1, the models used (DenseNet121, Inception-ResNet-v2 and VGG16) were initialized with ImageNet Computers in Biology and Medicine 195 (2025) 110555 4
L. Sánchez-Moreno et al. Fig. 2. Block diagram of the proposed system. weights. The architectures of the models were modified, removing the last classification layers and adding a new classifier that consists only of four output neurons (which correspond to the four possible outcomes of the classification). These last layers are the ones that are trained during the training process, while the rest are kept frozen, preventing the backpropagation algorithm from modifying the original ImageNet weights with which the layers were initialized. 4.3. Ensemble-based classifier Current CNN models face several key limitations that can impact their effectiveness, particularly in complex tasks such as medical imaging. First, lack of interpretability is a significant challenge, as CNNs are often regarded as ‘‘black-box’’ models, meaning that it is difficult to understand or explain the rationale behind their predictions. Second, single CNN models are prone to overfitting, particularly when trained on limited or imbalanced datasets. Overfitting occurs when a model performs well on training data but fails to generalize to new, unseen data, thus limiting its real-world applicability. Lastly, individual CNNs may exhibit limited generalization, meaning they might perform excellently on a specific dataset or task but struggle to generalize across a broader range of data, such as different tumor types in medical imaging. An ensemble model addresses these limitations by combining multiple models, which enhances interpretability by providing a more comprehensive decision-making process, reduces the risk of overfitting by leveraging the diversity of multiple models, and improves generalization across a wider variety of data and tasks. In this work, an ensemble-based classification approach was employed to leverage the strengths of multiple deep learning models for improved prediction accuracy. The ensemble method involves combining the predictions from the three different CNN architectures mentioned in Section 4.1 and trained: VGG16, DenseNet121, and InceptionResNet-v2. Each of these models has distinct design principles and strengths, which complement each other when combined, leading to more robust and generalized predictions. To combine the predictions of these three models, a majority voting mechanism was used. In this method, each model independently predicts the class label of a given image. The final prediction of the ensemble is determined by the class label that receives the most votes among the three models. For each input, the VGG16, DenseNet121, and Inception-ResNet-v2 models provide their individual predictions. The class predicted by at least two out of the three models is selected as the final output of the ensemble. If all three models predict different classes (a rare occurrence in practice), the output of the ensemble will be taken based on the prediction performed by the model that achieved the best accuracy among the three (VGG16 in this case, as can be seen in Section 5). Fig. 2 shows a block diagram of the whole system, where each of the steps considered in the design of the ensemble-based classifier are presented. 4.4. Evaluation metrics To assess the performance of the trained models, different standard evaluation metrics were used, including the accuracy, precision, recall, and F1-score. These metrics provide a comprehensive understanding of the model’s performance in classification tasks. Accuracy (see Eq. (1)) is the most commonly used performance measure and it is the ratio of correctly predicted samples to the total number of samples. Accuracy =TP +TN TP +TN +FP +FN (1) where: TP (True Positive) is the number of correctly predicted positive observations, TN (True Negative) is the number of correctly predicted negative observations, FP (False Positive) is the number of incorrectly predicted positive observations, and FN (False Negative) is the number of incorrectly predicted negative observations. Precision is the ratio of correctly predicted positive observations to the total predicted positives (see Eq. (2)). High precision relates to a low false positive rate. Precision =TP TP +FP (2) Recall (also known as sensitivity) is the ratio of correctly predicted positive observations to all the observations in the actual class (see Eq. (3)). Recall is a good measure to determine when the costs of false negatives are high (e.g., disease screening). Recall =TP TP +FN (3) The F1-score is the weighted average of Precision and Recall (see Eq. (4)). Therefore, this score takes both false positives and false negatives into account. F1-score = 2 × Precision ×Recall Precision +Recall (4) Computers in Biology and Medicine 195 (2025) 110555 5
L. Sánchez-Moreno et al. 4.5. Explainable AI In the pursuit of transparency and interpretability in deep learning models, particularly in CNNs, it is crucial to understand and visualize the key aspects and image features that drive these models towards the obtained predictions. To this end, two popular techniques have been employed, such as Gradient-Waved Class Activation Mapping (Grad-CAM++) [13] and Integrated Gradients [39]. These methods provide insights into the decision-making process of CNN models by highlighting the input features that most strongly influence the model’s predictions. 4.5.1. Grad-CAM++ Grad-CAM++ is an algorithm that is used to generate visual explanations for the predictions made by CNNs. Grad-CAM++ computes the gradient of the score for a particular class (the class of interest) with respect to the feature maps of the last convolutional layer of the network. The reason for using the final convolutional layer is that it preserves spatial information and possesses semantically rich features that are crucial for the final prediction. The computed gradients are then globally averaged over the width and height dimensions to obtain the importance weights for each feature map channel. These are used to perform a weighted combination of the feature maps, resulting in a class-specific heatmap. This heatmap is indicative of the regions in the image that are most influential in predicting the target class, and it is then overlayed on the original image to visualize the areas that the model focused on when making its prediction. With this process, Grad-CAM provides intuitive and humanunderstandable explanations, which can be crucial for validating model decisions, especially in critical applications such as medical imaging. 4.5.2. Integrated gradients Integrated Gradients is a technique used to attribute the prediction of a model to its input features, providing a detailed explanation of the contribution of each feature to the model’s output. The method requires a baseline input that represents the absence of features. Integrated Gradients computes the gradients of the model’s output with respect to the input along a straight-line path from the baseline to the actual input. The idea is to accumulate these gradients, which reflect how much each input feature contributes to the change in the output as we move from the baseline to the input. The integrated gradient for each feature is calculated by averaging the gradients at various points along this path and multiplying by the difference between the input and the baseline. This yields a set of feature attributions that sum up the difference between the model’s output for the input and the output for the baseline. This makes it a reliable method for understanding the importance of individual features in a model’s decision. 5. Results In this section, we present the performance and interpretability results of the different models that were trained for brain tumor classification from MRI images. First, in Section 5.1, we evaluate the classifiers on the test set, reporting accuracy and other key metrics to demonstrate its effectiveness in distinguishing between glioma, meningioma, pituitary adenoma, and non-tumor cases. Following this, in Section 4.5, we analyze the model’s interpretability through explainable AI techniques, specifically Grad-CAM++ and Integrated Gradients, which provide visual and quantitative insights into the features driving the classifier’s predictions. Finally, in Section 5.2, we compare the ensemble’s performance to that of individual CNN models, highlighting how the ensemble approach exploits the strengths of each architecture to achieve superior accuracy and robustness. Table 2 Summary of the results obtained with each of the trained models for the different evaluation metrics considered. The best result for each metric is highlighted in bold. Model Accuracy Precision Recall F1-score VGG16 0.8352 0.8356 0.8285 0.8289 DenseNet121 0.8158 0.8299 0.8093 0.8093 Inception-ResNet-v2 0.8287 0.8330 0.8244 0.8232 Ensemble-based classifier 0.8617 0.8629 0.8571 0.8563 5.1. Test set evaluation After training the models presented in Section 4.1 with the dataset and approach presented in Section 3, we evaluated them on the test set. Fig. 3 presents the evolution of the training and validation accuracy and loss over the whole training process for each of the CNN models considered. Regarding the evaluation over the test set, Fig. 4 present the confusion matrices obtained for the VGG16, Inception-ResNet-v2 and DenseNet121 models, where the confidence of each of them for each of the classes can be seen. As it can be observed from the confusion matrices, the three models achieve similar results, with VGG16 obtaining slightly superior performance compared to the rest. 5.2. Ensemble-based classifier results The ensemble-based classifier, combining VGG16, DenseNet121, and Inception-ResNet-v2 through a majority voting approach, demonstrated notable improvements in classification accuracy and robustness over individual CNN models. By taking advantage of the complementary strengths of each architecture, the ensemble achieved an accuracy of 86.17%, which surpassed the performance of each standalone model. This improvement reflects the ensemble’s ability to generalize across varying tumor types, reducing errors commonly associated with individual model limitations. VGG16 contributed efficient feature extraction, DenseNet121 provided depth for capturing complex patterns, and Inception-ResNet-v2 enhanced the model’s adaptability due to its residual connections. In cases where individual models exhibited ambiguity or conflicting predictions, the majority voting approach in the ensemble effectively resolved these inconsistencies, leading to a more accurate final prediction. This result underscores the advantage of an ensemble framework in complex medical imaging tasks, offering a balanced, reliable approach for brain tumor classification. As stated in Section 4.3, when there is complete disagreement among the three models, the one with the highest accuracy is designated as the ‘‘leader’’ to resolve the discrepancy and make the final classification decision. Fig. 5 shows the confusion matrix obtained for the ensemble-based classifier. Table 2 presents the results obtained for each of the different evaluation metrics. As can be seen, the ensemble-based classifier outperforms the individual models in each of the aforementioned metrics. A series of statistical tests were applied to confirm whether the ensemble-based classifier outperforms individual models (see Table 3). This includes paired t-test [40], Friedman Test (Non-Parametric ANOVA) [41], and Cohen’s d (Effect Size) [42]. The paired t-test results indicate statistically significant differences, with very low p-values (<0.05) in all comparisons, suggesting that the ensemble achieves consistently better accuracy. To assess the magnitude of these differences, Cohen’s d was calculated, yielding very high values (above 0.8, and ranging from 6.21 to 31.70), which indicate a substantial effect size and reinforce the practical significance of the improvement. Additionally, the Friedman test was conducted to compare all models simultaneously, resulting in a statistically significant difference (p = 0.0074), confirming that at least one model performs distinctly better than the others. These results collectively support the conclusion that the ensemble-based classifier provides a superior performance compared to individual deep learning models. Computers in Biology and Medicine 195 (2025) 110555 6
L. Sánchez-Moreno et al. Fig. 3. Evolution of the training and validation accuracy (left column) and loss (right column) during the training phase of each of the models evaluated (VGG16, InceptionResNet-v2, and DenseNet121). Table 3 Summary of statistical test results comparing the ensemble-based classifier with individual models. Test VGG16 DenseNet121 Inception-ResNet-v2 Paired t-test (t, p-value) (63.39, 8.65e−06) (12.42, 0.0011) (42.16, 2.94e−05) Cohen’s d 31.70 6.21 21.08 Friedman test (𝜒2, p-value) (12.0, 0.0074) (12.0, 0.0074) (12.0, 0.0074) 5.3. Explainable AI evaluation To ensure the interpretability of the classifier, we applied GradCAM++ and Integrated Gradients to generate visual explanations for each model’s predictions. Grad-CAM++ heatmaps were overlaid on MRI scans, highlighting specific regions that the model identified as crucial for its decision-making. This allowed for validation of the model’s focus on medically relevant areas, as confirmed by consulting with domain experts. Fig. 6 depicts the original image, Grad-CAM++ and the output of integrated gradients and normal gradients for a set of images in the test set. In particular, the top part of the figure shows a meningioma sample from the test set. Despite being a meningioma, which is one of the classes that the trained models classify the worst, we see that the system is able to accurately identify where the important features are in this image. The middle section of Fig. 6 displays a glioma test sample. The integrated gradients illustrate that the model concentrates largely on the skull area, with a particular emphasis on the malignant region. The Grad-CAM++ output reveals the tumor’s position is entirely highlighted in red, with the adjacent areas appearing in yellow. Finally, the bottom section of the figure presents a pituitary case from the test set. This malignancy has proven particularly challenging to identify in images, primarily due to its proximity to the skull. The Grad-CAM++ output effectively emphasizes the tumor region across the whole image. In contrast, the integrated gradients method performs inadequately, as it assigns significance to pixels throughout the skull instead of isolating the tumor area. Fig. 7 presents a sample from the normal class. In the case of healthy patients, it is expected to anticipate that MRIs would not provide significant insights for tumor classification. This is apparent in the integrated gradients, where the significant pixels of the skull have low intensity, implying they are not important. 6. Discussion The results of this study demonstrate that the ensemble-based deep learning approach for brain tumor classification from MRI scans offers significant improvements in accuracy and interpretability compared Computers in Biology and Medicine 195 (2025) 110555 7
L. Sánchez-Moreno et al. Fig. 4. Confusion matrices corresponding to the test set evaluated with each of the trained models (VGG16, Inception-ResNet-v2 and DenseNet121). Fig. 5. Confusion matrix for the ensemble-based classifier. The confusion matrix was obtained after evaluating the test set with each of the models trained (VGG16, Inception-ResNet-v2 and DenseNet121) and then performing a majority voting algorithm. to individual models and traditional machine learning methods. The ensemble of VGG16, DenseNet121, and Inception-ResNet-v2 achieved an accuracy of 86.17%, outperforming state-of-the-art models for brain tumor classification. This enhanced performance is largely due to the combination of multiple CNN architectures, each contributing unique strengths to the classification task. In contrast to previous works that focus primarily on individual CNN models, this study shows the benefits of an ensemble approach, which improves robustness by taking advantage of the diversity in architecture design and feature extraction capabilities of each model. While individual models like VGG16 or DenseNet121 have been widely used in medical image analysis, their performance plateaus when used alone. The ensemble approach addresses this by improving generalization and accuracy across different tumor types. This approach reduces the risk of overfitting by generalizing better to unseen data, as it averages the predictions from different models, each learning different aspects of the data. Additionally, it enhances generalization by learning more varied representations and reduces sensitivity to errors from individual models, providing greater robustness and stability. The use of transfer learning also played a pivotal role, as initializing the models with pre-trained weights from ImageNet significantly reduced the training time and improved convergence, a method commonly adopted in state-of-the-art models. This allowed for efficient training even with limited medical datasets, a challenge frequently encountered in medical imaging research. In order to perform a fair comparison between results from different works, the same test partitions should be used. The works available in the state-of-the-art (see Section 2) use different datasets and test sets, which make results not fairly comparable with ours. We included a combination of various datasets in order to have a more heterogeneous and large dataset. Therefore, even if results are not comparable due to the images used, we strongly believe that our work is not focused on achieving a slight improvement on a single specific dataset, but on providing some guidelines for researchers on methods to use to improve both performance and interpretability on brain tumor classification. Computers in Biology and Medicine 195 (2025) 110555 8
L. Sánchez-Moreno et al. Fig. 6. Grad-CAM++ and integrated gradients for various samples of the test set. Top: meningioma. Center: glioma. Bottom: pituitary. This study is unique in its application of explainable AI methods like Grad-CAM++ and integrated gradients, setting it apart from previous research that often views CNN models as black boxes. By highlighting which MRI regions influence the classification process, it aligns with the growing focus on interpretability in modern AI, especially in healthcare. Many models achieve high accuracy, but their opacity limits clinical applicability. The explainability techniques used in this work improve clinicians’ confidence and support the validation of the model’s decisions in real-world settings. In summary, the main findings of this study demonstrate that an ensemble-based deep learning model, coupled with explainability techniques, achieves superior accuracy and offers crucial insights into the model’s decision-making process. This combination enhances its clinical relevance, making it a significant advancement over existing state-of-the-art models that either focus solely on performance or neglect interpretability. Despite the promising performance of the proposed ensemble model, several limitations should be acknowledged. First, the dataset, although balanced, is relatively small compared to modern large-scale Computers in Biology and Medicine 195 (2025) 110555 9