2018年10月19日

Cascade RCNN 笔记

Cascade RCNN

在训练时,以低IoU阀值进⾏训练会导致效果不好,因为会产⽣很多噪声框;

所以我们希望阈值尽量⾼,⽽IoU阀值设过⾼时,训练出的detector效果却有下降趋势,如下图所示。

CascadeRCNN阈值与AP的关系.jpg

因为阀值⾼时,每轮训练正样本会更少(指数级下降),detector易过拟合。

如下图所示,训练样本通过RPN产⽣的RP与标注所对⽐的IoU直⽅图,当IoU增加时,正样本呈指数级下降。

The red numbers are the positive percentage higher than the corresponding IoU threshold.

CascadeRCNN阈值与正样本的关系.jpg

⽽如果训练和测试时使⽤不同阈值,即保持训练的阈值较低,只在测试时使⽤⾼阈值,detector得到的结果是次优的,称为inference-time mismatch.

下图可看出①在测试时使⽤更⼤阈值是次优的,即detector的AP会下降;
②低阈值训练的detector对低IoU样本上提升好,⾼阈值detector对⾼IoU样本提升好。

CascadeRCNN阈值与算法效果的关系.jpg

那么如何在阈值适中的情况下训练出效果最好、界线最分明(bbox更准、分类预测值更⾼)的detector呢?我们发现:

⾸先,detector对IoU接近阈值的bbox效果最好,在阈值为0.7时,若输⼊的bbox也为0.7时提升最⼤,如下图所示。

CascadeRCNN阈值对RP的提升.jpg

其次,It suggests that the output of a detector trained with a certain IoU threshold is a good distribution to train the detector of the next higher IoU threshold.

detector的输出是⼀个更加良好的分布,可以再进⾏训练。同时,在⼀个⽹络中进⾏⼀次cascade结构(串⾏使⽤多个不同阈值的detector)⽐Iterative BBox(串⾏使⽤同⼀个detector)效果好很多,且不会把⾼IoU的bbox回归到低IoU的位置。

如下图所示,IoU在0.9的bbox经过蓝⾊detector后会下降⾄0.86;分别使⽤蓝⾊、绿⾊、红⾊的detector⽐使⽤三次蓝⾊detector效果好。

CascadeRCNN修改阈值对RP的提升.jpg

关于提⾼阈值已有的⽅法

1. Iterative BBox

Iterative BBox.jpg

Iterative bbox使⽤初始的bbox与卷积层输出结合进⾏计算,得到bbox和分类,将得到的bbox再次与卷积层输出结合,重新使⽤该detector进⾏计算,如此迭代多次后将最后的结果作为输出。其过程可以⽤如下公式描述。

F'( x, b )=f \circ f \circ ... \circ f( x, b )

他忽略了两个问题:

⾸先,当测试的阈值⼤于训练阈值时,detector效果会降低。

其次,bbox的分布在每次计算后都有巨⼤的变化,⽽每次使⽤相同的detector进⾏计算,并不⼀定会使bbox回归得更加精确。因为detector对于初始分布是最优的,对于再次迭代后的分布是次优的;另外对于与训练集的IoU已经⾮常⾼的bbox来说,再次计算之后可能回归到⼀个低IoU的位置。

2. Integral Loss

Integral Loss.jpg

Integral Loss使⽤初始的bbox与卷积层输出多个不同阈值下的bbox和分类。由于阈值越⾼,可使⽤的正样本越少,其训练出的detector越容易过拟合;且⾼阈值训练的detector也需要处理⼤量IoU低的bbox。所以Integral Loss对于⽹络效果来说,并没有什么提升。

3. 本⽂提出Cascade R-CNN

CascadeRCNN结构.jpg

通过Iterative BBox可知道迭代使⽤同⼀个detector很难有更⼤的提升。本⽂提出的Cascade RCNN使⽤多个阈值越来越⾼的detector串联,得到了更好的效果。

⾸先,在每次detector计算后,IoU⾼的bbox的分布都会提升,使得下⼀阶段更⾼阈值下正样本的数量得到保证。如下图所示。

CascadeRCNN每个阶段的正样本数.jpg

其次,每经过⼀次detector,bbox都会变得更准确,更⾼的阈值可保证下⼀次回归效果更好。下图可以看出每次回归之后都会向⽬标框更接近。

CascadeRCNN每个阶段的BBox偏差.jpg

损失计算

Bounding Box Regression

BoundingBoxRegression.jpg

Classification

Classification.jpg

Cascaded Detection

Cascaded Detection.jpg

对照实验(Ablation Experiments)

IoU Thresholds

By increasing the stage threshold u, the detector can be made more selective against close false positives and specialized for more precise hypotheses, leading to additional gains.

Regression Statistics

Learning is not sensitive to these statistics.

Number of Stages

Four-stage cascade has the best performance for high IoU levels one RPN and three for detection with U = {0.5, 0.6, 0.7}.

结论(Conclusion)

The Cascade R-CNN improves on these baselines consistently by 2∼4 points,independently of their strength.

CascadeRCNN improves baselines.jpg

The computational overhead of the Cascade R-CNN is small, at both training and testing.

CascadeRCNN消耗计算量低.jpg

Share

You may also like...

发表评论

您的电子邮箱地址不会被公开。