Image multi-level-thresholding with Mayfly optimization

Image thresholding is a well approved pre-processing methodology and enhancing the image information based on a chosen threshold is always preferred. This research implements the mayfly optimization algorithm (MOA) based image multi-level-thresholding on a class of benchmark images of dimension 512x512x1. The MOA is a novel methodology with the algorithm phases, such as; i) Initialization, ii) Exploration with male-mayfly (MM), iii) Exploration with female-mayfly (FM), iv) Offspring generation and, v) Termination. This algorithm implements a strict two-step search procedure, in which every Mayfly is forced to attain the global best solution. The proposed research considers the threshold value from 2 to 5 and the superiority of the result is confirmed by computing the essential Image quality measures (IQM). The performance of MOA is also compared and validated against the other procedures, such as particle-swarm-optimization (PSO), bacterial foraging optimization (BFO), firefly-algorithm (FA), bat algorithm (BA), cuckoo search (CS) and moth-flame optimization (MFO) and the attained p-value of Wilcoxon rank test confirmed the superiority of the MOA compared with other algorithms considered in this work


INTRODUCTION
Recently, a considerable number of research works are proposed and implemented by the researches in various domains, in which the images recorded using a chosen procedure commonly; help to asses the essential information [1]- [5]. Image processing is emerged as one of the key research domains and widely adopted to process red, green, dan blue (RGB)/grayscale images with chosen methodologies [6]- [8]. Even though a considerable number of image processing approaches exist, the image multi-level thresholding (IMLT) is emerged as one of the vital methods to process various class images with assigned threshold values [9]- [12]. In most of the cases, the IMLT is considered to enhance the image texture/pixel information by grouping alike pixels based on the chosen thresholds. It can be implemented with recommended methods, such as Otsu, Kapur, Shannon and Tsallis with common values of preferred thresholds (T) as; 2-5 [13]- [18].
From year 1979, Otsu is commonly employed to enhance the RGB/grey scale images based on the chosen threshold [19]. Due to its superiority, this approach is widely adopted to pre-process a class of medical images recorded with different modalities [20], [21]. The earlier works in literature also confirm the need of Otsu's thresholding for medical image examination using the machine-learning and deep-learning techniques [22], [23]. The Otsu's scheme is commonly used to enhance the test images based on the chosen threshold and it can be implemented with; i) Traditional and ii) Heuristic algorithm assisted techniques. In traditional method, a manual operator is allowed to perform a number of trials to vary the threshold of the image till the between-class-variance (BCV) is improved. In heuristic-algorithm method, a chosen computer algorithm is permitted to adjust the image threshold, till improved value of BCV is reached. Implementation of traditional work seems to be more complex for IMLT and hence, a class of heuristic algorithm-based methods are widely adopted in recent days than traditional thresholding [24]- [27].
The proposed work aims to demonstrate the IMLT operation using the recently developed approach named mayfly optimization algorithm (MOA) [28]. The MOA is proposed in 2020 by combining the best strategies in firefly-algorithm (FA), particle-swarm-optimization (PSO), and genetic-algorithm (GA). The MOA considers a multiple search strategy for the optimal solution using the artificial Mayflies with male and female category. Further, this algorithm also generated a couple of Mayflies (male and female) with an assigned velocity value of zero. Due to the multiple search practice existing in MOA, getting the finest result based on the assigned threshold becomes an easy task [29].
In this work, the IMLT is implemented on well-known greyscale images with dimension 512x512x1 pixels and the attained results are then compared against the original test image to compute the essential image-quality-parameters (IQP) [30]- [32]. The proposed work is implemented with T=2 to 5 and the obtained results as well as IQPs are tabulated. In order to minimize the search time, a bounded-thresholdsearch (BTS) is employed, in which the threshold values with the lesser pixel distribution are discarded from the search. Other essential information regarding the BTS can be found in earlier work [20], [21]. In this approach, a threshold limit (Tmin and Tmax) is assigned during the search, which will help to attain a better result. Further, a multiple objective function (MOF) is also suggested with parameters, such as branch control valve (BCV), peak signal-to-noise ratio (PSNR) and structural-similarity-index-measure (SSIM); which helps to achieve an enhance result compared to the algorithm with single-objective-function (SOF).
This work also considers the feature-similarity-index (FSI) [33] to test the eminence of the processed image. The performance of the proposed MOA is then validated against the other heuristic procedures, such as PSO [16], bacterial foraging optimization (BFO) [34], [35], FA [21], [36], bat algorithm (BA) [27], cuckoo search (CS) [7] and moth-flame optimization (MFO) [37], [38] existing in the literature and the performance of the MOA on the IMLT problem is validated using the p-value attained using the Wilcoxon rank test. The result attained with the proposed work confirms that, the MOA approach helps to achieve a better result on the considered test image compared to the alternative algorithms.

RESEARCH METHOD
The superiority of all the optimization process depends on the procedure implemented and this section of the research depicts the outcome attained with MOA.

Overview of proposed method
The implementation of MOA assisted IMLT is depicted in Figure 1. The task is to find the optimal threshold based on the assigned threshold by maximizing the MOF. In this approach, the MOA is initialised with the essential parameters and allowed to find the optimal threshold for the chosen test picture. In this work, a BTS is implemented to attain a finest result with lesser iteration. The Otsu is considered as the methodology to enhance the image based on thresholds. The essential information on Otsu can be found in [39]. After attaining the result, a pixel wise comparison is performed between the original and processed image and the essential IQP are computed. This work is implemented with a MOF, which also helps to achieve a better threshold result for every image considered in this work. The entire operation works as a closed loop process and continued till the finest threshold is reached. After performing the essential operation, the attained results are compared and validated based on the computed IQP.

Benchmark image database
A considerable number of RGB/grayscale images are available in the literature [40]- [42] and this work considered the commonly used benchmark images of dimension 512x512x1 for the experimental study. All these images will have their own pixel distribution, ranging from smooth to complex and the sample test images considered for investigation are depicted in Figure 2. Every image is considered for the assessment and for the demonstration, the result attained for Barbara, Lena (smooth pixel distribution) and Butterfly, Bee (complex pixel distribution) shown in Figure 3 is presented and discussed in this research.

Mayfly optimization algorithm
MOA is one of the recent population-based methods invented in 2020 [28], [29]. As per the earlier statement by the authors, the MOA is derived from the PSO and it combines all the major strengths in PSO, FA and GA. The concept of MFO consist the following operations; i) Initialization of equal number of male and female agents, ii) Allowing the male-Mayfly to identify the Gbest for the chosen task, iii) Allowing the female-Mayfly to search and combine with male-Mayfly positioned at Gbest, iv) Offspring generation and v) Terminating the search and displaying the final result. The overall performance of the MOA depends on the initial position of the male and its attraction distance for the female. In this approach, when the agents are arbitrarily initialized in the search space with equal numbers of male and female agents; every Mayflies are allowed to converge towards the Gbest with increase in the convergence. This process will be stopped when equal numbers of offsprings is generated by every pair of agents. In order to terminate the process, every generated offsprings are assigned with a zero velocity, so that it cannot move further. The other essential information can be found in [28], [29] and its basic code can be accessed from [43]. Figure 4 graphically depicts the working mechanism of the MOA with various stages, such as Figure 4(a) initialization, Figure 4(b) is identification of Gbest by male agent and Figure 4(c) depicts the movement of female toward the male and offspring generation. As the operations shown in Figure 4, the mathematical expression for the MOA is also have various phases and, in this work, the algorithm parameters considered in [28], [43] is adopted during the implementation. Further, this algorithm contains the basic operation of PSO and FA during the movement and every agent (Mayfly) location can be varied based on the position and velocity equation present in the earlier algorithms.  allowed to move towards the finest position (Gbest), when the iteration increases. As in Figure 4(b), the male is allowed to reach the Gbest by adjusting its position and velocity. The movement of the agent towards the final destination will be guided by the Cartesian distance and the increased iteration. This operation is similar to the FA discussed in [21]. The position and the velocity update equations are shown in (1) and (2); where and +1 are initial and modified positions, +1 and , +1 initial and modified velocities respectively, personal learning parameter ( 1 C ) =1, Personal learning parameter ( 2 C )=1.5, β =2 and p D and g D are Cartesian distance. In (2) is framed by combining the FA and PSO values. When the updation continues based the progression in iterations, every male (M) will reach the best G and performs a velocity updation to attract the female (F) by performing a unique nuptial dance (moving up and down on a water surface). The velocity update during this process can be defined as; where nuptial dance value (d)=5 and R= random numeral [-1], [1]. After the optimal search by male is completed, every female (F) is then allowed to identify a male, who is at best G . Figure 4(c) depicts this process in which a female (F) may move towards the male based on the distance ( ) or it may escape to a new location using a random-walk (W=1) value. The mathematical expression for position and velocity update for F is depicted below, where O = maximized objective value. When the iteration increases, every F will reach the appropriate M and the offspring generation take place as depicted in Figure 4(c). In the MOA, the number of offsprings is equal to the combined M and F. Hence, every mating will result in a M and F offspring with an initial velocity value of Zero. For the IMLT problem, only the search performance of M and F alone considered and the search by the offspring is ignored by nullifying its initial velocity operator. From the above discussed equations, it is clear that, the proposed MOA is formed by combining the finest features of the FA, PSO and FA. Other related information can be obtained from [28], [29].

Objective function
The overall performance of the proposed optimization task depends on the chosen objective value and in this work maximization problem is considered based on (6); The (6) presents a weighted sum of objective function with various weights. In this work, BCV is given the higher priority and PSNR and SSIM are given with equal priorities. The task of the MOA is to explore the bounded threshold value and identify the finest threshold combination, which provides the Omax. Other related information regarding the weighted sum of MOF can be found in [20].

Image-quality-parameters
Assessment of attained IQP is essential to confirm the performance of the image processing approach. In this work, the well-known IQPs, such as RMSE, PSNR, SSIM, NAE, NCC, AD and SC are considered. The other image quality measure called the feature similarity index (FSIM) [33] is also adopted in this work to confirm the eminence of the proposed work. The mathematical expression for the considered IQPs can be found in [44], [45].

Other algorithms
To validate the performance of th MOA, the well-known heuristic methods, such as PSO, BFO, BA, FA, CS and MFO is considered and the performance of these methods are validated by computing the attained Otsu's BCV, convergence rate and the Wilcoxon rank test. Following algorithm parameters are commonly assigned for each algorithm; number of agents=20, search dimension = T (ie. T=2 to 5), maximum iterations 3000 and the stopping criteria=maximal iteration or optimized result. For each image, five trials are implemented with each T and the image which gives the finest IQP is considered as the threshold image. Other essential information regarding the implementation of the algorithms for IMLT problem can be found in [44]- [47].

RESULTS AND DISCUSSION
This section presents the experimental results and its discussions. All the experimental investigation is implemented using MATLAB and the performance of the proposed technique is confirmed using the p-value attained with the Wilcoxon test. Every image considered for the investigation is initially explored and a threshold's search boundary is assigned with a minimum (Tmin) and maximum (Tmax) value and the MOA is then allowed to explore the threshold boundary to find the finest threshold. The sample threshold boundary assigned for the Barbara picture is depicted in Figure 5. In this work, the optimization process will help to find the threshold by considering; Tmin<Threshold values<Tmax. The MOA is initialized with the parameters as discussed in section 2.3 and the results attained for assigned thresholds is depicted in Figure 6 along with the optimal threshold attained.  Figure 6(a) to 6(d) depicts the results attained with a chosen thresholds and this image confirms that; based on the threshold value, the quality and the information content of the image varies considerably. This picture also depicts the value of the SSIM-Map, which confirms that the proposed method helps to attain a better result with the proposed methodology. Similar methodology is implemented for other images and the results attained are clearly shown in Figure 7 for thresholds T=2 to 5. After collecting the necessary multi-threshold images, a comparative assessment is then implemented between the original image and the processed image and the essential IQP depicted in Table 1 is computed. The result of this table confirms that, when the threshold level increases, the prime parameters, such as PSNR, SSIM, FSIM and NCC improves and other parameters, such as root mean squared error (RMSE), NAE, AD and single crochet (SC) decreases.    Figure 8 depicts the maximal value of Orsu's BCV obtained for Barbara image for T=5 and this figure also depicts the convergence of the algorithm towards the optimal value. The MOA helps to attain a maximized BCV compared to other methods. Further, the MOA shows a better and steady convergence towards the maximized BCV. This confirms that the search performance of MOA is good compared to other methods considered in this research. The statistical significance of the MOA with respect to other methods is validated using the Wilcoxon rank test and the attained results are depicted in Table 2. This test is to evaluate the IMLT performance of the MOA with other considered methods and the presented result confirms that the p-value attained by this test is <0.05, which confirms the performance of the MOA is better on the considered thresholding problem [48].

CONCLUSION
This research implements a MOA based IMLT for a class of benchmark grayscale images using a novel objective function. The MOA helps to achieve an optimal result due to a two-level search process and provides better contrast to PSO and FA existing in the literature. In this work, the IMLT is implemented for T=2 to 5 and for exch case, five trials are implemented and the best result among the trials considered as the optimized result. After getting the processed image, a pixel level comparison with the original test image is then performed and the essential IQPs are computed. The obtained result of this study confirms that the proposed approach helps to get better outcome for various thresholds. Further, the optimization search convergence by MOA is better compared to other algorithms considered in this research. Finally, a statistical confirmation with Wilcoxon rank test is then performed to justify the performance of MOA compared to other heuristic algorithms on the chosen IMLT problem. In future, the MOA can be considered to identify the finest thresholds for RGB images and the images corrupted with noise.