# An Improved Grey Wolf Optimizer Based on Differential Evolution and OTSU Algorithm
## 4 De-Otsu\(-\)Gwo Algorithm for Classical Agricultural Image Recognition Problems
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. Figure 8: Image segmentation of five algorithms with the height of 30 m.  
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:  
\[C=\left|\frac{F(x+y)-F(x)}{F(x+y)}\right| \tag{31}\]  
If C is large, then \(F(x)\) is stable. If C is small, then \(F(x)\) is sensitive. Table 8 lists the analysis results for the DE-OTSU-GWO algorithm. For the first and the third thresholds, OTSU-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. 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 \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Algorithms** & \begin{tabular}{c} **The Threshold** \\ **Value** \\ \end{tabular} & \begin{tabular}{c} **Pixel** \\ **Values of** \\ **Part 1** \\ \end{tabular} & \begin{tabular}{c} **Pixel** \\ **Values of** \\ **Part 2** \\ \end{tabular} & \begin{tabular}{c} **Pixel** \\ **Values of** \\ **Part 3** \\ \end{tabular} & \begin{tabular}{c} **Pixel** \\ **Values of** \\ **Part 4** \\ \end{tabular} & \
\begin{tabular}{c} **Straw** \\ **Pixel** \\ **Value** \\ \end{tabular} &
\begin{tabular}{c} **Other** \\ **Pixel** \\ **Values** \\ \end{tabular} \\ \hline DE–OTSU–GWO & 123/161/228 & 969 & 8384 & 20,927 & 82,530 & 9353 & 103,457 \\ GWO & 71/140/199 & 2974 & 14,653 & 61,276 & 33,907 & 17,627 & 95,183 \\ DE–GWO & 49/145/189 & 4144 & 10,983 & 75,835 & 21,848 & 15,127 & 97,683 \\ PSO & 71/148/206 & 2296 & 11,483 & 64,488 & 34,543 & 13,779 & 99,031 \\
2D–OTSU–FA & 97/145/192 & 3886 & 11,241 & 43,542 & 54,141 & 15,127 & 97,683 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: The segmentation results of five algorithms. Figure 9: Manual segmentation of straw. and VI [38]. GCE, RI, and VI are shown below. (The use of the formula symbol in this section is shown in Table 9.)  
\[E\Big{(}S_{1},S_{2},p_{q}\Big{)}=\frac{\Big{|}R\Big{(}S_{1},p_{q}\Big{)}\backslash R \Big{(}S_{2},p_{q}\Big{)}\Big{|}}{\Big{|}R\Big{(}S_{1},p_{q}\Big{)}\Big{|}} \tag{32}\]  
\[GCE(S_{1},S_{2})=\frac{1}{n}\text{min}\Bigg{\{}\sum\limits_{i}E\Big{(}S_{1},S_{ 2},p_{q}\Big{)},\sum\limits_{i}E\Big{(}S_{2},S_{1},p_{q}\Big{)}\Bigg{\}} \tag{33}\]  
\[RI(S,S^{\prime})=1-\frac{\Big{[}\frac{1}{2}\Big{\{}\sum\limits_{i}\Big{(}\sum \limits_{j}n_{ij}\Big{)}^{2}+\sum\limits_{j}\Big{(}\sum\limits_{i}n_{ij}\Big{)} ^{2}\Big{\}}-\sum\ \ n_{ij}\Big{]}}{\Bigg{(} \begin{array}{c}N\\ 2\end{array} \Bigg{)}} \tag{34}\]  
\[VI(C_{1},C_{2})=[H(C_{1})-I(C_{1},C_{2})]+[H(C_{2})-I(C_{1},C_{2})] \tag{35}\]  
Table 10 lists the assessment results of segmentation. The manual segmentation image is regarded as the gold standard image. Compared with GWO, DE\(-\)GWO, PSO, and 2D\(-\)OTSU\(-\)FA, the DE\(-\)OTSU\(-\)GWO algorithm has better results in the detection of RI, GCE, and VI.