Deep Learning-aided Brain Tumor Detection: An Initial Experience based Cloud Framework

Received Apr 30, 2020 Revised Dec 4, 2020 Accepted Dec 29, 2020 Lately, the uncertainty of diagnosing diseases increased and spread due to the huge intertwined and ambiguity of symptoms, that leads to overwhelming and hindering the reliability of the diagnosis process. Since tumor detection from MRI scans depends mainly on the specialist experience, misdetection will result an inaccurate curing that might cause critical harm consequent results. In this paper, detection service for brain tumors is introduced as an aiding function for both patients and specialist. The paper focuses on automatic MRI brain tumor detection under a cloud-based framework for multi-medical diagnosed services. The proposed CNN-aided deep architecture contains two phases: the features extraction phase followed by a detection phase. The contour detection and binary segmentation were applied to extract the region of interest and reduce the unnecessary information before injecting the data into the model for training. The brain tumor data was obtained from Kaggle datasets, it contains 2062 cases, 1083 tumorous and 979 non-tumorous after preprocessing and augmentation phases. The training and validation phases have been done using different images’ sizes varied between (16, 16) to (128,128). The experimental results show 97.3% for detection accuracy, 96.9% for sensitivity, and 96.1% specificity. Moreover, using small filters with such type of images ensures better and faster performance with more deep learning. Keyword:


INTRODUCTION
Medical misdaignose has spreaded widely these days and lots of people suffering directly or indirectly from such misdiagnosing. passing away and permanent disabilities are consequences of misdiagnosis that results from misanalysis for medical conditions and wrong medication treatment. Reasons for misdaiagnosis and mistreatment varied widely including but not limited to, insufficient knowledge about certain diseases, the often symptoms overlapping of different diseases, and mis-ordering of laboratory tests. Therefore, researchers dedicate their efforts to harness data science and Internet technologies searching for solutions for such misdiagnosis disaster that increases by time and by discovering of new diseases. Moreover, lots of new scientific terms have appeared to represent the deployment of the mentioned technologies in health domain. Such as, eHealt, mhealth, cybermedicine, and IoT [1][2][3][4][5][6][7][8]. Early, in nineties, Cybermedicine, as a synonym for eHealth [1,9,10], presents the provision of the health care through the Internet, where patients' medical records including special and historical conditions are saved and shared with doctors and specialists, who directly can access such saved data through the Internet to communicate with patients and recommend drug prescriptions, medicine portions, advices, or even online appointment without physical visits to clinincs [1,2,3,11,12]. WebMD [13] is an example of such applications that utilized the cybermedicine concept using internet connection and developed in the bussiness domain successfully.regardless of the wide spreading of the cybermedicine applications specially in the bussiness domain, many concerns were act as obstacles, such as the problem of communication security, where personal data leakage or hacking processes were found through communication channels and enterprise database management systems. Later on, the IoT ecosystem flourished entailing embedded objects with sensors, software, and network connectivity to communicate with each other for data collection and exchange [7,14,15]. In e-health domain, IoT concept plays a prosper role for remote monitoring of patients' vital processes and alarm the crucial conditions [16,17,18,19]. It uses the power of the intelligent and smart devices that are connected, to provide an abundance of information repositories. Such information is processed, classified and analyzed based on specific models, that provides an actionable insights in the diagnosis decisions. Recently, the cloud computing in ehealth domain appeared and propagated widely. It consists of several layers including clouding infrastructure as a service (IaaS) and software as a service (SaaS) layers, and provide a scalable, on-demand, flexible, and secure environment for health care domain that assure low cost and secure services [20,21,22,16]. Recently, the cloud computing in ehealth domain prospered widely due to its availabilty, scalability and its security features [16,20,21,22], where in turn, such characterstics were a main lack and major weak points the cybermedicine domain suffered from. Accordingly, medical and health care services provided based on IoT and Cloud infrastructure will provide a more reliable diagnostic decisions that enjoys certain advantages as presented in [23].
In [23,24], we have proposed a new medical diagnosis service, that uses the IoT and cloud IaaS to avail from the previously mentioned characterstics. The service contains several layers and uses multiple classifier agents to assure accurate decisions. It aims to enrich the eHealth domain, by providing a new layer in the SaaS cloud architecture, introducing a proactive monitoring diagnostic system that collects different information continuously about patients, processing various types of input data either analogue or digital (numeric, continuous, images), deliver an interactive system, not only for diagnosis but also for knowledge education about different types of chronic diseases, that aids in the management and diagnose processes. Accordingly, in this paper, we are motivated to continue the development in our medical service by focusing on brain tumor detection and prediction as one of the multiple functions of provided service. a CNN model has been developed using real MRI for 2062 cases for brain, after processing, training and validations, the model shows a significant results than other researches that have been done on the same dataset. such that, the developed model shows higher accuracy, specificty, and sensitivty and lower loss.
The following sections are oragnized as follows: Section 2 represents the related work, Section 3 describes briefly the IoT service, Section 4 explains the CNN developed model in details, Section 5 explores and discusses the performance analysis and accuracy of the results, and finally Section 6 presents the conclusion.

RELATED WORK
Lately, lots of Home medical services have been devloped and issued for useage through the internet based on IoT embedded objects and cloud IaaS. Some of these services focused on utilizing the features of cloud to gurantee a secured application, and others achived smartness throught the IoT for critical condition monitoring [17,26,27,28].
In [19,27], the authors proposed a healthcare model that combines IoT-cloud technologies for pathology detection and classification, within the smart city or smart homes perspective, using remote sensors. In [19], they focused on the ECG prediction using two different types of CNN in order to measure the accuracy and represent the most accurate model, and they concluded that the AlexNet model is more accurate and sensitive for their data set. Moreover, they concluded that working using remote sensors is difficult due to multiple types of signals that will cause intrusions and noises for the ECG sensor signals, and it is better to use end-to-end data transmission, especially in the learning phase, where in [28] authors focused on the general vital human processes detection using HAAR algorithms for object detection. Despite showing a deep study for the CNN model for the ECG prediction, or human vital processes, detection for ECG and vital processes were measured extensively before in [26,27,29], they missed the deep view for the health care model main components and the interactivity or integration with the cloud, smart city or smart homes architectures, instead they represented a general framework paradigm as a cognitive smart healthcare system.
In [10], authors focused on providing a home care service for precaution knowledge as a protection phase before getting badly infected or sick depending on cloud Lucene ditributed cluster.The application provides an on-demand data storage model as well as an elastic scalable model that manage the rush hour access. It uses bloom filter signature, and formal concept computation for data analysis. However, it needs an offline specific Lucene data file, either to be prepared manually or automatically. Where, automatic formation for such file seems to be very difficult, it enjoys elasticity but looses self adaptation in the online mode.
In [31] authors proposed a system on Azure as a deployment for the cloud technology and be a shared for public usage, where they used the EEG electrodes, that is sticked behind the ears and its signal is read by the developed system to detect the abnormalities in the human brain and shows an alarm to notify the users to consult a physician. Despite detecting the human brain abnormalities is important but it missed the specificity of the disorder he/she faced, or the type of consultant that they should be given, it was better to continue and focused on specific type of brain diseases that can be declared by the EGG waves at the early stages.
In [32], authors detected brain tumor using discrete wavelet transformation, and classified the tissues to three classes of normal, begin and malignant using Probabilistic Neural network to achieve more accuracy. Authors depended that the IoT concept is deployed automatically if the dataset were located on the cloud servers, without presenting any details about how the data will be stored or manipulated to have user-system interaction trough cloud layers, or even the IoT paradigms or vision for the developed system main components.
In [32,33], authors focused on detecting brain tumors, from MRI, they implemented segmentation using (CNN) and used different databases to predict multiclass classification of tumors. CNN with three and four layers was used in their classification and prediction processes, which cause much more time with high complexity. We believe that if authors used two CNN layers it would lead to the same results with much less cost for both resources and time. Moreover, in [32] authors used multiple datasets as a Big data without presenting any insights about the deployment and utilizations of the veracity, velocity or any other known characteristics of big data and how they can overcome such problems. In [9], authors developed an IIoT-ecosystem for health care that is shared between multiple stakeholders, such as doctors, patients, drug organizations. the paper focused on the wavelet transformation for ECG signal analysis, they used watermarking technique to gurantee more secure data transmission process [23,24,29].
In [23,24] we introduce a novel medical diagnostic service that uses multiple types of sensors, remotely or M2M, for monitoring, such as the ECG for heart beat. The process of diagnosis is performed using bagging, and different classifiers are used to discover the symptoms' ambiguity. The service will manipulate multiple types of data, analogue, scans (images), and digital, and offers various functionalities, such as disease prediction, patient monitoring, and diagnosis through symptoms analysis, information searching and retrieving for different symptoms or new disease. In this paper, brain tumor detection and prediction is developed as a new task for the classifier agent entailed in the medical service. A CNN model is developed based on real MRI for 2062 cases for brain, with1083 tumorous and 979 non-tumorous. Such data was obtained for Kaggel datasets [37]. After pre-processing, training, and validation phases using different images' sizes, the model shows better results than other researches that have been done on the same dataset, where, a higher accuracy, specificity, and sensitivity and lower loss is obtained.

SERVICE ORIENTED ARCHITECTURE
The IoT and cloud computing is utilized, in the proposed service, to assure accuracy, ubiquity for both doctors and patients. As shown in Fig. 1, the service entails three main layers, the outer layer, that is responsible of gathering heterogeneous data from different resources such as sensors and scans and the interaction between the service and the users, the intermediate layer, that deploys multiple classifier agents to manipulate the different input data using integrated techniques, and the inner layer, that contains necessary knowledge and data using different phases for data storing and to facilitate the retrieving process. The outer layer, in the service, permits selecting of a particular part of the body, and enter different types of the available data, either scans or test laboratories' results depending on his/her choice. As example, it allows the user to enter the scan of his/her kidneys, brain, liver and others as seen in Fig. 2 (a) & (b), and the master classifier agent, in the intermediate layer, analyzes such scans and predicts different types of tumors, disorders, cancer, cysts, stones, and others. It detects patient's abnormal scans, marks the disorder, as seen in Fig. 3, and reports the user's conditions. Moreover, the service provides a special Search function that is activated only for specialists and doctors. Such functiont allows the doctor to search in previous cases by diagnosis, symptoms, or both, and follow up specific patient conditions. Furthermore, doctor can use the service to search for scientific papers on specific topic or specific disese, in specific time duration, and the inner layer uses the crawler to retrieve the needed information. The retrieved information is preprocessed, sorted and presented to the doctors giving them the ability to explore between the results' items, as shown in Fig. 4. For more details and clarification about the interoperability, functions, and modules see [23,24].

CNN MODEL AND EXPERIMENTAL RESULTS
In this section the brain tumor detection by the classifier agent (CA1) is represented in details. In order to obtain more accurate prediction, the agent was trained and verified using CNN. Data source, pre-processing, training, validation and accuracy of the agent are describes in the following subsections.

Data source and experimental setup
The used CT scans for the brain tumor is obtained from Kaggle [37]. It originally contains 253 brain MRI cases, 155 cases are tumorous and 98 are non-tumorous. Since such number of cases is not enough for the prediction and training of the CNN model, pre-processing phase has been done to increase the number of cases and aid in cultivating the training process, as explained in subsection 4.2.

Preprocessing
In order to use the convolution neural network (CNN) for tumor prediction, and avoid the overfitting and poor generalization performance, increasing the number of cases for training the model was mandatory. Keeping in mind that, it is important to keep the distribution of data classes (tumor and no tumor) balanced. So, the data have been enriched by adding more cases, where, augmentation pre-processing phase (translation, rotation and flipping) and contour detection have been used. Where, contour detection was used to extract the region of interest and reduce the unnecessary information in the images. Fig. 5, shows a sample of such augmentation pre-processing. As a result, the dataset became 2062 cases, 1083 tumorous and 979 nontumorous. An N-fold data set selection is used to choose 70% of the cases as training and 30% as test. After then, data segmentation process has been applied to find segments inside that are likelihood to be tumor using image conversion/binarization (gray level). In which, images have been converted from 256 gray levels to a black and white or binary level. As shown in Fig. 6, pixels that are likelihood to the tumor range are converted into white (1), while others are converted into black (0). Gary conversion is a necessary image processing phase to help digitalising segmentation of tumors or generally differentiate entailed objects.

Visualization filters and features extraction
Machine learning approaches are divided into two areas, traditional algorithms and deep learning algorithms. In the first, features extraction is needed and valuable step towards classification or clustering objectives. However, a privilege of using deep learning methods is the automatic extraction of features and erasing the burden of selection. Therefore, the visualization of images filters and features using deep learning model usually don't drag a great attention during implementation of the proposed system. Meanwhile, if visualized, it certainly will add an interval of confident of the obtained results. A simple visualization of features is achieved directly by plating them from the proposed system layers.
The filters are the set of assigned weights that have a spatial relationship to images. Hence plotting will result a two-dimensional images, see a sample of such filters below in Fig. 7. As mentioned in our description of the model layer, 3x3 filters were used for easier interpretation and matching architecture concerns. Applying such set of filters on the input medical images provides the set of features map. In fact the proposed model consists of two main Convolutional layers. The feature map dimension is 128x128x32. Drawing these 32 features as two dimension images of 8x8 squares are depicted in Fig. 8, for No Tumor cases and Fig. 9, for Yes Tumor cases.

CNN building layers
Convolution Neural Networks have been used as a machine learning imitator for the biologically construction of human brain. CNN is built from set of neurons that have learnable weights and biases. Each neuron recieves inputs multiplied by a weight and followed by an optional non-linear transformation. The neurons are classified as input, hidden, and output nodes. In a CNN each neuron is partially connected to a sub set of neurons in the previous layer and unlike other models, it is fully connected. As shown in Fig. 10, the construction of the CNN for detecting brain tumor: • The input CT scans are unified with size (128,128,1).
• The convolutional layer uses filters to convolve the input.
• The filter is slided along the input by computing the product between the values in the filter and the input to construct most discriminative feature map of each image. • The ReLU (Rectified Linear Unit) is a sigmoid activation function used as a computational mapping between the multiple inputs and the output.
The pooling layer is a non-linear sub-sampling layer that is used to reduce the space dimensions and focus on the most important features needed in the classification for detection.

PERFORMANCE AND ACCURACY
The performance measurements are the accuracy of the network, which is the main target of the classifier. As shown in Fig. 11 (a&b), the mean and standard deviation of the training accuracy and validation accuracy developed with different image sizes varying from [(16, 16), (32,32) figure represents that the accuracy in general increases by increasing the number of Epoch, and the accuracy of the images of (16,16) and (32,32) are very close to each other, and the same for images of size (64,64) and (128,128), whereas the higher accuracy is achieved by images of size (128,128). On the other hand, Fig.12, shows the training and validation loss for the same sequence of different image sizes respectively, the mean of the loss for both training and validation inversely proportion with the images size; it decreases with the increase of the image size. As a result, if the image size is small, the information in the image is not enough to predict tumor perfectly, while with bigger images, the mean accuracy in training and validation increases and the standard deviation increases as well, since there are many pixels in the image, some of them do not belong to the object itself, but the surroundings. Fig.13 shows the classification mean accuracy of different filter sizes varying from 8 to 64. It is observed that with bigger filter size the classification accuracy decreases, while smaller filter size increase the accuracy. Smaller filter size ensures a better performance because it looks at very few pixels at once that leds to faster performance and more deep learning. Usually larger filters focus on general features but in our case smaller filters focus on local feature (tumor existence). Moreover, the mean accuracy is increased when pooling size is decreased, this is because smaller pooling size maintain all important features by slower focused deep learning and with no information lose beside focusing on eliminating noise. And hence, it decreases again when the pooling size is increased, where the main task is dimensionality reduction.

CONCLUSION
In this paper, a new detection and prediction task has been developed and added to the classifier agent in the adaptive diagnostic service. The paper introduced a brief description for the main layers of the service and focused on the detection and prediction of the brain tumor using CNN as a new added task to the embedded classifier agent. The original MRI data for brain was obtained from [37], it contains 253 brain MRI cases, 155 cases are tumorous and 98 are non-tumorous. Since 253 cases is not enough for good prediction, cases were pre-processed by augmentation in order to be enriched and increased. After augmentation process, 2062 cases were obtained, 1083 tumorous and 979 non-tumorous. As seen in Fig. 15, the accuracy and the loss of the model have been improved after augmentation preprocessing in both training and validation phases, where different images' sizes varied between (16,16) and (128,128) have been used to improve the learning ability of the model.
After building and developing the CNN model, using 3x3 filters to provide the set of features map, results show higher accuracy and better performance than other machine learning techniques that have been implemented on the same data set as seen in Table 1, where the KNN shows 96.7 as max accuracy, and SVM shows 97.1, whereas the CNN model shows 97.3 accuracy.
Accuracy improving using CNN as predictive model was expected since CNN as a deep learning technique is faster in prediction and concentrates on the spatial distribution of the input data, whereas most machine learning techniques such as KNN and SVM focus only on the feature extraction and the matching between previously existed information.