小目标检测:Improving Small Object Detection

本文基于Faster R-CNN,提出一种改进小目标检测方法,通过调整anchor尺寸和引入超分辨率技术,显著提升小目标检测性能。

博客原文:https://blog.csdn.net/weixin_39290638/article/details/84487984

文章原文:https://pan.baidu.com/s/1WRI7KTNftyY9K1KHQtE_QA

Improving Small Object Detection (ACPR2017)

 

Harish Krishna, C.V. Jawahar
CVIT, KCIS
International Institute of Information Technology
Hyderabad, India

1 Motivation

小目标的分辨率低,形状简单(轮廓粗糙)。一般的目标检测网络在大,中尺寸的目标上能取得较好的效果,但是在小目标的检测上性能不好。

2 Contributions

  1. 通过数学推导,确定了anchors的合适尺寸,并进行了详细的试验以证明其选择的有效性。
  2. 在网络中加入超分辨率技术,提高了网络的性能。

3 Framework

本文是在Faster R-CNN的算法框架上针对小目标检测的的一些改进。核心思想有两点:

  1. RPN中anchor size的设置一定要合适,这样可以提高proposal的准确率。
  2. 对于分辨率低的小目标,我们可以对其所在的proposal进行超分辨率,提升小目标的特征质量,这样更有利于小目标的检测。

 

图1 网络框架

 

该算法框架和Faster R-CNN基本一致,改动出现在图中标注的3个虚线框处。

3.1 在 VGG16中每一个block后加入batch norm

这里简单介绍下batch Normalization,网上资料很多,读者可自行查找。batch Normalization作为最近年来DL的重要成果,已经广泛被证明其有效性和重要性。它有以下几点好处:

  • 极大提升了训练速度和收敛过程。
  • 提供了一种类似Dropout的防止过拟合的正则化表达方式,所以不用Dropout也能达到相当的效果;
  • 简化调参过程,对于初始化要求没那么高,可以使用大的学习率。

其算法流程如图2:

https://i-blog.csdnimg.cn/blog_migrate/d57fcb84637e0b597bf2997d6fa16100.png
图2 batch Normalization

 

3.2 设置尺寸合适的anchor boxes

图3 anchor size的选择

如图3所示,我们假设anchor和ground truth的框是正方形。那么图中Sgt表示ground truth的边长,SA表示anchor的边长,d表示两框在非重合区域中边界的距离。我们知道anchor和ground truth的IoU表示为:

         我们设置一个IOU的阈值为t,由min IoU ≥ t可得:

接着,作者引用了论文(Improving small object proposals for company logo detection , ICMR 2017)中的结论:

最后,d最大值等于anchor的步进,而anchor的步进可由主干网下采样的次数算出。我们可以得出:

3.3 使用convolutional-deconvolutional networkproposal区域进行超分辨率

作者引用了论文(Image Restoration Using Convolutional Auto-encoders with Symmetric Skip Connections, NIPS2016)中的Convolutional-deconvolutional network对proposals进行超分辨率。

图4 Convolutional-deconvolutional network

 

该网络的结构是对称的,每个卷积层都有对应的反卷积层。卷积层用来获取图像的抽象内容,反卷积层用来放大特征尺寸并且恢复图像细节。卷积层将输入图像尺寸减小后,再通过反卷积层上采样变大,使得输入输出的尺寸一样。每一组镜像对应的卷积层和反卷积层有着shortcut连接结构,将卷积层的特征和对应的反卷积层输出的特征做相加操作后再输入到下一个反卷积层。这样的结构类似ResNet的残差结构,卷积层和反卷积层学习的特征是目标图像和低质图像之间的残差,损失函数用的均方误差。该网络在ImageNet进行预训练。

超分辨后的proposal送入后续的Classifier进行分类(这里笔者认为还应该有对proposal里的小目标进行再一次regression的操作,但原作者并没有提到)。

4 EXPERIMENTS AND DISCUSSION

图5 Small Object Dataset目标size分布

 

本文使用了取自于Microsoft COCO and the SUN dataset 的Small Object Dataset ,其目标的size分布如图5所示。

作者分析数据集中对象的大小,将anchor的大小定为{16;25;32;45;64;90},并和标准的Faster R-CNN做proposal的mAP的比较(同时也和“R-cnn for small object detection”一文做了比较)。作者计算mAP时,在每张测试图片中取confidence排名前1000的非背景类的proposal。从Table 1可以看出,设置合适的anchor size对small object的proposal提取影响很大。最后作者放出了标准faster R-CNN和加入超分辨率后的方法的实验结构对比。作者改进后的方法在小物体检测的性能上有一定的提升。

5 总结

本文基于Faster R-CNN提出了一种改进小目标检测的方法。这种方法是从网络proposal部分入手,将模糊的小目标通过超分辨率清晰化后再进行分类和回归,提高了小目标检测的性能。

笔者在ECCV 2018中也见到类似的方法,如SOD-MTGAN,后续会和大家分享。笔者认为这种方法增加了不少时间复杂度,不适合实时性要求较高的系统。

### RT-DETR Model for Small Object Detection Implementation and Optimization The RT-DETR (Real-Time Deformable Transformer Detector) model is designed to address challenges specific to detecting smaller objects within images or video frames. This model leverages advanced techniques like deformable transformers which enhance feature extraction from complex scenes, particularly beneficial when dealing with small-scale targets[^1]. For implementing an RT-DETR model focused on improving detection rates of tiny objects: #### Data Augmentation Techniques To improve the robustness of training data specifically targeting small objects, various augmentation methods are employed including scaling down larger instances into miniature versions during preprocessing stages. Additionally, cutout operations that randomly mask out regions containing large foreground elements help focus more attention towards less prominent features. ```python import albumentations as A transform = A.Compose([ A.RandomResizedCrop(height=640, width=640, scale=(0.8, 1.0)), A.Cutout(num_holes=8, max_h_size=32, max_w_size=32), ]) ``` #### Optimizing Network Architecture Adjustments made at architectural level include increasing receptive field sizes through dilated convolutions while maintaining computational efficiency by reducing channel dimensions where appropriate. Such modifications allow deeper penetration across spatial hierarchies thus capturing finer details necessary for identifying minute structures accurately. #### Loss Function Customization Custom loss functions tailored toward penalizing false negatives associated with hard-to-detect items ensure better recall metrics even under challenging conditions. Focal losses adjusted according to size distribution patterns observed within dataset annotations contribute significantly here. ```python class SizeAwareFocalLoss(nn.Module): def __init__(self, alpha=None, gamma=2., reduction='mean'): super(SizeAwareFocalLoss, self).__init__() def forward(self, inputs, targets, area_weights): BCE_loss = F.binary_cross_entropy_with_logits(inputs, targets, reduce=False) pt = torch.exp(-BCE_loss) focal_loss = ((1 - pt)**gamma * BCE_loss).mean() weighted_focal_loss = focal_loss * area_weights return weighted_focal_loss.mean() if self.reduction == 'mean' else weighted_focal_loss.sum() ``` #### Post-processing Refinements Post-process steps involve applying non-maximum suppression thresholds tuned lower than usual settings so as not to discard valid detections prematurely due solely based upon overlap criteria alone but rather consider confidence scores alongside geometric relationships between bounding boxes.
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值