This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/3.0/).

Multilevel thresholding has been long considered as one of the most popular techniques for image segmentation. Multilevel thresholding outputs a gray scale image in which more details from the original picture can be kept, while binary thresholding can only analyze the image in two colors, usually black and white. However, two major existing problems with the multilevel thresholding technique are: it is a time consuming approach,

Segmenting an image into its constituents is a process known as thresholding [

The process of thresholding is considered as the simplest image segmentation method, which is true when the objective is to convert a gray scale image into a binary (black and white) one (that is to say only one threshold is considered). However, in the process of segmentation, information from the original image will be lost if the threshold value is not adequate. This problem may even deteriorate as more than one threshold is considered (

It has been proven over the years that as more thresholds are considered in a given image, the computational complexity of determining proper values for each threshold increases exponentially (when all possible combinations are considered). Consequently, this is a perfect scenario for implementing meta-heuristic tools [

When dealing with multilevel thresholding, in addition to the fast estimation, defining an adequate number of levels (thresholds that will successfully segment the image into several regions of interest from the background), has been another problem without a satisfactory solution [

The major differences between this work and the one presented in [

The following paper is organized as follows:

A detailed explanation of the proposed method is given in this section, where the mathematical formulation of the model is presented and the optimization techniques are introduced.

The Kullback-Leibler information distance (known as Relative Entropy Criterion) [_{d}_{d}_{j}

In this study Gaussian distributions are used to estimate Equation (4), where the central limit theorem (C.L.T.) is the motivation of using this type of distributions [_{j}_{j}_{j}^{2}_{j}^{th}

The purpose of assuming a mixture of “_{d}

Given that estimating a suitable number of distributions “

Equation (8) compares each prior probability _{j}_{j}_{d}

Therefore, by minimizing Equation (9), the introduced approach will not only determine an appropriate number of distributions in the mixture model, but will also find a good estimation (fitting) of the probabilities ^{l} = d^{l−}^{1} + 1 where “

The mathematical model which is used for segmenting a gray level image is presented as in Equation (10). By minimizing Equation (10) with “

Equation (11) guarantees a summation of the prior probabilities equal to 1, while Equations (12) and (13) ensure positive values to all prior probabilities and variances in the mixture model, respectively. To minimize Equation (10), a newly developed meta-heuristic named Virus Optimization Algorithm [

The flowchart at ^{l}^{l}^{l}^{l−}^{1}) is true; otherwise a suitable number of distributions (thresholds) just been found and the results coming from Θ(^{l−}^{1}) are output.

The purpose of using three algorithmic tools, is not only to reduce the computation time when implementing the proposed approach, but also, to verify if the adequate number of thresholds suggested by optimizing Equation (10) with different optimization algorithm remains the same. The reason of the aforementioned is because different algorithms may reach different objective function values. However, if the proposed method (

Inspired from the behavior of a virus attacking a host cell, VOA [

The strong and common viruses are determined by the objective function value of each member in the population of viruses,

Flowchart of the proposed optimization procedure.

To simulate the replication process when new viruses are created, the population size will grow after one complete iteration. This phenomenon is controlled by the antivirus mechanism that is responsible for protecting the host cell against the virus attack. The whole process will be terminated based on the stopping criterion: the maximum number of iterations (

The VOA consists of three main processes: Initialization, Replication, and Updating/Maintenance. The Initialization process uses the values of each parameter (defined by the user) to create the first population of viruses. These viruses are ranked (sorted) based on the objective function evaluation Θ(

The replication process is performed using the parameters defined by the user in the Initialization stage described above, where a temporary matrix (larger than the matrix containing the original viruses) will hold the newly-generated members. Here, Equations (14) and (15) are used to generate new members, where “^{th}^{th}^{th} dimensional space generated from the common viruses in the current replication:

The intensity in Equation (14) above reduces the random perturbation that creates new viruses from the strong members. This will allow VOA to intensify exploitation in regions more likely to have a global optimum (

The basic concept of Genetic Algorithms or GAs [_{i−}_{1}, _{i}_{0} = 0 and _{d}

Genetic Algorithm (GA) overview.

Particle Swarm Optimization was inspired by social behavior of bird flocking or fish schooling [_{max} value which is only 2% of the gray intensity range; that is to say, _{i}_{max} , V_{max}_{max}

Overview of the Particle Swarm Optimization (PSO) algorithm.

The stopping criterion for the VOA (GA or PSO) is when two consecutive replications (generations) did not improve the objective function value of the best virus (chromosome or particle). Once the VOA (GA or PSO) stops searching and the best value for the Θ(^{l}^{l}^{l−}^{1}) is satisfied; otherwise the proposed method will automatically stop iterating. After the proposed method stops, the parameters contained inside the vector _{d}^{l-}^{1} that represents the set of parameters of the best result in the previous iteration are output.

In order to avoid computational effort of calculating the threshold values that minimize Equation (7), the VOA (GA and PSO) will code each threshold value inside each solution, ^{l}

In the case of GA a chromosome containing integer values is used for encoding the solution. In order to evaluate the objective function of each virus or particle, the real values coded inside each member will be rounded to the nearest integer, whereas in GA this is not necessary since each chromosome is an array of integers. The parameters for each Gaussian distribution are computed as in Equations (19)–(21), which is considered as the decoding procedure of the three meta-heuristics implemented in this study:

In Equations (19)–(21), _{j}^{th}_{0} = 0 and _{d}

_{0} < _{1} < _{2} <...< _{d}

_{d}_{0} = 0) intensity in a gray level image, _{j}

Equation (22) is checked to ensure that the first condition is satisfied, where _{j}_{j}

In order to further test the method proposed in [

Test image 1: (

Test image 2: (

Test image 3: (

The setting of VOA, GA, and PSO was determined by using Design of Experiments (DoE) [^{4} combinations of the four parameters were tested.

Parameter values (factor levels) used during the for the VOA.

Parameter | Low Level | Medium Level | High Level |
---|---|---|---|

Initial population of viruses | 5 | 30 | |

Viruses considered as strong | 1 | 10 | |

Growing rate of strong viruses | 2 | 10 | |

Growing rate of common viruses | 1 | 6 |

Similarly, a 3^{3} full factorial design was implemented in order to set the population size (^{4} full factorial design determined the values for the swarm size, inertia weight (

Parameter values (factor levels) used during the DoE for the GA.

Parameter | Low Level | Medium Level | High Level |
---|---|---|---|

Population size (ps) | 5 | 10 | |

Probability of crossover (pc) | 0.8 | 0.99 | |

Probability of mutation (pm) | 0.05 | 0.15 |

Parameter values (factor levels) used during the DoE for the PSO.

Parameter | Low Level | Medium Level | High Level |
---|---|---|---|

Swarm size | 5 | 10 | |

Inertia weight (w) | 0.5 | 0.99 | |

Cognitive parameter (c1) | 2.1 | 2.2 | |

Social parameter (c2) | 2.1 | 2.2 |

The basic idea of the DoE is to run the 3^{4}, 3^{3}, and 3^{4}, parameters combinations for VOA, GA, and PSO respectively, to later select which level (value) yielded the best performance (lower objective function value). Once the values for each parameter which delivered the best objective function value are identified, each test image is segmented by optimizing Equation (10) with each of the algorithmic tools used in this study.

The advantage of using DoE is that it is a systematic as well as well-known approach when deciding the setting yielding the best possible performance among all the combinations used during the full factorial design. In addition to the aforementioned, it is also a testing method that has been proven to be quite useful in many different areas such as tuning algorithm parameters [

A comprehensive study of the proposed model implementing the three meta-heuristics introduced above is detailed in this part of

^{−17}.

By testing the image in

Thresholding results over 50 runs for the test image 1.

Algorithm | Number of Thresholds | Objective Function | Threshold Values | Means | Variances | Weights | CPU Time per Iteration (s) | Total CPU Time for the Proposed Approach (s) |
---|---|---|---|---|---|---|---|---|

VOA | 1 | 2.410 | 244 | 66.808 | 3836.212 | 0.637 | 0.026 | 0.507 |

251.391 | 37.709 | 0.363 | ||||||

2 | 0.976 | 62, 244 | 33.209 | 12.892 | 0.483 | 0.071 | ||

175.849 | 1298.019 | 0.167 | ||||||

252.452 | 0.616 | 0.350 | ||||||

4 | 0.896 | 55, 97, 163, 246 | 33.178 | 12.123 | 0.482 | 0.294 | ||

75.522 | 119.910 | 0.017 | ||||||

128.441 | 258.119 | 0.003 | ||||||

185.922 | 82.920 | 0.142 | ||||||

252.158 | 6.177 | 0.356 | ||||||

GA | 1 | 2.410 | 244 | 69.838 | 4226.048 | 0.650 | 0.106 | 0.658 |

252.452 | 0.616 | 0.350 | ||||||

2 | 0.994 | 65, 242 | 33.239 | 13.806 | 0.483 | 0.147 | ||

176.018 | 1256.142 | 0.166 | ||||||

252.440 | 0.736 | 0.351 | ||||||

4 | 0.882 | 44, 143, 155, 247 | 33.123 | 11.272 | 0.480 | 0.211 | ||

77.924 | 377.966 | 0.021 | ||||||

150.013 | 12.387 | 0.001 | ||||||

188.193 | 191.885 | 0.149 | ||||||

252.477 | 0.431 | 0.349 | ||||||

PSO | 1 | 2.384 | 247 | 70.158 | 4274.185 | 0.651 | 0.083 | 0.584 |

252.477 | 0.431 | 0.349 | ||||||

2 | 0.955 | 65, 247 | 33.239 | 13.806 | 0.483 | 0.118 | ||

176.672 | 1288.421 | 0.167 | ||||||

252.477 | 0.431 | 0.349 | ||||||

4 | 0.880 | 42, 135, 154, 247 | 33.097 | 11.070 | 0.479 | 0.211 | ||

74.922 | 381.817 | 0.022 | ||||||

144.535 | 35.001 | 0.001 | ||||||

188.161 | 192.778 | 0.149 | ||||||

252.477 | 0.431 | 0.349 |

The computational effort and parameters of each Gaussian distribution (

The behavior of the Relative Entropy function (

The additional function

Behavior of (

Fitting of the histogram of the test image 1 implementing (

When implementing Otsu’s method, it is rather impressive to observe that the output image delivered by the algorithms when optimizing Equation (10) resembles the one given by Otsu’s method (

Thresholding results over 50 runs for the test image 2.

Algorithm | Number of Thresholds | Objective Function | Threshold Values | Means | Variances | Weights | CPU Time per Iteration (s) | Total CPU Time for the Proposed Approach (s) |
---|---|---|---|---|---|---|---|---|

VOA | 1 | 1.051 | 143 | 87.326 | 1015.901 | 0.127 | 0.057 | 0.237 |

203.855 | 603.462 | 0.873 | ||||||

3 | 0.670 | 104, 174, 209 | 67.393 | 370.007 | 0.082 | 0.091 | ||

150.866 | 385.486 | 0.153 | ||||||

192.994 | 90.775 | 0.378 | ||||||

226.231 | 146.602 | 0.386 | ||||||

GA | 1 | 1.051 | 142 | 86.658 | 991.336 | 0.126 | 0.109 | 0.480 |

203.746 | 609.117 | 0.874 | ||||||

3 | 0.659 | 142, 149, 206 | 86.658 | 991.336 | 0.126 | 0.226 | ||

145.121 | 3.989 | 0.011 | ||||||

185.213 | 205.948 | 0.440 | ||||||

224.558 | 163.332 | 0.423 | ||||||

PSO | 1 | 1.051 | 143 | 87.326 | 1015.901 | 0.127 | 0.072 | 0.453 |

203.855 | 603.462 | 0.873 | ||||||

3 | 0.619 | 101, 180, 211 | 66.048 | 335.944 | 0.079 | 0.240 | ||

155.144 | 453.146 | 0.195 | ||||||

195.932 | 76.337 | 0.366 | ||||||

227.489 | 134.942 | 0.359 |

When an image containing text on a wrinkled paper (

Behavior of (

The outstanding performance of the three meta-heuristics is observed once again when comparing with the Otsu’s method (

Fitting of the histogram of the test image 2 implementing (

The thresholding results of the Lena image (

Thresholding results over 50 runs for the test image 3.

Algorithm | Number of Thresholds | Objective Function | Threshold Values | Means | Variances | Weights | CPU Time per Iteration (s) | Total CPU Time for the Proposed Approach (s) |
---|---|---|---|---|---|---|---|---|

VOA | 1 | 1.043 | 63 | 48.917 | 51.398 | 0.159 | 0.046 | 1.009 |

138.048 | 1442.095 | 0.841 | ||||||

2 | 0.575 | 59, 138 | 47.598 | 40.100 | 0.143 | 0.128 | ||

104.785 | 484.361 | 0.430 | ||||||

168.523 | 538.213 | 0.428 | ||||||

3 | 0.454 | 99, 140, 183 | 65.002 | 369.233 | 0.302 | 0.198 | ||

120.137 | 147.621 | 0.287 | ||||||

157.234 | 130.155 | 0.295 | ||||||

201.595 | 109.646 | 0.116 | ||||||

5 | 0.466 | 68, 104, 134, 156, 190 | 50.380 | 68.188 | 0.175 | 0.428 | ||

88.813 | 108.622 | 0.165 | ||||||

120.054 | 77.656 | 0.203 | ||||||

145.072 | 39.845 | 0.192 | ||||||

168.597 | 90.400 | 0.167 | ||||||

204.364 | 77.722 | 0.098 | ||||||

GA | 1 | 1.044 | 66 | 49.794 | 60.874 | 0.169 | 0.103 | 0.904 |

138.924 | 1393.456 | 0.831 | ||||||

2 | 0.606 | 69, 139 | 50.671 | 72.095 | 0.178 | 0.136 | ||

109.090 | 368.075 | 0.402 | ||||||

169.106 | 530.358 | 0.419 | ||||||

3 | 0.504 | 96, 140, 179 | 62.664 | 315.826 | 0.282 | 0.182 | ||

118.590 | 171.180 | 0.307 | ||||||

156.168 | 110.243 | 0.282 | ||||||

199.453 | 139.510 | 0.129 | ||||||

5 | 0.584 | 65, 87, 128, 152, 205 | 49.504 | 57.550 | 0.166 | 0.258 | ||

76.023 | 40.415 | 0.074 | ||||||

108.258 | 138.292 | 0.250 | ||||||

139.533 | 49.522 | 0.205 | ||||||

171.707 | 244.613 | 0.257 | ||||||

211.824 | 28.018 | 0.049 | ||||||

PSO | 1 | 1.044 | 64 | 49.212 | 54.387 | 0.163 | 0.096 | 0.887 |

138.353 | 1424.978 | 0.837 | ||||||

2 | 0.575 | 68, 140 | 50.380 | 68.188 | 0.175 | 0.128 | ||

109.403 | 387.984 | 0.414 | ||||||

169.718 | 522.330 | 0.411 | ||||||

3 | 0.446 | 97, 141, 191 | 63.440 | 333.741 | 0.288 | 0.170 | ||

119.639 | 170.199 | 0.309 | ||||||

159.625 | 168.784 | 0.308 | ||||||

204.790 | 73.728 | 0.095 | ||||||

5 | 0.478 | 60, 115, 117, 147, 186 | 47.926 | 42.582 | 0.147 | 0.273 | ||

90.827 | 237.679 | 0.255 | ||||||

115.514 | 0.250 | 0.010 | ||||||

132.322 | 71.331 | 0.240 | ||||||

161.755 | 107.986 | 0.240 | ||||||

202.782 | 94.639 | 0.108 |

Behavior of (

Once again, the fitting provided by the mixture model (

Fitting of the histogram of the test image 3 implementing (

To further test the proposed method an image with low contrast is used as illustrated in

Three thresholds are suggested after the optimization of Equation (10) is performed, which is good enough for successfully segmenting the image under study (

Thresholding result over 50 runs for the test image 4.

Algorithm | Number of Thresholds | Objective Function | Threshold Values | Means | Variances | Weights | CPU Time per Iteration (s) | Total CPU Time for the Proposed Approach (s) |
---|---|---|---|---|---|---|---|---|

VOA | 1 | 2.112 | 98 | 102.027 | 504.595 | 0.612 | 0.045 | 0.213 |

174.622 | 36.165 | 0.388 | ||||||

2 | 1.014 | 105, 169 | 91.007 | 2.994 | 0.486 | 0.051 | ||

146.853 | 157.462 | 0.160 | ||||||

176.415 | 0.749 | 0.354 | ||||||

4 | 0.919 | 103, 117, 140, 169 | 90.929 | 2.009 | 0.483 | 0.064 | ||

107.796 | 17.853 | 0.016 | ||||||

126.818 | 25.714 | 0.002 | ||||||

150.202 | 9.141 | 0.139 | ||||||

176.271 | 2.326 | 0.359 | ||||||

GA | 1 | 2.112 | 98 | 90.906 | 1.803 | 0.482 | 0.134 | 0.692 |

166.703 | 268.234 | 0.518 | ||||||

2 | 1.051 | 100, 166 | 90.914 | 1.861 | 0.482 | 0.153 | ||

145.534 | 191.624 | 0.161 | ||||||

176.349 | 1.354 | 0.357 | ||||||

4 | 0.998 | 109, 115, 139, 177 | 91.270 | 6.829 | 0.494 | 0.225 | ||

111.849 | 2.575 | 0.003 | ||||||

123.655 | 52.305 | 0.005 | ||||||

164.654 | 163.335 | 0.323 | ||||||

177.000 | 1.455 | 0.176 | ||||||

PSO | 1 | 2.112 | 98 | 90.906 | 1.803 | 0.482 | 0.027 | 0.171 |

166.703 | 268.234 | 0.518 | ||||||

2 | 1.005 | 97, 168 | 90.902 | 1.780 | 0.481 | 0.035 | ||

145.505 | 204.582 | 0.163 | ||||||

176.393 | 0.931 | 0.355 | ||||||

4 | 0.911 | 98, 130, 138, 169 | 90.906 | 1.803 | 0.482 | 0.065 | ||

108.777 | 42.833 | 0.019 | ||||||

133.110 | 4.122 | 0.001 | ||||||

150.704 | 16.707 | 0.144 | ||||||

176.415 | 0.749 | 0.354 |

Test image 4: (

Behavior of (

Fitting of the histogram of the test image 4 implementing (

Thresholding result over 50 runs for the test image 5.

Algorithm | Number of Thresholds | Objective Function | Threshold Values | Means | Variances | Weights | CPU Time per Iteration (s) | Total CPU Time for the Proposed Approach (s) |
---|---|---|---|---|---|---|---|---|

VOA | 1 | 1.023 | 67 | 48.328 | 119.083 | 0.172 | 0.060 | 0.435 |

138.301 | 1428.555 | 0.828 | ||||||

2 | 0.556 | 63, 137 | 46.555 | 100.292 | 0.155 | 0.075 | ||

104.962 | 436.410 | 0.421 | ||||||

168.426 | 564.154 | 0.424 | ||||||

3 | 0.504 | 88, 140, 206 | 57.730 | 278.208 | 0.254 | 0.082 | ||

115.780 | 221.287 | 0.346 | ||||||

165.005 | 334.790 | 0.358 | ||||||

214.735 | 50.956 | 0.042 | ||||||

5 | 0.495 | 77, 116, 143, 158, 214, 255 | 52.347 | 176.710 | 0.208 | 0.124 | ||

97.798 | 120.079 | 0.210 | ||||||

129.636 | 59.464 | 0.208 | ||||||

149.842 | 18.471 | 0.128 | ||||||

180.649 | 270.308 | 0.226 | ||||||

220.581 | 34.873 | 0.020 | ||||||

GA | 1 | 1.024 | 71 | 49.927 | 139.317 | 0.187 | 0.139 | 1.204 |

139.577 | 1363.879 | 0.813 | ||||||

2 | 0.669 | 76, 137 | 51.913 | 169.499 | 0.204 | 0.198 | ||

109.784 | 294.414 | 0.372 | ||||||

168.426 | 564.154 | 0.424 | ||||||

3 | 0.586 | 84, 138, 227 | 55.674 | 237.243 | 0.236 | 0.209 | ||

113.180 | 235.410 | 0.347 | ||||||

168.529 | 529.908 | 0.413 | ||||||

231.261 | 20.782 | 0.003 | ||||||

5 | 0.573 | 57, 90, 130, 156, 212 | 43.635 | 76.301 | 0.126 | 0.400 | ||

72.881 | 99.772 | 0.138 | ||||||

110.800 | 131.973 | 0.254 | ||||||

142.590 | 55.391 | 0.220 | ||||||

178.408 | 270.837 | 0.237 | ||||||

219.035 | 38.368 | 0.025 | ||||||

PSO | 1 | 1.023 | 66 | 47.900 | 114.220 | 0.168 | 0.034 | 0.373 |

137.948 | 1446.983 | 0.832 | ||||||

2 | 0.564 | 64, 137 | 47.023 | 104.922 | 0.159 | 0.060 | ||

105.419 | 421.751 | 0.416 | ||||||

168.426 | 564.154 | 0.424 | ||||||

3 | 0.413 | 97, 140, 182 | 63.047 | 390.706 | 0.300 | 0.073 | ||

119.448 | 154.217 | 0.300 | ||||||

157.206 | 130.606 | 0.281 | ||||||

201.012 | 152.773 | 0.119 | ||||||

5 | 0.576 | 40, 70, 125, 159, 230 | 32.580 | 32.714 | 0.037 | 0.115 | ||

53.830 | 68.546 | 0.146 | ||||||

100.401 | 235.202 | 0.297 | ||||||

141.671 | 92.691 | 0.281 | ||||||

184.398 | 346.042 | 0.237 | ||||||

234.122 | 19.797 | 0.002 |

The Lena image in which a random noise is generated will be our last test instance (

The objective function behavior (

Most of the relevant details from the original instance are kept. On the other hand, Otsu’s method (

Test image 5: (

Behavior of (

Fitting of the histogram of the test image 5 implementing (a) VOA, (b) GA, and (c) PSO.

In this study a new approach to automatically assess the number of components “

The novelty of the approach is that, not only an appropriate number of distributions determined by

Comparing the proposed method with Otsu’s method provided clear evidence of the effectiveness and efficiency of the approach where the algorithmic tools are used in order to reduce the computational effort when optimizing Equation (10). Additionally, the proposed method proved to reach the same value for the number of thresholds needed for the segmentation of the images tested in this study, even though different optimization algorithms were implemented.

It is worth mentioning that the proposed method proved to work remarkably well under test images with low contrast and random noise. A suitable number of thresholds and an outstanding result in the output thresholded images were obtained. Whereas for the Otsu’s method, the output image showed some defects once the segmentation was performed.

The fitting result coming from the proposed approach might not be the best; however, when segmenting an image what matters the most is the fidelity in which most of the details are kept from the original picture. This is what makes the difference between a good and poor segmentation result. Future directions point toward testing the proposed method with more meta-heuristic algorithms, as well as a wider range of images to evaluate the robustness of the approach.

This work was partially supported by National Science Council in Taiwan (NSC-100-2628-E-155-004-MY3).