Analysis of Brain Tumor Using MRI Images

The increasing rates of deadly brain tumors in humans correspondingly increase the need for highly experienced medical personnel for diagnosis and treatment. Therefore, to reduce the workload and the time from suspicion of disease to diagnosis, then plan for suitable treatment, there is a need to automate the initial part of the process by implementing a Computer-Aided-Disease-Diagnosis (CADD) system for brain tumor classification. The aim of this research is to develop and deploy all the needed components to design and implement a working Computer-Aided-Disease-Diagnosis (CADD) system for brain tumor classification. First, by understanding the brain tumors themselves and the convention of their classification. Second, the convolution neural network (CNN) structure and functionality and how to manipulate it. Third, find different CNN architectures with promising results in similar tasks. Fourth, find and evaluate the applicability of available data sources. Fifth, implement the most promising solutions and explore the applicability of using transfer learning for the given task to take advantage of previously gained knowledge. Finally, evaluate the results of the experiments, where we show that the DenseNet121 architecture, either fully trained or using transfer learning, likely is the most appropriate candidate for the CADD system in development.


I. INTRODUCTION
T HE CELL of origin and features found when examining the cells tissue define central nervous system tumors and predict their behavior [1]. After meningiomas, the most common primary brain tumor in adults is gliomas, with a rate of 5 to 6 persons per 100,000 annually [2].
The World Health Organization (WHO) tissue classification system categorizes gliomas, with grade 1 as the lowest and grade 4 as the highest. Thus, low-grade gliomas (LGG) consist of grade I and II tumors [3], while high-grade gliomas (HGG) consist of grade III and IV [2]. Grade I are the least malignant or benign tumors. Grade II is relatively slow-growing but may recur as a higher grade. Grade III is malignant and tends to recur as higher grades. Finally, grade IV is the most malignant, aggressive, necrosis and recurrence prone [1].
Histopathologic examination to study tissue morphology, diagnose, and grade brain tumors is the gold standard [3]. However, surgical resection for diagnosing a brain tumor is invasive and risky. Nevertheless, non-invasive diagnostic methods exist, like neuroimaging with Magnetic Resonance Imaging (MRI) [4].
Conventional MRI is the current imaging procedure of choice and identifies tumor size and associated Peritumoral Edema (PTE), one of the main features of malignant glioma [5]. To diagnose the brain tumor without surgical intervention, researchers have developed more advanced imaging methods such as texture analysis, mechanic modeling, and machine learning (ML) that form a predictive multi-parametric imagebased model. The application of ML models is an emerging field in radiogenomics and represents a data-driven approach to identifying meaningful patterns and correlations from often complex data sources. ML models train by feeding the ML algorithm a substantial amount of pre-classified image data as input, such as MRI images, to learn which patterns belong to the different classes.
The convolutional neural network (CNN) is a concept introduced by [6] as the Neocognitron, as a model of the brain's visual cortex; an improvement of [7] previous model for visual pattern recognition. Furthermore, [8] significantly improved the Neocognitron to one of the most successful pattern recognition models, dramatically influencing the field of computer vision and pattern detection in images.
In 2021 a fully automatic hybrid solution for brain tumor classification comprised of several steps was proposed [9]. First, pre-process the brain MRI images by cropping, resizing, and augmenting. Second, use pre-trained CNN models for feature extraction with better generalization. Third, select the top three performing features using fined-tuned ML classifiers and concatenate these features. Finally, use the concatenated feature as input for the ML classifiers to predict the final output for the brain tumor MRI. The proposed scheme uses a novel feature evaluation and selection mechanism, an ensemble of 13 pre-trained CNNs, to extract robust and discriminative features from brain MRI images without human supervision. The CNN ensemble, is comprised of ResNet-50, ResNet-101, DenseNet-121, DenseNet-169, VGG-16, VGG-19, AlexNet, Inception V3, ResNext-50, ResNext-101, ShuffleNet, MobileNet, and MnasNet. Since the researchers use fairly small datasets for training, they take a transfer learning-based approach by using the fixed weights on the bottleneck layers of each CNN model pre-trained on the ImageNet dataset.

II. DATA GATHERING & PRE-PROCESSING
The data-gathering part of the research starts with outlining some criteria. The data should contain non-tumorous, LGG, and HGG samples and be well balanced between the labels. The latter is essential since too much data augmentation on medical images often does not generalize well. A well-suited candidate was found at The Cancer Imaging Archive (TCIA). The REMBRANDT (REpository for Molecular BRAin Neoplasia DaTa) Dataset [10] seemed to have all this research's characteristics. The dataset is one of the most trusted publicly available datasets, comprised of MRI scans from 130 subjects of three classes, non-tumorous, LGG, and HGG. Furthermore, the LGG and HGG classes have subclasses that opened the opportunity to make the classification outcome more extensive. The dataset is a combination of metadata from various text and spreadsheet files and the 110,020 images in the DICOM format, which also includes a vast quantity of metadata. After preprocessing, the dataset comprises 123 patients and 105,265 slides, distributed as shown in Table I. At this point, it was discovered that one key bit of information was missing; how to separate the MRI slides that contained the tumorous cells from the ones that did not contain them. All the source data were reexamined, but the answer was not found. While searching online for how to find the needed key, one paper stood out [11]. The paper used that same dataset for a similar application. While being reduced to 4069 slides, it seemed that the authors of this paper had found a way to filter the data further. A meeting with the paper's main author was arranged to understand how to reproduce the dataset. His research team had employed help from neurologists to go through each slide manually and label them correctly. Fortunately, the main author offered to share a smaller dataset version. After further processing, the dataset has 735 samples distributed, as shown in Table II, and is now ready for training CNN models.

III. METHODOLOGY
Finding the CNN architecture with or without transfer learning that yields the best results for the classification task is the primary goal of the current research. Therefore designing a pipeline where the CNN architecture can easily be substituted is essential. Doing so required finding the generally most suitable division of the Test, Validation, and Test subsets, the most suitable baseline hyperparameter settings, and whether image augmentation was to be used. For this task, VGG16 [12] was selected, as it had been used for the same application with promising results [13] [14]. After training a large number of VGG16 models, a baseline for training other CNN architectures was established. A total of 60 images, 20 from the three classes, were randomly picked for the Test set. The remaining images are divided into 30% and 70% for the Validation and Training sets. The Training set is also augmented with rotation, width and height shift, shearing, zoom and brightness adjustment, and horizontal flipping. Filters with minimal adjustments to the original gave better results than fewer with more extensive adjustments. The Normal label has a little over half of the samples as LGG and HGG, and is therefore producing a higher number of augmented images. The Normal label in the Train set is increased from 103 to 309, LGG from 186 to 372, and HGG from 182 to 364. With a batch size of 24, the baseline uses 10 epochs for training with a learning rate of 0.001, Adam for optimization with categorical cross-entropy as the loss function. In addition to the VGG16 architecture, five other CNN architectures were used to train models, including AlexNet, MobileNet [15], ResNext [16], DenseNet121 [17], and a custom-designed architecture. The custom CNN architecture is designed to accept N amount of 224x224 image matrices with 3 color channels; it consists of three convolutional layers of 32, 64, and 64 filters, of filter size 3x3, with zero-padding, and ReLU as the activation function. The first convolutional layer is followed by a max-pooling layer of pool size 4x4, and the last two convolutional layers have a pool size of 2x2, each followed by a dropout layer with a dropout rate of 0.15. Next, a flattening layer is added to transform matrix output to vector inputs to be accepted by the first dense layer, which is comprised of 512 ReLU activated neurons, followed by a dropout layer with a 0.5 dropout rate. The last hidden layer is a dense layer of 256 ReLU activated neurons. The model's final layer, its output, is a 3 neuron softmax activated dense layer for classification. The general architecture of this model is shown in Fig. 1, and the folowchart is provided in Fig. 2.

IV. RESULTS
All the CNN architectures implemented to this point show outstanding results, as shown in Table III. While multiple runs were made on each architecture to obtain the given results, and there is an indication that the Test set in particular needs expansion, the results indicate that DenseNet121 is the best candidate for the given classification task. Surprisingly enough, with the custom architecture as the runner-up.

V. RESEARCH CONTRIBUTIONS
The research conducted has been a good start for further developing a usable CADD system. A pipeline for data preprocessing that makes preparing new data samples both easy and   fast has been developed. Similarly, a pipeline for augmenting the training data and a pipeline for defining CNNs, training them, and providing a classification model as the output has been developed successfully. Also, to demonstrate the potential of the research, a user interface has been developed and deployed to a web server where the general public can accessed at tumorclass.info. All the source code used in this project can be found in the GitHub repository.
VI. DEPLOYMENT A service called ngrok was selected for the deployment. Ngrok is a free service that allows the exposure of localhost to the internet in a secure manner. With ngrok installed, the only steps needed were to run the FastAPI in uvicorn on the local machine and then run ngrok in a separate terminal to expose the local host to the internet. To make it a little more elegant, a domain name was purchased, and the DNS was set to give access to ngrok. A monthly subscription on ngrok was also purchased to connect the autogenerated ngrok domain name to the custom domain name. In figures Fig. 3, Fig. 4, Fig. 5, and Fig. 6 the implemented user interface is shown.

VII. CONCLUSION & FUTURE WORK
The next step after our CADD system is to expand the data set. The amount of suitable data available is limited. However, the REMBRANDT dataset has a vast number of images suitable for manual labeling performed by radiologists. Expanding the data set will make it more transparent, which architectures generalize well. As such, these architectures can be the focus of further development. These days, MRI scans provide 3D images, so further development to facilitate 3D classification is also a viable option.