Hybrid Multilevel Thresholding Image Segmentation Approach for Brain MRI

A brain tumor is an abnormal growth of tissues inside the skull that can interfere with the normal functioning of the neurological system and the body, and it is responsible for the deaths of many individuals every year. Magnetic Resonance Imaging (MRI) techniques are widely used for detection of brain cancers. Segmentation of brain MRI is a foundational process with numerous clinical applications in neurology, including quantitative analysis, operational planning, and functional imaging. The segmentation process classifies the pixel values of the image into different groups based on the intensity levels of the pixels and a selected threshold value. The quality of the medical image segmentation extensively depends on the method which selects the threshold values of the image for the segmentation process. The traditional multilevel thresholding methods are computationally expensive since these methods thoroughly search for the best threshold values to maximize the accuracy of the segmentation process. Metaheuristic optimization algorithms are widely used for solving such problems. However, these algorithms suffer from the problem of local optima stagnation and slow convergence speed. In this work, the original Bald Eagle Search (BES) algorithm problems are resolved in the proposed Dynamic Opposite Bald Eagle Search (DOBES) algorithm by employing Dynamic Opposition Learning (DOL) at the initial, as well as exploitation, phases. Using the DOBES algorithm, a hybrid multilevel thresholding image segmentation approach has been developed for MRI image segmentation. The hybrid approach is divided into two phases. In the first phase, the proposed DOBES optimization algorithm is used for the multilevel thresholding. After the selection of the thresholds for the image segmentation, the morphological operations have been utilized in the second phase to remove the unwanted area present in the segmented image. The performance efficiency of the proposed DOBES based multilevel thresholding algorithm with respect to BES has been verified using the five benchmark images. The proposed DOBES based multilevel thresholding algorithm attains higher Peak Signal-to-Noise ratio (PSNR) and Structured Similarity Index Measure (SSIM) value in comparison to the BES algorithm for the benchmark images. Additionally, the proposed hybrid multilevel thresholding segmentation approach has been compared with the existing segmentation algorithms to validate its significance. The results show that the proposed algorithm performs better for tumor segmentation in MRI images as the SSIM value attained using the proposed hybrid segmentation approach is nearer to 1 when compared with ground truth images.


Introduction
Brain tumors, cancerous or noncancerous, are an outgrowth of abnormal cells in the brain. Malignant brain tumors are possible but rare [1]. Malignant brain tumors have a non-uniform structure and contain active (cancer) cells, while benign brain tumors have a uniform structure and are not cancerous [2]. Tumor identification, treatment planning, and monitoring of response to ontological therapy for brain tumors rely heavily on the reliable quantification and morphology of tumors derived from imaging data [3]. Magnetic Resonance Imaging (MRI) is a noninvasive medical imaging technique [4]. MRI produces high-quality images of human organs in 2D and 3D formats. Owing to its high-resolution images on brain tissues, the MR imaging modality is regarded to be one of the most accurate techniques for MRI categorization [5] and is also used to identify many disorders due to its image quality. MRI is the most common method to examine brain tissues that have been infected. Different operations are applied to MRI images for the detection of brain tumors. Brain tumor segmentation is one important method which plays a crucial role in the detection of brain tumors. Gray matter (GM), white matter (WM), and cerebrospinal fluid (CSF) are the normal brain tissues that are separated from the tumor tissues (active tumor, edema, and necrosis) during brain tumor segmentation [6]. Brain tumors are notoriously difficult to segment due to their various appearances in terms of location, size, forms, and recurrence [7][8][9].
Different researchers have proposed several methods for brain tumor segmentation. Joseph and Singh used k means and morphological operation methods for the segmentation of the MRI image [10]. Rehman et al. proposed a segmentation approach for the MRI images based on deep autoencoder-decoder [11]. Toufiq et al. utilized an optimized threshold difference algorithm and rough set methods for the segmentation task [12]. Tripathi et al. proposed an automatic segmentation method based on deep learning, crosschannel normalization, and parametric rectified linear units for the segmentation of the brain tumor [13]. Bodapati et al. proposed a segmentation approach using two channel based deep learning model [14]. Maqsood et al. proposed a multi-model system for segmentation using deep learning and a multi-class support vector machine [15].
The deep learning-based models are widely used and are quite successful [16]. However, the deep learning methods extensively depend on the size of the dataset and model performance degrades when there is a data distribution difference between the training data and test data. These models have parameter setting problems due to the presence of a large number of trainable parameters. Additionally, data collection at a high level is often time consuming, expensive, or even not possible in different scenarios. Thus, in such cases these models become inefficient. Apart from the deep learning-based segmentation methods, threshold-based approaches are used for the segmentation task by selecting the optimal threshold values. The threshold-based approaches are characterized by their ease of implementation and ability to give accurate segmentation results [17]. It can be divided into two types: bi-level and multi-level threshold. In the bi-level category, a single threshold value is used in the prior category to separate the image into two homogeneous foreground and background areas. While in the multi-level category, these are utilized to segment an image into more than two areas based on pixel intensities, known as histogram [18]. When segmenting an image, determining the thresholding values is very important due to the presence of enormous image thresholds; hence, this topic demands more investigation. This motivates us to propose a novel method for selecting the optimal multilevel thresholding values for segmentation of the brain tumors and performance enhancement for brain tumor detection.
The remaining paper is organized as follows: Section 2 provides the related work. The proposed approach has been described in Section 3. In Section 4, the dataset used in this work has been detailed. The experimental results and discussions are given in section 5. The conclusions and future scope of the work are given in Section 6.

Related Work
In this section, segmentation methods based on the multilevel threshold values have been analysed. Two approaches are commonly used to determine optimal threshold values for segmenting a given image into several regions. These are Otsu method [19] and Kapur entropy [20]. Otsu method maximizes the between-class variance, while Kapur entropy maximizes the entropy of the classes. These techniques are applicable for determining a single threshold value. However, it is impossible to precisely determine ideal threshold values for multi-level in these approaches. Consequently, multi-level thresholding is considered a challenge that needs to be optimized. The relevant literature makes extensive use of meta-heuristic approaches to solve these challenges.
Given their versatility and ease of implementation, academics have extensively demonstrated metaheuristic algorithms' ability to handle complex real-world issues, such as tracking of objects [21], feature weighting [22], feature selection [23,24], improvement of machine learning algorithms [25], monitoring [16], and engineering optimization algorithms [26,27], etc., in recent decades. Metaheuristic algorithms, in contrast to deterministic approaches, do not rely on gradient information to discover optimal solutions in the search space, instead, the randomly generated search agents and specialized operators. Many natural phenomena served as inspiration for these operators. Consequently, there are primarily three types of metaheuristic algorithms: (1) swarm-based, (2) natural evolution-based, and (3) physics-based methods. The two main approaches of study for multilevel image segmentation are the classical approach and the meta-heuristic approach. An incredible amount of progress has been made in the field of image segmentation during the past few decades. Traditional approaches to multilevel image thresholding have been proven to be inefficient due to the lengthy time required to find the optimal values with which to maximize the objective function. As a result, the computational time issue of multilevel thresholding algorithms for image segmentation is successfully addressed by a number of evolutionary metaheuristic algorithms in the literature.
Oliva et al. proposed a multilevel thesholding method for the segmentation of the digital images based on the harmony search optimization algorithm [28]. Oliva et al. utilized an electromagnetism-like algorithm for the selection of optimal threshold values of the images [29]. Kandhway and Bhandari introduced energy curve and the minimum cross entropy and multiverse optimizer algorithm-based multilevel threshold selection approach [30]. Upadhyay and Chhabra proposed Kapur's entropy and crow search optimization algorithm-based multilevel thresholding method [31]. Rather and Bala proposed constriction coefficient-based particle swarm optimization and gravitational search algorithm to find the optimal threshold values by utilizing the strength of both algorithms [32]. Resma and Nair proposed kill herd optimization for the segmentation of the images by maximizing the values of Kapur and Otsu entropy [33]. Houssein et al. utilized black widow optimization and the best threshold configuration using Otsu or Kapur as an objective function for the optimal threshold selection of the images [34].
Existing multilevel thresholding methods are only available for generalized images. The existing multilevel thresholding methods based on optimization algorithms are not utilized for the segmentation of the medical images because of their variability and complexity. Additionally, the optimization algorithm has the problem of slow convergence speed and can stuck in local optima. Considering these as motivation, in this work, a novel Dynamic Opposite Bald Eagle Search (DOBES) optimization algorithm has been proposed which is an improved version of the Bald Eagle Search (BES) [35] algorithm. The modifications are applied to solve the problem of slow convergence speed and local optima stagnation of BES algorithm. Using this DOBES algorithm a hybrid Multilevel Thresholding Image Segmentation method has been proposed to find the optimal threshold values and the additional undesired regions of the segmented image are further removed using the morphological operations based post-processing procedure.
The main contributions of this work are as follows: • The DOBES algorithm is proposed by invoking the DOL method in the initialization, as well as exploitation, phases of the BES algorithm to solve the problems of slow convergence speed and local optima stagnation. • A hybrid multilevel threshing approach is proposed for the segmentation of the brain tumor. • The proposed hybrid segmentation approach is compared with state-of-the-art algorithms to show its significance.

Proposed Hybrid Multilevel Thresholding Image Segmentation Approach
In this paper, a hybrid multilevel threshold segmentation approach has been proposed for the detection of brain tumors in the MRI image. The hybrid approach has two phases: Proposed Dynamic Opposite Bald Eagle Search (DOBES) optimization based multilevel threshold selection, and morphological operations-based post-processing procedure. The generalized block diagram of the proposed approach has been depicted in Figure 1. The hybrid approach has utilized the proposed DOBES algorithm in the first phase to find the optimal threshold levels. The selected optimal threshold levels are utilized to generate the threshold image based on the different threshold levels. The binary segmented image of the threshold image is generated for the next phase of operations. In the second phase, the morphological operations are applied to the previously generated binary segmented image to find out the area of interest and neglect the other undesired regions. The details of the different phases of the proposed approach are as follows.

DOBES Based Multilevel Threshold Selection
Image thresholding is classified into two types: bilevel and multilevel. The multilevel technique is the progression from the bilevel approach [36]. For a bimodal gray-level histogram with one valley between two peaks, the bi-level thresholding process is computationally simple and straightforward. The multilevel thresholding approach, on the other hand, is significantly more computationally demanding, but it might be well suited to a multimodal gray-level histogram with several peaks and troughs [37]. However, as the number of necessary thresholds rises, multilevel thresholding becomes more complex, and it becomes considerably more difficult when working with a two-dimensional graylevel histogram. To overcome this issue, metaheuristic optimization algorithms have been developed, which yield exceptionally better results for different types of images.
In this paper, a Dynamic Opposite Bald Eagle Search (DOBES) optimization algorithm is used for the selection of the optimal multilevel threshold of the brain MRI image. This algorithm is an improved version of the Bald Eagle Search (BES) [35] optimization algorithm. The BES algorithm has problems of slow convergence and local optima stagnation. These problems are addressed in the DOBES algorithm by employing Dynamic Opposition Learning (DOL). The BES algorithm has three phases: Select, Search, and Swoop. The select phase is used for exploring the available whole search space to search for the solution. Whereas the search phase is used to exploit the selected area, and the swoop phase is used to target the best solution. The formulation of the three phases is as follows: In this equation, i is the total number of search agents, random variable r have value ranging from [0, 1], and α is between [1.5, 2].
where, α is a algorithmic parameter having values in between 5 and 10, rand have values in between 0 and 1, and R denotes the number of search cycles having value in between 0.5 and 2.
where c1, c2 are the algorithmic numbers having values in the range of [1,2].
The proposed DOBES approach employs DOL to improve the initialization of the search agents. The initialization technique influences both the rate of convergence and the time necessary to find the best solution. As a result, DOL has been implemented in the DOBES algorithm to improve the likelihood of convergence to the global optimum while avoiding the stagnation problem associated with local optima. Furthermore, DOL has been used to accelerate the convergence rate by more equally spreading the search phases. DOL is utilized during the exploitation phase (the search phase) to analyse both the candidate solutions and their corresponding opposing candidate solutions, extending the exploitation space and improving the chance of discovering a better solution. The flow chart of the DOBES algorithm is given in Figure 2.
The working of the DOBES algorithm ( Figure 2) starts with the parameter setting of the algorithm. Then, in the modified initialization phase randomly initial positions of the search agents have been generated, and using the DOL method opposite positions of the search agents have been determined. Fitness values have been calculated for the search agents and only the best search agents are selected. In the select phase, the positions of the search agents are updated to explore the search space and selection of the best area. The selected area has been extensively searched in the modified search phase. In the modified search phase, the DOL positions of the search agents are considered to improve the working of the exploitation phase. In the last phase, the best optimal solutions have been selected. These phases are repeated until a stopping criterion has been satisfied.

Fitness Function for Multilevel Thresholding
For the multilevel thresholding Kapur's entropy [20] which is based on the probability distribution of the image's histogram is used as a fitness function in the proposed DOBES algorithm. The formulation of Kapur's method is as follows: where P j is the probability of the gray-levels.
The DOBES algorithm has utilized Kapur's entropy as a fitness function to find the multilevel threshold levels in the MRI image.

Morphology-Based Post-Processing Procedure
The morphological operations are used in the proposed hybrid approach to remove the additional undesired areas which are available in the binary segmented image. The operations used in this work are for the edge detection, image dilation, boundary detection, unwanted area removal, and area filling. Figure 3 shows the block diagram of the postprocessing method adapted in this work.  In Figure 3, the binary segmented image of the previous phase is used as an input image. The Canny edge detection method [38] has been utilized in the first step to detect all the edges of segments, then the image dilation method [39] has been used to fill the gaps by adding pixels in the edges of the selected area. In the next step, boundary detection method [40] has been applied to fetch the boundaries of the regions and the small undesired regions are removed from the binary segmented image. The image filling morphological operation [41] has been used to fill the remaining enclosed area regions. In the end, the region of tumor is selected from the processed image. The brain image processing layout of the proposed approach has been shown in  The layout shows that the optimal multilevel threshold values have been first computed using the proposed DOBES optimization algorithm and using the selected multilevel threshold values a threshold image is generated. Further, a binary segmented image has been generated using the threshold image to detect the tumor region. After the generation of the binary segmented image, a post-processing procedure based on the morphological operations has been applied to select the tumor region and remove other undesired regions.

Dataset Description
The brain tumor dataset has been taken from the Figshare website having URL [https:// figshare.com/articles/dataset/brain_tumor_dataset/1512427 (accessed on 15 November 2022)]. The dataset contains T1-weighted images of 233 patients. The images contain three types of tumor which are meningioma, glioma, and pituitary tumor. Figure 5 shows the input and ground truth images of the brain MRI.
In Figure 5, different types of MRI image views, i.e., Axial, Sagittal, and Coronal have been depicted. In the figure, three types of tumors and their respective ground truth image representation of tumor locations in the brain.

Results and Discussions
A hybrid segmentation approach for the segmentation of tumor regions from the MRI image has been proposed in this paper. The segmentation tests are performed on a computer equipped with the Windows 10 Pro operating system, an Intel ® Xenon ® CPU E5-2650 v3 (2.30 GHz), 8 GB of RAM, and MATLAB 2019a platform.
The performance metrics used for the analysis of the proposed segmentation model are structured similarity index measure (SSIM), peak signal-to-noise ratio (PSNR), fitness value, mean square error (MSE), and standard deviation. Mean square error (MSE) quantifies the error at each pixel position and generates a mean value, which is then used to calculate the image's PSNR. MSE is the difference in intensity between the input image and the segmented image. Peak signal-to-noise ratio (PSNR) is defined as the ratio of the highest achievable signal power to introduced noise. It is used to assess the quality of an image's reconstruction. The SSIM is a perception-based approach that takes image deterioration into account as a perceived change in structural information. SSIM is commonly used to determine the relationships between input and segmented images.

Comparison of Proposed DOBES and BES Algorithm for Benchmark Images
The performance of the proposed DOBES algorithm has been analysed and compared with the original BES algorithm to show the significance of the proposed DOBES algorithm. For the performance comparison five benchmark images (Baboon, Boat, Cameraman, Couple, Male) have been selected. The images have been taken from the UCS-SIPI image dataset having URL [https://sipi.usc.edu/database/ (accessed on 27 January 2023)]. The values of the performance measures are provided in Table 1. These results are obtained after running the algorithm for 100 iterations and 10 reruns with a population size of 30.  Table 1 shows a performance comparison of the proposed DOBES algorithm and BES algorithm for the benchmark images. The DOBES algorithm attains higher PSNR values for the baboon, boat, cameraman, and couple images while the BES algorithm attains higher PSNR values only for the male image. The DOBES algorithm attains SSIM metric values close to 1 and higher than the BES algorithm which shows that the DOBES algorithm performs better than the BES algorithm. This proves that the proposed DOBES algorithm is significantly better.

Analysis of Proposed Hybrid Segmentation Approach for the Brain Images
The proposed hybrid segmentation approach has been tested on the Figshare MRI image database for the tumor area detected from the MRI images. In Figure 6, the input, threshold image, binary segmented image, final segmented image after morphological operations, and segmented images mapped with the ground truth images have been depicted for the BES and proposed hybrid segmentation approach. The morphological operations-based post-processing approach has been applied to the segmented images generated using BES optimization algorithm for a fair comparison of these algorithms. Figure 6 represents the segmentation performance of the BES and the proposed hybrid segmentation approach. From the figure, it has been observed that the BES algorithm fails to identify the optimal threshold values of the MRI image, and the tumor region is not identified. This can be observed in the image generated after mapping with the ground truth image. The pink part in the image shows the original ground truth value of the tumor region and the green part in the image shows the tumor region selected using the BES algorithm. In comparison to the BES algorithm, the proposed hybrid segmentation approach is able to successfully select the optimal threshold values, and the tumor region is segmented correctly. This is proved using the ground truth mapping image.  The threshold levels and the convergence curves obtained using the proposed segmentation approach have been shown in Figure 7.  For the performance comparison of the proposed approach, three existing multilevel thresholding optimization algorithms are selected, i.e., Constriction Coefficient Based Particle Swarm Optimization and Gravitational Search Algorithm (CPSOGSA) [32], Electromagnetism-like Algorithm (EMO) [29], Harmony Search (HS) optimization [28]. Additionally, the proposed algorithm is compared with the BES algorithm to show the significance of the proposed DOBES algorithm.
In Figure 8, multilevel thresholding images and the corresponding binary images have been shown for the optimization algorithms. From Figure 8, it has been observed that the DOBES algorithm has segmented the tumor region clearly from the other brain regions whereas the BES and the state-of-the-art optimization algorithms fail to find the optimal threshold values for the tumor segmentation which leads to merging of the tumor region with the brain regions. This proves that the proposed algorithm is better in comparison to the comparative optimization algorithms.
In Table 2, a comparison of the proposed hybrid approach with the existing methods for the brain tumor detection has been shown. The same morphological operations-based post-processing procedure has been applied to all the state-of-the-art algorithms for a fair comparison of the segmented brain tumor images.
From the table, it has been observed that the proposed algorithm attains better values for the metrics 'best fitness values', as well as 'mean fitness values', in comparison to the BES and the other existing algorithms. Additionally, the proposed segmentation approach attains the highest or comparable SSIM values in the case of the segmented images vs. ground truth images.
Thus, the multilevel threshold values which have been obtained using the proposed approach are optimal as detection of the tumor regions in the brain MRI images is close to ground truth values. Additionally, the visual analysis proves that the existing algorithms are not able to find the optimal threshold values especially in the cases where the contrast difference between foreground and the background regions are not quite distinctive.

Conclusions and Future Directions
Brain tumors, a leading cause of death worldwide, are abnormal growths of tissue inside the skull that can impede the nervous system and body function. In neurology, segmenting brain MRIs is a foundational first step with multiple uses, including quantitative analysis, operational planning, and functional imaging. In this work, we apply the hybrid segmentation approach having two phases for the task of segmenting brain tumors from the MRI images. The selection of optimal multilevel threshold values has been accomplished using the Dynamic Opposite Bald Eagle Search (DOBES) optimization algorithm in the first phase and morphological operations-based post-processing procedure is utilized in the second phase for the selection of tumor regions. The proposed DOBES algorithm is a development by improving the original Bald Eagle Search (BES) algorithm. The original BES method has the issues of slow convergence and local optima stagnation. These problems are resolved in the DOBES algorithm by employing Dynamic Opposition Learning (DOL). Then the morphological operations based post-processing procedure has been applied for the tumor segmentation of the MRI image. The performance of proposed DOBES algorithm has been analysed using the benchmark images. The proposed DOBES algorithm achieves better PSNR and SSIM values in comparison to the BES algorithm for the benchmark images. The proposed hybrid segmentation approach is compared with the existing algorithm for the performance analysis. The SSIM values attained using the proposed hybrid segmentation approach for the segmented vs. ground truth images prove that the segmented images obtained using the proposed hybrid approach are closer to the ground truth images. Thus, the results show that the proposed approach successfully finds the optimal threshold values for the segmentation of the tumors.
In the future, the proposed method can be used to find the optimal thresholds in RGB images. Additionally, in place of Kapur's method other variance schemes can be used as objective functions. Medical data analysis is now a very active area of research and a fertile application domain for machine learning. As a result, the proposed approach can be used to find optimal multilevel thresholding values from more complex medical images and feature selection to improve the classification performance.