DiaMe: IoMT deep predictive model based on threshold aware region growing technique

Medical images magnetic resonance imaging (MRI) analysis is a very challenging domain especially in the segmentation process for predicting tumefactions with high accuracy. Although deep learning techniques achieve remarkable success in classification and segmentation phases, it remains a rich area to investigate, due to the variance of tumefactions sizes, locations and shapes. Moreover, the high fusion between tumors and their anatomical appearance causes an imprecise detection for tumor boundaries. So, using hybrid segmentation technique will strengthen the reliability and generality of the diagnostic model. This paper presents an automated hybrid segmentation approach combined with convolution neural network (CNN) model for brain tumor detection and prediction, as one of many offered functions by the previously introduced IoMT medical service “DiaMe”. The developed model aims to improve extracting region of interest (ROI), especially with the variation sizes of tumor and its locations; and hence improve the overall performance of detecting the tumor. The MRI brain tumor dataset obtained from Kaggle, where all needed augmentation, edge detection, contouring and binarization are presented. The results showed 97.32% accuracy for detection, 96.5% Sensitivity, and 94.8% for specificity.


INTRODUCTION
Diagnosis process based on medical images and scans plays an important role in medical domain, since magnetic resonance imaging (MRI) and omputerized tomography (CT) images show the internal structures for different biological organs in a clear way that help expertise in planning for treatment, monitoring severity and development of patients status happened so far, and provide a more confident insight about patients' conditions. Automatic analysis for such medical images to aid doctors and specialists in their decision is one of the most important tasks that attract researchers in both computer vision and artificial intelligent domains. One of the most important problems that face them is the segmentation process of the medical image that precedes the analysis, and aims to identify the exact boundaries of abnormal regions (e.g. tumors) based on images. The variety of medical image capturing methods (e.g. MRI, CT, ultrasound, 2D vs. 3D) makes segmentation process is more challenging. Since, manual segmentation is time consuming, and could provide an inaccurate detection, many segmentation algorithms based on different medical images have emitted from different sensors or electronic devices and lead to high intrusion, and they recommended to work end-to-end for transmitting data between sensors and the predictive model, especially in the learning phase. In Bianchi [27], authors detect the vital processes of human by HAAR algorithm for detecting surrounding objects. Since both ECG and human vital process were tackled in many previous studies such as in [24], [25], [30], it was better for authors to focus on the details of the interoperability of cloud architecture and the integrated IoMT environment, and shows the details of the used paradigm.
A cloud-based system deployed on Azure was proposed by [28] for public use. The system relies on readings from EEG electrodes that are sticked behind the person's ears to detect abnormalities in the person's brain. The system would notify the person if they need to consult a physician. Some of the drawbacks that can be seen in this system includes not identifying the specificity of the disorder the person is facing and the type of consultancy they might need.
Another system was developed by [29] that uses discrete wavelet transformation and probabilistic neural networks to classify tissues into one of three classes: normal, benign, and malignant with high accuracy. The system relied on IoT technology to work with datasets hosted on cloud servers. The shortcomings of this paper appear in not presenting any details about how the data is stored or manipulated to allow for user-system interaction through the cloud layers. Moreover, the paper didn't present the IoT paradigms used or the details of the system's main components.
Other works used convolutional neural networks (CNNs) to detect brain tumors [31], [32]. With CNNs of three and four layers, the system would suffer for being time expensive and high complexity. The work presented in [31] has relied on big data methods but without giving explicit description on the data used nor providing any details on the utilization of the veracity, velocity or other known characteristics of big data and how they overcame these problems.
The region growing segmentation algorithm has report successful achievement for brain tumor segmentation to obtain the region of interest (ROI). However, the main challenge is selecting the seed points to reach accurate results. Selecting the seed points may be semi-automatic (manually) or fully-automatic as shown in [33], [34]. Authors in Sarathi [33] selected the seed points manually during the run of their model and reach the ROI easily. Although semi-automated or manually selecting the seeds are inefficient in many data nature or model objective, however it was suitable to their model and objective. They also developed a wavelet features based region growing segmentation method, then significant wavelet feature points were used instead as a seed for the best ROI is extracted. Authors in Cui [34] applied binary fusion of two MRI images and generated the initial seed points for the region growing algorithm fully-automatic. In fact, their model reported success, but the overall performance suffers from inconsistency. The inconsistency appeared due to the randomization in selecting the seed points.
DiaMe as an IoMT cloud service has been introduced in [1], [35], it contains various sensors types, connected either end-to-end or remotely, and provide multiple functionalities such as ECG monitoring and disorder detection, alarming for critical cases, tumors detection for kidney and brain, and others. Ensemble technique based on multiple types of classifiers, to improve the interoperable symptoms, is used. In addition, to guarantee high accuracy; a crawler is added to search for diagnosis from a massive data repository. In this paper, we focus on the detecting process of brain tumor to improve the accuracy of the prediction process that has been developed in the DiaMe service. The model implemented CNN as a deep learning methodology using 2062 real MRI cases for different brain tumors types and positions, data was obtained from Kaggll datasets [36]. A hybrid image segmentation technique, that combine between region growing segmentation and threshold-based segmentation algorithms, for extraction accurate region of interest (ROI) over the brain tumor MRI is implemented. And a comparative analysis between results gained from the implementation of the hybrid segmentation technique and other different segmentation techniques done on the same data set is introduced to clarify the improvement that has been achieved from implementing such hybrid segmentation technique.

IoMT DIAME SERVICE
DiaMe is IoMT health service uses IoT and cloud layers for more accurate predictions, service availability for both doctors and patients, and secure transmission of information. Figure 1, represents the paradigm of DiaMe service and the interoperability between different modules in the service. The various data is received as heterogeneous data from different resources such as sensors, scans and interaction data between the service and the user. The classifier agents controls several agents and manipulates the different input data using integrated classification techniques, and the data storage contains the raw data, extracted information, resulted charts and reports, and others.
In DiaMe service entered data is received either directly from end users' entries or remotely gathered by sensors based on the users choices. Users can enter the MRI or CT scans of his/her kidneys, brain, liver and others as seen in Figures 2(a) and (b), and the main classifier agent has the ability to analyze such scans and show out the different types of tumors, disorders, cancer, cysts, stones, and more. Then, the classifier agent sends the results to the DiaMe service to alert the abnormal readings or scans, marks the disorder, as seen in Figure 3, and shows the medical conditions or the user with accuracy. For example, the service activates an aiding function for specialists and doctors to enter brain MR images, then allow doctors to search for tumors by uploading scan, convert it into gray levels, detect edges, segment and detect the abnormal regions, and predict the diagnosis of the case, either tumor or normal, as seen in Figure 4, for more details see [1], [35].

TRG SEGMENTATION AND CNN DEEP ARCHITECTUR
In this section the brain tumor detection by the classifier agent (CA) is represented in details. Targeting enhanced prediction, the agent was multi-trained using different literately reported segmentation algorithms with CNN. Data pre-processing, proposed architecture of model, setting parameters for training, validation and accuracy of the agent are describes in the following subsections.

MRI sources and initial settings
253 brain CT cases (155 are tumorous and 98 are non-tumorous) were downloaded from Kaggle [36]. Based on the fact that CNN models and neural network in general learn by examples; these models need a large number of cases or examples. Therefore, data augmentation is a main pre-processing step that helps in cultivating the training of the deep model.

Preprocessing
Training the convolution neural network (CNN) is among many machine learning models that learn by examples such decision trees and all traditional neural networks (NN, RNN, and DNN). These models enhance the generalization performance and to mitigate the overfitting during training with the increase of the the number of examples or simply the available data for training. Another constrain for developing these models for a specific domain, is the existence of balance dataset between positive samples and negative samples like in predicting tumor, where a binary class problem is a main objective. Accordingly, augmentation of the downloaded data was mandatory to enrich the small number of the available data. Examples of the augmentation may include (deforming, translation, rotation and flipping) of the tumor. Figure 5, illustrate two samples of the augmentation operations in the MRI. After augmentation, the dataset increased to 2062 MRI (1083 tumorous and 979 non-tumorous). For the preparation of the MRI towards implementation of a segmentation algorithm, some additive treatment for image is necessary like specifying edges, cropping (focused area of the CT is determined), binarization (the CT is converted from 256 gray levels to a black and white or binary level), contouring (the structure lines of the CT is determined to help finding important segments), skull stripping. Figure 6 shows a sample of the mentioned gray level preprocessing: The top figure is a positive tumor case (tumor exist) and bottom Figure is a negative tumor case (no tumor exist).

Segmentation
Accurate automatic segmentation for medical images is crucial and time saving for tumor detection. Although many techniques have been proposed, however this research area still attract the researcher attention for more enhancement. In Addition, one segmentation algorithm is usually not appropriate to handle the variation in the scanning resolution and noise existence in multi-source medical images. Also, in the variation size and position of the tumor itself, accordingly, we combined two types of segmentation algorithms, the region growing Segmentation and the threshold-based segmentation to extract the ROI.

Region growing segmentation
The region growing segmentation [37] gained its name from its procedure which depend on selecting manually a seed point (a specific pixel), then this point is compared with neighbouring pixels, where close nature neighbouring pixels (similar intensity or colour) are added to the seed point to construct initial region that grow with each addition. As the neighbouring pixel start to be different, the region stops growing and another seed point is selected for another region and so on till regions are all determined. Traditional classification methods therefore could classify different regions based on similarities. The manual selection of the seed point is also called semi-automatic segmentation and the selection occur during the execution time, while the full-automatic selection happens when selection is based on maybe centre pixel, random and/or high intensity. The mathematical (1-3) present the formulation of the algorithm.
Where P is pixels set that the border is at least one of the areas and Np(a) is set of neighbouring pixels for pixel a. Asi is the set of iterative seed points. For a Є P, Np(a) meets just one of the ASi by connected neighbours to the pixel a. Then i(a) Є {1, 2; 3,…. n} is defined such that N(a) ∩ Asi ≠ 0 and λ(a) is defined to be the minimum difference between Np(a) and α considered as a measure of similarity that α is the region mean.
where gl(a) is the grey value of the CT point a and α defined as. where n is the number of pixels [38]. The Region growing segmentation in some data types like the case of CT or MR Images where noise or variation of intensity exist, it may result in detecting unreal or unimportant regions.

Threshold based segmentation
Thresholding based segmentation is an easy to implement and faster results are obtained as the algorithm depends one (Single value threshold) or more (Multi-threshold) intensity threshold values. In both scenarios, these values of threshold are compared with pixel intensities. Selecting the right threshold value Tv, binarization is applied on the gray image pixels ( , ), where the outcome contains the entire decisive information about the objects position and shape, see (4).
The threshold segmentation, achieves satisfying extraction of ROI only when homogeneous intensity exists in the MR images. Unfortunately, intensity in the brain tumour is not homogeneous [39]. However, the experimental computational results proved that, it combines strengths by hybridization with the region growing segmentation. Some more segmentation algorithms that are based on contouring like cluster segmentation, region-based segmentation and watershed algorithm; reported good results, however may suffers from over-segmentation [40].

CNN deep architecture
Convolution neural networks have been used in medical image classification and proved a super results. CNNs consist of several layers that learn hierarchy of features automatically. Taking CT or MRI as input, they convert raw pixels to final class scores by passing them through series of learnable convolution filters. Figure 7, shows illustration of convolution operation and pooling for a sample MR pixel values, where, the filters are the set of assigned weights that have a spatial relationship to images. Hence plotting will result a two-dimensional images. The convolution layers comprise of convolution filters with a small receptive field of 3 × 3 and a spatial padding. Applying such set of filters on the input medical images provides the set of features map. Figure 8, depicts the model architecture, it consists of two main convolutional layers. Some details on the setting the parameter of the proposed deep model are: The input MRI is of a normalized size of (128,128,3), the Padding of size (2,2) is used for keeping the identical size of MR images from shrinking or changing. The filter as in Figure 8 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 rectified linear unit (ReLU) is used as a mapping between the inputs and the output. Max pool stride of 2 is set as a non-linear sub-sampling layer to reduce the space dimensions and focus on valuable features toward accurate classification.

VISUALIZATION AND PERFORMANCE ANALYSIS
Targetting the visualization of segements, Figures 9 and 10 show the results of applying different segementation algorithms for two positive of brain tumor cases and two negative brain tumor cases, respectively. In both figures, the first vertcail subfigure shows the origin case, then threshold segemenation, watershed segemenation, cluster segemenation, region based segemenation and the hybrid method that combine region growing and threshold segementation. From threshold figures, we can see that threshold and origin based segementation highlighted the tumor position and size, however both included more wrong points and assigned the charcteristics of tumor to these points. Also, from the figures, we can see watershed, cluster and the proposed method, could even visually present the most accurate results for these samples. More on their accurate classification when injected to the deep model will be presented below. This visualization characteristic ensures the reliability of the proposed image segmentation and provides the ability to resist noise. However, a close verficiation will be concluded from the performance of the overall proposed deep model for the tumor detetction. As the proposed predictive model targets enhancement in prediction, the performance analysis depends on accuracy value. As shown in Figure 11(a) and (b), the average of the training accuracy and validation accuracy developed with varying image sizes of (16,16), (32,32), (64,64) and (128,128). The figures validate that in general, the average classification accuracy and the average validation accuracy  (16,16) and (32,32) are very close to each other, and the same conclusion for images size (64,64) and (128,128), whereas the higher accuracy for both is achieved setting the images size to (128,128). In addition, Figure 12 shows the classification mean accuracy of variant filter sizes [from 8 to 64]. The classification accuracy decreases with the increase of filter size. In fact, the smaller the filter size, the deeper learning handles of a small set of pixel, which in turn, leads to faster performance. Usually, the larger the filter size, the more general features obtained. But in searching for tumor in MRIs, a smaller filters focuse on local features (tumor) and achieve the objective of the model. Moreover, the mean accuracy is increased when pooling size is decreased, this is because smaller pooling size keeps all important features while eliminating noise. And hence, it decreases again when the pooling size is increased, where the main task is dimensionality reduction. Figure 13(a) shows the model configuration of training and validation accuracy. The optimal setting parameters for configuring the proposed model was epoch=50 and each epoch consist of 50 steps, the image size= (128,128). Then the classification accuracy, loss, validation accuracy and validation loss were recorded as in the Figure 13 Table 1 shows a comparison between results of the introduced hybrid segemantation technique and other techniques that have been used on the same data set. Where, the lowest accuracies were obtained from the threshold and the growing region algorithms, with consecutive accuracies 91.11 and 93. 6. Despite the region based algorithm has high accuracy with 97. 13 but it is not the highest. The maximum accuracy is obtained from the hybrid TGR technique with 97.32. In addition, the CNN classifier model results are compared with other machine learning classifier models for brain tumor detection from medical scans. As presented in Table1, the lowest accuracies were obtained from the SVM based (BWT) and the KNN classifiers with 90.54 and 93.0, whereas, the CNN classifier model accuracy, based on the TRG hybrid technique shows 97.32.

CONCLUSION
This paper focuses on improving the brain tumor detection process as a new task in the previously introduced IoMT service annotated as DiaMe. The main paradigm of the service has been presented and a more detailed block diagram for detecting and predicting brain tumor from MR images using CNN model based a hybrid segmentation technique is presented. The MR images in this study contain 253 different cases, 155 tumors, and 98 normal. The number of cases was increased to be 2062 cases by augmentation process, with 1083 tumorous and 979 normal cases. As seen in Figure 13(b), 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. In order to achieve high accuracy, and to increase the reliability and generalization with respect to variation of tumors sizes, locations and shapes, a modified threshold region growing segmentation algorithms (TGR) that integrates both the threshold and the growing region algorithms for boundaries detection, has been implemented as a hybrid technique. Based on the results shown in Tabel 1, the proposed hybrid technique achieved the higest accuracy (97.32%). Accuracy improving using CNN as predictive model was expected, especially when combined with the TRG hybrid technique, 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.