简介
paper:Unsupervised Deep Tracking
这篇论文的亮点在于通过无监督学习的方式来进行目标跟踪,且取得了与监督学习模型相当的精度。
论文的基本思想是:首先将当前帧作为template frame
,后一帧作为Search frame
,从而得到响应
R
S
R_S
RS,之后反过来,将后一帧作为template frame
同时以预测结果
R
S
R_S
RS作为其标签,然后当前帧作为Search frame
预测当前帧的响应
R
T
R_T
RT,然后通过计算
R
T
R_T
RT和真实标签(高斯标签)
Y
T
Y_T
YT之间的误差来训练模型。这就像录像的正放和倒放,目标在当前帧的位置应当是相同的。(见下图)
主要内容
如上图所示是这篇论文中模型的主要框架,其中跟踪模型采用了Dcfnet,整个训练过程分为Forward
和Backward
两步。
Revisiting Correlation Tracking
论文采用基于相关滤波框架的模型,相关滤波模型的优化目标是找到一个最优的滤波器 W W W,从而使得下式的值最小:
min W ∥ W ∗ X − Y ∥ 2 2 + λ ∥ W ∥ 2 2 \min _{\mathbf{W}}\|\mathbf{W} * \mathbf{X}-\mathbf{Y}\|_{2}^{2}+\lambda\|\mathbf{W}\|_{2}^{2} Wmin∥W∗X−Y∥22+λ∥W∥22
Here, Y Y Y is a ground-truth label, λ \lambda λ is a regularization paramenter , ∗ * ∗ denotes the circular convolution.
将上式转换为在傅里叶域内计算,则滤波器 W W W可以通过下式计算得到:
W = F − 1 ( F ( X ) ⊙ F ⋆ ( Y ) F ⋆ ( X ) ⊙ F ( X ) + λ ) \mathbf{W}=\mathscr{F}^{-1}\left(\frac{\mathscr{F}(\mathbf{X}) \odot \mathscr{F}^{\star}(\mathbf{Y})}{\mathscr{F}^{\star}(\mathbf{X}) \odot \mathscr{F}(\mathbf{X})+\lambda}\right) W=F−1(F⋆(X)⊙F(X)+λF(X)⊙F⋆(Y))
where ⊙ \odot ⊙ is the element-wise product, F ( ⋅ ) \mathscr{F}(\cdot) F(⋅) is the Discrete Fourier Transform (DFT), F − 1 ( ⋅ ) \mathscr{F}^{-1}(\cdot) F−1(⋅) is the inverse DFT, and ⋆ \star ⋆ denotes the complex-conjugate operation.
而响应图 R R R可以通过下式得到:
R = W ∗ Z = F − 1 ( F ⋆ ( W ) ⊙ F ( Z ) ) \mathbf{R}=\mathbf{W} * \mathbf{Z}=\mathscr{F}^{-1}\left(\mathscr{F}^{\star}(\mathbf{W}) \odot \mathscr{F}(\mathbf{Z})\right) R=W∗Z=F−1(F⋆(W)⊙F(Z))
Unsupervised Learning Prototype
无监督学习过程分为Forward Tracking
和Backward Tracking
两部分。
Forward Tracking
前向跟踪时,从首帧
P
1
P_1
P1中取template patch
T
T
T,下一帧中取search patch
为
S
S
S,同时以高斯标签
Y
T
Y_T
YT 作为其标签,根据DCF中的公式(也就是上面计算滤波器的公式)可计算滤波器模板
W
T
W_T
WT为:
W T = F − 1 ( F ( φ θ ( T ) ) ⊙ F ⋆ ( Y T ) F ⋆ ( φ θ ( T ) ) ⊙ F ( φ θ ( T ) ) + λ ) \mathbf{W}_{\mathbf{T}}=\mathscr{F}^{-1}\left(\frac{\mathscr{F}\left(\varphi_{\theta}(\mathbf{T})\right) \odot \mathscr{F}^{\star}\left(\mathbf{Y}_{\mathbf{T}}\right)}{\mathscr{F}^{\star}\left(\varphi_{\theta}(\mathbf{T})\right) \odot \mathscr{F}\left(\varphi_{\theta}(\mathbf{T})\right)+\lambda}\right) WT=F−1(F⋆(φθ(T))⊙F(φθ(T))+λF(φθ(T))⊙F⋆(YT))
且响应为:
R S = F − 1 ( F ⋆ ( W T ) ⊙ F ( φ θ ( S ) ) ) \mathbf{R}_{\mathbf{S}}=\mathscr{F}^{-1}\left(\mathscr{F}^{\star}\left(\mathbf{W}_{\mathbf{T}}\right) \odot \mathscr{F}\left(\varphi_{\theta}(\mathbf{S})\right)\right) RS=F−1(F⋆(WT)⊙F(φθ(S)))
Backward Tracking
反向跟踪时,将前向跟踪得到的响应
R
S
R_S
RS作为标签
Y
S
Y_S
YS,同时将
S
S
S作为template patch
,
T
T
T作为search path
.计算反向跟踪的滤波器目标
W
S
W_S
WS 为:
W S = F − 1 ( F ( φ θ ( S ) ) ⊙ F ⋆ ( Y S ) F ⋆ ( φ θ ( S ) ) ⊙ F ( φ θ ( S ) ) + λ ) \mathbf{W}_{\mathbf{S}}=\mathscr{F}^{-1}\left(\frac{\mathscr{F}\left(\varphi_{\theta}(\mathbf{S})\right) \odot \mathscr{F}^{\star}\left(\mathbf{Y}_{\mathbf{S}}\right)}{\mathscr{F}^{\star}\left(\varphi_{\theta}(\mathbf{S})\right) \odot \mathscr{F}\left(\varphi_{\theta}(\mathbf{S})\right)+\lambda}\right) WS=F−1(F⋆(φθ(S))⊙F(φθ(S))+λF(φθ(S))⊙F⋆(YS))
同理计算反向跟踪的响应 R T R_T RT为:
R T = F − 1 ( F ⋆ ( W S ) ⊙ F ( φ θ ( T ) ) ) \mathbf{R}_{\mathbf{T}}=\mathscr{F}^{-1}\left(\mathscr{F}^{\star}\left(\mathbf{W}_{\mathbf{S}}\right) \odot \mathscr{F}\left(\varphi_{\theta}(\mathbf{T})\right)\right) RT=F−1(F⋆(WS)⊙F(φθ(T)))
Consistency Loss Computation
根据预想, R T R_T RT应当尽可能与原始标签 Y T Y_T YT相似,即最小化它们之间的误差:
L un = ∥ R T − Y T ∥ 2 2 \mathcal{L}_{\text {un }}=\left\|\mathbf{R}_{\mathbf{T}}-\mathbf{Y}_{\mathbf{T}}\right\|_{2}^{2} Lun =∥RT−YT∥22
最终通过下面的偏导来更新网络:
∂ L u n ∂ φ θ ( T ) = F − 1 ( ∂ L u n ∂ ( F ( φ θ ( T ) ) ) ⋆ + ( ∂ L u n ∂ ( F ( φ θ ( T ) ) ) ) ⋆ ) ∂ L u n ∂ φ θ ( S ) = F − 1 ( ∂ L u n ∂ ( F ( φ θ ( S ) ) ) ⋆ ) \begin{aligned} \frac{\partial \mathcal{L}_{\mathrm{un}}}{\partial \varphi_{\theta}(\mathbf{T})} &=\mathscr{F}^{-1}\left(\frac{\partial \mathcal{L}_{\mathrm{un}}}{\partial\left(\mathscr{F}\left(\varphi_{\theta}(\mathbf{T})\right)\right)^{\star}}+\left(\frac{\partial \mathcal{L}_{\mathrm{un}}}{\partial\left(\mathscr{F}\left(\varphi_{\theta}(\mathbf{T})\right)\right)}\right)^{\star}\right) \\ \frac{\partial \mathcal{L}_{\mathrm{un}}}{\partial \varphi_{\theta}(\mathbf{S})} &=\mathscr{F}^{-1}\left(\frac{\partial \mathcal{L}_{\mathrm{un}}}{\partial\left(\mathscr{F}\left(\varphi_{\theta}(\mathbf{S})\right)\right)^{\star}}\right) \end{aligned} ∂φθ(T)∂Lun∂φθ(S)∂Lun=F−1(∂(F(φθ(T)))⋆∂Lun+(∂(F(φθ(T)))∂Lun)⋆)=F−1(∂(F(φθ(S)))⋆∂Lun)
Unsupervised Learning Improvements
在实际测试中,作者发现两个问题:一个是跟踪器可能会在向前跟踪中偏离目标,但是在向后跟踪中仍然返回到原始位置;二是有些训练数据包含无语意信息或者目标被遮挡。
对于这些情况,作者提出了两个新的举措的来解决。
Multiple Frames Validation
为了解决上面提到的第一种问题,作者通过使用三帧相邻的图像来放大预测的误差。如上图中右图所示,对第二帧预测的结果在进行一次前向跟踪得到第三帧的预测结果,之后将第三帧作为template
,第一帧作为search
,之后进行反向跟踪,并定义新误差为:
L u n = ∥ R ~ T − Y T ∥ 2 2 \mathcal{L}_{\mathrm{un}}=\left\|\widetilde{\mathbf{R}}_{\mathbf{T}}-\mathbf{Y}_{\mathbf{T}}\right\|_{2}^{2} Lun=∥∥∥R T−YT∥∥∥22
where R ~ T \widetilde{\mathbf{R}}_{\mathbf{T}} R T is the response map generated by an additional frame during the backward tracking step.
Cost-sensitive Loss
为了解决第二个问题,作者引入了motion weight vector
A
m
o
t
i
o
n
A_{motion}
Amotion,每个位置的
A
m
o
t
i
o
n
i
A^{i}_{motion}
Amotioni通过下面式子计算得到:
A m o t i o n i = ∥ R S 1 i − Y T i ∥ 2 2 + ∥ R S 2 i − Y S 1 i ∥ 2 2 \mathbf{A}_{\mathrm{motion}}^{i}=\left\|\mathbf{R}_{\mathbf{S}_{1}}^{i}-\mathbf{Y}_{\mathbf{T}}^{i}\right\|_{2}^{2}+\left\|\mathbf{R}_{\mathbf{S}_{2}}^{i}-\mathbf{Y}_{\mathbf{S}_{1}}^{i}\right\|_{2}^{2} Amotioni=∥∥RS1i−YTi∥∥22+∥∥RS2i−YS1i∥∥22
A m o t i o n i A^{i}_{motion} Amotioni的值越大,代表目标在该连续帧中运动的幅度越大。
之后对 A m o t i o n i A^{i}_{motion} Amotioni进行正则化:
A norm i = A drop i ⋅ A motion i ∑ i = 1 n A drop i ⋅ A motion i \mathbf{A}_{\text {norm }}^{i}=\frac{\mathbf{A}_{\text {drop }}^{i} \cdot \mathbf{A}_{\text {motion }}^{i}}{\sum_{i=1}^{n} \mathbf{A}_{\text {drop }}^{i} \cdot \mathbf{A}_{\text {motion }}^{i}} Anorm i=∑i=1nAdrop i⋅Amotion iAdrop i⋅Amotion i
最终的损失函数通过下面的式子决定:
L u n = 1 n ∑ i = 1 n A n o r m i ⋅ ∥ R ~ T i − Y T i ∥ 2 2 . \mathcal{L}_{\mathrm{un}}=\frac{1}{n} \sum_{i=1}^{n} \mathbf{A}_{\mathrm{norm}}^{i} \cdot\left\|\widetilde{\mathbf{R}}_{\mathbf{T}}^{i}-\mathbf{Y}_{\mathbf{T}}^{i}\right\|_{2}^{2} . Lun=n1i=1∑nAnormi⋅∥∥∥R Ti−YTi∥∥∥22.
实验结果
小结
这篇论文的想法很新颖,也很有意思,通过无监督学习的方式取得了与监督学习相当的结果,不容易(PS:无监督目标跟踪也是一个好坑位!)