Journal of Intelligent Systems and Internet of Things

Brain Tumor Diagnosis Using Pre-Trained Conventional Neural Network Model

Shokhan M. Al-Barzinji, Mohammed Q. Jawad, Othman Mohammed Jasim, Zaid Sami Mohsen, Omar Falah Al-Jumaili
Volume 17, Issue 1, pp. 118-128 (2025)
DOI: https://doi.org/10.54216/JISIoT.170109
Online: https://www.americaspg.com/journal/18/article/3787

Abstract

Diagnosis of brain tumors from MRI scans is a vital concern in medical imaging that contributes to the need for fast and accurate deep learning models. In this study, it is proposed a Hybrid CNN-ViT Feature Extraction framework that utilizes the local spatial feature extraction capability of Convolutional Neural Networks (CNNs) and long-range dependency capturing ability of Vision Transformers (ViTs). The method starts with a set of advanced preprocessing techniques such as contrast limited adaptive histogram equalization (CLAHE) and data augmentation based on generative adversarial networks (GAN) to help increase image quality and balance the dataset. First, trained by a CNN-based backbone is EfficientNet to obtain low- and mid-level spatial features, the hybrid model is proposed. These feature maps are further converted into patches and input to a Vision Transformer  (ViT) encoder, where self-attention functions to refine global feature representations. The proposed method utilized concatenation and attention-based mechanism for feature fusion, which ensured the discriminative classification of features from both CNN and ViT. Finally, a fully connected layer with the softmax classifier predicts the presence of tumor and its kind. Extensive experiments have been conducted on benchmark brain MRI datasets, which show that the Hybrid CNN-ViT model significantly outperforms traditional CNN-based models and achieves higher accuracy, precision, recall, and F1-score. The study demonstrates the successful application of hybrid deep learning techniques for robust and generalizable brain tumor classification. The novelty of this research lies in integrating spatial information with context attention in enhancing AI-based medical diagnostics.

Keywords: Brain Tumor Diagnosis; Convolutional Neural Networks; Vision Transformer; Feature Fusion; MRI; Deep Learning; Medical Imaging

1. Introduction

Crop Brain tumors is characterized by the uncontrolled growth of cells in the brain, one of the most serious and deadly neurological disorders. An early and accurate diagnose is crucial for the disease to be treated, and the efficacy of treatment is important as a timely intervention has a beneficial effect on patient survival rates[1]. Out of all imaging techniques available, the one most frequently used for brain tumor detection is Magnetic Resonance Imaging (MRI). Yet the manual diagnosis of MRI scans by radiologists is a complex and time-consuming task prone to human error and subjectivity. Deep learning, especially Convolutional Neural Networks (CNNs), have shown great success in automated brain detection and classification, which is a probable solution to overcome the aforementioned challenges[2][3][4]. A neural network architecture designed for the fundamentals of image analysis. They automatically learn the spatial hierarchies of features from input images, making them suitable for medical image classification tasks[5][6]. CNN-based models have been increasingly successful in medical diagnosis over the years, significantly outperforming conventional machine learning approaches. These models are capable of identifying detailed patterns in MRI images, making them suitable for accurate classification of brain tumor types, such as glioma, meningioma, and pituitary tumors[7][8][9].

However, due to these advances, there are still some challenging problems in CNN-based classification of brain tumor’s[10]. As one of the most important parameters, the performance of CNN models is heavily reliant on hyperparameter tuning, such as filter size, stride padding, activation functions, learning rate, and intuition for batch size. Moreover, their clinical adoption is limited by their lack of interpretability and transparency. Additionally, most of the existing models are trained on specific datasets, making them potentially nongeneralizable across wide-ranging real-world scenarios[11][12][13]. In light of these challenges, the goal of this study is to establish an optimized CNN framework for the accurate classification of brain tumors, which includes advanced hyperparameter tuning, feature extraction techniques, and explainability mechanisms[14][15]. By employing a hybrid deep learning methodology that combines convolutional neural networks (CNNs) with Vision Transformers, we enable a model that achieves superior feature representation and, ultimately, classification performance[16][17]. The study also uses approaches of ensemble learning and explainability methods including SHAP (SHapley Additive exPlanations), Grad-CAM to enhance transparency in the model and make it more interpretable[18][19][20][13]. This paper introduces a hybrid CNN-ViT feature extraction framework for brain tumor diagnosis in images that fuses the local feature extraction capabilities of CNNs with the global context modeling of ViTs is proposed.

1. It utilize Contrast Limited Adaptive Histogram Equalization (CLAHE) for contrast enhancement of images and generative adversarial network (GAN)-based data augmentation, aimed at improving data quality and model generalization. The framework uses EfficientNet as the CNN backbone for extracting spatial features, followed by a ViT encoder to capture the long-range dependency. 2. This paper proposes a new feature fusion strategy based on concatenation and attention mechanism, which boosts the classification performance. Moreover, Grad-CAM visualization increased the interpretability of the model, which is essential for deployment in a real-world medical context. 3. The proposed approach has shown considerable superiority over traditional models, therefore proposing a scalable, accurate and explainable AI-based diagnostic procedure for brain tumor detection.

The rest of this paper is organized as follows: in Section 2, a thorough literature review on CNN-based brain tumor classification is presented. Section 3 introduces the proposed method, discussing the combination of CNNs with ViTs and cutting-edge optimization techniques in section 4. Finally, Section 5 concludes the study and describes possible future research. Section 5 concludes the paper with final remarks and potential future research.

In recent years, brain tumor classification and diagnosis using deep learning has been a actively researched topic. Different CNN models and optimization techniques have been proposed in recent years to enhance classification accuracy, feature extraction, and computational cost. This section describes the prominent works published in the domain of brain tumor classification using deep learning techniques.

Asiri et al. [21] introduced an optimized CNN model with tuned hyperparameters that included filter size, stride padding, pooling techniques, activation functions, learning rate, and batch size. On the multi-class MRI dataset, their model achieved a 96% accuracy and an 88% accuracy on the binary classification dataset. Hyperparameter tuning was shown to be important for improving the performance and generalization capabilities of these models.

Brahim et al. [22] applied a deep convolutional neural network (DCNN) whose architecture is based on VGG16, using data augmentation techniques to increase the dataset. Using transfer learning, they developed a model with an accuracy of 96% and an F1-score of over 97% for brain tumor detection. However, their method did not consider different architectures or explainability frameworks.

Aamir et al. [23] proposed a hyperparameter tuning on CNN for its batch size, layer count, learning rate, activation functions, pooling strategies, and filter sizes. Their fine-tuned CNN model outperformed state-of-the-art techniques and achieved an accuracy of 97% on three different brain MRI datasets. Their model achieved improved classification accuracy, but its performance on real-world clinical data and comparison against human experts is unexplored.

Li and Dib [24] presented a new computer-aided diagnosis (CAD) system based on six pre-trained deep learning models such as ResNet-50, Xception, InceptionV3, etc., to classify a multi-class brain tumor. They utilized Grad-CAM, which aims to explain the predictions of convolutional neural networks by exactly highlighting the important regions. The system obtained state-of-the-art accuracy (99%) on a benchmark dataset, with implementation in a user-friendly Streamlit-based application. Although their model performed better, based on pre-trained models that may not be applicable to other datasets.

Ullah et al. [25] proposed a hybrid deep learning model based on Bayesian optimization for hyperparameter tuning and a QT-based Marine Predator Algorithm (QTbMPA) for feature selection. Employing the InceptionResNetV2 and EfficientNetB0 architectures, the model presented yielded a remarkable accuracy of 98.80%, minimizing the time spent on computation. Nevertheless, this method was only evaluated on the Figshare dataset and should be tested on a different dataset in such as BRATS.

Deep learning-based brain tumor classification approaches recorded in the reviewed studies cover a variety of methods. Moreover, optimizing hyperparameters in CNN-based models is beneficial for feature extraction, while using pre-trained architectures and hybrid optimization techniques results in a more accurate model. However, issues around generalizability, interpretability, and applicability in the real word are active areas of research that require more work.

3. Methodology

This A Convolutional Neural Network (CNN) is one of the most important models in the field of deep learning customarily used for analyzing the picture, mainly medical images. In short, these networks utilize a series of layers to progressively extract relevant features from the input images for pattern recognition and classification. Generating high-quality images using CNN architectures are made up of convolutional layers, activation functions, pooling layers, and fully connected layers that help learn image data representations hierarchically. A CNN generally works on an image in the following manner, which is illustrated in figure 1 below.

Figure 1. CNN generally works
Figure 1. CNN generally works

The CNN pipeline starts with the preprocessing stage, where the input images are prepared for analysis. This part is all about resizing the images to a specific size, scaling the pixel values to a set range (usually between 0 and 1), and then using standardization methods to balance the pixel distribution. We use our preprocessing techniques to further improve on the image quality and learn the important features in an effective manner. This preprocessing also helps decrease computational complexity for a smoother learning process.

After preprocessing, the images are processed through a series of convolutional layers, where features are extracted. These convolutional layers utilize small, trainable filters (or kernels) that slide over the input image, searching for patterns like the edges, textures, and structures. This produces feature maps, which emphasizes relevant regions of the image yet retains spatial semantics. The convolutional phase is integral to understanding tumor-centric properties in MRI imagery, enabling the network to correctly distinguish normal from abnormal tissue.

After each convolution, we add an activation function like Rectified Linear Unit (ReLU) to add non-linearity to the network. ReLU function f(x)=max(0,x) which passes only positive values to the next layer and also discards negative values. The resulting activation mechanism enables the network to learn complex interactions, leading to enhanced ability to discriminate between tumor types.

After performing feature extraction, pooling layers enable us to minimize the dimensionality of feature maps and maintain their key information. Pooling operations like max pooling and average pooling downsample feature maps by selecting representative values from one or more local regions in the input feature map. It not only saves computational cost but also helps in generalization, as it makes the model less sensitive to insignificant changes in input images. Pooling process helps in concentrating on clearer features, which aids in enhancement of CNN's ability to classify brain tumors as highly accurate.

Finally, the fully connected layer is the last layer in the CNN architecture, and it combines all extracted features and makes the final classification decision. The resulting feature maps are then flattened into a 1D vector and fed into fully connected layers, where learned weights are applied to produce output probabilities for each target class. In binary classification, for example, a sigmoid activation function is used to produce output scores on probability scale for the "tumor" or "no tumor" labels, whereas multi-class classification tasks usually rely on softmax functions.

Finally, the output of the classification step gives the definitive diagnosis: whether or not a brain tumor exists. This architecture is an enhanced deep learning workflow because image preprocessing has operated alongside CNN operations, producing better feature representation while requiring less memory time. The CNN models leverage the inherent spatial correlation in the data and automate both image feature extraction and classification. Their – accurate and reliable – automated analysis makes them an indispensable asset in contemporary medical diagnostics.

3.1. Dataset

A diverse collection of multi-institutional, clinically acquired pre-operative multimodal MRI scans of glioblastoma (GBM/HGG) and lower-grade glioma (LGG), with pathologically confirmed diagnoses and overall survival (OS) data, is provided for training, validation, and testing in this year’s BraTS 2018 challenge. Notably, the dataset has been updated since BraTS'18 to include a greater number of routine, clinically acquired 3T multimodal MRI scans, with expert-annotated ground truth labels provided by board-certified neuroradiologists [26].

Figure 2. BraTS'18 Dataset
Figure 2. BraTS'18 Dataset

3.2. Data Preprocessing

MRI preprocessing is an important step to guarantee the data quality, noise reduction and relevant features enhancement for subsequent analyzation and diagnosis. This is a multi-step process that aims to standardize, clean, and enhance images for downstream processes like segmentation. Fig 3 summarizes the complete MR preprocessing pipeline.

A Data Acquisition and Conversion phase, where MRI scans are obtained from manikins or patients from clinical sources and formatted appropriately for analysis. Subsequently, image registration is conducted to position the MRI images within a common coordinate system like the Montreal Neurological Institute (MNI) space for uniformity across varying scans.

Normalization is performed to ensure that intensity values range from a fixed scale (0–255) to enhance images further, as illustrated in Equation 1. This allows us to standardize pixel intensity and makes it easier for deep learning models to read the data. Normalizing the product generates a text report and facilitates the reduction of noise with Gaussian smoothing to further eliminate undesired artefacts in our images, a step that should be taken for effective feature extraction.

𝐼𝑏𝑟𝑎𝑖𝑛 (𝑥,𝑦)− 𝜇 𝜎 (1) 𝐼𝑛𝑜 (𝑥, 𝑦) =

For segmentation tasks, more preprocessing steps are performed to extract certain areas of interest, like regions containing tumors. This is done by using masking or other segmentation techniques. Various tools and approaches such as Brain Extraction Tool (BET) models as stated in Equation 2 are used to extract tumor areas, focusing on accurate analysis of the tumor region.

𝐼𝑠𝑒𝑔(𝑥, 𝑦) = 𝐼𝑎𝑢𝑔(𝑥, 𝑦) ⊙𝑆 (𝑥, 𝑦) (2)

Preprocessing for MRI brain images ultimately helps enhance present and improve future tumor detection and classification by optimizing them for downstream tasks through these preprocessing steps in figure 3.

Figure 3. Pre-processing steps
Figure 3. Pre-processing steps

3.3. Hybrid CNN-ViT Feature Extraction

The Hybrid CNN-ViT (Convolutional Neural Network - Vision Transformer) Feature Extraction approach leverages the strengths of both CNNs and Vision Transformers (ViTs) to enhance feature extraction for brain tumor diagnosis from MRI scans. CNNs are well suited for extracting local spatial features through convolutional operations, while ViTs excel at capturing long-range dependencies and global contextual information using selfattention mechanisms. By integrating these two architectures, the hybrid model achieves better feature representation, improving classification accuracy and robustness.

3.3.1. Feature Extraction Using CNN

The first stage of the hybrid model employs a CNN-based backbone, such as EfficientNet to extract low-level and mid-level features from MRI images, see figure 4.

 Convolutional Layers: Capture spatial patterns such as edges, textures, and shapes.

 Activation Functions (Leaky ReLU): Introduce non-linearity to help the network learn complex patterns.

 Pooling Layers (Max Pooling): Reduce dimensionality while retaining critical spatial information.

Figure 4. Architecture of EfficientNet
Figure 4. Architecture of EfficientNet

3.3.2. Transitioning to Vision Transformer (ViT)

Once the CNN extracts essential spatial features, they are flattened into patches and passed to a ViT encoder for further processing.

 Patch Embedding: The extracted feature maps are divided into fixed-size patches and transformed into embedding vectors.

 Self-Attention Mechanism: The Multi-Head Self-Attention (MHSA) mechanism in ViT allows the model to learn long-range dependencies and relationships between different regions of the image.

 Positional Encoding: Unlike CNNs, ViTs do not inherently capture spatial hierarchy. Thus, positional encodings are added to the input embedding’s to retain spatial information.

3.3.3. Feature Fusion and Classification

The features extracted from both CNN and ViT are fused using different strategies:

 Concatenation Fusion: The feature vectors from both models are concatenated to form a comprehensive representation.

 Attention-based Fusion: A weighted attention mechanism assigns higher importance to the most relevant features.

The final fused features are passed through a fully connected layer, followed by a softmax classifier, to predict the presence and type of brain tumor, all these steps in Algorithm1.

Figure

3. Results and Discussion

The results from the model were exceptional, with an accuracy of 99.95%, a recall of 99.64% and an F1-score of 99.3%, see table1. The model is saturated observed at the interactions during the test under the mentioned results. This high accuracy indicates the model is able to correctly classifying almost all instances. The model has a recall value of 99.64%, which indicates that the model predicts presence with very little false negatives. On the other hand, the F1-score that harmonizes precision and recall, further affirms that the model upholds a robust equilibrium of these two basic classification metrics. High values like these signify a well-tuned and efficient learning system.

Table 1. Result of Our works
Table 1. Result of Our works

The confusion matrix see figure 5: presents more detailed insights (in terms of correct and incorrect prediction) about a model's sensitivity to each class. True Positive and True Negative is very high which all means number of false positive (number of instance wrongly classifying as positive) and False Negative (number of instance wrongly classifying as negative) are very minute. This indicates that the model is able to differentiate between various classes well. A matrix with sufficient diagonal dominance signifies that most predictions are consistent with actual labels, reaffirming the model's prediction strength. But through analysis of misclassified instances, you can find common patterns or characteristics within the data that are now resulting in occasional errors. The further examination of such errors can inform further refinements in the model, such as dos and don’ts around feature selection, inclusion of training data variety, tuning of hyperparameters, etc., which can enhance the overall reliability of the model.

Figure

Figure 5. The confusion matrix Let us look at the training and validation loss curves, which explain how the model learned over time. The curve of training loss and validation loss should fall smoothly, and the two curves should be relatively close. If both the losses are consistently falling and reach a constant low value, that shows that the model is learning good and is not overfitted. Nevertheless, if the training loss and validation loss are too far from each other, that is, the training loss is much less than the validation loss, the model is overfitting, it is performing well on a set of input but not generalizing well on new inputs. Regularization (L1/L2 penalties), dropout layers, data augmentation are all techniques to mitigate this issue and ensure better generalization. Practically, a small loss gap indicates good generalization ability, which is consistent with the high accuracy of the RNN model and good for being applied in actual situations, see figure 6.

Figure

Figure 6. Loss curve It was batch trained on a batch size of 64 using the ADAM optimizer with an initial learning rate of 0.00025. The best results were obtained at a final loss of 0.14997, which shows stable convergence. Using a relatively small learning rate and the ADAM optimizer, the model was able to modify its weights in a controlled manner so that they did not vary too widely from one iteration (epoch) to another. Here, we compare the accuracy of our proposed model in comparison to those reported in related works, to validate the effectiveness of our model. The accuracy of the model are as follows and higher than those of previous studies: 99.95%, see table 2, figure 7.

Table 2. Comparison the accuracy of our proposed model and related works
Table 2. Comparison the accuracy of our proposed model and related works

In studies listed in references [21] and [22], they reported 96% accuracy that demonstrated a significant gap between their performance and our model. These indicate that the drafting of advanced optimization and welltuned hyperparameter selection also greatly enhance the logic classification precision. However, Reference [23] obtained an accuracy of 97%, which is an improvement compared to References [21] and [22], but still significantly lower than the one proposed in this Article. The superior performance could be due to improved data preprocessing techniques and a more optimal training framework employed in our work. In [24] proposed a more competitive model, with 99% accuracy. Nevertheless, the adaptive learning rate with a batch size of 64 and ADAM optimizer yield a lower generalization error and leads to convergence faster than this work. Ultimately, Reference [25] achieved an accuracy of 98.8%, which was a remarkable performance. However, our model outperforms them by more than 1%, what suggests that our progress have a better correct classification frame with our features extraction and optimization methods.

Figure 7. Comparison the accuracy of our proposed model and related works
Figure 7. Comparison the accuracy of our proposed model and related works

4. Conclusion

We propose a Hybrid CNN-ViT Feature Extraction framework for brain tumor diagnosis from MRI scans in this study leveraging the strengths of Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs) in feature representation and classification performance. The CNN part can absorb the local spatial features, and the ViT encoder can capture long-distance dependencies with self-attention. We also applied sophisticated preprocessing methods like CLAHE to augment contrast and GAN-based data augmentation, which helped in enhancing image quality and maintaining a balanced dataset. Furthermore, our proposed feature fusion strategy, which combined concatenation and attention-based approaches in the opinion matrix stage, also helped improve the classification performance considering class liveness even further, while at the same time outperforming classical models. Although the performance is promising, we saw a lot of opportunity for improvement moving forward. First, the model's ability to generalize needs to be confirmed through further testing on larger, more diverse datasets and real-world clinical MRI scans. Second, the inclusion of self-attention mechanisms within the CNN layers could improve the feature extraction even more, closing the gap between the convolutional operations and transformer-based learning. Finally, it is worth investigating Vision Transformer variants like Hybrid Transformers, as they might offer further increases in performance. Fourth, a semi-supervised or self-supervised, learning approach could be integrated which would extensively leverage the unlabeled medical data set without relying so much on high quality labeled datasets. Finally, deploying the model in a real-time clinical decisionsupport system using cloud-based or edge computing solutions may make it more applicable to healthcare settings.

Funding: “This research received no external funding”

Conflicts of Interest: “The authors declare no conflict of interest.”

Figure
Figure
Figure