# Parallel Compact Differential Evolution for Optimization Applied to Image Segmentation
## 3 Parallel Compact Differential Evolution
It is because the target and background account for the largest proportion of all pixels, and the gray value of the pixels inside the target area and the background area are relatively uniform. The gray values of the points are similar to their neighborhood average gray value, so they are concentrated near the diagonal. The two peaks respectively represent target and background. Away from the diagonal, the height of the peak drops sharply. This part reflects the image noise, edges and other information. A two-dimensional histogram XOY plan view is shown in Figure 6. Region A and B correspond to the target and background, and region C and D to the edges and noise. The optimal threshold is determined by the pcDE algorithm to maximize the amount of information that truly represents the target and background. Figure 4: Performance trends of pcDE and cDE algorithms under three different strategies. Assuming that the target region and the background region have different probability distributions, we normalize each region with the posterior probability of the target and the background region, so that the entropy of each region is additive. We suppose the threshold is (s, t), then the discrete two-dimensional entropy is:

\[H=-\sum_{i}\sum_{j}P_{i,j}lgP_{i,j} \tag{12}\]

The two-dimensional entropy function of the target and the background is defined as:

\[\phi(s,t)=H_{A}/P_{A}+log_{10}[P_{A}(1-P_{A})]+(H_{L}-H_{A})/(1-P_{A}) \tag{13}\]

where \(P_{A}=\sum_{i=1}^{s}\sum_{j=1}^{t}P_{i,j}\), \(H_{A}=-\sum_{i=1}^{s}\sum_{j=1}^{t}P_{i,j}lgP_{i,j}\). \(H_{L}\) is the entropy when (s, t) takes the maximum gray value. The calculation method is the same as \(H_{A}\). Using the formula (13) as the

Figure 5: Two-dimensional gray histogram. Figure 4:0 Two-dimensional histogram XOY plan view. evaluation function, the pcDE algorithm is used to calculate the fitness value at different thresholds. Finally we get the optimal threshold. Table 4 shows the final fitness and standard deviation of the Lena images (Figure 7) tested with four algorithms, s and t represent the final two-dimensional segmentation threshold (s,t\(\in\)[0,255]). The performance comparison among these four algorithms is shown in Figure 4:1 In the following section, we segment a medical image of lung and compare the experimental results of Otsu method, minimum error thresholding method, and pcDE. The main steps include:

1. Image preprocessing. Enhance the contrast of the image to achieve better segmentation. 2. Calculate the optimal threshold for image segmentation through different methods to get the binarized image. 3. Use morphological methods to process images to extract targets. 4. Mark target contour. above experimental results, we can see that the image segmented via the pcDE algorithm is much closer to the reality, compared with other algorithms. On the basis of the above experiments, we add Gaussian noise(\(\mu=1.00\times 10^{-5},\sigma=1.00\times 10^{-1}\)) to the original picture and re-run the experiment. Figure 11 shows the experimental result, in which (a)-(c) are the images after threshold segmentation, and (d) and (e) are the images after morphological processing, and (g) is the original image, and (h) is the noisy image. Figure 12 shows the contour marked image. Figure 4:2 (**a–c**) image after threshold segmentation, (**d–f**) image after morphological processing, (**g**) original image, (**h**) contrast-enhanced image. Several frequently-used metrics in medical image segmentation are: Dice coefficient (DICE), volumetric overlap error (VOE), relative volume difference (RVD), average symmetric surface distance (ASD), and maximum symmetric surface distance (MSD) (see [41; 42]) etc. This paper uses DICE as a metric to evaluate the quality of image segmentation results. DICE is the most frequently-used method. When the segmentation effect is optimal, the value of DICE is \(1\).