本文介绍
为提升 YOLOv8 在目标检测任务中的特征表达能力,本文借鉴 AAAI2025 PConv-SDLoss 所提出的Pinwheel-shaped Convolution(PConv)模块改进YOLOv8的下采样层。 风车型卷积(PConv)能更好地拟合红外小目标的类高斯空间分布,并且实现在进引入极少参数的前提下,显著扩大感受野,提升特征提取能力。实验结果如下(本文通过VOC数据验证算法性能,epoch为100,batchsize为32,imagesize为640*640):
| Model | mAP50-95 | mAP50 | run time (h) | params (M) | interence time (ms) |
|---|---|---|---|---|---|
| YOLOv8 | 0.549 | 0.760 | 1.051 | 3.01 | 0.2+0.3(postprocess) |
| YOLO11 | 0.553 | 0.757 | 1.142 | 2.59 | 0.2+0.3(postprocess) |
| yolov8_PConv | 0.551 | 0.763 | 1.100 | 2.94 | 0.3+0.3(postprocess) |

重要声明:本文改进后代码可能只是并不适用于我所使用的数据集,对于其他数据集可能存在有效性。
本文改进是为了降低最新研究进展至YOLO的代码迁移难度,从而为对最新研究感兴趣的同学提供参考。
代码迁移
重点内容
步骤一:迁移代码
ultralytics框架的模块代码主要放在ultralytics/nn文件夹下,此处为了与官方代码进行区分,可以新增一个extra_modules文件夹,并创建一个conv.py文件,然后将我们的代码添加进入。
具体代码如下:
import torch
import torch.nn as nn
from ..modules import Conv
class PConv(nn.Module):
''' Pinwheel-shaped Convolution using the Asymmetric Padding method. '''
def __init__(self, c1, c2, k, s):
super().__init__()
# self.k = k
p = [(k, 0, 1, 0), (0, k, 0, 1), (0, 1, k, 0), (1, 0, 0, k)]
self.pad = [nn.ZeroPad2d(padding=(p[g])) for g in range(4)]
self.cw = Conv(c1, c2 // 4, (1, k), s=s, p=0)</

最低0.47元/天 解锁文章
1031

被折叠的 条评论
为什么被折叠?



