Yuyin Wang (2020)
Yuyin Wang (2020)
Yuyin Wang*
Bo wen college of mangement guilin university of technology
*
Corresponding author: [email protected]
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 ].
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) 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)
Ds ( x) = Cs ( x) + M s ( x) (5)
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 ev (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.
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 )
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)
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)
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.
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.