Upload
shuang
View
220
Download
0
Embed Size (px)
Citation preview
Multilevel thresholding methods for image segmentation with Otsu based on QPSO
Huang Yourui1 , Wang Shuang2
(Department of Electrical Engineering, Anhui University of Science and Technology, Huainan 232001, Anhui)
E-mail: [email protected]
Abstract
Image segmentation is the key step from image processing to image analysis. Ostu thresholding, which features a good performance, is one of the main image threshold segmentation methods. Like other threshold methods, the application of the Otsu has been restricted for the long-paying computation. In order to overcome the disadvantages and get better results, a new method based on quantum particle swarm optimization (QPSO) algorithm is proposed in this paper. The image by use of the thresholds can be segmented. Simulation result has demonstrated that the QPSO not only realizes the image segmentation applicable, but also well. 1. Introduction
Image segmentation is the first step of automatic target recognition. Its purpose is to separate target and background and provide a basis for the follow-up actions of computer vision. Image segmentation methods include thresholding, edge detection, and so on. Within this total, the threshold segmentation is the most basic method. Threshold selection has a number of means such as histogram bimodal method, the maximum entropy method, Otsu, moment maintain method, gradient statistics method,and so on.In these methods, Otsu segmentation method has a wide application because of its good effect and wide scope. According to the threshold number, image thresholding segmentation can be divided into single-threshold segmentation and multi-threshold segmentation. Multi-threshold can be divided into a series of single-threshold.But it is necessary to search a threshold best combination in the whole gray-scale range. The process is more time-consuming and difficult to use. In this paper, the QPSO involved in multi-threshold segmentation with Otsu can find the best threshold quickly and accurately.
PSO algorithm is an novel evolutionary algorithm proposed by Eberhart doctor and Kennedy doctor. It originates from the simulation predation behavior of
birds. As one kind important optimization implement, PSO algorithm being already used for fields such as system identification 、 neural networks training successfully. As the other global optimization algorithm, in practical, the PSO algorithm also has shown a few dissatisfactory problems. These most problems are that the PSO is easy to premature, the ability of global optimization is relatively poor, convergence speed is slow and so on. In order to solve the problem of easy to premature, improvement methods are suggested that such as inertia method of weighting , hybridization PSO algorithm, adaptive mutation. But these improvements have varying reduced degreely convergence speed. The method of compressing is able to improve convergence speed, but there are still a problem because of premature convergence phenomenon.
The quantum evolution algorithm (QEA) is one kind of probability evolution algorithm developing recently , it takes a few concepts and theories of the quantum calculates , such as the quantum bit and the quantum overlay state. It is compared with the classical evolution algorithm , QEA has a lot of merits, for instance much better group diversity, the overall situation optimizing ability, less group scale but not affect the algorithmic function and so on. But generated binary solution through observing the state of quantum chromosome in QEA, it is a probability operation process , has very big randomness. Here some improvements have been made. The probability of the quantum bit has expressed the solution of optimizing problem directly, such method both have avoided the randomness through observing and have avoided decoding process from binary to decimal.
It is proposed that a novel quantum particle swarms algorithm (QPSO). The QPSO encode current location of particles using quantum bits, search particles using quantum rotation gate, realize mutations using quantum non-gate to avoid premature. The experiment indicates that the optimization ability and optimization are better than PSO algorithm.
2008 Congress on Image and Signal Processing
978-0-7695-3119-9/08 $25.00 © 2008 IEEEDOI 10.1109/CISP.2008.76
706
2008 Congress on Image and Signal Processing
978-0-7695-3119-9/08 $25.00 © 2008 IEEEDOI 10.1109/CISP.2008.76
706
2008 Congress on Image and Signal Processing
978-0-7695-3119-9/08 $25.00 © 2008 IEEEDOI 10.1109/CISP.2008.76
701
2.Image Segmentation Based On the Otsu Method
Otsu is also called maximum variance between clusters. Image histogram as the basis and maximum variance between target and background as the selection criteria, the method achieved a good threshold in many cases.
A image whose gray-scale range is{ }1,...,1,0 −L is divided into target and background by threshold t . The probability of gray i is ip . The probability of
target is ∑=
=t
iipt
00 )(ω . The probability of
background is ∑−
+==
1
11 )(
L
tiiptω . The mean of target is
∑=
=t
iiiptu
000 /)( ω . The mean of background is
∑−
+==
1
111 /)(
L
tiiiptu ω . The formula of variance
between the two parts is 2
1010 ))()()(()()( tututttd −= ωω . Optimal
threshold *t makes the variance maximum. So the multi-threshold segmentation as following,
)1()(...
)(...
)()(
)(...)(
)()(
),...,,(
211
211
23131
22121
200
23030
22020
21010
21
kkkk
kk
kk
k
uu
uu
uuuu
uuuu
uuuu
tttd
−++
−++
−+−+
−+−+
−+−=
−− ωωωω
ωωωωωωωω
ωωωω
∑+=
−−
=n
n
t
tiin pt
11
1
)(ω , ∑+=
−−−
=n
n
t
tinin iptu
111
1
/)( ω ,
)1(1 +≤≤ kn 。
The optimal thresholds **2
*1 ,...,, kttt make the total
variance maximum. That is: ),...,,(max,...,, 21...0
**2
*1 21 ktttk tttdArgttt
k<<<<= . Thus, by use of Otsu, multi-threshold segmentation would be summarized as a optimization problem of the optimal thresholds **
2*1 ,...,, kttt .
3.Particle Swarm Optimization Algorithm
PSO algorithm is an evolutionary algorithm proposed by Eberhart and Kennedy. This algorithm originated from the flock of predatory behavior. Each particle of PSO is a solution, it adjusts its flight according to the flying experience of its own and companions. Each particle in the course of flying experience can find the best location which is the optimal solution. This location is called individual extreme( pbest ). The entire group experienced the best position is the optimal solution of the entire group. This position is called global extreme( gbest ). In practical operation, the value of particles are evaluated through the fitness function decided by the optimization. Each particle can update itself constantly through these two extreme, then creat a new generation of groups. Because of simple and easily achieved with few parameters, PSO has been used in function optimization, neural network training, fuzzy control systems and other application areas.
In PSO, each particle can be regarded as a point. If the particle size of the group is M, No.
),...,2,1( Mii = particle’s position can be expressed
as iX . The best position of the No. i is expressed as
][ipbest , and the speed is expressed as iV . The index of the best position of the group is expressed as g . So No. i particle updates its speed and position according to following formula:
)][(())][(()
2
1
i
iii
XgpbestrandcXipbestRandcVV
−××+−××+×= ω
(2)
iii VXX += (3)
21 ,cc are constants, they are called learning factor. ()Rand and ()rand are random numbers which
in [0,1]. ω is called inertia weight. PSO’s parameters include: inertia weight parameter
ω , the learning factors 21 ,cc , the largest number of
iterations maxiter and population size M.
4.Quantum Optimization Algorithm
In the theory of quantum calculation, the minimal information element is indicated quantum bit, the quantum bit is also quantum byte, a quantum bit state is expressed as 10 βαφ += , α and β are called the quantum bits probability amplitudes and
707707702
satisfy normalization condition: 122 =+ βα . Let
)cos(θα = , )sin(θβ = , The quantum bit also can
be indicated as [ ]T)sin()cos( θθ , θ is phase of quantum bits.
In the quantum optimization algorithm, changes of the phase of quantum bits are performed by one bit quantum rotation gates. Definition as:
∆∆∆−∆
)cos()sin()sin()cos(
θθθθ
(4)
The mutations of quantum bits can be as to exchange probability amplitudes which are performed by quantum non-gate:
=
αβ
βα
0110
(5)
Examination the quantum optimization algorithm at present, when handling the alternation relation between quantum bit and the solution vector, it is adopt to a given random number generally, compared with a probability amplitude of quantum bit, come to ascertain that owing quantum bit alternation result (0 or 1) , get a binary solution, and then alter a decimal solution vector. This handles having certain randomness, easy to use some the individual degeneration. It is directly applied quantum bit probability amplitudes as code of the solution vector and to avoid randomness of change.
5.Quantum Particle Swarm Optimization Algorithm
If the solution of n-dimensional space optimization problem as a point or a vector in n-dimensional space, Optimization can be described as:
),,(max 1 nxxf ,
iii bXa ≤≤ , ni ,,2,1= , n is the number of
optimization variables. [ ]ii ba , is definition domain of
iX , f is the objective function, the value of f can be described as fitness of the particles. Specific operations as follows: 5.1 The initial population
In QPSO, the current location of particles are encoded through the use of probability amplitudes of quantum bit. Taking into account the random of the initialization population, the program of coding:
=
)sin()cos(
)sin()cos(
)sin()cos(
2
2
1
1
in
in
i
i
i
iiP
θθ
θθ
θθ
(6)
Randomij ×= πθ 2 , Random is a random
number in [0,1], mi ,,2,1= ; nj ,,2,1= ; m is population size, n is space-dimension. Thus, every particle of population occupies two locations of traverse space. They are corresponding to the probability amplitudes of >0 and >1 .
))cos(,),cos(),(cos( 21 iniiicP θθθ= (7)
))sin(,),sin(),(sin( 21 iniiisP θθθ= (8)
In order to facilitate interpretation, icP is called
cosine position while isP is called sine position.
5.2 Transform of solution space
In QPSO, each dimension of traverse space of particles is [-1,1], In order to calculate the pros and cons of particle current location, the transform of solution space is required. The two positions occupied by each particle are tranformed from n[-1,1]=I to the solution space of the optimization. Each probability amplitude of quantum bit of particles is corresponded with a variable of optimization. Let the No. i quantum bit of jP is [ ]Tj
ij
i βα , , then variables for the solution space:
[ ])1()1(21 j
iij
iij
ic abX αα −++= (9)
[ ])1()1(21 j
iij
iij
is abX ββ −++= (10)
So, the two solutions of optimization are corresponded with each particle. And the probability amplitude j
iα of >0 is corresponded with jicX ,
the probability amplitude jiβ of >1 is
corresponded with jisX . ni 2,1= , mj 2,1= .
5.3 Update of Particle position
In QPSO, the movement of particle position can be achieved by quantum rotation gate. Thus, the update of particle speed in PSO become to the update of the corner of quantum rotation gate; the update of particle position become to the update of the probability
708708703
amplitude of quantum bit. The current optimal position of iP :
))cos(,),cos(),(cos( ln21 iilililP θθθ= (11) The current optimal position of whole population:
))cos(,),cos(),(cos( 21 gngggP θθθ= (12) Based on the above assumptions, the updating rules
of particle state can be described as: 1)the update of quantum-angle increment rate of
iP :
)()()()1( 2211 glijij rcrctt θθθωθ ∆+∆+∆=+∆ (13)
>−≤−≤−
−<−
−−−
−+=∆
)()(
)(
2
2
πθθπθθπ
πθθ
πθθθθ
θθπθ
ijilj
ijilj
ijilj
ijilj
ijilj
ijilj
l ,
>−≤−≤−
−<−
−−−
−+=∆
)()(
)(
2
2
πθθπθθπ
πθθ
πθθθθ
θθπθ
ijgj
ijgj
ijgj
ijgj
ijgj
ijgj
g
2)the update of quantum-probability amplitude of
iP :
+∆+∆+∆+∆
=
∆∆
+∆+∆+∆−+∆
=
++
))1()(sin())1()(cos(
))(sin())(cos(
))1(cos())1(sin())1(sin())1(cos(
))1(~sin())1(cos(
tttt
tt
tttt
tt
ijij
ijij
ij
ij
ijij
ijij
ij
ij
θθθθ
θθ
θθθθ
θθ
(14) ni 2,1= , mj 2,1=
the two updated new locations of iP :
)))1()(cos(,
)),1()((cos(~
+∆+∆
+∆+∆=
tt
ttP
ijij
ijijic
θθθθ
(15)
)))1()(sin(,
)),1()((sin(~
+∆+∆
+∆+∆=
tt
ttP
ijij
ijijis
θθθθ
(16)
It can be seen that quantum rotation gate has achieved the two location mobile at the same time through changing the quantum-phase of particles. In the condition of unchange of population size, quantum bit encode can expand ergodicity of search space and improve the efficiency of the optimization algorithm.
5.4 Variation processing
In many cases, PSO will be a local minimum because of the loss of diversity of population. In evolutionary algorithm,in order to increase the diversity of population, mutation factor is produced to avoid premature. In QPSO, mutation can be realized by the quantum non-gate.Firstly, assume a mutation probability mp , assignment of each particle a random
number irand in [0,1], if mi prand < , then
choose [ ]2n quantum qit of the particle randomly, the two probability amplitude are exchanged by using quantum non-gate, their own optimal position and quantum-angle vector remain unchanged.
+
+=
=
)2
sin(
)2
cos(
)cos()sin(
)sin()cos(
0110
πθ
πθ
θθ
θθ
ij
ij
ij
ij
ij
ij
(17) { }mi ,,2,1∈ , { }nj ,,2,1∈ .
It can be seen from the above that mutation is also a kind of rotation. For No. j quantum qit,
ijij θπθ 22
−=∆ . This rotation has nothing with their
optimal position and the current position of population, as a result, particles increase the diversity.
5.5 QPSO Algorithm description
To summarize the above, the steps of the QPSO algorithm as follows: 1.Population Initialization according to formula (6); 2.Transform of solution space according to formula
(9),(10), calculate the fitness of each particle. If the current lacation of particle is superior to the memory optimal location,the optimal location is replaced by the current position. If the current loacaion of global is superior to the memory optimal location,the optimal location is replaced by the current position;
3.Update the state of particles according to formula (13),(14);
4.Mutation of each particle accoriding to foumula (17); 5.Return to step2, stop when meet the termination
condition. 6.Image Segmentation based on QPSO
The finess function is defined as So the fitness function is defined as :
709709704
)18()(...
)(...
)()(
)(...)(
)()(
),...,,(
211
211
23131
22121
200
23030
22020
21010
21
kkkk
kk
kk
k
uu
uu
uuuu
uuuu
uuuu
tttdFit
−+
−++
−+−+
−+−+
−+−=
=
−− ωωωω
ωωωωωωωω
ωωωω
Steps of image segmentation refer to 5.5. Experimental results and analaysis as follows:
Figure 1
Figure 2 Figure 3 Figure 4
Figure1: ’Lena’; Figure2: two-threshold segmentation image;
154,98 21 == tt ; the number of iterations: 10
Figure3: three-threshold segmentation image; 171,127,80 321 === ttt ;
the number of iterations: 14 Figure4: four-threshold segmentation image;
177,144,104,70 4321 ==== tttt ; the number of iterations: 19
These results show that the result of multi-threshold image segmentation based on QPSO are very good and high efficiency so as to provide a basis for the follow-up actions of computer vision.
7.Conclusions
Ostu thresholding, which features a good performance, is one of the main image threshold segmentation methods. Like other threshold methods, the application of the Otsu has been restricted for the long-paying computation. In this paper, we get the thresholds based on QPSO algorithm. Experimental results have demonstrated that QPSO is a new optimization algorithm whose convergence speed is
faster and functions are more powerful. The application of image segmentation based on QPSO overcome the problem that the calculation is big. This also explains QPSO has a certain prospect in image processing. 8. References [1] ZHANG Yu-jin.Image segmentation[M]. Beijing:
Science Press,2001. [2] JIN Cong, PENG Jia-xiong. Image gray multi-level
threshold selection method based on genetic strategy[J]. Computer Engineering and Applications, 2003,39(8): 23-26.
[3] Hyun K, Kim J H. Quantum-inspired evolutionary
algorithm for a class of combinational optimization[J]. IEEE Transactions on Evolutionary Computing, 2002,6(6):580-593.
[4] KENNEDY J, EBERHART R. Particle swarm
optimization[C]//IEEE International Conference on Neural Networks Piscataway, NJ:IEEE Press,1995:1942-1948.
[5] M A Nielsen, I L Chuang. Quantum Computation
and Quantum Information. Cambridge: Cambridge University Press, 2000.
[6] A Pittenger. An Introduction to Quantum
Computing Algorithms. Birkhauser, 2000.
710710705