Cross Entropy Loss |
L
=
−
1
m
∑
i
=
1
m
log
e
W
y
i
T
x
i
+
b
y
i
∑
j
=
1
n
e
W
j
T
x
i
+
b
j
L = -\frac{1}{m}\sum_{i=1}^m\log\frac{e^{W_{y_i}^Tx_i+b_{y_i}}}{\sum_{j=1}^ne^{W_j^Tx_i+b_j}}
L=−m1∑i=1mlog∑j=1neWjTxi+bjeWyiTxi+byi | 否 | 否 | 欧式空间 |
(
W
1
−
W
2
)
x
+
b
1
−
b
2
=
0
(W_1-W_2)x+b_1-b_2=0
(W1−W2)x+b1−b2=0 | — |
triplet loss |
∥
f
(
x
i
a
)
−
f
(
x
i
p
)
∥
2
2
+
α
<
∥
f
(
x
i
a
)
−
f
(
x
i
n
)
∥
2
2
\|f(x_i^a)-f(x_i^p)\|_2^2 + \alpha < \|f(x_i^a)-f(x_i^n)\|_2^2
∥f(xia)−f(xip)∥22+α<∥f(xia)−f(xin)∥22 | 否 | 否 | 欧式空间 | – | facenet |
center loss |
L
=
−
1
m
∑
i
=
1
m
log
e
W
y
i
T
x
i
+
b
y
i
∑
j
=
1
n
e
W
j
T
x
i
+
b
j
+
λ
2
∑
i
=
1
m
∥
x
i
−
c
y
i
∥
2
2
L = -\frac{1}{m}\sum_{i=1}^m\log\frac{e^{W_{y_i}^Tx_i+b_{y_i}}}{\sum_{j=1}^ne^{W_j^Tx_i+b_j}}+\frac{\lambda}{2}\sum_{i=1}^m\|x_i-c_{y_i}\|_2^2
L=−m1∑i=1mlog∑j=1neWjTxi+bjeWyiTxi+byi+2λ∑i=1m∥xi−cyi∥22 | 否 | 否 | 欧式空间 | – | centerloss |
coco loss |
L
=
∑
i
∈
β
e
x
p
C
(
f
(
i
)
,
c
l
i
)
∑
m
≠
l
i
e
x
p
C
(
f
(
i
)
,
c
m
)
L =\sum_{i\in\beta}\frac{expC(f^{(i)},c_{l_i})}{\sum_{m \neq l_i}expC(f^{(i)},c_m)}
L=∑i∈β∑m=liexpC(f(i),cm)expC(f(i),cli) | 否 | 是 | 欧式空间 | – | cocoloss |
L-softmax |
L
i
=
−
log
(
e
∥
W
y
i
∥
∥
x
i
∥
Φ
(
θ
y
i
)
e
∥
W
y
i
∥
∥
x
i
∥
Φ
(
θ
y
i
)
+
∑
j
≠
y
i
e
∥
W
y
i
∥
∥
x
i
∥
cos
(
θ
j
)
)
L_i =-\log(\frac{e^{\|W_{y_i}\|\|x_i\|\Phi(\theta_{y_i})}}{e^{\|W_{y_i}\|\|x_i\|\Phi(\theta_{y_i})}+\sum_{j \neq y_i}e^{\|W_{y_i}\|\|x_i\|\cos(\theta_j)}})
Li=−log(e∥Wyi∥∥xi∥Φ(θyi)+∑j=yie∥Wyi∥∥xi∥cos(θj)e∥Wyi∥∥xi∥Φ(θyi)) | 否 | 否 | 角度空间 |
∥
W
1
∥
∥
x
∥
cos
(
m
θ
1
)
=
∥
W
2
∥
∥
x
∥
cos
(
θ
2
)
\|W_1\|\|x\|\cos(m\theta_1) = \|W_2\|\|x\|\cos(\theta_2)
∥W1∥∥x∥cos(mθ1)=∥W2∥∥x∥cos(θ2) | L-Softmax |
L2-softmax |
L
=
−
1
m
∑
i
=
1
m
log
e
W
y
i
T
x
i
+
b
y
i
∑
j
=
1
n
e
W
j
T
x
i
+
b
j
L = -\frac{1}{m}\sum_{i=1}^m\log\frac{e^{W_{y_i}^Tx_i+b_{y_i}}}{\sum_{j=1}^ne^{W_j^Tx_i+b_j}}
L=−m1∑i=1mlog∑j=1neWjTxi+bjeWyiTxi+byi | 否 | 是 | 欧式空间 |
(
W
1
−
W
2
)
x
+
b
1
−
b
2
=
0
(W_1-W_2)x+b_1-b_2=0
(W1−W2)x+b1−b2=0 | L2-softmax |
A-softmax |
L
i
=
−
log
(
e
∥
x
i
∥
cos
(
m
θ
y
i
,
i
)
e
∥
x
i
∥
cos
(
θ
y
i
,
i
)
+
∑
j
≠
y
i
e
∥
x
i
∥
cos
(
θ
j
,
i
)
)
L_i =-\log(\frac{e^{\|x_i\|\cos(m\theta_{y_i},i)}}{e^{\|x_i\|\cos(\theta_{y_i},i)}+\sum_{j \neq y_i}e^{\|x_i\|\cos(\theta_j,i)}})
Li=−log(e∥xi∥cos(θyi,i)+∑j=yie∥xi∥cos(θj,i)e∥xi∥cos(mθyi,i)) | 是 | 否 | 角度空间 |
∥
x
∥
cos
(
m
θ
1
)
=
∥
x
∥
cos
(
θ
2
)
\|x\|\cos(m\theta_1) = \|x\|\cos(\theta_2)
∥x∥cos(mθ1)=∥x∥cos(θ2) | A-Softmax |
AM-softmax |
L
i
=
−
log
(
e
s
(
cos
(
θ
y
i
)
−
m
)
e
s
(
cos
(
θ
y
i
)
−
m
)
+
∑
j
≠
y
i
e
s
cos
(
θ
j
)
)
L_i =-\log(\frac{e^{s(\cos(\theta_{y_i})-m)}}{e^{^{s(\cos(\theta_{y_i})-m)}}+\sum_{j \neq y_i}e^{s\cos(\theta_j)}})
Li=−log(es(cos(θyi)−m)+∑j=yiescos(θj)es(cos(θyi)−m)) | 是 | 是 | 余弦空间 |
cos
(
θ
1
)
−
m
=
cos
(
θ
2
)
\cos(\theta_1)-m = \cos(\theta_2)
cos(θ1)−m=cos(θ2) | AM-Softmax |
cosFace |
L
i
=
−
log
(
e
s
(
cos
(
θ
y
i
)
−
m
)
e
s
(
cos
(
θ
y
i
)
−
m
)
+
∑
j
≠
y
i
e
s
cos
(
θ
j
)
)
L_i =-\log(\frac{e^{s(\cos(\theta_{y_i})-m)}}{e^{^{s(\cos(\theta_{y_i})-m)}}+\sum_{j \neq y_i}e^{s\cos(\theta_j)}})
Li=−log(es(cos(θyi)−m)+∑j=yiescos(θj)es(cos(θyi)−m)) | 是 | 是 | 余弦空间 |
cos
(
θ
1
)
−
m
=
cos
(
θ
2
)
\cos(\theta_1)-m = \cos(\theta_2)
cos(θ1)−m=cos(θ2) | cosFace |
ArcFace |
L
i
=
−
log
(
e
s
cos
(
θ
y
i
+
m
)
e
s
cos
(
θ
y
i
+
m
)
+
∑
j
≠
y
i
e
s
cos
(
θ
j
)
)
L_i =-\log(\frac{e^{s\cos(\theta_{y_i}+m)}}{e^{^{s\cos(\theta_{y_i}+m)}}+\sum_{j \neq y_i}e^{s\cos(\theta_j)}})
Li=−log(escos(θyi+m)+∑j=yiescos(θj)escos(θyi+m)) | 是 | 是 | 角度空间 |
cos
(
θ
1
+
m
)
=
cos
(
θ
2
)
\cos(\theta_1+m) = \cos(\theta_2)
cos(θ1+m)=cos(θ2) | arcface |