简介
paper:Fast Online Object Tracking and Segmentation: A Unifying Approach
code:foolwood/SiamMask
参考:[CVPR2019]我对Siamese网络的一点思考(SiamMask)
这篇论文提出了一个可同时用于单目标跟踪(SOT)和视频目标分割(VOS)的跟踪模型。当前的单目标跟踪算法普遍采用第一帧的bbox进行初始化,问题在于:有时候仅仅通过bbox并不能很准确地描述目标物体;此外当前的视频目标分割算法速度普遍偏慢,无法到达实时要求。
基于上述问题,作者试图突破单目标跟踪和视频目标分割的gap
,所以提出了SiamMask
。这个跟踪模型与通常的跟踪模型相比,最大的特点就是增加了一个预测mask
的分支,当用于跟踪任务时,通过mask
来定位目标(这使得该跟踪算法不在局限与初始的bbox),此外mask
又可以用于视频目标分割任务中。
We aim at retaining the offline trainability and online speed of these methods while at the same time significantly refining their representation of the target object, which is limited to a simple
axis-aligned bounding box
主要内容
上图是SiamMask
的主要框架,如图所示,mask
分支是该模型最大的特点。
Fully-convolutional Siamese networks
这篇论文借鉴了SiamFc
的siamese
结构和SiamRPN
的RPN
结构,并将两者融合一体。
其中,对于response map
的计算采用SiamFc
中的方式,即:
g θ n ( z , x ) = f θ ( z ) ⋆ f θ ( x ) g_{\theta}^{n}(z, x)=f_{\theta}(z) \star f_{\theta}(x) gθn(z,x)=fθ(z)⋆fθ(x)
where z z z is an examplar image and x x x is the search image. And same as the SiamFc, the z z z size is 127 × 127 × 3 127 \times 127 \times 3 127×127×3 and the x x x size is 255 × 255 × 3 255 \times 255 \times 3 255×255×3
不同于SiamFc
中的response map
是一个二维的矩阵,这篇论文中采用了depth-wise cross correlation
来替代cross correlation
,从而得到大小为
17
×
17
×
256
17 \times 17 \times 256
17×17×256 的response map
.
此外这篇论文中,作者将response map
中每个位置元素称为RoW
(response of a condidate window).
we refer to each spatial element of the response map as response of a candidate window (RoW)
之后将response map
输入到mask
分支,bbox
预测分支和score
预测分支。
对于bbox
预测分支和score
预测分支,每个RoW
对应k个anchor box 和与之对应的目标/背景得分.
Each RoW encodes a set of k anchor box proposals and corresponding object/background scores.
SiamMask
mask
分支是本文的重点和亮点,对于mask
分支,作者采用了两种方式进行处理:base
版本和refinement
版本。
mask
分支可以表示为:
m n = h ϕ ( g θ n ( z , x ) ) m_{n}=h_{\phi}\left(g_{\theta}^{n}(z, x)\right) mn=hϕ(gθn(z,x))
其中,对于base
版本,采用两层
1
×
1
1\times1
1×1的卷积进行处理,其中第一层输出通道数为
256
256
256,第二层输出通道数为
6
3
2
63^{2}
632。最终输出结果就如上图所示,每个Row
对应于一个大小为
63
×
63
63 \times 63
63×63的向量,这个向量即与每个Row
相对应的mask
特征。
对于refinement
版本,作者借鉴了shapreMask
中的思路提高mask
的预测精度。
With the aim of producing a more accurate object mask, we follow the strategy of Learning to refine object segments, which merges low and high resolution features using multiple refinement modules made of upsampling layers and skip connections.
在refinement
版本中,对于mask
预测采用下图所示更为复杂的模型进行预测(具体可以参考原文和sharpMask
):
Box generation
由于在SOT任务中需要给出预测的bbox,而这篇论文采用的是预测mask
,所以作者考虑了三种根据mask
生成bbox
的方法:
- axis-aligned bounding rectangle (Min-max)
- rotated minimum bounding rectangle (MBR)
- the optimisation strategy used for the automatic bounding box generation proposed in VOT-2016 (Opt)
在经过实验比较以后,作者认为采用MBR
性价比最高。
Loss function
论文作者实现了three-branch
和two-branch
两个版本的SiamMask
,其中two-branch
没有bbox
预测分支且score
分支只预测对应的Row
的分数.(three-branch
中score
分支代表目标/背景得分)
在训练时,对于mask
分支,损失函数定义如下(通过下列函数可以看出只有正样本才会计算
L
m
a
s
k
\mathcal{L}_{mask}
Lmask):
L m a s k ( θ , ϕ ) = ∑ n ( 1 + y n 2 w h ∑ i j log ( 1 + e − c n i j m n i j ) ) \mathcal{L}_{mask}(\theta, \phi)=\sum_{n}\left(\frac{1+y_{n}}{2 w h} \sum_{i j} \log \left(1+e^{-c_{n}^{i j} m_{n}^{i j}}\right)\right) Lmask(θ,ϕ)=n∑(2wh1+ynij∑log(1+e−cnijmnij))
each RoW is labelled with a ground-truth binary label y n ∈ ± 1 y_n ∈ {±1} yn∈±1 and also associated with a pixel-wise ground-truth mask c n c_n cn of size w × h w×h w×h. Besides, a RoW is considered positive ( y n = 1 y_n = 1 yn=1) if one of its anchor boxes has
IOU with the ground-truth box of at least 0.6 0.6 0.6 and negative ( y n = − 1 y_n = −1 yn=−1) otherwise.
最终,总的损失如下:
L 2 B = λ 1 ⋅ L m a s k + λ 2 ⋅ L s i m L 3 B = λ 1 ⋅ L mask + λ 2 ⋅ L score + λ 3 ⋅ L box \begin{array}{c} \mathcal{L}_{2 B}=\lambda_{1} \cdot \mathcal{L}_{m a s k}+\lambda_{2} \cdot \mathcal{L}_{s i m} \\ \mathcal{L}_{3 B}=\lambda_{1} \cdot \mathcal{L}_{\text {mask }}+\lambda_{2} \cdot \mathcal{L}_{\text {score }}+\lambda_{3} \cdot \mathcal{L}_{\text {box }} \end{array} L2B=λ1⋅Lmask+λ2⋅LsimL3B=λ1⋅Lmask +λ2⋅Lscore +λ3⋅Lbox
在跟踪的时候,对于two-branch
版本,输出的bbox是通过使用mask的Min-max box
得到。而three-branch
时则采用前面所讲的三种方法中最优的一种。
实验结果
小结
总的来说,这篇论文还是很具有创新性的,将SOT和VOS两个任务整合到了一起。此外,通过mask
来得到bbox
使得预测精度更高,这一点很值得思考:即仅靠bbox提供的信息并不全面。