0% found this document useful (0 votes)
28 views8 pages

Yuyin Wang (2020)

This document summarizes a research paper that proposes a two-dimensional Otsu image threshold segmentation method based on the Seagull optimization algorithm. The algorithm uses the Seagull algorithm to calculate threshold points for two-dimensional Otsu image segmentation. Simulation results showed that the algorithm improves segmentation speed and accuracy compared to directly using Otsu or clustering methods. It introduces the Seagull optimization algorithm, which mimics the migration and attacking behaviors of seagulls, to effectively search for optimal segmentation thresholds.

Uploaded by

Rizki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views8 pages

Yuyin Wang (2020)

This document summarizes a research paper that proposes a two-dimensional Otsu image threshold segmentation method based on the Seagull optimization algorithm. The algorithm uses the Seagull algorithm to calculate threshold points for two-dimensional Otsu image segmentation. Simulation results showed that the algorithm improves segmentation speed and accuracy compared to directly using Otsu or clustering methods. It introduces the Seagull optimization algorithm, which mimics the migration and attacking behaviors of seagulls, to effectively search for optimal segmentation thresholds.

Uploaded by

Rizki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Journal of Physics: Conference Series

PAPER • OPEN ACCESS

Otsu Image Threshold Segmentation Method Based on Seagull


Optimization Algorithm
To cite this article: Yuyin Wang 2020 J. Phys.: Conf. Ser. 1650 032181

View the article online for updates and enhancements.

This content was downloaded from IP address 182.1.79.61 on 18/12/2020 at 05:50


2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

Otsu Image Threshold Segmentation Method Based on


Seagull Optimization Algorithm

Yuyin Wang*
Bo wen college of mangement guilin university of technology
*
Corresponding author: [email protected]

Abstract. In this paper, a two-dimensional Otsu image threshold segmentation method


based on Seagull optimization is proposed. The Seagull algorithm is used to calculate
the threshold points of two-dimensional Otsu image segmentation and segment the
image. The algorithm makes full use of the seagull migration operator of global search
and the seagull attack operator of simulated local search. Simulation results show that
the algorithm not only improves the speed, but also improves the segmentation accuracy.

1. Introduction
Image segmentation refers to extracting the required target from the image, so as to separate the
background from the target. At present, the threshold segmentation methods mainly include maximum
variance between classes, projection threshold method of two-dimensional gray histogram, minimum
cross entropy method, minimum error threshold method under the assumption of normal distribution
and so on. The method of maximum variance between classes divides the plane into two parts by
calculating the threshold T, one part is the set whose threshold is lower than T, and the other part is the
set whose threshold is higher than T, thus obtaining the binary image. The method of maximum variance
between classes is widely used in image segmentation because of its simple calculation method and high
speed.
In recent years, with the rapid development of artificial intelligence, more and more intelligent
optimization algorithms provide new ideas for image segmentation, such as particle swarm algorithm,
wolf swarm algorithm, pigeon swarm algorithm, firefly algorithm, genetic algorithm, etc. Compared
with the direct use of maximum variance between classes or clustering method, the accuracy, operation
speed and convergence speed of image segmentation have been improved to a certain extent. Swarm
intelligence algorithm can effectively solve nonlinear optimization problems. Because of its fast
convergence speed, simple algorithm principle and high efficiency, it has attracted many researchers'
attention and has been widely used. Therefore, this paper aims at the new swarm intelligence algorithm-
Seagull Optimization Algorithm, and combines Otsu method to apply it to image segmentation.
Experiments show that this algorithm can achieve better image segmentation.

2. Seagull Algorithm
Seagulls are the most common seabirds, which often move in pairs or small groups, or fly in the air.
Seagull, an animal with strong attack power, often hovers in the air to find and attack prey with wisdom.
Seagulls will migrate between different regions with seasonal changes in order to find the most abundant
food and provide enough energy. When seagulls migrate, they often attack migratory birds. When they

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

attack, the group makes a spiral natural movement shape. Therefore, the two most important
characteristics of seagulls are migration and aggression. The migration and prey attack behavior of
seagulls are similar to the optimization objective function, and the optimal solution is searched in a given
search space.

2.1. Migration
The migration process of seagulls is equivalent to global search, and the best seagull location is found
according to the solutions in the migration rules. In the process of migration, seagulls need to meet the
following three conditions:
1)Avoid collisions
When migrating, the position of each seagull is different. In order to avoid the collision between
neighbors (other seagulls), the additional variable A is used to calculate the new seagull position.

Cs ( x) = A  Ps ( x) (1)

Cs ( x ) indicates the new position of seagull, which does not conflict with other seagulls. Ps ( x)
represents the current position, x represents the current iteration times, A represents the movement
behavior of seagulls in the search space, and the range of A is [0, f c ].

A = f c − ( x  ( f c / MAX iteration )) (2)

f c can control the frequency of variable A , and its value decreases linearly from 2 to 0.
2)Optimum position and direction
Approaching to the best position: Seagulls will move to the best position during migration.

M s ( x) = B (Pbs ( x) − Ps ( x)) (3)

M s ( x) indicates the direction of the best position, and B is the random number responsible for
balancing the global and local search.

B = 2  A2  rd (4)

rd is a random number in the range of [0,1].


3)Close to the best position
Close to the best position: the seagull moves towards the best position and reaches the best position.

Ds ( x) = Cs ( x) + M s ( x) (5)

Ds ( x) is the new position (best position) of seagull.

2.2. Attack
The attack behavior of seagulls is equivalent to local search. Seagulls keep their height with their wings
and weight during migration, and constantly change their angles and speeds to attack. In the process of
attacking prey, keep spiral motion. The motion behavior in the spatial x, y and z planes is described as
follows:

2
2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

x = r  cos( ) (6)

y = r  sin( ) (7)

z = r  (8)

r = u  ev (9)

In which r is the radius of the spiral and  is a random value in the range of [0, 2 ]. u and v are the
correlation constants of spiral shape, and e is the base of natural logarithm.
The attack position of seagull is calculated by formula (10).

(10)

Ps ( x) represents the attack position of seagulls, that is, the optimal solution of search space.

3. Two-dimensional Maximum Variance between Classes (two-dimensional OTSU)


Because the performance of image segmentation with noise interference is degraded by one-dimensional
gray histogram, based on the one-dimensional histogram, a two-dimensional gray histogram is
constructed by introducing the neighborhood average gray value of the image, which considers both the
pixel information and the spatial information of the image. Two-dimensional maximum variance
between classes method uses the gray value of pixel and the average gray value of neighboring pixels
to calculate the threshold. In the two-dimensional gray histogram (fig. 1), if (s, t) is the threshold point
of segmentation, the two-dimensional histogram is divided into four blocks, as shown in fig. 1.

Figure 1. Two-dimensional gray histogram

In most cases, there are obvious differences between the image background and the pixels near the
target's boundary. The corresponding 2D histogram is the target (C0) and the background (C1) in the
upper area of the diagonal, and the area away from the diagonal (C2 and C3) is the edge or noise.
Let P(C0 ) represent the probability of target C0 ( s, t ) and P (C1 ) represent the probability of
background C1 ( s, t ) . Then

s t
P(C0 ) =  pij = P0 ( s, t ) (11)
i =0 j =0

3
2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

L −1 L −1
P(C1 ) = p
i = s +1 j =t +1
ij = P1 ( s, t ) (12)

The mean vectors corresponding to the target and the background are


( i , j )C0 ( s ,t )
ipij 
( i , j )C0 ( s ,t )
jpij
0 = ( 00 , 01 ) = (
T
, )T (13)
P0 ( s, t ) P0 ( s, t )


( i , j )C1 ( s ,t )
ipij 
( i , j )C1 ( s ,t )
jpij
1 = ( 10 , 11 ) = (
T
, )T (14)
P1 ( s, t ) P1 ( s, t )

The total mean vector on the two-dimensional histogram is

L −1 L −1 L −1 L −1
T = ( T 0 , T 1 )T = ( ipij ,  jpij )T (15)
i =0 j =0 i =0 j =0

The areas c2 and c3 represent the boundary information of the target and the background. The
boundary information far from diagonal is usually ignored, that is, the probability of regions
i = s + 1,..., L −1 and j = 0,..., t or i = 0,..., s and j = t +1,..., L −1 is about 0, pij  0 .

So P0 ( s, t ) + P1 ( s, t )  1 . (16)

T  P0 ( s, t ) 0 + P1 ( s, t ) 1 (17)

The dispersion matrix between classes is expressed as:

S B = P0 ( s, t )[( 0 − T )( 0 − T )T ] + P1 ( s, t )[( 1 − T )( 1 − T )T ] (18)

Using the trace of S B as the dispersion measure between classes;

tr S B = P0 ( s, t )[( 00 − T 0 ) 2 + ( 01 − T 1 ) 2 ] + P1 ( s, t )[( 10 − T 0 ) 2 + ( 11 − T 1 ) 2 ] (19)

The optimal threshold ( s* , t * ) is determined by formula (20):

(s* , t * ) = arg max [tr SB (s, t )] (20)


0 s ,t  L −1

Two-dimensional OTSU algorithm is composed of image pixel gray value and neighborhood average
gray value, which can improve the accuracy of threshold calculation and the anti-noise ability of the
algorithm, but it has a large amount of calculation. Trace tr S B (s, t) of S B is calculated at any point (s,
t), and the cumulative sum of corresponding items is repeatedly calculated from the origin (0, 0) for both
mean vector and probability. Therefore, in this paper, OTSU uses the fast recursive algorithm proposed

4
2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

by Jing Xiaojun et al. [1] to calculate the distance measure between target and background to get the
best threshold. The fast recursive algorithm can reduce the computation time and the required space.
s t s t
Other i ( s, t ) =  ipij ,  j (s, t ) =  jpij . There is a fast recursive algorithm formula:
i =0 j =0 i =0 j =0

P0 ( s, 0) = P1 ( s − 1, 0) + ps 0 (21)

P0 ( s, t ) = P0 ( s, t − 1) + P0 ( s − 1, t ) − P0 ( s − 1, t − 1) + pst (22)

i ( s, 0) = i ( s − 1, 0) + s  ps 0 (23)

i ( s, t ) = i ( s, t − 1) + i ( s − 1, t ) − i ( s − 1, t − 1) + s  pst (24)

 j ( s, 0) =  j ( s − 1, 0) + s  ps 0 (25)

 j ( s, t ) =  j ( s, t − 1) +  j ( s − 1, t ) −  j ( s − 1, t − 1) + s  pst (26)

4. Image Segmentation Technology Based on Seagull Algorithm


Seagull algorithm is proposed by Dhiman G et al. [2], which simulates the process of seagulls searching
for food in nature to find the optimal solution. Seagull algorithm, as a new iterative optimization method,
takes the position of each seagull as the spatial solution, and the position of the richest food as the
optimal solution. Seagulls constantly migrate and attack to find rich food.
Seagull algorithm calculation steps are as follows:
(1) Parameter initialization. Set the maximum iteration times MAX iteration , frequency variable f c ,
correlation constants u and  , rd and  of spiral shape.
(2) Calculate the additional variable A (Formula 2) and the random number B (Formula 4), which is
responsible for balancing the global and local factors
(3) According to the fitness function formula (formula 19-26), the fitness value Ps ( x) of each
seagull and the position Cs ( x ) of seagull (formula 1) are solved.
(4) Compare the migration position of seagulls with the fitness function solved in step (3), so as to
find a better position Pbs ( x) . According to the initial position and better position of seagulls, get the
direction M s ( x ) (formula 3) and the best position Ds ( x) (formula 5) of the better position, and update
the fitness value and the best position of seagulls.
(5) According to the attack radius r of seagull, the attack position coordinates are calculated, and
the new position Ps ( x) of seagull is updated according to the position, attack radius, attack direction
coordinates and the best position of seagull (formula 10).
(6) Repeat steps 3, 4 and 5 to update the seagull position. If the best position is found to stagnate and
no longer change, the process is terminated, otherwise, go to step 3 and continue to execute until the
maximum number of iterations is reached.
(7) The optimal threshold Ps ( x) is used to segment the image.

5. Experimental Results and Analysis


In order to verify the rationality of this algorithm, experiments are carried out on lena, lake and
cameraman images, and the resolution of the images is 512  512. The experimental environment is

5
2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

Windows 7 operating system and the program running software is Matlab2016b. Parameters are set as
follows: frequency variable f c =2, correlation constants of spiral shape u =1,  =1,
Max_iterations=200, rd is a random number in the range of [0,1] and  is a random angle value of (0,2
 ), where the dimension of search space is 2.
Otsu algorithm and Seagull algorithm are used to segment the image, and the segmentation effect is
shown in Figure 2.

Original image Two-dimensional Otsu algorithm This algorithm


Figure 2. Image segmentation result

From the image segmentation results in Figure 2, it can be seen that the segmentation results of this
algorithm are more noise-resistant than those of Otsu algorithm, for example, lena image and cameraman
image segmentation have some improvements. In addition, the running time of this algorithm in lena
image segmentation is about 5s, while the time of two-dimensional Otsu algorithm is more than 7s.
Relatively speaking, the time has also been improved, and the time has been shortened in the
segmentation of lake and cameraman images.

6
2020 International Conference on Applied Physics and Computing (ICAPC 2020) IOP Publishing
Journal of Physics: Conference Series 1650 (2020) 032181 doi:10.1088/1742-6596/1650/3/032181

6. Summary
In this paper, Seagull algorithm is used for image segmentation. Three images are segmented in the
experiment, and otsu algorithm is used to verify the superiority of this algorithm. Generally speaking,
these two algorithms can show the contour of the segmented image. However, this algorithm has certain
advantages in anti-noise and time. Experimental results show that Seagull algorithm can not only obtain
the equivalent segmentation results of two-dimensional otsu algorithm, but also has shorter operation
time. Therefore, applying Seagull algorithm to image segmentation can effectively improve the
optimization ability and shorten the running time. In image segmentation, this algorithm has better
practical value.

Acknowledgments
This work was financially supported by the funds: (1) 2019 Guangxi University Young and Middle-
aged Teachers Scientific Research Basic Ability Enhancement (Project No.: 2019KY1063); (2) 2019
Guangxi Higher Education Undergraduate Teaching Reform Project (Project No.: 2019JGA399).

References
[1] Jing Xiaojun, Cai Anni, Sun Jingao. An image segmentation algorithm based on two-dimensional
maximum between-class variance [J]. Journal of Communications, 2001(04): 71-76.
[2] GauravDhiman,VijayKumar. Seagull optimization algorithm: Theory and its applications for
large-scale industrial engineering problems [J]. Knowlege-based Systems, 2019,165:169-196.
[3] Han Yi, Xu Zibin, etc. New intelligent optimization algorithms abroad. Modern Marketing
(Business Edition). 2019.10
[4] Chen Yao, Chen Si. Application Research of Dynamic Weighted Bat Algorithm in Image
Segmentation [J/OL]. Computer Engineering and Application
[5] 2020.06.
[6] Zhang Hao, Wang Suzhen, Zheng Yu, Wang Wei, Li Weizhi, Wang Peng, Ren Guishan, Ma
Jialin. A FPGA implementation of image edge detection combined with 4 algorithms of
GAUSS-filter, SOBEL, NMS and OTSU [J]. LCD With display, 2020, 35(03): 250-261.
[7] Li Tao. Intelligent algorithm and its application in image processing [D]. West China Normal
University, 2019.
[8] Cheng Wei. Improvement of intelligent optimization algorithm and its application in image
segmentation [D]. Nanchang University, 2019.

You might also like