An Improved Grey Wolf Optimizer Based on Di ﬀ erential Evolution and OTSU Algorithm

: Aimed at solving the problems of poor stability and easily falling into the local optimal solution in the grey wolf optimizer (GWO) algorithm, an improved GWO algorithm based on the di ﬀ erential evolution (DE) algorithm and the OTSU algorithm is proposed (DE-OTSU-GWO). The multithreshold OTSU, Tsallis entropy, and DE algorithm are combined with the GWO algorithm. The multithreshold OTSU algorithm is used to calculate the ﬁtness of the initial population. The population is updated using the GWO algorithm and the DE algorithm through the Tsallis entropy algorithm for crossover steps. Multithreshold OTSU calculates the ﬁtness in the initial population and makes the initial stage basically stable. Tsallis entropy calculates the ﬁtness quickly. The DE algorithm can solve the local optimal solution of GWO. The performance of the DE-OTSU-GWO algorithm was tested using a CEC2005 benchmark function (23 test functions). Compared with existing particle swarm optimizer (PSO) and GWO algorithms, the experimental results showed that the DE-OTSU-GWO algorithm is more stable and accurate in solving functions. In addition, compared with other algorithms, a convergence behavior analysis proved the high quality of the DE-OTSU-GWO algorithm. In the results of classical agricultural image recognition problems, compared with GWO, PSO, DE-GWO, and 2D-OTSU-FA, the DE-OTSU-GWO algorithm had accuracy in straw image recognition and is applicable to practical problems. The OTSU algorithm improves the accuracy of the overall algorithm while increasing the running time. After adding the DE algorithm, the time complexity will increase, but the solution time can be shortened. Compared with GWO, DE-GWO, PSO, and 2D-OTSU-FA, the DE-OTSU-GWO algorithm has better results in segmentation assessment.


Introduction
Image segmentation is an important part of image processing in practice [1][2][3][4][5], as well as a key image analysis technique [6][7][8][9][10]. The threshold image segmentation method divides pixels into several classes by setting the threshold value to realize the separation of the object and the background in the image. Threshold segmentation based on a histogram is the most widely used image segmentation method. The histogram is used for analysis. A better threshold is selected according to the relationship between the peaks and troughs of the histogram [11][12][13].
Shannon, Otsu, and Kapur are the most common methods. Shannon entropy is used to determine the amount of information contained in a random data source [14]. The OTSU algorithm is an automatic method to determine the threshold using the maximum interclass variance [15]. Kapur entropy is the pixel grey value with the maximum entropy of the whole image [16]. Two-dimensional OTSU algorithm by Liu and Li integrates the average grey value of neighborhood pixels on the basis of one-dimensional OTSU [17].
Heuristic algorithm is proposed relative to the optimization algorithm, in which genetic algorithm (GA) [18], particle swarm optimizer (PSO) [19], and grey wolf optimizer algorithm (GWO) [20] are applied in various research fields.
Zahara et al. proposed a hybrid optimization scheme for multiple thresholding by the criteria of OTSU, Gaussian function, and PSO algorithms [21]. Cui et al. proposed a threshold segmentation algorithm based on 2D grey histogram and PSO for fire image segmentation [22]. An improved two-dimensional OTSU algorithm based on PSO was proposed to find the optimal threshold for lung parenchyma segmentation and extraction by Helen et al. [23]. The multithresholding based on modified PSO (MMPSO) method by Hamdaoui et al. was a PSO algorithm based on the new fitness function and OTSU method or multilevel thresholding [24]. Khairuzzaman et al. used Kapur entropy and OTSU combined with GWO algorithm to apply the multithreshold problem [25]. Ibrahim et al. proposed a multilevel threshold optimization method based on GWO. These principles included chaotic logistic map, the opposition-based learning (OBL), differential evolution (DE) algorithm, and the disruption operator (DO) [26]. Bohat et al. proposed the WOA-TH, GWO-TH, and PSO TH algorithm [27]. Zhou et al. proposed a method combining two-dimensional OTSU image threshold segmentation and improved firefly algorithm [28].
This paper proposes an improved GWO algorithm. There is an improved GWO algorithm for initial population selection and threshold selection. By combining the GWO algorithm with the three principles, multithreshold OTSU, Tsallis entropy, and differential evolution (DE) algorithms, an improved GWO algorithm based on the DE algorithm and the OTSU algorithm is proposed (DE-OTSU-GWO). Each principle has its own function. Multithreshold OTSU calculates the fitness in the initial population and makes the initial stage basically stable. Tsallis entropy quickly calculates the fitness. Differential evolution can solve the local optimal solution of the GWO algorithm.
Compared with existing PSO and GWO algorithms, the experimental results show the stability, accuracy, and convergence of the DE-OTSU-GWO algorithm. In addition, when compared with other algorithms, a convergence behavior analysis proves the high quality of the DE-OTSU-GWO algorithm.
The rest of the paper is organized as follows. Section 2 describes an improved GWO based on the DE and OTSU algorithms. Section 3 presents the experimental results and analysis. Section 4 details an experiment and discusses the best method for straw coverage detection. The last section summarizes this article.

Multithreshold OTSU
The original OTSU method is a better threshold selection algorithm in image segmentation. This method is simple and is not affected by the brightness and contrast of the image. However, the original OTSU method is a single-threshold segmentation method. After using the algorithm to divide the image into two classes, the target within the two classes can no longer be distinguished. It is possible to distinguish other targets between the two classes; therefore, we need to further divide these two classes. The multithreshold OTSU method is used to segment different classes. Assuming there are m classes to be distinguished in an image X, there are m − 1 thresholds k 1 , · · · , k n , · · · , k m−1 , which are used to divide image X into m classes. These classes are represented as C 0 = {0, 1, · · · , k 1 }, · · · , C n = k n + 1, k n + 2, · · · , k n+1 , · · · , C m = {k m + 1, k m + 2, · · · , L − 1}. The interclass variance [29,30] is as follows. (The use of the formula symbol in this section is shown in Table 1).
A set of thresholds that maximize the σ BC is the desired threshold.

Tsallis Entropy
An entropy criterion is selected to determine the threshold in threshold segmentation. Compared with Shannon entropy threshold segmentation, Tsallis entropy can be extended to nongeneralized systems.
For an image with G grey levels, p i is the probability of the greyscale i appearing in the image. Tsallis entropy S q for each distribution is as follows: In the case of single-threshold segmentation, let threshold z divide the image into two classes: target part A and background part B. The grey probability of these two parts is as follows: Tsallis entropy of two parts is as follows: The total Tsallis entropy is as follows: Set E 1 = t i=0 ( p i w 1 ) q , and extend it from a single threshold to multilevel thresholds with thresholds R. Tsallis entropy S q ([t 1 , t 2 · · · t R ]) [31] is as follows:

Differential Evolution
Differential evolution (DE) algorithm is a global optimal random search based on population iteration. Like the other genetic algorithms (GAs), DE algorithm begins with an initial population vector containing many target individuals. The current generation evolves through a repeating evolutionary process to the next generation until the termination condition is reached. DE algorithm includes mutation, crossover, and selection operations [32].
The mutation operation generates a new parameter vector by adding the weighted difference between two population vectors to a third vector, as follows: The crossover operation increases the diversity of the perturbed parameter vectors. The trial vector is as follows: The crossover operation is as follows: The selection operation is compared to the target vector using the greedy criterion, as follows:

Grey Wolf Optimizer
The grey wolf optimizer (GWO) algorithm simulates the hierarchy and hunting behavior of grey wolves. Grey wolves have a very strict social dominance hierarchy: Alpha (α) is the leader and is the best in terms of managing the pack; however, it is not the strongest member of the pack. This suggests that organization and discipline are more important than strength.
Beta (β) obeys alpha and can command other lower-level wolves. In addition, beta transmits alpha commands and provides feedback to alpha. Delta (δ) obeys alpha and beta. Omega rules over his inferiors. Omega (ω) is balanced within the population and is subject to all other dominant wolves.
The main stages of grey wolf hunting are as follows: encircling, hunting, and attacking. The behavior process of encircling prey is as follows: The hunting process is usually guided by alpha. Beta and delta might occasionally participate in hunting. According to the best search agent location, other search agents (including omega) should update their positions. Note the following formulas: The attacking is the final stage. When the prey stops moving, the grey wolves attack to end the hunting process. The GWO algorithm obtains the optimal threshold. The process model building is mainly realized by the decreasing of value → a [20]. However, the threshold value may fall into the local optimal solution with the operators after the GWO algorithm finishes the iteration.

The Proposed Method
A flowchart of the proposed algorithm is shown in Figure 1. The pseudo-code of the proposed algorithm is shown in Figure 2. The multithreshold OTSU algorithm is used to calculate the fitness of the initial population. The population is updated using the GWO algorithm and the DE algorithm through the Tsallis entropy algorithm for crossover steps. The OTSU algorithm is stable and not affected by the image brightness and contrast. The Tsallis entropy algorithm can increase the flexibility and adaptability of the algorithm. The DE algorithm prevents the threshold of the GWO algorithm from falling into the local optimal solution. GWO is used as a global search method with good search domain detection capabilities. Each stage of the proposed algorithm is described in detail below.

Initial Stage
After initializing the grey wolf population X and defining the parameters, calculate the fitness of each search agent by the multithreshold OTSU algorithm.

Initial Stage
After initializing the grey wolf population X and defining the parameters, calculate the fitness of each search agent by the multithreshold OTSU algorithm.
If there are m classes to be distinguished in wolves X = 0, 1, · · · , L − 1, then there are m − 1 thresholds. k 1 , · · · , k j , · · · , k m−1 is used to classify X into m groups of wolves. The variance between classes is as follows: The fitness of wolves, namely, the threshold value X 1 , X 2 , · · · , X n , is as follows: The multithreshold OTSU algorithm improves the selection of fitness screening, and the overall fitness becomes more accurate and stable.

Updating Stage
This stage is used to update the fitness and → X α , → X β , and → X δ position for the next stage.

Calculating Stage
In this stage, the solutions are updated in two steps. In the first step, the GWO algorithm and DE algorithm are computed separately. In the second step, the crossover and selection are used. These two steps are discussed in detail below.
The distance → D α , → D β , and → D δ between the wolves and the optimal threshold is calculated though the GWO algorithm. The position vectors of the wolf → X α , → X β , and → X δ are determined. Next, the position vector → X is updated. The mutation population y i (t + 1) is generated by a mutation operation of the DE algorithm.

Crossing and Selecting Stages
According to the mutation population obtained, all search agents perform crossover operation. Next, produce a new search agent that combines the GWO algorithm and DE algorithm. Then, select the better item from the fitness of the updating stage and the fitness of this stage that the new search agent produced.

Results and Discussion
In this section, we use a set of unconstrained benchmark functions. There are 23 benchmark functions (7 groups of unimodal benchmark functions, 6 groups of multipeak benchmark functions, and 10 groups of fixed-dimension multipeak benchmark functions) in CEC 2005 test functions [33]. These test functions were selected to compare our results with those of the current meta-heuristic. The test functions will replace the algorithm that calculates fitness. These benchmark functions are shown in Tables 2-4, where Dim represents the dimension of the function, Range is the boundary of the search space of the function, and f min is the optimal value. Figure 3 shows the 2D version of the benchmark functions used in Tables 2-4. Table 2. Unimodal benchmark functions.

Function
Dim Range f min u(x i , 10, 100, 4) All of the comparison algorithms uniformly set 30 search agents and carry out 500 iterations. The algorithm was run 30 times on each benchmark function. The average value indicates the accuracy of the search results, and the standard deviation indicates the stability of the results. To verify the results, the DE-OTSU-GWO algorithm was compared with the PSO and GWO algorithms.

Exploitation Analysis
According to Table 5, the DE−OTSU−GWO algorithm for unimodal benchmark functions f2, f3, f5, and f6 performs better than the other algorithms. The search results are closer to the real optimal solution. These results demonstrate the superior performance of DE−OTSU−GWO in finding optimal solutions.

Exploitation Analysis
According to Table 5, the DE−OTSU−GWO algorithm for unimodal benchmark functions f2, f3, f5, and f6 performs better than the other algorithms. The search results are closer to the real optimal solution. These results demonstrate the superior performance of DE−OTSU−GWO in finding optimal solutions.
For the multimodal benchmark functions, the DE−OTSU−GWO algorithm is for the most part superior to the other algorithms. For f11, f12, and f13, the DE−OTSU−GWO algorithm performed superior optimization.
For the fixed−dimension multimodal benchmark functions f14, f15, and f21, the DE−OTSU−GWO algorithm had better results. In addition, the GWO algorithm performed well in f20, f22, and fc23.

Convergence Behavior Analysis
During the initial step optimization, the movement of the search agent should change the mutation. This helps the meta−heuristic to explore the search space broadly. To observe the convergence of the DE−OTSU−GWO algorithm, Figure 4 depicts the changes in the iterative process of the three algorithms and describes the search history of the search agent (A final value close to f min is preferable). This shows that the search agents of the PSO and GWO algorithms tend to search a wide range of promising areas of the search space and dig out the best areas. In the DE−OTSU−GWO algorithm, there is mutation in the initial stage, and the mutation gradually decreases with the progress of iteration.   In summary, compared with the GWO and PSO algorithms, the DE−OTSU−GWO algorithm is more stable and accurate in solving benchmark functions. To further investigate the effect of the proposed algorithm, the next section discusses the practical problem of classical agricultural image recognition. Compared with the existing algorithm, the validity of the algorithm is verified.

DE−OTSU−GWO Algorithm for Classical Agricultural Image Recognition Problems
The problem studied in this section is called the detection of straw coverage. Straw is one of the important biomasses in agricultural production systems. Straw mulching is an effective measure used to increase soil fertility and crop yield and promote the sustainable development of cultivated land. Straw coverage is an important index to measure conservation tillage technology. Research on the method of detecting straw coverage quickly can improve the efficiency and accuracy of straw coverage detection. This is important for straw coverage experiments.
At present, straw coverage detection research is common. However, due to the constraints of the shooting environment, detection conditions, external interference, and other factors, the research of straw coverage based on machine vision is still in the experimental picture processing stage. The method is difficult to apply to actual field work. The methods of identifying straw and soil of similar colors caused by different coverage degrees and of calculating the actual area of farmland synchronously are seldom studied.
In this part, the DE−OTSU−GWO algorithm is compared with four other algorithms (PSO, GWO, DE−GWO [34], and 2D−OTSU−FA [28]) to detect and segment the straw coverage image.
For the image of straw, the INSPire2 unmanned aerial vehicle (DJI) was equipped with an X5S camera. The key technical methods of straw coverage rate detection are studied by means of image processing to calculate the straw coverage rate and actual coverage area. The straw, land, and incineration parts of the straw images are yellow, light brown, brown, and dark brown. These colors are very similar to each other.
To  The problem studied in this section is called the detection of straw coverage. Straw is one of the important biomasses in agricultural production systems. Straw mulching is an effective measure used to increase soil fertility and crop yield and promote the sustainable development of cultivated land. Straw coverage is an important index to measure conservation tillage technology. Research on the method of detecting straw coverage quickly can improve the efficiency and accuracy of straw coverage detection. This is important for straw coverage experiments.
At present, straw coverage detection research is common. However, due to the constraints of the shooting environment, detection conditions, external interference, and other factors, the research of straw coverage based on machine vision is still in the experimental picture processing stage. The method is difficult to apply to actual field work. The methods of identifying straw and soil of similar colors caused by different coverage degrees and of calculating the actual area of farmland synchronously are seldom studied.
In this part, the DE−OTSU−GWO algorithm is compared with four other algorithms (PSO, GWO, DE−GWO [34], and 2D−OTSU−FA [28]) to detect and segment the straw coverage image.
For the image of straw, the INSPire2 unmanned aerial vehicle (DJI) was equipped with an X5S camera. The key technical methods of straw coverage rate detection are studied by means of image processing to calculate the straw coverage rate and actual coverage area. The straw, land, and incineration parts of the straw images are yellow, light brown, brown, and dark brown. These colors are very similar to each other.
To test the effectiveness of the algorithm, the segmentation effects of PSO, GWO, DE−GWO, DE−OTSU−GWO, and 2D−OTSU−FA were compared. To calculate the straw coverage, it is necessary to divide the straw part and the other parts. The five algorithms are all calculation units of three thresholds. Part 1 and part 2 are the straw part, and part 3 and part 4 are the other parts. Figure 5 shows the original straw image with a height of 100 m. The overall pixel value is 15,681,600. The segmentation results of five algorithms are listed in Table 6.  Figure 6 shows the image segmentation of the five algorithms. It can be seen that GWO, DE−GWO, and 2D−OTSU−FA misjudged the road as straw. Compared with the PSO algorithm, the DE−OTSU−GWO algorithm has a better segmentation effect. The segmentation results of five algorithms are listed in Table 6.    The segmentation results of the five algorithms are listed in Table 7.      The sensitivity generated by the integration of each algorithm can be seen from the influence of the algorithm on the whole. The sensitivity C is as follows: (31) If is large, then is stable. If is small, then is sensitive. Table 8   The segmentation results of the five algorithms are listed in Table 7. Figure 8 shows the image segmentation of the five algorithms. It can be seen that GWO, DE−GWO, PSO, and 2D−OTSU−FA can also divide the straw part, however, the four algorithms misjudge the land as straw. The DE−OTSU−GWO has a better segmentation effect in comparison with the other four algorithms. The sensitivity generated by the integration of each algorithm can be seen from the influence of the algorithm on the whole. The sensitivity C is as follows: If C is large, then F(x) is stable. If C is small, then F(x) is sensitive. Table 8   3.654632 Figure 9 shows the manual segmentation of straw using Adobe Photoshop software.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 18 of 21 If is large, then ( ) is stable. If is small, then ( ) is sensitive. Table 8 lists the analysis results for the DE−OTSU−GWO algorithm. For the first and the third thresholds, OTSO−GWO is sensitive compared with GWO and DE−GWO, and the difference is obvious. In the second threshold, DE−GWO is sensitive compared with OTSU−GWO, but the difference is insignificant. T(n) is time complexity. The size of the loop n of the algorithm is different, therefore, T(n) cannot directly represent the time consumption. After adding the DE algorithm, although the time complexity increases by O(18n 4 ), it reduces the time to solve the local optimal solution of the GWO algorithm. The OTSU algorithm needs to traverse each grey value and classify it; the overall time is increased. For example, when the DE−OTSU−GWO algorithm processes Figure  7 as configured in Section 3, the processing time is within the acceptable range. 3.654632 Figure 9 shows the manual segmentation of straw using Adobe Photoshop software. A number of parameters can be used to assess the segmentation. In this paper, the global consistency error (GCE) [35], random index (RI) [36], and variation of information (VI) [37] are used to compare the segmentation results. If GCE and VI are high, then there is a significant difference in segmentation. If GEC and VI are low, then there is a slight difference. RI means the opposite of GCE and VI [38]. GCE, RI, and VI are shown below. (The use of the formula symbol in this section is shown in Table 9.) A number of parameters can be used to assess the segmentation. In this paper, the global consistency error (GCE) [35], random index (RI) [36], and variation of information (VI) [37] are used to compare the segmentation results. If GCE and VI are high, then there is a significant difference in segmentation. If GEC and VI are low, then there is a slight difference. RI means the opposite of GCE and VI [38]. GCE, RI, and VI are shown below. (The use of the formula symbol in this section is shown in Table 9.) Table 9. The implication of the formula symbol in Section 4.

Symbol Implication
Symbol Implication  Tables 8 and 10, it can be seen that the OTSU algorithm is improved compared with the other four algorithms in terms of accuracy, although it increases in time. The combination of DE and GWO can solve the local optimal solution problem and reduce time consumption.

Conclusions
There have been a number of improved grey wolf optimizer (GWO) algorithms in recent years, including an improved GWO algorithm for initial population selection and threshold selection. This paper proposed an improved GWO algorithm based on the differential evolution (DE) algorithm and the OTSU algorithm. The GWO algorithm combines multithreshold OTSU, Tsallis entropy, and DE algorithms. Multithreshold OTSU calculates the fitness in the initial population and makes the initial stage basically stable, and not affected by image brightness and contrast. Tsallis entropy quickly calculates the fitness. The DE algorithm can solve the local optimal solution of the GWO algorithm.
The performance of the DE−OTSU−GWO algorithm was tested using a CEC2005 benchmark function (23 test functions). Compared with existing PSO and GWO algorithms, the experimental results showed that the DE−OTSU−GWO algorithm is more stable and accurate in solving benchmark functions. In addition, compared with other algorithms, a convergence behavior analysis proved the high quality of the DE−OTSU−GWO algorithm.
In the results of classical agricultural image recognition problems, compared with GWO, PSO, DE−GWO, and 2D−OTSU−FA, the DE−OTSU−GWO algorithm had accuracy in straw image recognition and is applicable to practical problems. In the sensitivity detection of each algorithm, for the first and the third thresholds, the OTSO−GWO is sensitive compared with GWO and DE−GWO, and the difference is obvious. In the second threshold, the DE−GWO is sensitive compared with OTSU−GWO, but the difference is insignificant. In terms of time complexity, after adding the DE algorithm, the time complexity increases by O(18n 4 ). However, the OTSU algorithm needs to traverse each grey value and classify it, so the overall time is increased. Adding the DE algorithm can solve the local optimal solution of GWO and the time will be reduced.

Conflicts of Interest:
The authors declare no conflict of interest.