Detection and Localization of Early-Stage Multiple Brain Tumors Using a Hybrid Technique of Patch-Based Processing, k-means Clustering and Object Counting

Brain tumors are a major health problem that affect the lives of many people. These tumors are classified as benign or cancerous. The latter can be fatal if not properly diagnosed and treated. Therefore, the diagnosis of brain tumors at the early stages of their development can significantly improve the chances of patient's full recovery after treatment. In addition to laboratory analyses, clinicians and surgeons extract information from medical images, recorded by various systems such as magnetic resonance imaging (MRI), X-ray, and computed tomography (CT). The extracted information is used to identify the essential characteristics of brain tumors (location, size, and type) in order to achieve an accurate diagnosis to determine the most appropriate treatment protocol. In this paper, we present an automated machine vision technique for the detection and localization of brain tumors in MRI images at their very early stages using a combination of k-means clustering, patch-based image processing, object counting, and tumor evaluation. The technique was tested on twenty real MRI images and was found to be capable of detecting multiple tumors in MRI images regardless of their intensity level variations, size, and location including those with very small sizes. In addition to its use for diagnosis, the technique can be integrated into automated treatment instruments and robotic surgery systems.


Introduction
A brain tumor is an abnormal mass of tissues that grows and multiplies rapidly. It can originate within the brain, which is called primary brain tumor, or in other surrounding areas and moves to the brain at a later stage, which is called metastatic brain tumor. ere are more than 120 types of tumors classified as benign or malignant (cancerous). Cancerous tumors cause serious health problems such as severe headaches, blindness, and paralysis [1]. e timely detection and diagnosis of these tumors at their very early stages help clinicians to decide the most appropriate treatment protocol.
Magnetic resonance imaging (MRI) is one of the most advanced medical imaging modalities. It is a noninvasive so tissue contrast imaging used for the diagnosis of tumors within the human brain tissues [2]. MRI system produces image scans through the application of a combination of radio waves and a strong magnetic field to align the magnetic spins in body organs along the magnetic field. When the radio frequency is turned off, the spin system produces a signal, called the free induction decay (FID) signal, which reflects the water content of brain tissues. e FID signal is processed further to give a two dimensional (2D) image of the organ tissues. MRI systems are capable of producing images of different sections (slices) within the brain with no overlap of other anatomical structures, which can provide detailed information about brain tumors such as exact location, shape, and size. is information can help clinicians and surgeons to reach an accurate diagnosis of tumors in order to determine the appropriate treatment procedure/protocol such as surgery, chemotherapy, and radiotherapy [3]. Manual extraction of the essential clinical information from the MRI images is not an easy task because of the complex nature of these scans, which requires interpretation by skilled and experienced medical professionals. Moreover, the large number of MRI images recorded in hospitals and clinics, makes manual segmentation a very tedious and time-consuming task. To accelerate the diagnosis process and make it accurate and reliable, various automated segmentation and detection techniques were developed [4].
International Journal of Biomedical Imaging 2

Related Work
Brain image segmentation begins with image preprocessing which includes eliminating noncerebral tissues from the image using a process known as skull stripping, followed by intensity normalization and filtering of noisy pixels [5,6]. Various techniques of skull stripping have been developed over the years. A skull stripping technique presented by Hahn et al. is based on a 3D watershed transformation using a combination of white matter three-dimensional connectivity and a modified watershed algorithm combined with preflooding in order to avoid oversegmentation [7]. Ségonne et al. proposed a hybrid approach of deformable surface models and watershed algorithms, which involves estimating the brain volume by three-dimensional connectivity operation [8]. Sadananthan et al. developed a skull stripping technique, which involves graph cuts, intensity thresholding, followed by removal of narrow connections to obtain a brain mask [9]. ese approaches are relatively successful in determining the brain edge but they are highly complex, computationally intensive, and prone to the possibility of brain tissue erosion and oversampling. In this paper, we have implemented a fast and accurate skull stripping technique that involves multiple thresholding and object counting.
Various fully automatic medical image segmentation techniques that involve various machine vision techniques have been described in the literature [10]. A technique presented by Karkanis et al. is based on wavelet decomposition for obtaining the color wavelet covariance features of the second-order textural measures in an endoscopic video [11]. Another technique suggested by Logeswari et al., involves hierarchical self-organizing maps generated by removing noise and artifacts and then identifying the principle tissue structures using fuzzy c-means clustering [12]. An approach proposed by Sinha et al. for tumor detection consists of three techniques: k-means clustering with watershed segmentation, optimized k-means clustering with genetic algorithm, and optimized c-means clustering with genetic algorithm [13]. A technique for tumor region detection, developed by Megersa et al. combines skull stripping and fuzzy Hopfield neural networks [14]. A technique introduced by Bahadure et al. uses Berkley wavelet transformation and support vector machine to improve the segmentation process by extracting features from the segmented tissues [15]. Hanuman et al. developed a technique for brain tumor segmentation, which includes anisotropic diffusion, k-means clustering, morphological operations, temporal smoothing, and volumetric measurement [16]. A brain tumor detection technique proposed by Hazra et al. is comprised of three stages: noise removal, edge detection, and k-means clustering [17]. Kharrat et al. proposed an efficient technique for the detection of brain tumors that includes morphological operations to enhance the image contrast followed by wavelet transformation for segmentation and k-means clustering for extracting the tumor [18]. Gujar et al. suggested a technique for brain image segmentation that combines k-means clustering and genetic algorithms [19]. An automatic segmentation technique introduced by Pereira et al. consists of three steps: preprocessing, classification with convolutional neural network, and post-processing [20]. A brain tumor segmentation technique using ant colony optimization (ACO) was proposed by Kullayamma et al. [21]. A new approach to improve the segmentation accuracy of brain tumors based on temperature profiles changes in the tumorous region was proposed Bousselham et al. [22]. In this approach, Pennes bioheat equation and Canny edge detection method were used to estimate tumor contours based on the change of temperature. Brain tumor segmentation based on hybrid clustering and morphological operations was proposed by Zhang et al. [23] which consists of adaptive Wiener filtering for denoising, morphological operations to remove non cerebral tissues and k-means clustering combined with Gaussian kernel-based fuzzy c-means algorithm to segment images. e majority of the techniques discussed above give a general segmented MRI image without localizing the tumor region; some techniques can detect a single tumor, but none of them addressed the detection and localization of multiple and very small tumors. In this paper, we propose an automated technique that can detect and localize multiple brain tumors, including those with very small sizes. e technique begins with an initialization step using k-means clustering to identify the brain surrounding edge, followed by dividing the MRI image into patches that are iteratively scaled, followed by object detection and counting using multiple threshold values. e novelty and contribution of the proposed technique is that it can detect both large and small tumors in the same MRI image without the need for advanced machine learning algorithms or direct comparison of the tested images with reference images from a database.

Methodology
e proposed technique involves four image processing operations: k-means clustering, patch-based processing, object counting and tumor evaluation, discussed in the following sections.

k-Means
Clustering. k-Means clustering is an unsupervised clustering algorithm that divides the intensities in the image based on cluster centroids, followed by calculating the distance between each image pixel and the corresponding centroid. e algorithm assigns each pixel to a specific centroid based on the minimum distance value. e algorithm also updates the centroids by finding the average distance values of the assigned pixels of the centroids. e values of the distances are updated with respect to the new centroids and the pixels are re-assigned. e algorithm continues until there are no significant changes in the distances from the centroids [16]. Effective k-means clustering is achieved by minimizing the within cluster variance, which is the sum of squares within each cluster (SSW), and maximizing the between cluster variance, which is the sum of squares between clusters (SSB), as follows: = number of clusters, = overall centroid, = number of objects in a data set, {퐶1 ⋅ ⋅ ⋅ 퐶푘} = set of clusters, = number of objects in cluster , and = centroid of . e lower the total SSW value is, the greater the intracluster cohesion associated with the given cluster configuration and the higher the total SSB value of a cluster configuration is, the greater the degree of separation. A flowchart of the k-means clustering algorithm is shown in Figure 1.

Patch-Based Image Processing.
In patch-based image processing, the original image is divided into small patches, which are processed independently and subsequently combined to give the final processed image. In the proposed technique, the MRI image is uniformly divided into multiple patches of the original MRI image. In order to detect and localize smaller tumors which cannot be detected at the normal scale of the image, each patch is scaled up to three times its original size. Each scaled patch is processed using k-means, object counting, and tumor evaluation for the detection and localization of tumors in the selected patch. e processed patches are combined to give the total detected tumors in the original MRI image.

Tumors Detection Using Object Counting.
Object counting is a technique used to detect objects in images for the purpose of localization and counting. An object is defined as a group of bright pixels that form a connected component in a binary image. Brain tuomors are considered as objects since they appear in MRI images as bright areas. In order to detect tumors the original MRI image is converted to multiple binary images using different threshold values followed by continuous erosion coupled with object counting until the number of objects in each binary image is equal to one object. e produced images are subsequently added together into one image. If the image contains more than one connected component, the connected component having pixels with maximum integer value is considered for region growing to give an object, which represents a possible tumor. On the other hand, if the image has no object, then there are no more tumors in the original image. Once a possible tumor is detected, it is eliminated from the original MRI image and the object counting process is repeated in order to detect and localize all possible tumors in the MRI image [22].

Tumor Evaluation.
Brain tumors usually do not occur very close to the skull. ey occur within the cerebral tissues of the brain, therefore the bright objects that appear adjacent to the skull are considered as false tumors. To identify and eliminate such objects, the Euclidean distance between the possible tumor and the largest surrounding edge of the skull is used. If it is found to be less than a predefined threshold, that possible tumor is considered as a false tumor. On the other hand, if the Euclidean distance is greater than the predefined threshold value, the possible tumor is considered as a true tumor in the MRI image [22].

e Proposed Technique Steps.
e proposed technique comprises the following processing steps: (i) Clustering the MRI image using k-means into three regions: bright regions (possible tumors), medium International Journal of Biomedical Imaging 4 in order to magnify small tumors so that they can be detected in the next step.

Implementation and Results
e proposed technique was implemented and tested using an algorithm developed using Matlab TM . e technique was tested for detecting small size tumors using 20 real MRI images. e selected MRI images contained multiple early-stage tumors in addition to larger tumors as shown in Figure 3(a). e intensity regions (including cerebrum) and dark regions. Figure 1 shows a flowchart of the k-means clustering. (ii) Localizing and enhancing the brain edge. Unlike skull stripping in which the surrounding edge is removed, in this technique, the surrounding edge is enhanced and used for the elimination of false tumors. (iii) Selecting a threshold for the Euclidean distance between the brain surrounding edge and cerebral tissues to eliminate false tumors that are part of the skull. (iv) Converting the original MRI image into two images: the first image is obtained by multiplying the medium intensity k-means cluster with the inverted largest surrounding edge that is expanded towards the centre, followed by selecting the largest connected component and filling the holes. e second image is obtained by filtering the original MRI image using an averaging filter with a small kernel and multiplying the filtered image by the intensity adjusted original MRI image within the range of 49.99-50.01%. Performing further adjustment of the intensities of the pixels in the MRI image using the range between 10% and 90%. (v) Splitting the converted image into patches, which undergo scaling-up to three times their initial sizes, such as the skull. A threshold value of the Euclidean distance of possible tumors from the skull was determined based on the total number of brain pixels. e threshold value is directly proportional to the brain size. e next step was applying morphological operations on the original MRI image in order to detect the tumors. e first operation was applying a binary mask that considers the k-means cluster with the medium intensity regions and the largest surrounding edge that was expanded towards the centre by morphological erosion (Figure 4(a)) using the following binary kernel: implementation started with applying k-means clustering for the MRI image in order to cluster the image into three main regions: bright regions that include possible tumors, medium intensity regions that include normal brain tissues and dark regions that do not include tissues or skull parts, as shown in Figure 3(b). e largest surrounding edge was determined by considering two of the k-means clusters: the bright regions and the medium intensity regions. Morphological removal of the interior pixels was performed to obtain an outline for the boundaries of both clusters. is process resulted in detecting the largest surrounding edge, as shown in Figure 3(c). e holes in the largest surrounding edge were filled to obtain the total number of pixels of the cerebral tissues and other components International Journal of Biomedical Imaging 6 e possible tumor was discarded if its Euclidean distance from the skull was less than the selected threshold value which was determined based on the area of the brain image as shown in e expanded largest edge was then inverted and multiplied by the medium intensity k-means cluster and the largest connected component was considered for hole filling as shown in Figure 4(b). e second operation was filtering the original MRI image by a small averaging filter to remove the noise then multiplying the filtered image by the original MRI image that had an adjusted intensity between 49.99% and 50.01% in order to focus on pixels that represent abnormal tissues. e contrast of the resultant image was further adjusted between 10% and 90% for greater concentration on abnormal tissues. Finally, both modified images were multiplied with each other to give the image in Figure 4(c).
A er obtaining the modified MRI image, the next step was splitting it into small patches in order to detect small size tumors, as shown in Figure 4(d). Each patch has an initial size of 200 × 200 pixels, which was scaled up to three times larger for processing. Each enlarged patch was first smoothed using an averaging filter followed by morphological operations which include; low intensity elimination; conversion to multiple binary images using threshold values of 0.1, 0.3, 0.5, 0.7, 0.9, and Otsu's threshold value [22]; elimination of small objects; filling holes; object counting; continuous erosion using an incremental disk until the number of binary objects was equal to one object; and region growing using the centre of the detected binary object as the seed point [23]. ese operations were repeated with an additional initial step of intensity adjustment between 30% and 70% in order to increase the contrast of all possible tumors and eliminate false dark regions. e processed images were added together to give a final image that contained regions of possible tumors. e whole process that started with splitting the image into patches was repeated in steps of 50 pixels l shi within each patch as shown in Figures 4(e)-4(g). e shi ing and processing produced output images with regions that had pixel values between zero and four. Only regions with pixel values between zero and two were considered as possible tumors while others were ignored. e last step was evaluating the detected tumors to determine if they were true tumors or not. e evaluation was performed by finding the Euclidean distance between each detected tumor and the largest surrounding edge of the skull.     . is relationship shows that the Euclidean distance threshold values are directly proportional to the total number of pixels in the brain image. Smaller threshold values such as 5 and 6 are assigned to smaller brain areas such as 5000 or 8000 pixels. A larger threshold value such as 25 is assigned to larger brain area such as 100000 pixels. e detected true tumors in the MRI image a er applying tumor evaluation are shown in Figure 4(h). It can be noted that both small tumors and large tumors were detected while the surrounding false regions that are part of the skull were discarded. e technique was also tested further on twenty MRI images that contained multiple tumors of different sizes as shown in Figure 6.

Discussion
Based on the implementation and testing results, the proposed technique is capable of detecting multiple large as well as small and low intensity tumors in MRI images. is is very evident in the original MRI image shown in Figure 6 (9) which has eight different size tumors and the detection results In these equations, TP is the number of true positive pixels which indicates how many actual tumorous tissues have been correctly detected; FP is the number of false positive pixels which indicates how many pixels falsely detected as tumorous; FN is the number of false negative pixels, which refers to the pixels falsely detected as nontumorous; and TN is the number of true negative pixels and refers to the pixels correctly detected as nontumorous as the ground truth nontumorous pixels. e performance parameters were calculated using the detection results related to the MRI images shown in Figure 6. It can be noted from Table 1 Table 2. e average value for Specificity is 99.99%, which is close to the maximum possible value. e Sensitivity is 92.16%, which is greater than the highest sensitivity value of 91.66% reported by Gujar et al. [19]. e Precision value is very close to the highest Precision value reported by Gujar et al. [19].
e Dice Score Coefficient is 95.81%, which is greater than the value of 80% reported by Hanuman et al. [16]. e Accuracy value is 99.81%, which is greater than the 92.62% value reported by Kullayamma et al. [21].

Conclusion
Effective MRI image segmentation is an essential step for the diagnosis and treatment of brain tumors. Detection of cancerous tumors at the very early stages of their development enables doctors to determine the appropriate treatment and hence it enhances the patients' chances of full recovery. In this paper, an automated technique for the detection and localization of early-stage brain tumors in MRI images was implemented using a combination of k-means clustering, patch-based processing, object counting, and tumor evaluation. e technique was tested and implemented using twenty real brain MRI images, which were diagnosed by clinicians. In addition to large tumors, the proposed technique was able to detect early-stage tumors in MRI images regardless of their size, intensity variation, and location. In order to make the technique more robust, an adaptive approach for the patch scaling will be explored in the future.
Data Availability e data used to support the findings of this study are included within the article.