1 Introduction

Image segmentation is the basic work of image processing research. There are primarily four types of segmentation methods: thresholding [26, 28, 45], boundary-based [13, 18], region-based [8, 12, 37], and hybrid techniques [7, 9, 20, 30]. The threshold method involves selecting a set of thresholds using some of the characteristics defined from the image. The concept of gray-level co-occurrence matrix (GLCM) considers the spatial correlation among the gray level of image [4, 32]. GLCM has attracted more and more attention, and high quality segmentation images can be obtained by using gray co-occurrence matrix for image segmentation. GLCM is used in many fields, Li M proposed a method on marble texture image segmentation based on Gray Level Co-occurrence Matrix (GLCM) [27]. Zhao M proposed a method of declaring an image based on rich edge region extraction using a gray-level co-occurrence matrix [55]. This method could better extract the edge information of the image. Qayyum R presented a novel approach for classification of wood knot defects for an automated inspection [40]. The proposed technique utilized gray level co-occurrence matrix based features and a particle swarm optimization trained feedforward neural network. The improved GLCM algorithm can improve the segmentation accuracy, so in order to better improve the image segmentation accuracy of the algorithm, it has become a common method to use the optimization algorithm to find the optimal segmentation threshold of the multi-threshold algorithm [21, 31, 51].

The optimization algorithm can solve practical engineering problems in recent years. Different optimization algorithms adapt to different engineering problems and have different optimization capabilities [6, 33]. These nature-inspired optimization algorithms are mainly classified into two classes recently which are evolutionary algorithm (EA) and biology-inspired or bio-inspired algorithms. EA imitated the Darwinian theory of evolution [14]. There were many good algorithms in this class. In 1975, GA was invented by John Holland [16], it used the binary representation of individuals. In 1997, Differential evolution was proposed Rainer stone, the essence was a multi - objective optimization algorithm [46]. The most popular class was the biology-inspired or bio-inspired algorithms right now. One of the most famous algorithm was the Particle Swarm Optimizer (PSO) which was developed based on the swarming behavior of fish and birds [24]. In 2015, the ant lion optimizer was proposed by Mirjalili [35]. In 2016, Askarzadeh proposed the crow search algorithm [3]. In 2017, the killer whale algorithm was proposed by Biyanto [5]. These algorithms were inspired from the predation behavior animal, so as to obtain better searching ability. There also some algorithms inspired from the physics and chemistry, these algorithms usually had simple mathematical models, but had good optimization effect. In 2001, the harmony search algorithm was proposed by Geem [15]. In 2015, Zheng Yu-Jun proposed water wave optimization algorithm [56]. In 2017, Kaveh A proposed the thermal exchange optimization [23]. The algorithm was proposed according to Newton’s law of cooling. Because of the simple mathematical model, these algorithms that imitated physical phenomena were easy to fall into local optimum when solving complex optimization problems. So, using different strategies to improve the optimization algorithm can better solve engineering problems.

Although there is no perfect optimization algorithm, the optimization algorithm can be improved to make it more suitable for solving engineering problems. The strategy commonly used by scholars was Levy-flight. Levy flight (LF) was a random walk strategy whose step length obeyed the Levy distribution [29, 48, 57]. Yan Bailu proposed a particle swarm optimization algorithm which used random learning mechanism and levy flight as the improved strategies [52]. The algorithm can be found faster and more efficiently. Mesa A used Levy flight improve the cuckoo search algorithm [34]. The results show that compared with particle swarm optimization and other existing algorithms, the algorithm can obtain better facility location. Mousavirad S J proposed a simple but efficient population-based metaheuristic algorithm called human mental search (HMS) [36]. The algorithm performed a mental search of HMS, exploring the area around each solution based on Levy flight. Heidari A A proposed an improved modified GWO algorithm for solving either global or real-world optimization problems [19]. Opposition-based learning (OBL) as a new scheme for machine intelligence was introduced by Tizhoosh H R [47]. This new approach was based on estimates and counter-estimates, weights and relative weights, actions and counteractions. Ahmed A E proposed an improved version of the grasshopper optimization algorithm (GOA) based on the opposition-based learning (OBL) strategy called OBL-GOA for solving benchmark optimization functions and engineering problems [1]. Experiments show that the results of this algorithm were better than those of ten famous algorithms in this field. Dong W improved particle swarm optimization with OBL [10]. This method solved the problem of premature convergence of traditional particle swarm optimization. So, the strategic methods can increase the jump step length of individual population and increase the search range of individual population.

In this paper, we mainly study the threshold selection of multi-threshold GLCM. As the number of thresholds increases, the operation time of the algorithm increases and the segmentation accuracy decreases. We propose an improved TEO algorithm to optimize the multi-threshold GLCM algorithm, and use LF and OBL to improve the TEO algorithm to improve its optimization ability. The DCE is used as the fitness function to find the image threshold more accurate. The ITEO algorithm can effectively improve the segmentation accuracy of multi-threshold GLCM and reduce the overall running time of the algorithm.

2 Material and methods

2.1 Problem assessment of multilevel thresholding

The process of searching optimal thresholding values of a given image is considered as a constrained optimization problem. For bi-level thresholding, the problem is to find an optimal valueT. If the image intensity Ii, j is less than the value T, the pixel in an image is replaced with a black pixel or a white pixel if the image intensity is greater than that constant T, the expression can be stated as follows:

$$ g\left(x,y\right)=\left\{\begin{array}{l}1\kern0.5em if\kern0.5em f\left(x,y\right)>{T}^{\ast}\\ {}0\begin{array}{cc}& if\begin{array}{cc}& f\left(x,y\right)<{T}^{\ast}\end{array}\end{array}\end{array}\right. $$
(1)

The problem can be extended to multilevel thresholding that has more than one threshold value and divide the original image into multiple classes:

$$ {\displaystyle \begin{array}{l}{N}_0=\left\{g\left(x,y\right)\in I\left|0\le g\left(x,y\right)\le {t}_1-1\right|\right\}\\ {}{N}_1=\left\{g\left(x,y\right)\in I\left|{t}_1\le g\left(x,y\right)\le {t}_2-1\right|\right\}\\ {}{N}_i=\left\{g\left(x,y\right)\in I\left|{t}_i\le g\left(x,y\right)\le {t}_i-1\right|\right\}\\ {}{N}_n=\left\{g\left(x,y\right)\in I\left|{t}_n\le g\left(x,y\right)\le L-1\right|\right\}\end{array}} $$
(2)

where Ni is the ith class, n is the number of threshold values, and ti(i=1,⋯,n) is the ith threshold value.

2.2 Grey-level co-occurrence matrix (GLCM)

GLCM is a second-order statistical method that computes the frequency of pixel pairs having same gray-levels in an image and applies additional knowledge obtained using spatial pixel relations [22, 38]. Co-occurrence matrix embeds distribution of grayscale transitions using edge information. Since, most of the information required for computing threshold values is embedded in GLCM, it has emerged as a simple yet effective technique.

Consider I as an image with 0 to L quantized gray-levels, L is considered as 256. Each matrix element of the GLCM contains the second-order statistics, probability values for changes between gray levels i and j for a particular displacement and angle. For a given distance, four angular GLCM are defined for θ=0°, 45°, 90°, and 135°.

$$ G=\left[g\left(d,{0}^{\circ}\right)+g\left(d,{45}^{\circ}\right)+g\left(d,{90}^{\circ}\right)+g\left(d,{135}^{\circ}\right)\right]/4 $$
(3)

Where g(•) denotes GLCM in one direction only. Next, to prevent a negative value occurring for the entropy, we normalize the final GLCM as:

$$ G\left(i,j\right)=g\left(i,j\right)/\sum \limits_{i=1}^L\sum \limits_{j=1}^Lg\left(i,j\right) $$
(4)

In this paper, we use the entropy feature computed from the GLCM. Let L be the number of gray levels in the image. Then the size of GLCM will be L×L. Let G(i, j) represents an element of the matrix. Then the entropy feature from the matrix is computed as

$$ H=-\sum \limits_{i=1}^L\sum \limits_{i=1}^LG\left(i,j\right)\times \ln \left(G\left(i,j\right)\right) $$
(5)

However, for bi-level thresholding, for a threshold value T, the DCE is computed as

$$ {H}_A=-\sum \limits_{i=1}^T\sum \limits_{i=1}^TG\left(i,j\right)\times \ln \left(G\left(i,j\right)\right) $$
(6)
$$ {H}_C=-\sum \limits_{i=T+1}^L\sum \limits_{i=T+1}^LG\left(i,j\right)\times \ln \left(G\left(i,j\right)\right) $$
(7)
$$ {H}_{DCE}(T)={H}_A(T)+{H}_C(T) $$
(8)

When this formulation is extended to multilevel thresholding, we consider only the diagonal regions of the GLCM for computing the DCE for each level of thresholding. The optimum thresholds are obtained when DCE is minimized. We introduce here the theoretical formulation for multilevel thresholding using DCE. For (K–1) thresholds [T1,T2,...,TK−1] the DCE is computed as

$$ {H}_{DCE}\left({T}_1,{T}_2,...,{T}_{K-1}\right)=-\sum \limits_{i=1}^{T_1}\sum \limits_{i=1}^{T_1}G\left(i,j\right)\times \ln \left(G\left(i,j\right)\right)-\sum \limits_{i={T}_1}^{T_2}\sum \limits_{i={T}_1}^{T_2}G\left(i,j\right)\times \ln \left(G\left(i,j\right)\right)\cdots -\sum \limits_{i={T}_{K-1}+1}^L\sum \limits_{i={T}_{K-1}+1}^LG\left(i,j\right)\times \ln \left(G\left(i,j\right)\right) $$
(9)

The proposed objective function is:

$$ \left\{{T}_1,{T}_2,...,{T}_{K-1}\right\}=\mathrm{argmin}\left\{{H}_{DCE}\left({T}_1,{T}_2,...,{T}_{K-1}\right)\right\} $$
(10)

Where, K is the number of classes.

2.3 Between-class variance method (Otsu’s method)

The Otsu based between-class variance method has been employed in determining the optimal thresholding values of an image. The Otsu’s method can be described as follows: assume that an image can be represented in L gray levels (1,2, …,L) and has N pixels [25]. The number of pixels at level i are denoted byf1, and N=f1+f2+⋯fi.Then, the occurrence probability of gray level i can be defined by the following equation:

$$ {p}_i=\frac{f_i}{N},{p}_i\ge 0,\sum \limits_{i=1}^L{p}_i=1 $$
(11)

In bi-level thresholding, the optimum threshold t divides the image into two classes, and the cumulative probabilities of each class can be described as follows:

$$ {\varpi}_0=\sum \limits_{i=1}^t{p}_i,{\varpi}_1=\sum \limits_{i=t+1}^L{p}_i $$
(12)

The mean levels of two classes can be defined as follows:

$$ {\mu}_0=\sum \limits_{i=1}^ti{p}_i/{\varpi}_0,{\mu}_1=\sum \limits_{i=t+1}^Li{p}_i/{\varpi}_1 $$
(13)

Let μT be the mean levels of the whole image and it can be defined by

$$ {\mu}_T=\sum \limits_{i=1}^Li{p}_i $$
(14)

The between-class variance of whole classes can be represented by

$$ f(t)={\sigma}_0+{\sigma}_1 $$
(15)

Whereσ0=ϖ0(μ0μT)2andσ1=ϖ1(μ1μT)2. For bi-level thresholding, the Otsu’s method find an optimal threshold tby maximizing the between-class variance, that is:

$$ {t}^{\ast }=\mathrm{argmax}\left(f(t)\right) $$
(16)

The Otsu’s method can be also extended to multi-level thresholding. Assuming that there are m thresholds, which divide the image into m+ 1 classes. The extended between-class variance is calculated by

$$ f(t)=\sum \limits_{i=0}^m{\sigma}_i $$
(17)

The sigma terms are determined by Eq. 18 and the mean levels are calculated by Eq. 19:

$$ {\displaystyle \begin{array}{l}{\sigma}_0={\varpi}_0{\left({\mu}_0-{\mu}_T\right)}^2,{\sigma}_1={\varpi}_1{\left({\mu}_1-{\mu}_T\right)}^2,\cdots, \\ {}{\sigma}_{M-1}={\varpi}_{M-1}{\left({\mu}_{M-1}-{\mu}_T\right)}^2\end{array}} $$
(18)
$$ {\displaystyle \begin{array}{l}{\mu}_0=\sum \limits_{i=1}^ti{p}_i/{\varpi}_0,{\mu}_1=\sum \limits_{i={t}_1+1}^{t_2}i{p}_i/{\varpi}_1,\cdots, \\ {}{\mu}_{M-1}=\sum \limits_{i={t}_{M-1}+1}^Li{p}_i/{\varpi}_{M-1}\end{array}} $$
(19)

The optimum thresholds are found by maximizing the between-class variance by Eq. 20:

$$ {t}^{\ast }=\mathrm{argmax}\left(\sum \limits_{i=0}^{M-1}{\sigma}_i\right) $$
(20)

2.4 Thermal exchange optimization

The TEO is a new optimization algorithm based on Newton’s law of cooling which the rate of heat loss of a body is proportional to the difference in temperatures between the body and its surroundings. The hot iron objects transferring heat to the surrounding environment is shown in Fig. 1.

Fig. 1
figure 1

Hot iron objects, transferring heat to the surrounding environment

In TEO algorithm, some agents are defined as the cooling objects and the remaining agents are supposed to represent the environment. Updating the temperature formula between objects can be defined as:

$$ {T}_i^{env}=\left(1-\left({c}_1+{c}_2\times \left(1-t\right)\right)\times random\right)\times {T}_i^{\hbox{'} env} $$
(21)
$$ t=\frac{l}{L} $$
(22)

where c1, c2 are the controlling variables, \( {T}_i^{\hbox{'} env} \) is the previous temperature of the object, which is modified to \( {T}_i^{env} \). l is the current iteration number, L is the max iteration number.

According to the previous steps and Eq. 23, new temperature of each object is updated by

$$ {T}_i^{new}={T}_i^{env}+\left({T}_i^{old}-{T}_i^{env}\right)\exp \left(-\beta t\right) $$
(23)
$$ \beta =\frac{\mathrm{Cos}t(object)}{\mathrm{Cos}t\left( worst- object\right)} $$
(24)

Where, the nature when an object has lower β, it exchanges the temperature slightly. The value of β for each object is evaluated according Eq. 24. The Cost(object) is the current value of the target object, and the Cost(worstobject) is the worst value of the target object.

To prevent the temperature of the object from falling into local optimum, set the parameter Pro. It is specified whether a component of each cooling object must be changed or not. If rand<Pro, one dimension of the ith agent is selected randomly and its value is regenerated as follows:

$$ {T}_{i,j}={T}_{i,\min }+\mathit{\operatorname{rand}}\times \left({T}_{j,\max }-{T}_{j,\min}\right) $$
(25)

Where, Ti, j is the j th variable of the ith agent. Tj, max and Tj, min are the lower and upper bounds of the j th variable.

The general framework of TEO as follows:

figure a

2.5 Levy flight trajectory

Levy’s flight is a random step that describes the Levy distribution. Numerous studies have shown that the behavior of many animals and insects is a classic feature of Levy’s flight [54]. Levy flight is a special random step method, which is a simulation of the flight path of Levy. The Fig. 2 is the simulation of two-dimensional levy flight by Mantegna method. Its step length is always small, but occasionally it will also appear large pulsation.

Fig. 2
figure 2

Levy’s flight path

The formula for Levy flight is as follows:

$$ Levy\sim u={t}^{-\lambda },1<\lambda \le 3 $$
(26)

The formula for generating Levy random step proposed by Mantegna is as follows:

$$ \mathrm{s}=\frac{\mu }{{\left|v\right|}^{1/\beta }} $$
(27)

where, parameter β=1.5, \( \mu =\mathrm{N}\left(0,{\sigma}_{\mu}^2\right) \) and \( \mathrm{v}=\mathrm{N}\left(0,{\sigma}_{\mu}^2\right) \) are gamma functions.

The variance of the parameters as follows:

$$ {\sigma}_{\mu }={\left[\frac{\varGamma \left(1+\beta \right)\times \sin \left(\pi \times \beta /2\right)}{\varGamma \left[\left(1+\beta \right)/2\right]\times \beta \times {2}^{\left(\beta -1\right)/2}}\right]}^{1/\beta },{\sigma}_v=1 $$
(28)

The distribution of β parameters in determining the main part. The parameter β controls the probability of the shape so that you can get the probability distribution of different shapes, especially in the tail region according to the parameter β. Thus, the smaller the beta parameter, the longer the distribution jumps because there are long tails.

2.6 Opposition-based learning

The opposition-based learning can be regarded as a well-regarded mathematical concept among the community of computational intelligence. The OBL can attain the opposite locations for candidate solutions for a given task. The new location can provide a new chance to become aware of a neighboring point to the best position [41].

The core conception of OBL optimization is, for disclosing an improved solution, simultaneously calculating and evaluating a candidate solution and related matching opposite solution, choosing the best solution as the next-generation individual. For a candidate solutionXi, the related matching opposite solution\( {X}_i^{\hbox{'}} \) can be calculated according to the following formula:

$$ {X}_i^{\hbox{'}}=a+b-{X}_i,{X}_i\in \left[a,b\right] $$
(29)

Where a and b are the lower bound and upper bound of the search space, respectively. Optimization based optimization: Let Xi be a point in the d-dimensional space, and suppose f(Xi) is a fitness function to evaluate the fitness of candidates. By definition of vertices, \( {X}_i^{\hbox{'}} \) is the opposite of Xi. If \( f\left({X}_i^{\hbox{'}}\right) \) is better than f(Xi), then update Xi with \( {X}_i^{\hbox{'}} \); Otherwise, keep the current point Xi. Hence, the current point and its relative points are calculated at the same time to be consistent with more appropriate points.

3 Proposed method

3.1 Improved thermal exchange optimization (ITEO)

In this subsection, we describe in detail strategic approaches to improving TEO algorithms. LF and OBL can improve the optimal position moving step length, so that it can get closer to the food source more quickly. The strategy method can make a suitable balance between the exploration and exploitation. The basic formula of the strategy is shown in section 2. The improved ITEO algorithm will be described by the following formula.

We choose Levy flight with strong randomness to improve the best individual position, increase its jump step size. Levy’s flight strategy can speed up the transfer of heat between objects in TEO algorithm, so as to quickly move to the optimal value of the function, which is formulated as follows:

$$ {T}_i^{Levy}={T}_i^{env}+\left({T}_i^{old}-{T}_i^{env}\right)\exp \left(-\beta t\right)\times Levy\left(\beta \right) $$
(30)

After updating the positions of all search agents in the population, the opposition-based learning strategy is used to generate the oppositional population corresponding to the current population. This mechanism helps to search for more efficient space and improves the overall exploration capability of the algorithm. Equation 25 can be generated by the following formula:

$$ {T}_i^{op}={T}_{\mathrm{max}}+{T}_{\mathrm{min}}-{T}_{best}+r\left({T}_{best}-{T}_i\right) $$
(31)

Where, \( {T}_i^{op} \) is the position of the ith opposite temperature inside the search domain. Tmaxand Tmin are the lower and upper bounds of the ith variable. Tbest is the position of the best temperature, r is a random vector with elements inside (0,1). And Ti is the position vector of the ith temperature in population. Then, the best temperature is also updated based on the fitness of the opposite locations. The improved algorithm can better improve the global search ability and convergence performance of TEO algorithm, so as to make the temperature change faster and find the optimal value better.

3.2 Proposed GLCM-ITEO method

In this section, the multi-segmentation method based on ITEO is described in detail. The computational complexity of the proposed method ITEO-GLCM depends on the number of each combination (L), the number of threshold (K), the number of generations (g), the population number (n) and the parameters dimensions (d). Therefore, the overall computational complexity is O(GLCM, ITEO)=g*(O(Updating the position of all search agents)+O(Evaluate the fitness of all agents)+O(Calculate the oppositional position of all search agents and evaluate its fitness)+O(Sort search agents in population and oppositional population)). As we all know, GLCM’s computational complexity of L combination is O(LK). The computational complexity of updating the position of all search agents is O(n*d). Evaluating the fitness of all agents is O(nLK). Calculating the oppositional position of all search agents and evaluate its fitness is O(nLK). Sorting search agents in population and oppositional population is O(2n*log2n). So, the final computational complexity of the proposed method is as follow:

$$ O\left( GLCM, ITEO\right)\approx O\left(g\ast \left(n\ast d+n\ast {L}^K+n\ast {L}^K+2n\ast \log 2n\right)\right)=O\left(n\ast g\ast \left(d+2\left({L}^K+\log 2n\right)\right)\right) $$
(32)

As can be seen from Eq. 32, as the number of thresholds increases, the computational complexity increases, and the segmentation accuracy of the obtained results will decline to some extent. Therefore, ITEO optimization algorithm is used to optimize multi-threshold GLCM, and DCE is used as the fitness function to find the minimum value of this function. At this point, the optimal value obtained is multiple thresholds of the image, and the input image is segmented into multiple regions by multiple thresholds to obtain the segmentation result graph. The flow chart of the ITEO-GLCM can be seen from Fig. 3.

Fig. 3
figure 3

The flow chart of the ITEO-GLCM

The pseudo code of the GLCM-ITEO is given below.

figure b

4 GLCM image segmentation experiment

In this section, ITEO algorithm is applied to optimize the DCE function of GLCM algorithm. In order to better verify the image segmentation ability of GLCM-ITEO algorithm, it is compared with the optimized GLCM algorithm of CSA, PSO, FPA and BA. The color image has three color channels. In this paper, the images of the three channels are segmented, and then the three resulting images are fused to obtain the final segmentation result graph. Firstly, the segmentation effect and precision of GLCM-ITEO algorithm are analyzed when the threshold value is increased. Then the segmentation ability, statistical analysis and stability analysis of the proposed ITEO algorithm and other optimization algorithms in GLCM image segmentation are analyzed. Finally, the Berkeley image library is tested and analyzed. All parameters of the comparison optimization algorithm are shown in Table 1.

Table 1 Parameters and references of the comparison algorithms

The test images in this paper are as follows Fig. 4. The test images included color natural images and satellite images. Natural color test images (Kodim images) are accessed from http://r0k.us/graphics/kodak/. The satellite images such as Satellite image1 and Satellite image2 has been obtained from the aerial dataset available on http://sipi.usc.edu/database/database.php?volume=aerials. Satellite image3 and Satellite image4 has been obtained from https://landsat.visibleearth.nasa.gov/. Color image segmentation requires a higher threshold level, so it is more complex to use optimization technology to solve the problem. Therefore, the optimization algorithm has the characteristics of randomness. So, all image segmentation experiments were run separately for 30 times. And the threshold levels of 4, 6, 8 and 12 are selected to find the threshold points corresponding to each color channel in the image. The evaluation of image segmentation result graph is very important, so this paper selected Average Precision (AP) [11] and Intersection over Union (IoU) [17]as the evaluation index of test image.

Fig. 4
figure 4

The color test images

4.1 Experiment 1: Levy’s flight parameter β selection

According to the section 3, Levy’s flight strategy has a strong jumping ability, and its parameters can affect its jumping results. Therefore, ITEO algorithm is tested. Through experiments on 8 images, AP and IoU values of different β results are obtained in Tables 2 and 3. From the tables, it can be seen that the addition of levy flight effectively improves the segmentation accuracy of the algorithm and increases the optimization ability of TEO algorithm. At the same time, from different β results, it can be clearly seen that they have different influences on the results. Obviously from the table, when the parameter β=0.5, the step size is small, and the jumping ability is not obvious, it is easy to fall into the local optimal. When parameter β=2, the step size is too large and the jumping ability is too strong, which easily influences the optimization ability of the algorithm beyond the boundary. When parameter β=1.5, ITEO gets the best result. So, in subsequent experiments, the parameter β=1.5.

Table 2 The AP value of ITEO under different parameters
Table 3 The IoU value of ITEO under different parameters

4.2 Experiment 2: Multilevel thresholding results on GLCM-ITEO

In this experiment, the results obtained by proposed GLCM based ITEO algorithm is analyzed at number of threshold values (T=4, 6, 8, and 12) for the test images. Satellite images are difficult to be segmented because of their multimodal characteristics. Therefore, an algorithm based on spatial correlation is proposed to solve these problems. Table 4 indicates the AP and IoU values of the segmented results. Higher values of AP and IoU signify better and accurate segmentation. When the number of threshold values T=4, the AP value and IoU value of each algorithm are lower. With the increase of the number of threshold values, the IOU and AP values also increase, indicating that the increase of the number of threshold values can increase the segmentation precision of the image and make the segmentation result more similar to the original image. Tables 5 and 6 show the optimal thresholds obtained by the proposed technique for satellite images and natural color images, respectively.

Table 4 The AP and IOU of each algorithm under GLCM
Table 5 The threshold levels of each algorithm under GLCM
Table 6 The optimal fitness value of each algorithm under GLCM

For visual qualitative analysis, the performance of this method at different segmentation levels is shown in Figs. 5, 6, 7, 8, 9, 10, 11 and 12. As can be seen from the satellite images, the ITEO algorithm can also achieve satisfactory segmentation effect with good edge preservation. It can be seen from the natural images that the ITEO algorithm can avoid the phenomenon of under-segmentation and the segmentation of natural images is relatively complete.

Fig. 5
figure 5

The segmentation results of Satellite image1

Fig. 6
figure 6

The segmentation results of Satellite image2

Fig. 7
figure 7

The segmentation results of Satellite image3

Fig. 8
figure 8

The segmentation results of Satellite image4

Fig. 9
figure 9

The segmentation results of Kodim image1

Fig. 10
figure 10

The segmentation results of Kodim image2

Fig. 11
figure 11

The segmentation results of Kodim image3

Fig. 12
figure 12

The segmentation results of Kodim image4

4.3 Experiment 3: Comparison with CSA, FPA, PSO, and BA algorithm based multilevel segmentation techniques

In this experiment, to show the merits of proposed GLCM-ITEO technique, the results are compared with CSA, FPA, PSO and BA using same objective function (GLCM). From Table 4, it can be observed that for all the test images, ITEO is better and more reliable than CSA, FPA, PSO, and BA, because of its precise search capability, at a high threshold level (T). Performance of CSA and BA has closely followed ITEO. The solution update strategy for FPA and PSO may have led to poor results. The good results based on the ITEO algorithm are shown in Table 4, and the GLCM-ITEO algorithm performs best in color images such as satellite images. The comprehensive performance ranking of the comparison algorithm is as follows: ITEO>CSA>BA>FPA>PSO. Tables 5 and 6 shows the optimal threshold of the algorithm for satellite image and natural color image respectively. Therefore, ITEO has the best performance, so it determines the best threshold to produce accurate and high-quality segmentation images.

From Fig. 5, 6, 7, 8, 9, 10, 11 and 12, the visual results show that this method achieves a good segmentation effect by accurately identifying the complex target and background in each level of satellite image segmentation. The image segmentation effect in Figs. 5b, d and 6b–d is poor, and the contour segmentation in satellite images is not clear. As the number of thresholds increases, the image segmentation quality can be enhanced from Figs. 5 and 6. The ITEO algorithm in this paper has the best segmentation effect. It can be seen from Figs. 10, 11 and 12, ITEO algorithm for natural color image segmentation effect is best, CSA and BA algorithm is essentially the same as a result, PSO algorithm segmentation results figure effect is the worst, under segmentation phenomenon exists, the target area segmentation effect is not obvious, and the existence chromatism, the best threshold segmentation results are local optimal phenomenon.

In order to observe the segmentation performance of each algorithm more intuitively, the histogram of AP and IOU values of algorithm results as shown in Figs. 13 and 14. It can be clearly seen from the figures that ITEO algorithm has a good segmentation ability, which is significantly better than other comparison algorithms. Although the segmentation accuracy of the algorithm is important, the running time of the algorithm also affects the segmentation effect. The CPU time of each algorithm is shown in Fig. 15. In order to better observe the performance of each algorithm, the result in the figure is the CPU time used when the threshold number T=12. As can be seen from Fig. 15, ITEO algorithm has the shortest CPU time, BA algorithm and CSA algorithm have basically the same running time, and FPA algorithm and PSO algorithm have the slowest running time. So, the ITEO algorithm not only has a strong segmentation ability, but also its CPU time is less.

Fig. 13
figure 13

The histogram of the AP

Fig. 14
figure 14

The histogram of the IoU

Fig. 15
figure 15

The histogram of the CPU time

4.4 Stability analysis

Based on the natural optimization algorithm, the results of each run are not the same. Therefore, in order to analyze the stability of the proposed algorithm based on GLCM-ITEO, we use the value of standard deviation (STD). The STD can be intuitive to the operation stability of the algorithm, and the lower the value of the algorithm, the stronger the robustness of the algorithm. Table 7 shows the STD values of each algorithm after 30 runs. It can be seen from the table that the stability of ITEO algorithm is the strongest, especially when dealing with the segmentation of satellite images, its stability is obviously better than other comparison algorithms, indicating that GLCM-ITEO algorithm has a good segmentation ability, and can find the optimal threshold of image better, more accurately and more stably.

Table 7 Comparison of standard deviation (STD) of IoU computed by CSA, FPA, PSO, BA and ITEO using GLCM as an objective function

4.5 Statistical analysis

We statistically analyze the experimental results to better observe the differences between algorithms. We use Wilcoxon rank sum test [42], a nonparametric statistical test that checks whether one of two independent samples is larger than the other. We calculate the p value of IoU of ITEO algorithm and CSA, FPA, PSO and BA algorithm. The experimental statistical results are shown in Table 8.

Table 8 The calculated p values from the Wilcoxon test for the GLCM-ITEO versus other optimizers

If the p value of two algorithms is greater than 0.05, there is no significant difference between the two algorithms. On the other hand, a p value less than 0.05 means that there is a significant difference between the two algorithms at the significance level of 5%. It can be seen from the Table 8 that 28 out of 32 results of ITEO algorithm are better than CSA algorithm, 32 out of 32 results are better than FPA algorithm, 32 out of 32 results are better than PSO algorithm, and 30 out of 32 results are better than BA algorithm. Therefore, the GLCM-ITEO algorithm is obviously better than the comparison algorithm in the statistical sense.

4.6 Comparison of different algorithms on Berkley segmentation data set (BSDS300)

Each multilevel image thresholding method has also been evaluated using a well-known benchmark-the Berkley segmentation data set (BSDS300) with 300 distinct images. The 300 images from the Berkeley segmentation data set (BSDS 300) available at https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/BSDS300/html/dataset/images.html. This paper uses an extensive comparative study on Berkeley database by using performance metrics like Probability Rand Index (PRI), Variation of Information (VoI), Global Consistency Error (GCE), and Boundary Displacement Error (BDE) [2, 43, 44]. Table 9 shows the average results of PRI, BDE, GCE and VoI of ground truth results of the 300 images of BSDS300 data set.

Table 9 The comparison results for the GLCM-ITEO versus other optimizers

The results displayed in Table 9, that the proposed technique outperforms all other compared multilevel thresholding algorithms. The GLCM-ITEO technique has obtained results close to the ground truth images. Higher values of PRI indicate better segmentation performance. While lower values of BDE, GCE, and VoI show better segmentation. It can be seen from the table that the numerical value of GLCM-ITEO algorithm is the best, indicating that its segmentation result is the closest to groundtruth and the segmentation effect is the best. And the PSO and FPA algorithm segmentation effect is the most check. So, GLCM-ITEO algorithm can effectively solve the problem of image segmentation.

5 Conclusions

In this paper, the ITEO algorithm is used to optimize the multi-threshold GLCM algorithm to obtain the optimal multi-threshold image. We use LF and OBL strategies to improve TEO algorithm, increase the random step size of the algorithm, and improve the optimization ability of the algorithm. In this paper, the algorithm is compared with other optimization algorithms to jointly optimize GLCM algorithm for color natural image and satellite image segmentation experiments. From AP and IoU values, it can be seen that GLCM-ITEO algorithm has the best segmentation accuracy. Finally, we compare the GLCM-ITEO algorithm with the multi-threshold Otsu algorithm, and conduct segmentation experiments on 300 images in the Berkeley image library. It can be seen from the PRI, VoI, GCE and BDE index that both the ability of ITEO to optimize GLCM and Otsu algorithm is better than other comparative optimization algorithms, and the segmentation effect of GLCM-ITEO algorithm is better than the segmentation effect of multi-threshold Otsu algorithm. Therefore, the GLCM-ITEO algorithm proposed in this paper has better image segmentation accuracy and better stability. In the future, we will continue to study multi-threshold methods and different optimization algorithms, so as to improve the image segmentation accuracy.