Additional blocks

Apr 25, 2024
1 views
Computer Vision

SPP (spatial pyramid pooling layer)

SPP applies a slightly different strategy in detecting objects of different scales. It replaces the last pooling layer (after the last convolutional layer) with a spatial pyramid pooling layer. The feature maps are spatially divided into m×m bins with m, say, equals 1, 2, and 4 respectively. Then a maximum pool is applied to each bin for each channel. This forms a fixed-length representation that can be further analyzed with FC-layers.

在最后一层的卷积层后替换最后一层pooling层,后接fc

image

Many CNN-based models containing FC-layers and therefore, accepts input images of specific dimensions only. In contrast, SPP accepts images of different sizes. Nevertheless, there are technologies like fully convolution networks (FCN) that contain no FC-layers and accepts images of different dimensions. This type of design is particularly useful for image segmentation which spatial information is important. Therefore, for YOLO, convert 2-D feature maps into a fixed-size 1-D vector is not necessarily desirable.

YOLO with SPP

In YOLO, the SPP is modified to retain the output spatial dimension. A maximum pool is applied to a sliding kernel of size say, 1×1, 5×5, 9×9, 13×13. The spatial dimension is preserved. The features maps from different kernel sizes are then concatenated together as output.

利用不同大小的kernel,不改变feature大小,利用不同感受野的卷积核concat在一起

image

ASPP

YOLO v4中对ASPP是这么描述的

The difference in operation between ASPP module and improved SPP module is mainly from the original k×k kernel size, max-pooling of stride equals to 1 to several 3 × 3 kernel size, dilated ratio equals to k, and stride equals to 1 in dilated convolution operation.

就是将卷积核都变为3x3 并将dilated ratio变为k

image

RFB

image

RFB结构来自RFBNet,效果不错,计算量也不大,可以看出RFB是ASPP的推广,其采用了不同大小的kernel和不同的空洞率,相比ASPP,计算量减少不少,效果应该差不多。RFB在推理阶段引入的计算量非常xi小,但是在ssd中AP提高蛮多,是个不错的选择。