Brain Tumor Detection and Classification Using Deep Learning Models on MRI Scans

INTRODUCTION: The primary goal of artificial intelligence (AI) is to develop computers that exhibit human-like behavior and functionality. Computer-based activities employing artificial intelligence encompass a variety of extra features beyond only pattern detection, planning, and problem resolution. METHODOLOGY: Machines use a set of techniques collectively called "deep learning." Magnetic resonance imaging (MRI) is employed with the use of deep learning methods to develop models that can effectively identify and classify brain cancers. This technique facilitates the rapid and straightforward detection of brain cancers. Brain problems mainly arise from the abnormal multiplication of brain cells, leading to detrimental alterations in brain structure and finally culminating in the development of cancer in the brain, malignant. Early detection of brain tumors along with following effective intervention can reduce mortality rates. This paper proposes convolutional neural network (CNN) architecture to effectively detect brain cancers using magnetic resonance (MR) images. RESULTS: This research further examines several models, including ResNet-50, VGG16, and Inception V3, and compares the proposed architecture and these models. For the efficacy of the models, many measures were evaluated, including accuracy, recall, loss, and area under the curve (AUC). After analyzing several models and comparing them with the suggested model using the specified metrics, it was determined that the proposed model exhibited superior performance compared to the alternative models. Based on an analysis conducted on data from 3265 MR images. CONCLUSION: It was seen that the CNN model exhibited a classification precision of 93.3%. Additionally, the area under the receiver operating characteristic curve (AUC) was determined to be 98.43%, while the recall rate was 91.19%. Furthermore, the model's loss function yielded a value of 0.25. Based on a comparative analysis with other models, it can be inferred that the suggested model is highly reliable in detecting various types of brain cancers at an early stage.


Introduction
A brain tumour is an aggregation of abnormal cells that arises inside the rigid cranial vault encompassing the cerebral organ [1].The occurrence of any growth or development inside a limited or restricted space might potentially give rise to various challenges or problems [2].
The presence of any tumour inside the cranial cavity may lead to brain damage, hence presenting a significant threat to the overall health and functioning of the brain [3,4].Brain tumours are considered the 10th most prominent cause of mortality in adults and children [5].There exists a diverse array of cancers, each exhibiting significantly diminished rates of survival, which are contingent upon factors such as texture, location, and form [6]. Brain tumours are most prevalent among the elderly population.However, they may occasionally manifest in individuals at a younger age [7].Brain tumours are a prominent kind of cancer in children, ranking second in prevalence.Consequently, there is a pressing need for innovative research and the development of early detection methods to facilitate prompt diagnosis [8].There exists a diverse array of around 130 distinct types of tumours that have the possible to impact the brain and central nervous system (CNS) [9].These tumours exhibit a broad spectrum of characteristics, ranging from benign to malignant, and vary in their prevalence, with some being very uncommon while others are more often seen.Brain malignancies are classified as primary and secondary tumours, totalling 130 cases [10,11].Primary brain tumours are the most common kind of brain cancer.A tumour that first developed in brain tissue may sometimes become encased by nerve cells surrounding the brain.The malignancy or benignity of this type of brain tumour depends on the specifics of each case.Subsequent brain tumours, which account for most brain tumours, are notorious for their aggressiveness and eventual fatality.Malignancies that begin in one part of the body and spread to another, such as breast, kidney, and skin cancer, are used as examples.While primary brain tumours don't metastasize, it's important to remember that all subsequent brain tumours are cancerous.Manually classifying brain tumour pictures is a significant challenge for radiologists because of the striking similarity in the structure of MR images.The precise identification and categorization of brain tumours need the specialized knowledge and skills of radiologists and is a process that requires a significant amount of time.In contrast, computer-aided diagnosis (CAD) systems can automate the process of diagnosing brain tumours and assist radiologists in making precise judgments [12].Brain tumours are a very lethal condition with a significant prevalence among adult and pediatric populations.The prompt detection of brain tumours has the potential to enhance treatment alternatives and significantly increase the survival rates of those impacted by this condition.In the case of brain tumours, using CAD technology for early diagnosis may hasten treatment and reduce mortality rates.In recent years, there have been notable breakthroughs in medical imaging techniques and using AI methods, resulting in enhanced CAD of brain tumours.MRI-based methodologies have shown their efficacy as an imaging technique for investigating brain tumours.Time-consuming procedures, a need for topic expertise, and a susceptibility to errors characterize the process of manually analyzing MRI scans for illness identification.Artificial intelligence methods, namely ML and deep learning DL, have shown efficacy in automating disease diagnosis, particularly in brain tumour detection [13].Deep learning is often used in healthcare for analysis, classification, and detection.The processing capability of CNN is derived from a computational model inspired by the structure and functioning of the human brain.Humans can see and identify things by relying on their external visual characteristics.The CNN, known for its proficiency in image processing, operates similarly.Several wellrecognized CNN models include Res Net, Goog LeNet, Alex Net, and VGG [14].Recently, deep learning has been employed to enhance diagnostic accuracy in classification and detection jobs within biomedical engineering.Deep learning approaches have been shown to enhance performance due to their ability to extract profound characteristics, resulting in effective detection and classification.Hence, the suggested computer-aided design (CAD) system employs ML and DL methodologies to accurately classify and assess several categories of brain tumours based on brain MRI [15].

Architectural Framework
This work used an input picture measuring 32 × 32 pixels.This image was then passed through an initial convolutional layer of 16 filters.The resulting feature map had dimensions of 32 × 32 × 16, and a kernel size of 3 × 3 was employed while searching for the most general characteristics.A max-pooling layer was then fed the data from the convolutional layer, yielding a map for the feature with 15×15×16 dimensions.This pooling operation was performed to reduce the spatial data size by half for the succeeding layer.The max-pooling process was used to choose the maximum number of components or picture elements from the feature map region covered by the light of the filtration system.The previous layer's output was then passed through an additional convolutional layer.This layer had a filter size of 32 and produced a feature map with dimensions of 13 × 13 × 32.The convolution operation was performed using a kernel size of 3 x 3. Subsequently, the resulting output was directed to the feature map of the maximum-pooling layer, which had dimensions of 6 × 6 × 36.This process reduced the geographic information by half, preparing it for the subsequent layer.Subsequently, an additional convolutional layer and a subsequent pooling layer were included.The last convolutional layer consisted of a feature map with dimensions 4 × 4 × 64, generated by applying 64 filters with a kernel size of 3 x 3. Subsequently, the final pooling layer produced a 64-by-64-pixel feature map.The final result from the preceding convolutional layer was flattened and then delivered to a freshly created, completely connected dense layer possessing a dimension of 4160.The SoftMax activation function was applied to the last layer's output.Without resorting to dropout, the output in the preceding layer was activated by employing a SoftMax activation function.However, the dropout rate was set to 1.5, and the activation function was ReLU in all the preceding layers.The CNN mentioned above architecture's configuration is shown in Fig 1.The model underwent training, validation, and testing processes throughout 80 epochs.The batch size for these processes was set to 18, and a learning rate of 0.01 was used loss value was calculated with the help of the Adam optimizer and a loss function based on category crossentropy.The process may be delineated into many pivotal steps.Initially, the data was acquired from an accessible internet source, kaggle.com.Subsequently, the datasets underwent pre-processing procedures.The holdout validation system was used during the validation step.They trained the image dataset using a variety of machine-learning methods.Eighty per cent of the dataset was set aside for training, ten per cent for testing, and ten per cent for validation.Four brain tumours were studied for their validity in imaging: gliomas, meningiomas, tumour-free pictures, and pituitary tumours.To back up the findings, look at several metrics, including precision, remember, the area beneath the slope, and a loss.Fig2illustrates the sequential breakdown of the research process.

Building up the Environment
The environment was established using the Google Collab Pro+ platform, which operates entirely on the cloud.Google's Colab Pro+ was developed viaT4, NVIDIA Tesla K80, and P100 graphics processing units.Moreover, with 53 GB of RAM, this system has enough processing power.A custom-built environment can save time and effort when training machine learning models.

Dataset Collection
Kaggle.com provided the internet data utilized in this research, which was collected from the public domain.The dataset was constructed using magnetic resonance imaging (MRI) images.The decision was made to use magnetic resonance imaging (MRI) for the study due to its superior capability in identifying brain malignancies.This investigation uses four distinct categories of brain tumour data, including meningioma, absence of tumour, pituitary tumour, and glioma tumour.A total of 3264 MRI information was used in the dataset.

Data Processing
Early processing is essential because it turns the data into something that can be used for training.They needed to be more precise and low-quality because they came from a patient record.Standardized pictures at this point to prepare them for more work.The writers also used Gaussian and Laplacian filters to smooth the pictures and eliminate the blurry ones from the originals.

Divide and Enhance Data
The dataset used in this study was limited and only comprised of MR images.However, it is well acknowledged that neural networks need substantial data to provide hopeful outcomes.The dataset used in this study included a total of 3264 magnetic resonance (MR) pictures.The data was partitioned into three subsets: 80% of the images were to be paid for training.In contrast, the leftover images were divided equally for testing and validation, with each subset accounting for 10% of the dataset.The initial dataset may be expanded by augmentation techniques, enhancing the training process.Furthermore, this augmentation increases the model's ability to acquire knowledge.Thus, the dataset was improved by the application of data augmentation methods.The MR images were mirrored, rotated, shifted in width and height, and zoomed.Holdout validation was then used to double-check the datasets.

The Validation Process
The selection of an appropriate validation process was of utmost importance for the dataset, including 3264 scan pictures.A holdout validation method was used, whereby 80% of the data was allocated for training purposes, and the remaining 20% was reserved for testing.The holdout validation methodology is widely used and has been shown to provide favorable outcomes.The holdout method is a commonly used machine learning technique that divides the dataset into two subsets: training and testing sets.This partitioning facilitates more efficient model training.Using the training dataset, this machine learning model was trained, and its performance was tested using the testing dataset.The holdout tactic only put 80% of the information to use in the training phase, saving the other 20% for the evaluation phase.The model was trained using the input data from the preparation set, and next its performance was evaluated with data from the testing set.A more extensive dataset is provided for the model to find out when 80% of the data is used for training.This increased data may enhance the model's ability to generalize well with novel, unknown data.Nevertheless, it is essential to note that the testing set used in this study may not accurately reflect the whole dataset's characteristics, which might introduce bias into the performance estimate.

Performance Measures
Many measures were considered to assess the efficacy of the ML models and conduct a comprehensive analysis of their performances, including precision, recollect, and AUC.

Precision
The proportion of accurate calculations made is the accuracy's unit of measurement.Precision may be calculated using Eq. ( 1).
Where tp indicates a positive result; Tn a negative one; For every fn, there is an fp, or false positive.

Recollect
An additional key measure used to assess an ML model is recollection.The formula for determining recall is: and resources, such as a graphics processing unit (GPU) and large-scale databases, while using pre-trained models saves both.

ResNet-50
The term "residual network" is shortened to "Res Net-50."ResNet-50 is a modernized version of the ResNet architecture, and it uses at least a million photos from the database maintained by ImageNet to train its deep layers.ResNet-50 is constructed using standard pooling convolutional units.The residual layer of the network is unique among neural networks in that its output does not go into the next layer's input.

Fig. 3 .
Fig. 3. Brain tumour MR pictures (a) Glioma tumour (b) Pituitary tumour(c) No tumour Transfer learning, in the field of machine learning, is the practice of applying learned methods in other settings.VGG16, Res Net-50, and Inception V3 are a few of the most well-known models for transfer learning used for object recognition and image classification.When it comes to saving money and time, transfer learning tactics are unrivalled.Starting from scratch requires more time EAI Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 |

Table 1
presents the comprehensive collapse of the data, whereas Fig 3visually represents the magnetic resonance (MR) pictures categorized by different types of brain tumours.
EAI Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 |

Table 3
53% AUC, 92.2% recall, and 0.360 validation loss.Fig 8 displays CNN, Res Net-50, Inception V3, and VGG16 validation and training accuracy graphs.Orange lines indicate validation set accuracy, whereas blue lines indicate training set accuracy.With 94.40% validation precision and 90.50% training accuracy, the CNN performed well.For validation, ResNet-50 had 82.20% accuracy and the highest training accuracy of 98.43%.Establishing the V3 model has 90% validation precision and 91.79% training accuracy.However, VGG16 had the lowest validation (62.50%) and training (79.20%).The Adam optimizer set the batch size to 18 and the epochs to 80 during model implementation.CNN performed better than other models based on the accuracy graph.Validation accuracy increased more than training accuracy, supporting this claim.Lack of over-or underfitting improves CNN's performance advantage.
compares deep learning models trained on the brain cancer MR image dataset, and Fig 7 shows the results with human assessment.This includes VGG16, CNN, ResNet-50, and Inception V3.Table 3 shows model estimates for accuracy, AUC, recall, and loss function.CNN outperformed VGG16, ResNet-50, and Inception V3 deep learning models, according to Table 1.After validation, the CNN had 94.4% validation accuracy, EAI Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 | 97.

Table 3
Brain tumour detection performance.