RPN的目标函数是分类和回归损失的和,分类采用 交叉熵,回归采用稳定的 Smooth L1,
SmoothL1公式 为:
s
m
o
o
t
h
L
1
(
x
)
=
{
0.5
x
2
,
∣
x
∣
≤
1
∣
x
∣
−
0.5
,
∣
x
∣
>
1
smooth_{L_{1}}(x)=\left\{ \begin{aligned} &0.5x^{2}&,&|x|\leq1 \\ &|x|-0.5&,&|x|>1 \end{aligned} \right.
smoothL1(x)={0.5x2∣x∣−0.5,,∣x∣≤1∣x∣>1
整体损失函数 具体为:
Smooth L1
- 相比于L1损失函数,可以收敛得更快。
- 相比于L2损失函数,对离群点、异常值不敏感,梯度变化相对更小,训练时不容易跑飞。
[1] Faster R-CNN原理介绍
[2] 深度网络中softmax_loss、Smooth L1 loss计算以及反向传播推导