Brain tumors can be a major cause of psychiatric complications such as depression and panic attacks. Quick and timely recognition of a brain tumor is more effective in tumor healing. The processing of medical images plays a crucial role in assisting humans in identifying different diseases. The classification of brain tumors is a significant part that depends on the expertise and knowledge of the physician. An intelligent system for detecting and classifying brain tumors is essential to help physicians. The novel feature of the study is the division of brain tumors into glioma, meningioma, and pituitary using a hierarchical deep learning method. The diagnosis and tumor classification are significant for the quick and productive cure, and medical image processing using a convolutional neural network (CNN) is giving excellent outcomes in this capacity. CNN uses the image fragments to train the data and classify them into tumor types. Hierarchical Deep Learning-Based Brain Tumor (HDL2BT) classification is proposed with the help of CNN for the detection and classification of brain tumors. The proposed system categorizes the tumor into four types: glioma, meningioma, pituitary, and no-tumor. The suggested model achieves 92.13% precision and a miss rate of 7.87%, being superior to earlier methods for detecting and segmentation brain tumors. The proposed system will provide clinical assistance in the area of medicine.

1. Introduction

The brain is a key organ responsible for the central nervous system. The human brain complements the central nervous system by connecting the bone marrow. The brain has the responsibility of controlling the actions of the human body. It receives the information from a different sense and after making decisions, sends the instructions to the body. The brain is the central part of the administration section of the human body that is responsible for all the activities of the human body with the help of neurons.

Malignant and benign are the currently prevalent types of significant brain tumors. The brain tumor is considered deadly cancer in adults and children. A brain tumor occurs when the brain tissues develop unnaturally. The abnormal tissues overgrow compared to the healthy cells, causing the mass of cells that eventually transform tumors [1].

A benign tumor is the least damaging type of tumor and has no tumor cells. Malicious cancer is tumor cells that can be very deadly and deliberate to be deadly. A malignant tumor can affect the entire brain. Common primary tumors found among adults are glioma, meningioma, and pituitary. Gliomas come from glial cells that exist in the supporting tissue of the brain. Meningiomas are typically benign tumors that grow slowly and come from the outer shells of the brain just beneath the skull. Meningiomas are generally found in the cerebral hemispheres, and they can take several years to be detected. The pituitary gland is situated at the lower part of the brain. Its main function is to produce the hormones to control the various glands of the body, such as thyroid glands. A pituitary tumor may affect the operation of these glands (National Brain Tumor Society).

Quick and timely recognition of a brain tumor is of the utmost importance for curing the tumor. It depends on the expertise and professional skills of the doctor and which method is selected to treat the patient for rapid recovery. It is challenging to determine the correct type of brain tumor in the initial phase, yet vital as it helps the physicians treat the patient accordingly [2].

Gastrointestinal is the most commonly diagnosed type of cancer. It activates the gastrointestinal polyps. The method of diagnosis of gastrointestinal polyps is video endoscopy. A small camera enters the human body and is guided by the gastrointestinal tract to reveal and exclude polyps. However, some polyps are considered undetected and may be malignant tumors at some point. To reduce the polyp misdetection rate, “a computer-aided polyp detection system” should be used [3].

Brain tumors can be a major contributor to psychiatric complications such as depression and panic attacks. Early detection of brain tumors has a significant impression on the success of tumor treatment. Gliomas are significant early brain tumors with an extremely high mortality occurrence ratio. Gliomas can be classified as High-Grade Gliomas (HGG), which are infiltrated and more destructive, or Low-Grade Gliomas (LGG), which are of little harm. It is challenging to detect the tumor because it can appear in any shape, size, and location.

Glioma is considered to be the more common type of brain tumor. MRI scans generally segment glioma in necrotic tissue, active tumor, and surrounding edema (ED). Manually segmenting tumors are a slow and repetitive procedure that requires the help of a human expert. Computerized tools play an essential role in glioma segmentation. Glioma segmentation algorithms can be typically distributed into traditional Machine Learning and Deep Learning algorithms. According to a study, a Deep Learning Algorithm (3D Dense UNet CNN) was proposed to classify the output in the whole tumor (WT), tumor core (TC), and enhancing tumor (ET) [4].

The processing of medical images plays a key role in assisting humans in identifying different diseases. Computer tomography (CT) and Magnetic Resonance Imaging (MRI) are two approaches usually utilized for inspecting the irregularities in brain tissues concerning the size, location, or shape of cells, which can help in detecting the tumor in its initial stages [5].

Robust machine learning systems enhance the accuracy identification that supports clinicians in treatment. It is important to choose an effective algorithm with specific characteristics and classifiers to classify the tumor to achieve maximum efficiency. In contrast to traditional manual classification, algorithms are more efficient and accurate in classification [6].

This article proposes a new machine learning (ML) model to overcome this precise segmentation of brain tumors. The proposed intelligent detection model for identifying brain tumors has been classified into four classes: no-tumor, glioma, meningioma, and pituitary. A total of 3264 images has been used in the model, including 926, 937, and 901 for glioma, meningioma, and pituitary, respectively, and 500 for the no-tumor class.

Deep learning replicates the brain in data processing, pattern recognition, and decision-making development. Deep neural networks have the competency of unsupervised learning from unstructured data. Convolutional Neural Network (CNN) works exceptionally well in deep learning, especially recognition and classification of images, speech, or text. Convolutional Network typically contains an inserting layer, a resulting layer, and many undiscovered layers. A series of convolutional layers are linked in the undiscovered layers. The starting function comprises the RELU layer, and the Final Convolution embroils the backpropagation [7].

Salçin [8] proposed the mechanism to diagnose brain tumors in early stages. Magnetic resonance imaging (MRI) images have been analyzed to detect the regions containing tumors and classify these regions into different tumor categories. Deep learning provides relatively efficient results for image classification tasks. Therefore, the Convolutional Neural Networks method has been utilized and implemented via the TensorFlow library in this study. It has been shown that the faster CNN method can yield an accuracy of 91.66%, which is higher than the related work.

Sarkar et al. [9] proposed a model to detect the type of brain tumor using MRI scans. A 2D Convolutional Neural Network (CNN) was designed for classification, which propelled an overall accuracy of 91.3% for detecting meningioma, glioma, and pituitary tumors, respectively. The dataset used in the study contained the data of the three most commonly diagnosed brain tumors.

Ranjbarzadeh et al. [10] recommended a flexible and effective brain tumor segmentation system. This method decreases computing time and overcomes the overfitting problems in a Cascade Deep Learning model. This CNN model mines both local and global features in two different routes. Also, the brain tumor segmentation accuracy is improved compared with the state-of-the-art models. The proposed method achieves a mean WT, enhancing tumor, and tumour core dice scores of 0.9203, 0.9113, and 0.8726, respectively.

Kokila et al. [11] built a model to diagnose brain tumors using Magnetic Resonance Imaging (MRI). It involves detecting the tumor, classifying the tumor in terms of grade, type, and identification of tumor location. This method has utilized one model for organizing brain MRI on different classification tasks rather than an individual model for each classification task. The Convolutional Neural Network (CNN)-based multitask classification is equipped to classify and detect tumors. Identifying brain tumor location is also done using a CNN-based model by achieving 92% accuracy of segmenting the brain tumor.

Gumaei et al. [12] implemented the brain tumor division by combining the Regularized Extreme Learning Machine (RELM). The method first preprocessed images so that the system can read them with ease. For preprocessing, the system used the min–max approach. The min–max preprocessing process was very beneficial in increasing the contrast of input images.

Kaplan et al. [13] instigated mind tumor detection and division by combining both methods. The first suggested method was the Local Binary Pattern (LBP) based on the neighbour distance relation called nLBP, and the second method focused on the angle between the neighbours called αLBP. These two approaches were used to preprocess the MRIs of the most communal categories of brain tumor, namely, glioma, meningioma, and pituitary. The histograms of the preprocessed images were used for characters evolving. This reformed model performed better than the traditional feature extraction techniques.

Yin et al. [14] suggested a Multilayer Perceptron (MLP) neural network-based classification approach to improving Whale Optimization Algorithm (WOA). The hybrid model provided an enhanced version of WOA for better characters evolving and division. In an advanced implementation, noise removal from the images was done using the Median Filter. Feature selection from the extracted features was made using the improved WOA. The MLP-IWOA-based classifier was used for tumor classification showing better results than some existing methods.

Reference [15] combined statistical features with neural network algorithms to develop a method for the division of mind tumors. The framework focused on the Region of Interest (ROI) where the tumor existed. Then, the features were from that input image using the 2D Discrete Wavelet Transform (DWT), 2D Gabor Filter, and statistical features. These statistical features were combined to develop the feature set for further classification. After the feature extraction, brain tumor classification was done using Backpropagation Neural Network (BPNN). A large dataset of tumor images was used for this purpose.

Thejaswini et al. [16] recommended a system for enhanced accurate spotting and division of mind tumors by combining Support Vector Machine (SVM) along with Artificial Neural Network (ANN). The strategy suggested for segmentation of the input images was Adaptive Regularized Kernel-based Fuzzy CMeans Clustering (ARKFCM). After character evolving, SVM was applied for tumor detection, and then ANN was utilized for classifying the brain tumors. The SVM classifier was used to distinguish between tumor and no-tumor images, while ANN backpropagation organized the image into a benign or malignant tumor.

Reference [17] applied Intensity-based Segmentation by using Gray Level Cooccurrence Matrix (GLCM). GLCM works on the grey level image pixels and extracts 13 properties used in classification later. SVM works by creating a hyperplane, and the selection of a hyperplane depends on the kernel. The proposed model consisted of three classes for classification: expected, benign, and malignant, respectively. A genetic algorithm (GA) was used for making the performance of classification better through SVM. GA increased the learning capacity and decision-making of SVM. GA-SVM performed better in the classification of MRIs of the brain.

Sekaran et al. [18] studied that pancreatic cancer is the most dangerous cancer and is supposed to be untreatable. The pancreas malignancy created in the pancreas tissues, which helps in assimilation, is situated behind the lower part of the stomach. The treatment of this cancer depends on the level of its development. The detection of the tumor is done by directly diagnosing the infected portion from the CT scan image. It predicts the image or area of tumor considered using the Gaussian Mixture Model with Expectation-Maximization algorithm and Deep Learning Convolution Neural Network (CNN). “FISHMAN” is a deep learning project used to proceed with millions of images and foretells pancreas cancer at an early stage. It also helps the patients for better treatment for cure. The dataset used for experimenting with this model is The Cancer Imaging Archive (TCIA). This dataset consists of approximately 19,000 images with a size of 10.2 GB. This dataset consists of 82 abdominal CT scan images. The CT scans collected 512 × 512-pixel resolutions with differences in slice thickness between 1.5 and 2.5 mm, which were collected using Philips and Siemens MDCT Scanners. It considered multiple sets of images and diagnosed them concerning the threshold parameters and features obtained using GMM with EM Algorithm stage at training phase. The results of the prediction of cancer for the threshold parameters fed to deep learning are presented by identifying the tumor rate of spread in the head section of the pancreas; after diagnosing and treatment, the spread of tumor size has been decreased. It helped patients to get cured compared to the traditional process of analyzing.

Ito et al. [19] proposed a semisupervised learning method for brain tumor segmentation using MRIs. The researcher suggested a probabilistic approach to eradicate the problem of Label Propagation in the registration-based process. The Expectation-Maximization (EM) algorithm helped the researchers to compute the valid label of a latent image, knowing the probability distribution controlling those latent images before applying the algorithm. The DNN model was combined with the EM algorithm for training this probabilistic model. The model was aimed to recuperate the erroneous labels attached to the initially unlabeled images in the EM algorithm. The method was verified on the two datasets: open benchmark human MR images registered at the Internet Brain Segmentation Repository (IBSR) and the marmoset brain image dataset.

Nadeem et al. [20] recommended a hierarchical framework of SVM and CNN for brain tumor segmentation. The suggested model comprised two segments: confidence surface modality (CSM) generation and brain tumor segmentation using CNN. In the second phase, the proposed CNN architecture took the input of 2D extracted regions from the first phase. The CNN model recommended by the researcher comprises three other pathways (TP) to retrieve a different level of features at every step. Each track processed the 2D image extracted from the respective modality, and then the feature maps were combined. Dice Similarity Score was applied to calculate the system’s accuracy and the BRATS-2015 dataset was used. The novel TP-CNN model achieved 0.81 on the complete tumor, 0.76 on the core tumor, and 0.73 on enhancing tumor.

3. Proposed Model

Internet of medical things (IoMT) aids the health of individuals by mounting the worth of human welfare and life along with shrinking medical expenditures. In IoMT, input components are used for data acquisition, and then users use the input to deliver the preeminent healthcare facility in an effective and protected manner.

The proposed brain tumor identification system revolved around three essential layers: data acquisition, preprocessing, and application. In the first layer, data acquisition, the layer collects the data in raw form. This natural material was then run out to the second layer (preprocessing layer), managed, moved, and normalized. The consistent data will be sent to the prediction layer, the third layer where CNN was applied. The data acquisition layer consisted of variables as input and output. The last layer, the performance evaluation layer, computes the precision and miss rate of the problem. In the decisive area, the conclusion was drawn about brain tumor development.

The detailed flow of the proposed model of Hierarchical Deep Learning-Based Brain Tumor Classifier (HDL2B-TUMOR-CLASSIFIER) is explained in Figure 1. It describes the complete architecture of the system suggested in the study.

The model has two phases: training and validation, respectively. The data are first retrieved from IoMT devices, which are the MR images of the brain. The data acquisition layer processes the data coming from different IoMT devices and passes it to the next layer for preprocessing. Normalization and resizing are the significant steps done in the preprocessing layer to get the given image ready to hand to CNN.

Convolution is the next step of CNN in which the feature extraction is performed on the input image. Convolution is a linear operation as the images are often nonlinear, so ReLU layer is used to increase disconnection in the network. In CNN, characteristics are evolved by the preprocessed image using the convolutional and pooling layers.

Convolutional Neural Network is a multilevel neural network proficient in identifying visual patterns through learning mechanisms. CNN specifies that the network implies a mathematical operation called convolution. Convolutional Neural networks are limited, which utilize convolution in one of the multiple layers of the network rather than the widely known multiplication matrix. CNN uses fewer parameters and connections than the conventional feedforward neural networks, making the training easier. Feature extraction and detection in CNN are not spatially dependent, and higher-level features are acquired as the input travels to the deeper layers.

The conventional neural network typically comprises the input layer, hidden layers, and output layer. It consists of a single or multiple convolution layers and subsampling layers, following one or more utterly interlinked folding and a resulting folding. CNN has multiple layers: parametric layers, pooling, and nonlinearity layers are convolutional and fully connected, taking the input matrix as input, processing it, and classifying it into different output classes. These four possible classes are no-tumor, glioma, meningioma, and pituitary. The evaluation layer assesses the working of classification by inspecting the accuracy and miss rate.

The model retrains itself if it does not fulfill the required learning criteria. After meeting the criteria, the Softmax Transformation Function is used to convert the number vectors into probabilities as defined in the following equation:

In the above equation, denotes the logits vector; various logit vectors will be converted into probabilities via Softmax transformation.

interrelated weights are calculated with the essential learning criteria; the trained network model is stored on the cloud server.

The validation phase consists of the same data acquisition and preprocessing phase. After the preprocessing layer, the tumor classifier network is imported from the cloud, and the input image is tested to validate the model outcome. The model will classify the input image into the four classes mentioned earlier.where  is the number of classes depending on the application.

The mathematical model of the proposed system is comprised of backpropagation by differentiating equation (1) concerning the weights and bias .

Here, we find loss by taking derivate of with respect to weights that consist of two summations as mentioned in equation (4). The first summation initiates from j = 1 to and the second one starts from l = 1 to . Then, these two derivatives are multiplied together. After applying the chain rule, it can be written as follows:

In equation (1), is related to as expressed in the following expression: is given as .

Two cases are discussed and solved, first where I = l, and second, when i = nth unit, where n is the particular neuron focus point in Softmax output where n has the highest values, and the surrounding neurons have values near to zero.

Case 1.
Quotient rule is applied to take the derivative of equation (3):Taking common from equation (6), we getBy taking Anti-LCM, we acquireFrom equation (3), , so the equation can be modified as follows:In the above equation, i! = nth unit, where the probability value is deficient and n is the focal point of Softmax output neurons.

Case 2.
Applying quotient rules to take the derivative of equation (4) with respect to ,By simplifying,As we know that and , we put these values in the following equation: By summarizing equations (9) and (12),As is not available in cross-entropy loss, we do the partial differentiation of concerning .Taking the partial derivative, the equation becomes is previously measured for the Softmax gradient. Two cases are discussed here now: and as in equation (13). Now, equation (15) is distributed into two portions:whereWe can simplify this as follows:We can further simplify this as follows:where represents 1.Now, put the value of in equation (4):where represent the input weights.
The differentiation of loss concerning weights for the fully connected layer is formulated in equation (21).

4. Result and Simulations

MATLAB 2020a is utilized for the outcomes of the hierarchical deep learning model for intelligent detection of brain tumors and their types using a Convolutional Neural Network. CNN-based smart healthcare system is planned for accurate recognition and classification of brain tumors. The dataset was collected from Kaggle [21], which comprised four classes, including one no-tumor and three tumor types. A total of 3264 images have been used in the model, including 926, 937, and 901 for the glioma, meningioma, and pituitary classes, respectively, and 500 for the no-tumor class. The proposed hierarchical deep learning model is split into two phases: the training and validation phases. In the training phase, 87% of input images are picked from each class, and 13% are used in the validation phase. Accuracy (ACC) and miss rate (MR) to assess the efficiency of the model are as follows:

The proposed smart detection model for brain tumor identification has been classified into four classes. no-tumor, glioma, meningioma, and pituitary.

Table 1 shows the input matrix for the proposed HDL2B-TUMOR-CLASSIFIER. A total of 3264 images are used for training and validation purposes. In total, 2870 images, 87% of the total input, are used for the training phase, and the remaining 13%, i.e., 394 images, are utilized in the validation phase. The input samples are further divided into 926, 937, 500, and 901, representing the glioma, meningioma, no-tumor, and pituitary.

In the following mathematical results of HDL2B-TUMOR-CLASSIFIER, the symbols used to represent the input and output parameters are as follows:(i)(ii)  =  (iii)  =  (iv)(v)(vi)(vii)(viii)

Table 2 signifies the prediction results of the suggested HDL2B-TUMOR-CLASSIFIER for training. In total, 2870 input images are used, divided into 826, 822, 395, and 827, representing the glioma, meningioma, no-tumor, and pituitary classes, respectively. For glioma, a total of 826 samples are taken, in which 780 samples are correctly anticipated, 44 are mispredicted as meningioma, and 2 samples are mispredicted as no-tumor. For meningioma, a total of 822 images are used, in which 779 samples are acceptably projected, and 39 and 4 samples are erroneously projected as glioma and no-tumor, respectively. For no-tumor, 395 images are used, in which 375 samples are acceptably projected, and 18 and 2 samples are erroneously predicted as meningioma and pituitary, respectively. In contrast, 827 samples are taken, of which 788 samples are appropriately estimated and 39 are erroneously estimated as no-tumor.

Figure 2 shows the performance of the proposed HDL2B-TUMOR-CLASSIFIER in the training phase. The accuracy is 94%, 95%, 95%, and 95% and MR is 6%, 5%, 5%, and 5% of predicting glioma, meningioma, no-tumor, and pituitary, respectively.

Table 3 indicates the prediction results of the suggested HDL2B-TUMOR-CLASSIFIER for the validation phase. A total of 394 input images are used, which are further divided into 100, 115, 105, and 74, representing the glioma, meningioma, no-tumor, and pituitary classes, respectively. For glioma, 100 samples are taken, in which 92 samples are correctly anticipated and 8 are mispredicted as meningioma. For meningioma, a total of 115 images are used, in which 106 samples are acceptably projected, and 7 and 2 samples are erroneously projected as glioma and no-tumor, respectively. For no-tumor, a total of 105 images are used, in which 94 samples are acceptably projected, and 9 and 22 samples are erroneously predicted as meningioma and pituitary, respectively. In contrast, 74 samples are taken, in which 71 samples are adequately estimated and 3 are erroneously estimated as no-tumor.

Figure 3 shows the performance of the proposed HDL2B-TUMOR-CLASSIFIER in the validation phase. The accuracy is 92%, 92%, 90%, and 96% and MR is 8%, 8%, 10%, and 4% of predicting the glioma, meningioma, no-tumor, and pituitary, respectively.

Figure 4 illustrates the overall efficiency of the proposed HDL2B-TUMOR-CLASSIFIER. The accuracy of all the classes in the training phase is 94.84%, and MR is 5.16%. And the accuracy in the validation phase is 92.13%, and the MR in the validation phase is 7.87%.

Figure 5 represents the proposed HDL2B-TUMOR-CLASSIFIER performance with other state-of-the-art algorithms showing the improved and enhanced accuracy. The accuracy values of Salçin [8], Sarkar et al. [9], Kokila et al. [11], and Ranjbarzadeh et al. [10] are 91.66, 91.3, 92.00, and 92.03, respectively, and the proposed HDL2B-TUMOR-CLASSIFIER in this study showed 92.13% accuracy.

5. Conclusion

The brain tumor is considered to be fatal cancer in adults and children. The common types of primary tumors found in adults are glioma, meningioma, and pituitary. Numerous methods have been suggested and inspected in the literature for detection and classification of the brain tumor to expand the possibilities of treatment and endurance of the patients. A Hierarchical Deep Learning-Based Brain Tumor Classifier is proposed using CNN in the present study. The model classified the input into four classes: glioma, meningioma, pituitary, and no-tumor. The proposed model accomplished 92.13% accuracy, and MR was 7.87%, superior to existing brain tumor detection and segmentation methods. The system also classifies the tumor into different classes after tumor recognition. The proposed system will provide clinical support in the medical field.

Data Availability

The data used in this article are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.