1 Introduction

The boom in machine vision has spurred the development of many related technologies, image steganography technology [30, 51], image significance detection technology [19, 57], target detection technology [3], visual perception technology [60], image tamper detection [4] and so on. Image segmentation as the lowest level of machine vision engineering applications have been widely used in all walks of life, especially in the diagnosis and analysis of lesions through medical image segmentation. Many researchers have explored the field, for instance Guo et al. [11] proposed Otsu thresholding algorithm based on local grid box filter, which shortens the segmentation time and improves the segmentation accuracy. Mutasem [1] proposed the mixture of fuzzy C-means and neutrophils which was used to segment jaw lesions, improved the segmentation accuracy and achieved better segmentation results. J. Hu et al. [17] used Fuzzy C-Means Clustering to segment and recognize fish diseases, which has high segmentation accuracy. Compared with before, the performance of modi-fied intuitionistic fuzzy C-means algorithm (MIFCM) has been improved greatly. Madhukumar [33] made a compareation between K-means and fuzzy C-means for the performance in image segmentation. Although there are also some other segmentation methods,such as watershed [13, 35, 58], mean-shift [18, 32], none of them are particularly perfect.

In the late 1980s, Eckhorn et al. [9, 45] found that in the study of cat visual cortex, the binary images produced by the midbrain in an oscillating manner can extract different features from visual impressions. Then, this discovery was written as an algorithm, which was applied to image processing after a series of improvements and promotion [21, 22, 24, 31, 42, 44]. This algorithm is called pulse coupled neural network (PCNN) [20, 23]. In recent years, PCNN has played an important role in the field of image processing, such as image segmentation [16, 28, 53, 61], image fusion [5, 27, 55, 59], image enhancement [49], and image recognition [7]. As the third generation of neural network, PCNN has incomparable advantages compared with the current advanced neural network technologies, such as the convolutional neural networks (CNN) [48] and the radial basis function neural network (RB-FNN) [43]. It does not need complex training, so it can complete image segmentation more efficiently. But it has its own limitations, which is more parameters need to be set. In addition, it is difficult and time-consuming to set parameters through manual experience and experiments. Therefore, how to determine parameters is a hot issue. On the one hand, researchers have made great efforts in the adaptation of PCNN parameters. MA et al. [54] proposed an algorithm of combining PCNN with image entropy, but this method also requires manual participation in setting parameters, and can not achieve full automation. Wu et al. [50] published a method of self-adaptively setting parameters of PCNN, but it is limited to a single parameter and can not completely solve the problem of parameter setting. On the other hand, Scholars have explored how to reduce the number of PCNN parameters. Simplified PCNN is proposed by MA et al. [8] to reduce the complexity of parameter setting. Although this is a great progress, parameter setting still needs experiments and experience to decide.

Therefore, if the combination of PCNN and intelligent optimization algorithm can be used, the parameters of PCNN for each image can be automatically set quickly and accurately, so as to achieve a perfect segmentation effect. Some researcher have explored these aspects, Hage et al. [12] proposed PCNN combined with particle swarm optimization (PSO) algorithm to segment cortical. Although the image can be segmented better, it still needs to train a certain number of images to extract features to match the fitness function of the algorithm, which means that it can not achieve complete automatic segmentation. Mohammed et al. [41] used genetic algorithm (GA) to search PCNN parameters for image classification and retrieval. Xu et al. [52] segmented medical images by optimizing PCNN parameters through the ant colony optimization (ACO) algorithm. It is an improved ACO, which enhances the global search ability, reduces the probability of solution falling into local optimum, and can better search the parameters of PCNN globally. However, when initializing the ACO algorithm, the corresponding parameters need to be set artificially. Different initialization parameters may have different segmentation results. He et al. [10] proposed an improved cuckoo search algorithm (CS) applied to the parameters of adaptive PCNN to segment infrared human.

The above methods have several common problems, such as setting more initial parameters of intelligent optimization algorithm manually, complex search mechanism, and possibly falling into local optimum. Hence, in order to improve the efficiency and accuracy of segmentation, we propose a remarkable PCNN parameter auto-setting method combined with Harris Hawks optimization (HHO) [15] for medical image segmentation. HHO is the state-of-the-art heuristic algorithm which imitates Harris Hawk’s cooperative predation. It has a concise and efficient search mechanism and can improve the global search ability.

The remaining parts of this paper are as follows: Section 2 introduces the structure and working mechanism of the simplified pulse coupled neural network (SPCNN) model [8]. The optimization mechanism of HHO algorithm is introduced in the third section. In section 4, an image segmentation model based on PCNN and HHO algorithm is introduced, and image entropy (H) [54] and mutual information entropy (MI) [6] are proposed as fitness functions. The segmentation results and evaluation indexes of medical image and gray image include UM [26, 46], CM [29], Precision [47], Recall and Dice [2] in Section 5. Finally, the full text is summarized and the direction of future work is pointed out in Section 6.

2 Simplified pulse coupled neural network model

In order to improve efficiency and reduce the interaction between parameters, a simplified PCNN model derived from the SPCNN model is adopted in this paper. As shown in Fig. 1, the structure of simple PCNN is divided into three parts: receptive part, modulating part and pulse generator.

Fig. 1
figure 1

Model structure of simple PCNN

Its mathematical expression is expressed as follows:

$$ {F}_{ij}\left[n\right]={S}_{ij} $$
(1)

whereFij[n] denotes the input of the simple PCNN model, and Sij denotes the excitation signal of the external input, i.e., the gray value of the corresponding pixels of the point (i, j).

$$ {L}_{ij}\left[n\right]=\sum {W}_{ij kl}{Y}_{kl}\left[n-1\right] $$
(2)
$$ {U}_{ij}\left[n\right]={F}_{ij}\left[n\right]\left(1+\beta {L}_{ij}\left[n\right]\right) $$
(3)

Lij[n] is the link input, Uij[n] means the internal activity.

$$ {\theta}_{ij}\left[n\right]=\exp \left(-{\alpha}_E\right){\theta}_{ij}\left[n-1\right]+{V}_E{Y}_{ij}\left[n-1\right] $$
(4)
$$ {Y}_{ij}\left[n\right]=\left\{\begin{array}{c}1,{U}_{ij}\left[n\right]\ge {\theta}_{ij}\left[n\right]\\ {}0,{U}_{ij}\left[n\right]<{\theta}_{ij}\left[n\right]\end{array}\right. $$
(5)

θij[n] is the dynamic threshold and Yij[n] is the output of neurons; β shows the link strength between neurons; Wijkl indicates the link matrix; αE is the threshold attenuation coefficient, VE means the threshold magnification coefficient.

The simplified PCNN model is mainly to simplify the feed channel and link channel. By It can be seen that the external excitation of the feed channel only has the gray value of the image from the Eq. (1). Other reasons are not taken into account, which is expressed by Eq. (2), the value of the link input is weighted by the sum of the trigger signals of the neurons in the neighborhood. In short, the feed channel is only affected by the neuron itself, and the link channel is only affected by the neighboring neuron.

In the simple PCNN model, there are three important parameters which have a great impact on the image segmentation effect. They are the link strength β, the threshold attenuation coefficient αE and the threshold magnification coefficient VE. The link matrix Wijkl has little effect on segmentation, so it is set to a fixed value. Wijkl usually is a matrix of size 3 × 3, in which each element represents the reciprocal of the Euclidean distance from the central element to each surrounding pixel, which can be described as:

$$ {W}_{ijkl}=\left[\begin{array}{ccc}0.707& 1& 0.707\\ {}1& 0& 1\\ {}0.707& 1& 0.707\end{array}\right] $$
(6)

VE means that when a neuron fires, the dynamic threshold θij will rapidly increase to a higher value, which will make the neuron unable to output the pulse attenuation coefficient again in a certain period of time. The attenuation coefficient αE is used to attenuate θij. The link coefficient β determines the degree of pulse capture in the PCNN model. The higher the value, the higher the probability that the neighboring neurons of the ignition neuron will be captured, resulting in the synchronous output of the neighboring neurons. In this way, the segmentation effect will be better and the edges will be clear. When the value of β is smaller, the probability of adjacent neurons being fired synchronously is smaller, and the details of segmentation results obtained at this time will be more abundant.

3 Harris hawks optimization algorithm

Harris Hawks optimization (HHO) algorithm is a bionic algorithm that mimic the predatory behavior of hawks, mainly composed of three parts: exploration phase, transition from exploration to exploitation and exploitation phase.

3.1 Exploration phase

In HHO, the Harris hawks inhabit randomly in some locations, waiting for prey to be found through two strategies. q is used to randomly select which strategy to adopt.

$$ X\left(t+1\right)=\left\{\begin{array}{c}{X}_{rand}(t)-{r}_1\left|{X}_{rand}(t)-2{r}_2X(t)\right|\kern0.5em q\ge 0.5\\ {}\left({X}_{rabbit}(t)-{X}_m(t)\right)-\\ {}{r}_3\left( LB+{r}_4\left( UB- LB\right)\right)\kern5.75em q<0.5\end{array}\right. $$
(7)
$$ {X}_m(t)=\frac{1}{N}\sum \limits_{i=1}^N{X}_i(t) $$
(8)

where X(t) refers to the position of hawks currently, Xrabbit(t) refers to the position of a rabbit, Xrand(t) is the random location of one of the current hawks, Xm is the average of all hawk positions at the moment,r1r2, r3, r4 and q are random numbers ranging from 0 to 1. In addition, (UB, LB) refers to the range of the initial random location of the hawks.

3.2 Transition from exploration to exploitation

$$ \boldsymbol{E}=\mathbf{2}{\boldsymbol{E}}_{\mathbf{0}}\left(\mathbf{1}-\frac{\boldsymbol{t}}{\boldsymbol{T}}\right) $$
(9)

where E is the escape energy of prey, E0 is the initial energy of prey and T is the maximum number of iterations.

3.3 Exploitation phase

There are four ways to simulate this phase in HHO. When the prey is in danger, it tries to escape, while r < 0.5 indicates that the prey can escape successfully, and r > 0.5 indicates that the prey failed to escape successfully. In addition, |E| > 0.5 and |E| < 0.5 correspond to the soft besiege occurs and the hard besiege occurs, respectively. Here we describe each case in detail.

3.3.1 Soft besiege

This behavior will occur when |E| ≥ 0.5 and r ≥ 0.5, and the mathematical expression can be described as follows:

$$ X\left(t+1\right)=\varDelta X(t)-E\left|J{X}_{rabbit}(t)-X(t)\right| $$
(10)

where ΔX(t) = Xrabbit(t) − X(t) and J is a random number between 0 and 2.

3.3.2 Hard besiege

When |E| < 0.5 and r ≥ 0.5, the current position update equation is as follows

$$ X\left(t+1\right)={X}_{rabbit}(t)-E\mid \varDelta X(t)\mid $$
(11)

3.3.3 Soft besiege with progressive rapid dives

This method will be adopted when |E| ≥ 0.5 and r < 0.5. The location update strategy is as follows:

$$ X\left(t+1\right)=\left\{\begin{array}{c}Y\kern1.5em if\ F(Y)<F\left(X(t)\right)\\ {}Z\kern1.5em if\ F(Z)<F\left(X(t)\right)\end{array}\right. $$
(12)

where =Xrabbit(t) − E ∣ JXrabbit(t) − X(t)∣, Z = Y + S × LF(D),D and S are the dimensions of the question and random vectors, respectively.

In addition, Levy flight function is introduced in position updating, which can be calculated by Eq. (14).

$$ \mathrm{LF}(x)=0.01\times \frac{u\times \sigma }{{\left|v\right|}^{\frac{1}{\beta }}} $$
(13)
$$ \upsigma ={\left(\frac{\varGamma \left(1+\beta \right)\times \mathit{\sin}\left(\frac{\pi \beta}{2}\right)}{\Gamma \left(\frac{1+\beta }{2}\right)\times \beta \times {2}^{\frac{\beta -1}{2}}}\right)}^{\frac{1}{\beta }} $$
(14)

where u, σ, v are random numbers with values ranging from 0 to 1, and β is a default constant.

3.3.4 Hard besiege with progressive rapid dives

Hard besiege with progressive rapid dives will happen when |E| ≥ 0.5 and r ≥ 0.5, and the positions of the Harris hawks can be calculated by Eq. (15).

$$ X\left(t+1\right)=\left\{\begin{array}{c}Y\kern1.5em if\ F(Y)<F\left(X(t)\right)\\ {}Z\kern1.5em if\ F(Z)<F\left(X(t)\right)\end{array}\right. $$
(15)

where Y = Xrabbit(t) − E|JXrabbit(t) − X(t)| and Z = Y + S × LF(D).

4 Combination of PCNN and HHO

As we mentioned earlier, simple PCNN has three important parameters (the link strength β, the threshold attenuation coefficient αE, the threshold magnification coefficient VE), so we need to optimize these parameters with HHO to achieve excellent segmentation results.

The selection of fitness function is an important step in optimization algorithm. At present, there are mainly two kinds of functions as the fitness function of image segmentation. They are the entropy (H) [6] of the segmentation image and mutual information entropy (MI) [46] of the original image and the segmentation image. The advantage of using the entropy of the segmentation image as the fitness function is that the calculation is simple and the operation efficiency is high. However, the disadvantage is that the target and background of the segmentation image are close to each other. The cross-entropy overcomes the disadvantage of considering only the entropy of the segmentation image. The original image is taken into account to improve the accuracy of segmentation, but this improves the complexity and reduces the efficiency of segmentation. Therefore, in order to be more objective and comprehensive, we use these two kinds of entropy as fitness function to test. The fitness functions are expressed as follows:

$$ H=-{p}_1\times {\log}_2{p}_1-{p}_0\times {\log}_2{p}_0 $$
(16)

where p1 and p0 represent the percentages of 1 and 0 in the whole binary image, respectively.

$$ MI=H(X)+H(Y)-H\left(X,Y\right) $$
(17)

where H(X) and H(Y) mean marginal entropy of original image and segment image, H(X, Y) express the joint entropy.

The search process of the algorithm is shown as follows:

Step 1: Initialize the random location of the algorithm, set the number of iterations, population number, search dimension and scope.

Step 2: The image to be segmented is taken as input, and the optimization algorithm assigns three parameters to the PCNN. After the PCNN iteration, the fitness values between groups are compared and the optimal fitness values and positions are obtained.

Step 3: The optimization algorithm updates the population position according to different strategies and re-assigns it to PCNN. The fitness function value of the output is compared with the optimal value of the previous iteration, and the optimal fitness function and population position are updated.

Step 4: When the maximum number of iterations of the algorithm is reached, the optimal fitness value and three optimal parameters for image segmentation are output. Then, the optimal parameters are input into the PCNN model and the segmented image is output.

The pseudocodes of HHO-PCNN are shown as follows:

4.1 The flowchart of HHO-PCNN

5 Experimental results and discussion

In order to evaluate the performance of the proposed algorithm, we put forward a trail of experimental results in this section. We set forth the experimental conditions including hardware and software environments, the original image database, and segmentation methods in the comparative experiments (Fig. 2).

Fig. 2
figure 2

Flowchart of HHO-PCNN algorithm

We randomly selected four and five images from the Berkeley Segmentation Dataset BSDS300 and the Harvard Whole Brain. All experiments were performed on a PC with Intel® Pentium CPU G4560 @ 3.50GHz and 4 GB RAM with windows 10. The software used was Python3.7.

Six different intelligent optimization algorithms, including WOA [37], SSA [34, 40], SCA [36], PSO [25], MVO [39] and GWO [38] are introduced to compare the proposed algorithms. These algorithms use different search mechanisms to find the optimal parameters, which are representative. The initialization parameters of each algorithm and PCNN are set as shown in Tables 1 and 2. Population size and number of iterations are set according to experience, and other parameters used by each comparison algorithm are selected from the above references.

Table 1 Pseudo-code of HHO-PCNN algorithm
Table 2 Parameters of each algorithm and PCNN

For each algorithm, we tested them based on image entropy and mutual information entropy, and compared the optimal algorithm with state-of-the-art method in order to objectively evaluate the performance of the algorithm.

5.1 Segment evaluation index

In order to objectively evaluate the segmentation effect, five evaluation indexes are introduced, namely UM, and CM, Precision, Recall and Dice.

UM refers to the uniformity of image segmentation, which can be expressed as follows:

$$ UM=1-\frac{\sigma_1^2+{\sigma}_2^2}{A} $$
(18)
$$ {\sigma}_i^2=\sum \limits_{\left(x,y\right)\in {G}_i}{\left(f\left(x,y\right)-{\mu}_i\right)}^2 $$
(19)
$$ {\mu}_i=\sum \limits_{\left(x,y\right)\in {G}_i}f\left(x,y\right)/{B}_i $$
(20)

where Bi is the number of pixels in the corresponding segmentation area Gi, and A is the normalization factor, which refers to the number of pixels in the whole image.

CM refers to the regional difference of the segmented image, which can be described as

$$ CM=\frac{\mid {f}_i-{f}_j\mid }{f_i+{f}_j} $$
(21)

where fi is the average gray level of the target area, and fj is the average gray level of background area.

In order to further evaluate the experimental results objectively, TP, FP, FN and TN are introduced as follows:

TP means the target area, the segmentation result is also the target area, FP represents the non-target area, but the segmentation result is the target area, FN is the target area, but the segmentation result is not the target area, TN indicates the non-target area, and the segmentation result is not the target area. Precision is the percentage of accurately identifying regions relative to all regions that are segmented.

$$ Precision=\frac{TP}{TP+ FP} $$
(22)

If the value of precision is 0, the region and ground-truth of the segmented image do not overlap. On the contrary, if its value is 1, it means perfect overlap. Recall is the rate of correct recognition of regions of interest.

$$ \mathrm{Recall}=\frac{\mathrm{TP}}{\mathrm{TP}+\mathrm{FN}} $$
(22)

The range of recall values is 0 to 1, and the larger the value, the better the effect. Dice reflects the similarity between segmented image and ground-truth.

$$ Dice=\frac{2 TP}{\left( TP+ FP\right)+\left( TP+ FN\right)} $$
(24)

The value of Dice is between 0 and 1, the closer it is to 1, the better.

5.2 Segmentation experiment and result analysis

5.2.1 Medical image segment

For medical image, we randomly selected four pictures from the Harvard Whole Brain as test pictures for this experiment. Different algorithms using image entropy and mutual information entropy as fitness functions are shown in Fig. 3 and Fig. 4. It can be seen that the performance of the proposed method is better than that of other methods, regardless of whether the fitness function is image entropy or mutual information entropy. Firstly, our method is more suitable for image edge processing, while other methods have different degrees of over-segmentation. Second, our approach is closer to the ground-truth.

Fig. 3
figure 3

Segmentation results of the algorithms using image entropy as fitness function

Fig. 4
figure 4

Segmentation results of the algorithms using mutual information entropy as fitness function

The objective evaluation of four images using image entropy as the fitness function of the algorithm are shown in (a)-(e) of Fig. 5, respectively. We can see that our method has the highest Recall and Dice in all the images. UM are also higher, but CM is slightly lower in slice15. For precision, recall and dice, we note HHO-PCNN has the highest Precision (93.65%), Recall (77.21%) and Dice (88.42.%), SCA-PCNN has higher Recall (74.91%) and Dice (75.97%). In addition, MVO-PCNN and SSA-PCNN have similar Dice and Recall. For UM, our method holds the UM of 98.62%, which is close to PSO-PCNN that has the UM of 97. 38%, while GWO-PCNN did not perform well with the UM of 71.22%. For CM, our method is at a moderate level with the CM of 39.08%. WOA-PCNN and PSO-PCNN have similar CM values, GWO-PCNN have lower CM of 35.67%. Besides, we take the average value of all the image evaluation indexes and calculate the variance of precision to reflect the stability and robustness of the method. As shown in Table 3 and (f) of Fig. 5, our method has the smallest variance and the highest average, which reflect the excellent robustness of our method. GWO-PCNN, WOA-PCNN, MVO-PCNN, SCA-PCNN, SSA-PCNN and PSO-PCNN ranked second, third, fourth, fifth, sixth and seventh, respectively. Figure 6 shows the computational time required to process medical images. The fastest method is the proposed scheme, followed by PSO-PCNN, WOA-PCNN, MVO-PCNN, SSA-PCNN, SCA-PCNN and GWO-PCNN.

Fig. 5
figure 5

Different algorithms based on image entropy as fitness function (a)-(f)

Table 3 Variance of segmentation results of each algorithm
Fig. 6
figure 6

Time efficiency comparison of the algorithms based on image entropy as fitness function

(a)-(e) of Fig. 7 display the segmentation evaluation index of the algorithms based on mutual information entropy as fitness function. We averaged each evaluation index of all medical images, and the results are shown in (f) of Fig. 7. Here into, UM of 0.94, CM of 0.86, Recall of 0.94 and Dice of 0.89 have a comparative performance than other algorithms. Precision of 0.86 has a great advantage than other experimental results. In addition, as shown in Fig. 8, the proposed algorithm performs equally well in terms of running time, ranking first with an average of 134 s. Therefore, the proposed algorithm also performs well when it takes mutual information entropy as the fitness function.

Fig. 7
figure 7

Different algorithms based on mutual information entropy as fitness function results (a)-(f)

Fig. 8
figure 8

Time efficiency comparison of the algorithms based on mutual information entropy as fitness function

Figure 9 and Fig. 10 show the convergence curves of mutual information entropy and image entropy as fitness functions, respectively. In Fig. 9, the proposed algorithm has obvious advantages over other algorithms in terms of convergence speed and final accuracy. In Fig. 10, the convergence speed of HHO is not very fast, but the final accuracy is the highest. Compared with other algorithms, the convergence speed of HHO is at a better level in the other three images, and the final accuracy is also perfect. In summary, this fully illustrates the powerful performance of the proposed algorithm.

Fig. 9
figure 9

Convergence curve with mutual information entropy as fitness function (a)-(d)

Fig. 10
figure 10

Convergence curve with image entropy as fitness function (a)-(d)

By comparing with other optimization algorithms, we can see that the proposed algorithm has obvious advantages. In order to evaluate algorithms objectively, state-of-the-art methods are introduced to compare the proposed algorithm. They are Otsu [11], K-means [14, 57], and Fusing NCut Eigenvectors Maps (F-NCut-EM) [56]. The segmentation results of each algorithm are shown in Fig. 11 and the evaluation index values of the response are shown in Tables 4, 5, 6 and 7.

Fig. 11
figure 11

Comparison of segmentation results with state-of-the-art methods

Table 4 Performance of different methods in Slice 15
Table 5 Performance of different methods in Slice 29
Table 6 Performance of different methods in Slice 17
Table 7 Performance of different methods in Slice 34

As can be seen from Fig. 11, the algorithm proposed in this paper has a better segmentation effect than other algorithms, and can well segment the location of lesions, while other algorithms cannot do this completely. From Tables 4, 5, 6 and 7, it is obvious that the UM, CM, Precision, Recall and Dice values obtained by this method are better than those obtained by other methods. In conclusion, the experimental results show that this method has better performance than other methods.

5.2.2 Gray image segment

For gray image, we also randomly selected five pictures from the Berkeley Segmentation Dataset BSDS300 as test pictures. In order to maintain consistency, we also select the same evaluation index and comparison method as above. The segmentation results are shown in Fig. 12 and Fig. 13, which reflect that our proposed method performs better visually than other methods. From Table 8, we have noticed that our algorithm has the highest value in CM, Precision, Recall and Dice, regardless of whether image entropy or mutual information entropy is chosen as fitness function, which fully demonstrates the strong segmentation ability of our method. When image entropy is selected as fitness function, although UM value of the proposed method is not the highest in all algorithms, it also approximates the maximum value of 0.97, which has absolute advantages for other indicators. WOA-PCNN has relatively good segmentation effect, ranking second. PSO-PCNN holds higher CM value, Precision than WOA-PCNN, but Recall is lower than WOA-PCNN. SSA-PCNN and MVO-PCNN is not good enough in all images. SCA-PCNN and GWO-PCNN are worse than other methods, although SCA-PCNN holds a high value in Recall.

Fig. 12
figure 12

Segmentation results of the algorithms using image entropy as fitness function

Fig. 13
figure 13

Segmentation results of the algorithms using mutual information entropy as fitness function

Table 8 Segmentation index results of PCNN combined with different algorithms

When mutual information entropy is selected as fitness function, the UM value obtained by the proposed method is 0.85, which means that the segmentation region has good uniformity. The value of CM is 0.03, and the experimental results are better than all the methods. This shows that the pixel intensity difference of the target area is small in our method. Precision and Recall values of this method are 0.74 and 0.90 respectively, which have higher segmentation accuracy than other methods. The value of Dice is 0.88, which is also a reasonable result. In summary, this method can segment the image accurately, and the segmentation efficiency is also high.

6 Conclusion

In this paper, a method of image segmentation is proposed by using HHO algorithm to optimize PCNN parameters. Then, image entropy and interactive information entropy are selected as fitness functions. Four medical images and five gray images were used as test images. UM, CM, Precision, Recall and Dice were used as evaluation criteria to objectively evaluate the segmentation results. HHO-PCNN was compared with WOA-PCNN, SCA-PCNN, SSA-PCNN, PSO-PCNN, GWO-PCNN and MVO-PCNN, respectively. Furthermore, it is compared with the state-of-the-art algorithms including Otsu and K-means. Finally, the results show that HHO-PCNN can clearly segment the target in vision, and it can also be clearly seen that the algorithm has the highest segmentation accuracy from the evaluation criteria. In addition, the proposed method can be applied to object segmentation in various situations because of its good segmentation ability and robustness. Fitness function and color image segmentation will be studied in the future.