Keywords

1 Introduction

A primary brain or spinal cord tumor is one that begins throughout the brain or spine [1]. An approximate of 24,530 adults in the United States (13,840 males and 10,690 females) [2] will now be confirmed with predominant cancerous tumors of the brain and spinal cord this year. There seem to be secondary brain tumors, also known as brain metastases, in relation to primary brain tumors. When a tumor begins elsewhere in the body and spreads to the brain, this is known as metastasis. Bladder, breast, kidney, and lung cancers, as well as leukemias, lymphoma, and melanoma, are perhaps the most prevalent cancers that extend to the brain. As shown in Fig. 1, according to the World Health Organization (WHO), a total of 19,292, 789 new cancer cases recorded with 905,677cases are expected due to liver cancer, 2,206,771 from lung cancer, 2,261,419 from breast cancer, 1,414,259 from prostate cancer, 1,931,590 from colorectum cancer, 1,089,103 from stomach cancer, 604,127 from cervix uteri cancer, 604,100 from esophagus cancer, and 8,275,743 new cases from other types of cancers in 2020 (World Health Organization, New Cancer Release Report 2020) [3]. The statistics for the cases are shown in Fig. 1.

Fig. 1
figure 1

The number of new cancer cases in 2020, both sexes, all ages

Brain tumor is a wide group of cancers that may begin in almost any brain tissues and organs of a person whenever irregular cells develop uncontrollably and penetrate adjoining regions of the brain [4]. Tumors sprout from the cells that surround the brain’s membranes (meninges), glands, and nerves. In general, tumors can wreak havoc on brain cells. They can cause cell damage by increasing the pressure within the skull. Several healthcare systems in low- and middle-income societies are ill-equipped to deal with the issue, and a substantial proportion of brain tumor patients around the world lack adequate access to high-quality diagnosis and care. Many forms of cancer recovery rates are strengthening in countries with good healthcare organizations due to early diagnosis, comprehensive treatment, and overall survivorship services. As a result, early intervention and detection of a brain tumor are important for many people’s lives to be saved. Visual assessment and manual procedures are commonly used to diagnose certain types of tumors. This method of manually interpreting medical images consumes a very long time and seems to be vulnerable to errors. As a result, deep-learning-based computerized research has shown promise as a diagnostic mechanism [5, 6].

Deep learning was already commonly used in a number of fields, especially biomedical imaging, because its implementation does not necessarily involve the expertise of a subject matter specialist, but it really does necessitate a large volume of data as well as a complex set of data in order to produce good prediction performance. For instance, convolutional neural nets (CNN) have shown to be capable of detecting tumors with positive results [7]. With both the diagnosis and treatment processes, researchers have focused on brain magnetic resonance imaging (MRI) as being one of the excellent imaging techniques for diagnosing brain tumor and predicting tumor progression. Because of the high resolution of MRI images, they have a major impact across the domain of automated medical image interpretation because they can provide a great deal of knowledgeable information about the structure of brain and anomalies inside the brain tissues [8,9,10]. For such a reason, we described the word “deep learning.”

As shown in Fig. 2, deep learning (DL) is a series of machine learning approaches that start learning at multiple levels and progress through different abstraction levels. Levels refer to distinctive levels of meanings, whereby higher-level principles are described from lower-level principles, as well as the similar lower-level principles can help to describe certain higher-level principles. DL models [11, 12] become more and more precise as they analyze more data and fundamentally learn from past findings to improve their abilities to create correlations and associations. Deep learning can be extended to virtually every field of science and has resulted in significant advancements. With new excellent progress of DL in the area of robust recognizing steps, DL strengthens all aspects of activity by finding common problems and also adds additional domains of study. Deep learning has shown excellent results in a variety of fields. It is gradually making its way into ground-breaking technology with high-value applications in the medical sector [16,17,18,19]. Researchers are required to increase the performance of automation and smart decision-making in main patient treatment and public health systems. As a result, the goal of this chapter is to explore the potential of deep learning models for brain tumor segmentation from microscopic tissue images via integrating an advanced convolution model [20,21,22] and evaluation using different performance metrics.

Fig. 2
figure 2

Deep learning abstraction levels

2 Related Work

Sarhan et al. [10] developed a new CAD methodology for MRI image recognition of brain tumor. The proposed design extracts feature from brain MRI images by using the discrete wavelet transform’s strong energy compactness property (DWT). The wavelet aspects were being used to characterize the input MRI image using a CNN. As a result, the proposed method was less time complex. MRI scans from the Figshare (Cheng) database were used to create the brain images. The extracted features were fed into both the proposed WCNN method and the SVM classifier. The suggested system output was comparable to SVM classifier to demonstrate its accuracy and robustness. Using a decomposed stage of two and the Haar wavelet, computational experiments on the Figshare (Cheng) database yielded 99.3% recognition accuracy. According to simulation performance, the proposed method consistently outperforms as compared to the SVM model in terms of effective metrics.

Rao et al. [1] reviewed different approaches for fully automated brain tumor segmentation and classification that do not require user interaction. In the first stage, the image data was pre-processed with an edge preserved anisotropic diffusion filter and then segmented with GLCM texture features segmentation to distinguish tumor, white matter (WM), grey matter (GM), and edema regions. And at last, the selected features were analyzed to identify the proper features that used artificial neural network (ANN) and support vector machine (SVM). Finally, through distinct machine learning methods, the extracted feature has been further categorized as tumor and non-tumor.

Chauhan et al. [13] proposed the DWA-DNN method for classification of brain MRI. The performance findings indicate that DWA-DNN was much precise and managed the huge dataset quantity more conveniently. The proposed DWA layer was made up of DWT and AE. The image was encoded using AE and afterward processed via DWT that uses Daubechies mother wavelet of 2nd order to obtain the estimated and comprehensive coefficients by transferring it through low-pass and high-pass filters, respectively, within this layer. The estimation coefficient was then used in the DNN model for classification. In comparison to the other methods, the accuracy of the CNN model was almost identical to DWA-DNN but just not as efficient due to the use of deep neural networks. This means that classification accuracy continued to improve whenever the extracted features were precise.

Havaei et al. [14] presented a deep convolutional neural-network-based method for automatically segmenting brain tumors. The author assessed the effects of various architectures on performance. The outcomes of the BRATS 2013 online analysis system proved that the proposed method significantly outperforms on the presently documented state-of-the-art models in terms of both speed and accuracy, as introduced at MICCAI 2013. The elevated effect was obtained through the use of a unique two-pathway architecture (that can simulate both local features and global details) including by stacking two CNNs to model local label implementations. The training was predicated on two techniques that allowed CNNs to be trained efficiently even though the label distribution was unbalanced. The classification system tends to result had been very fast due to the convolutional existence of the modeling techniques and an efficient GPU execution. The time required to segment the whole brain with any of the CNN classification algorithms ranges between 25 s and 3 min, making the proposed method more practical for logical segmentation techniques.

Amin et al. [15] presented a computer-aided system for segmenting and classifying brain cancer using magnetic resonance imaging (MRI). For such segmentation of candidate lesions, various methodologies have been used. Then, for each individual tumor, a feature array was selected based on shape appearance and severity. At a certain point, the implemented new framework accuracy was compared using the support vector machine (SVM) classifier to distinct cross-verification on the selected features. The proposed approach was tested on three benchmark datasets: Harvard, RIDER, and Local. The system had an overall precision of 97.1%, a region under a curve of 0.98, a sensitivity of 91.9%, and a specificity of 98.0%.

Mohsen et al. [17] proposed an effective method for classifying brain MRIs into standard and three kinds of malignant brain tumors: glioblastoma, sarcoma, and metastatic bronchogenic carcinoma using the discrete wavelet transform (DWT) and the deep neural nets (DNN). The novel methodology implementation was similar to the convolutional neural nets (CNN) system, but it needed less hardware requirements and took a reasonable amount of time to process large images (256*256). Furthermore, as opposed to standard classifiers, the use of the DNN classifier demonstrated high precision, and the performance assessment was very successful across all performance steps.

Zhao et al. [18] developed an innovative brain tumor segmentation approach based on the integration of fully convolutional neural nets (FCNNs) and conditional random fields (CRFs) in a coherent system to achieve segmentation outcomes with presence and spatial accuracy. The suggested procedure was tested by the authors using imaging samples from the Multimodal Brain Tumor Image Segmentation Challenge (BRATS) 2013, BRATS 2015, and BRATS 2016. The analytical findings indicated that the evolved approach created a segmentation system using Flair, T1c, and T2 scans and obtained comparable performance to some of the designed using Flair, T1, T1c, and T2 scans.

3 Proposed Work

The proposed approach employs the CNN model to diagnose brain tumors from MRI scans and the model being trained by the use of Python script. This research also reveals the technological capability of deep learning to identify the brain tumors automatically by classifying them as tumorous or non-tumorous. The proposed work is depicted in Fig. 3 as a block diagram.

Fig. 3
figure 3

Proposed work

3.1 Dataset Description

The dataset for all of this research was obtained from Kaggle and consists of two folders: yes and no, and containing 253 brain MRI images. Yes covers 155 tumorous brain MRI scans, whereas no has 98 non-tumorous brain MRI image data. Figure 4 depicts the dataset distribution prior to the augmentation.

Fig. 4
figure 4

Dataset distribution before augmentation

3.2 Data Augmentation

Data augmentation typically applied to generate additional images because of the dataset’s moderate size. Data augmentation is often performed to address the problem of data imbalance (since 61 of the data belong to the tumorous class). The tumorous scans represent for 61% of the dataset (155 images), while the non-tumorous scans account for 39% (98 images). Consequently, in terms of balancing the data, we can create 8 new frames for each image as in “no” class and 5 new images for each image in the “yes” class. As a augmentation, the following parameters are used:

  • Shear: 0.1

  • Rotation range: 10

  • Width shift range: 0.1

  • Height shift range: 0.1

  • Brightness range: (0.3, 1.0)

  • Horizontal flip=True

  • Vertical flip=True

  • Fill mode=“nearest”

After augmentation, the dataset has a maximum volume of 1812 images, with 51.32% (930 scans) being tumorous and 48.67% being non-tumorous (882 images). Figure 5 depicts the prevalence of the dataset after augmentation.

Fig. 5
figure 5

Data distribution after data augmentation

3.3 Loading and Splitting Augmented Data

We provide two arguments to load the augmented data: the first is a list of directory paths for the folders “yes” and “no,” and the second is the image size. To locate the extreme top, bottom, left, and right locations of the brain, the very first scan in both directories is examined and then cropped to accommodate only the brain image, as seen in Fig. 6.

Fig. 6
figure 6

Original image after cropping

Because the images in the dataset are of varying sizes, they are resized to (224, 224, 3) before being fed into the neural network. After that, normalization is used to scale the pixel from 0 to 1. Images with labels are appended to X and Y, followed by shuffling. The total number of images is 1812, with the X shape being (1812, 224, 224, 3) and the Y form being (1812, 1). The kernel density plot for both the classes is shown in Figs. 7 and 8.

Fig. 7
figure 7

Kernel density plot of tumorous images after augmentation

Fig. 8
figure 8

Kernel density plot of non-tumorous images after augmentation

The sample images for both the classes are shown in Figs. 9 and 10.

Fig. 9
figure 9

Brain tumor yes

Fig. 10
figure 10

Brain tumor no

The data (X,Y) is then divided into three parts: 70% for training (1268 images), 15% for validation (272 scan), and 15% for testing (272 images). The shapes for split data are listed below.

  • X train shape: (1268, 224, 224, 3)

  • Y train shape: (1268, 1)

  • X val shape: (272, 224, 224, 3)

  • Y val shape: (272, 1)

  • X test shape: (272, 224, 224, 3)

  • Y test shape: (272, 1)

3.4 CNN Architecture

In CNN, every input image can be processed through a sequence of convolution layers using filters (kernels), pooling, fully connected layers (FC), and Softmax to identify an item with probabilistic values ranging from 0 to 1.

An convolution layer is implemented using 32 filters, followed by batch normalization, and ReLU is applied as an activation function that is measured by f(x) = max(0,x). The model used two max-pooling layers with stride 4 × 4 followed by flatten layer. Subsequently, using the sigmoid activation function, one dense layer is employed for the output. Figure 11 depicts the classification’s layered design.

Fig. 11
figure 11

CNN layered architecture

4 Result and Analysis

The model is trained on Google Colab for only 35 epochs using a python script with batch size 32 and Adam optimizer. As for evaluations, accuracy curves, loss curves, and f1 score-based analyses are used. Equations 1, 2, 3, 4, and 5 illustrate the mathematics underlying accuracy, loss, precision, recall, and F1 score, respectively.

$$\displaystyle \begin{aligned} Accuracy=(TP + TN)/(TP + TN+ FP + FN) {}\end{aligned} $$
(1)
$$\displaystyle \begin{aligned} logloss=-1/N\sum_{i}^{N}\sum_{j}^{M}y_{ij}log(p_{ij}) {} \end{aligned} $$
(2)
$$\displaystyle \begin{aligned} Precision=TP/ (TP + FP) {}\end{aligned} $$
(3)
$$\displaystyle \begin{aligned} Recall = TP/ (FN + TP) {}\end{aligned} $$
(4)
$$\displaystyle \begin{aligned} F1 Score =2 X (Precision * Recall) / (Precision + Recall). {}\end{aligned} $$
(5)

As illustrated in Figs. 12 and 13, the research framework recorded the model’s accuracy and loss curve per epoch. Training accuracy is over 100%, whereas validation accuracy is nearly 90%, as indicated in the graph. We also computed the F1 score for the validation set, which was 89.37%.

Fig. 12
figure 12

Training and validation accuracy of CNN

Fig. 13
figure 13

Training and validation loss of CNN

On the test set, we also deployed the proposed model. There are 272 scans in the test set, 49.63% of which are tumorous (135 images) and the remaining 50.36% are non-tumorous (137 images). With a 0.50 logloss score, the proposed model achieved a test accuracy of 88.23%. Again, for testing, the F1 score is determined at 87.78%.

We built a classification model using custom CNN layers to classify if an individual has a brain tumor or not using MRI images in this chapter. The model performed well with a small number of training samples, but test accuracy can be improved by adding more layers or using more deeper pre-trained architectures such as Vgg16 or Resnet 34, etc.

5 Conclusion

Medical vision evaluation serves an important responsibility in the healthcare industry, particularly in non-invasive therapy and clinical research. Healthcare professionals and radiologists can use medical analytical techniques and reporting capabilities to appropriately diagnose the condition. Medical imaging has emerged as one of the main effective methods for detecting and evaluating a wide range of abnormalities. Visualization enables doctors to analyze and interpret MRI scans in order to detect deformities or anomalies inside the organs. Medical data collected from numerous biomedical equipment that use diverse imaging techniques such as X-rays, CT scans, MRI, mammograms, and others that play an important factor in the diagnosing. Magnetic resonance imaging (MRI) is used to diagnose a brain tumor (MRI). When an MRI reveals that there is a tumor in the brain, the most common technique to determine the type of tumor is to read the results of a biopsy sample of cells. We suggested a CNN model appropriate of locating tumors using MRI scans of the brain regions in this chapter. With a 0.50 logloss score and an F1 score of 87.78%, the proposed model achieved a test accuracy of 88.23%. As a result, AI will undoubtedly have an impact on radiology, and it will do so much more rapidly than in other medical disciplines. It will have a greater impact on radiology practicing than ever before. In future, advanced deep neural network models with app-based user interface can be developed for better analysis of the brain tumor.