目录
- 1.摘要
- 2.算法原理
- 3.结果展示
- 4.参考文献
- 5.代码获取
1.摘要
本文提出了一种新的多策略集成粒子群算法(GSRPSO),用于提高宫颈癌图像的多阈值分割精度。GSRPSO通过四种策略协同工作,增强了算法的优化能力。动态参数平衡了探索与开发阶段,增益共享策略和随机位置更新策略加速了收敛过程并增加了种群多样性,垂直交叉变异策略则提升了局部开发能力,避免了算法的早期停滞。
2.算法原理
粒子群算法
经典PSO位置更新:
V
i
t
+
1
=
ω
∗
V
i
t
+
c
1
∗
r
1
∗
(
p
b
e
s
t
i
t
−
X
i
t
)
+
c
2
∗
r
2
∗
(
g
b
e
s
t
t
−
X
i
t
)
X
i
t
+
1
=
X
i
t
+
V
i
t
+
1
\begin{aligned} \mathbf{V}_i^{t+1} & =\omega*\mathbf{V}_i^t+c_1*r_1*\left(pbest_i^t-\mathbf{X}_i^t\right)+c_2*r_2*\left(\mathbf{g}best^t-\mathbf{X}_i^t\right) \\ \mathbf{X}_i^{t+1} & =\mathbf{X}_i^t+\mathbf{V}_i^{t+1} \end{aligned}
Vit+1Xit+1=ω∗Vit+c1∗r1∗(pbestit−Xit)+c2∗r2∗(gbestt−Xit)=Xit+Vit+1
动态权重因子
PSO算法中惯性权重
w
w
w,个体学习因子
C
1
C_1
C1和群体学习因子
C
2
C_2
C2通常是固定常数。较大的惯性权重和个体学习因子会使粒子过度聚焦于全局探索,导致收敛过程受到影响;而较大的群体学习因子则可能导致算法过早收敛,无法充分探索解空间。因此,本文提出了多阶段递减的惯性权重和不对称学习因子策略:
ω
=
{
1
−
δ
×
(
t
T
)
2
,
0
≤
t
≤
T
3
1
−
δ
×
(
t
T
)
,
T
3
<
t
≤
2
T
3
1
−
δ
×
(
2
t
T
)
−
δ
×
(
t
T
)
2
,
2
T
3
<
t
≤
T
\omega = \begin{cases} 1 - \delta \times \left( \frac{t}{T} \right)^2, & 0 \leq t \leq \frac{T}{3} \\ 1 - \delta \times \left( \frac{t}{T} \right), & \frac{T}{3} < t \leq \frac{2T}{3} \\ 1 - \delta \times \left( \frac{2t}{T} \right) - \delta \times \left( \frac{t}{T} \right)^2, & \frac{2T}{3} < t \leq T \end{cases}
ω=⎩
⎨
⎧1−δ×(Tt)2,1−δ×(Tt),1−δ×(T2t)−δ×(Tt)2,0≤t≤3T3T<t≤32T32T<t≤T
C
k
=
C
k
i
n
i
+
(
C
k
f
i
n
−
C
k
i
n
i
)
×
t
/
T
,
k
=
1
,
2
C_k=C_k^{ini}+\left(C_k^{fin}-C_k^{ini}\right)\times t/T,\quad k=1,2
Ck=Ckini+(Ckfin−Ckini)×t/T,k=1,2
增益共享知识策略
增益共享知识策略将增益共享行为分为初级阶段和高级阶段,计算需要通过初级增益共享知识策略和高级增益共享知识策略更新的粒子维度:
D
J
u
n
i
o
r
=
D
∗
(
1
−
t
/
T
)
k
D
S
e
n
i
o
r
=
D
−
D
J
u
n
i
o
r
\begin{aligned} & D_{Junior}=D*\left(1-t/T\right)^{k} \\ & D_{Senior}=D-D_{Junior} \end{aligned}
DJunior=D∗(1−t/T)kDSenior=D−DJunior
在算法的初期阶段,粒子在整个搜索空间中寻找最优解。为了在广泛探索的同时加速接近最优解,初级增益共享阶段通过根据适应度将种群按升序排列,并利用当前粒子与最接近的两个粒子之间的位移差以及当前粒子与随机粒子之间的位移差来更新当前粒子的位置。当随机粒子的适应度低于当前粒子的适应度时,整个种群将朝着随机粒子所在的位置移动。通过初级增益共享策略,粒子能够在更广泛的空间内进行探索,同时逐步逼近最优解。
X
i
t
+
1
=
{
X
i
t
+
α
∗
[
(
X
i
−
1
t
−
X
i
+
1
t
)
+
(
X
r
t
−
X
i
t
)
]
i
f
f
(
X
i
t
)
>
f
(
X
r
t
)
X
i
t
+
α
∗
[
(
X
i
−
1
t
−
X
i
+
1
t
)
+
(
X
i
t
−
X
r
t
)
]
O
t
h
e
r
w
i
s
e
\left.\mathbf{X}_i^{t+1}=\left\{ \begin{array} {ll}\mathbf{X}_i^t+\alpha*\left[\left(\mathbf{X}_{i-1}^t-\mathbf{X}_{i+1}^t\right)+\left(\mathbf{X}_r^t-\mathbf{X}_i^t\right)\right] & \quad iff\left(\mathbf{X}_i^t\right)>f\left(\mathbf{X}_r^t\right) \\ \mathbf{X}_i^t+\alpha*\left[\left(\mathbf{X}_{i-1}^t-\mathbf{X}_{i+1}^t\right)+\left(\mathbf{X}_i^t-\mathbf{X}_r^t\right)\right] & \quad Otherwise \end{array}\right.\right.
Xit+1={Xit+α∗[(Xi−1t−Xi+1t)+(Xrt−Xit)]Xit+α∗[(Xi−1t−Xi+1t)+(Xit−Xrt)]iff(Xit)>f(Xrt)Otherwise
在高级增益共享阶段,首先根据适应度将种群按升序排列,选择前10%、中间80%和后10%的粒子,分别形成最优粒子群、较好粒子群和最差粒子群。根据最优粒子群和最差粒子群之间的随机距离,粒子群会及时脱离局部最优区域。当较好粒子的适应度小于当前粒子的适应度时,整个种群将移动到较好粒子所在的位置,这有利于种群探索更多未知区域,并在有限时间内找到全局最优区域。高级阶段的位置更新:
X
i
t
+
1
=
{
X
i
t
+
α
∗
[
(
X
r
b
e
s
t
−
X
r
w
o
r
s
t
)
+
(
X
r
m
t
−
X
i
t
)
]
i
f
f
(
X
i
t
)
>
f
(
X
r
m
t
)
X
i
t
+
α
∗
[
(
X
r
b
e
s
t
−
X
r
w
o
r
s
t
)
+
(
X
r
m
t
−
X
r
t
)
]
O
t
h
e
r
w
i
s
e
\left.\mathbf{X}_{i}^{t+1}=\left\{ \begin{array} {ll}\mathbf{X}_{i}^{t}+\alpha*\left[(\mathbf{X}_{rbest}-\mathbf{X}_{rworst})+\left(\mathbf{X}_{rm}^{t}-\mathbf{X}_{i}^{t}\right)\right] & \quad iff\left(\mathbf{X}_{i}^{t}\right)>f\left(\mathbf{X}_{rm}^{t}\right) \\ \mathbf{X}_{i}^{t}+\alpha*\left[(\mathbf{X}_{rbest}-\mathbf{X}_{rworst})+\left(\mathbf{X}_{rm}^{t}-\mathbf{X}_{r}^{t}\right)\right] & \quad Otherwise \end{array}\right.\right.
Xit+1={Xit+α∗[(Xrbest−Xrworst)+(Xrmt−Xit)]Xit+α∗[(Xrbest−Xrworst)+(Xrmt−Xrt)]iff(Xit)>f(Xrmt)Otherwise
随机位置更新策略
Levy飞行是一种具有无限方差和均值的随机游走过程。通过引入Levy飞行策略,种群能够实现瞬时跳跃:
X
i
t
+
1
=
X
i
t
+
V
i
t
+
r
∗
l
e
v
y
(
β
)
∗
(
g
b
e
s
t
t
−
X
i
t
)
∗
k
k
=
2
∗
t
/
T
\begin{aligned} & \mathbf{X}_i^{t+1}=\mathbf{X}_i^t+\mathbf{V}_i^t+r*levy(\beta)*\left(gbest^t-\mathbf{X}_i^t\right)*k \\ & k=2*t/T \end{aligned}
Xit+1=Xit+Vit+r∗levy(β)∗(gbestt−Xit)∗kk=2∗t/T
论文设置了一个选择参数
P
P
P,当
P
<
2
/
3
P<2/3
P<2/3时,使用Levy飞行策略更新粒子位置;反之,则使用随机位置更新策略:
X
i
t
+
1
=
{
X
l
t
+
b
1
(
h
1
∗
g
b
e
s
t
t
−
h
2
∗
X
k
t
)
+
b
2
ρ
(
h
2
∗
(
X
1
i
t
−
X
2
i
t
)
)
+
h
2
(
X
r
1
t
−
X
r
2
t
)
/
2
,
i
f
h
1
<
0.5
g
b
e
s
t
t
+
b
1
(
h
1
∗
g
b
e
s
t
t
−
h
2
∗
X
k
t
)
+
b
2
ρ
(
h
2
∗
(
X
1
i
t
−
X
2
i
t
)
)
+
h
2
(
X
r
1
t
−
X
r
2
t
)
/
2
,
o
t
h
e
r
w
i
s
e
\left.\mathbf{X}_{i}^{t+1}=\left\{ \begin{array} {l}\mathbf{X}_{l}^{t}+b_{1}\left(h_{1}*gbest^{t}-h_{2}*\mathbf{X}_{k}^{t}\right)+b_{2}\rho\left(h_{2}*\left(\mathbf{X}_{1i}^{t}-\mathbf{X}_{2i}^{t}\right)\right)+h_{2}\left(\mathbf{X}_{r1}^{t}-\mathbf{X}_{r2}^{t}\right)/2,ifh_{1}<0.5 \\ gbest^{t}+b_{1}\left(h_{1}*gbest^{t}-h_{2}*\mathbf{X}_{k}^{t}\right)+b_{2}\rho\left(h_{2}*\left(\mathbf{X}_{1i}^{t}-\mathbf{X}_{2i}^{t}\right)\right)+h_{2}\left(\mathbf{X}_{r1}^{t}-\mathbf{X}_{r2}^{t}\right)/2,otherwise \end{array}\right.\right.
Xit+1={Xlt+b1(h1∗gbestt−h2∗Xkt)+b2ρ(h2∗(X1it−X2it))+h2(Xr1t−Xr2t)/2,ifh1<0.5gbestt+b1(h1∗gbestt−h2∗Xkt)+b2ρ(h2∗(X1it−X2it))+h2(Xr1t−Xr2t)/2,otherwise
垂直变异算子
C X i , d 1 t = r ⋅ X i , d 1 t + ( 1 − r ) ⋅ X i , d 2 t CX_{i,d1}^t=r\cdot X_{i,d1}^t+(1-r)\cdot X_{i,d2}^t CXi,d1t=r⋅Xi,d1t+(1−r)⋅Xi,d2t
流程图
伪代码
3.结果展示
4.参考文献
[1] Hu G, Zheng Y, Houssein E H, et al. GSRPSO: A multi-strategy integrated particle swarm algorithm for multi-threshold segmentation of real cervical cancer images[J]. Swarm and Evolutionary Computation, 2024, 91: 101766.