需要更多程序资料以及答疑欢迎大家关注——微信公众号:人工智能AI算法工程师
前期一直没有时间跑YOLOv7源码,今天对YOLOv7在NWPU-10遥感图像数据集上进行实验测试,现将实验训练以及评估过程分享如下,希望对大家有帮助。为了客观分享,我对整个过程进行了截图,能够让大家看到我的实验参数以及实验设置。先说结论,珍惜时间。
一、结论
训练过程用了0.55个小时,得到的权值文件为11.77MB,mAP为89.3%,与YOLOv5s对比来看,YOLOv5s(5.0版本)在nwpu-10数据集上mAP可以达到91.7%,权值文件为13MB,实验设置几乎一致的前提下。目前来看,该算法与YOLOv5s对比来看,相差不大,可能综合整体来说稍微有所提升,没有想象中那样提高很大的精度,有很惊人的表现。
个人建议:有需要发论文的朋友,可以改YOLOv7网络,之前也分享很多改进方法也可以用到V7,可以在其他数据集上进行尝试。但是网络结构比较多,比较难画图,还不如YOLOv5好用,个人倾向于用V7来做对比试验验证自己算法优越性。
二、训练过程:选择YOLOv7.yaml配置文件,具体超参数以及实验过程如下所示
# parameters
nc: 80 # number of classes
depth_multiple: 1.0 # model depth multiple
width_multiple: 1.0 # layer channel multiple
# anchors
anchors:
- [10,13, 16,30, 33,23] # P3/8
- [30,61, 62,45, 59,119] # P4/16
- [116,90, 156,198, 373,326] # P5/32
# YOLOv7-tiny backbone
backbone:
# [from, number, module, args]
[[-1, 1, Conv, [32, 3, 2]], # 0-P1/2
[-1, 1, Conv, [64, 3, 2]], # 1-P2/4
[-1, 1, Conv, [32, 1, 1]],
[-2, 1, Conv, [32, 1, 1]],
[-1, 1, Conv, [32, 3, 1]],
[-1, 1, Conv, [32, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [64, 1, 1]], # 7
[-1, 1, MP, []], # 8-P3/8
[-1, 1, Conv, [64, 1, 1]],
[-2, 1, Conv, [64, 1, 1]],
[-1, 1, Conv, [64, 3, 1]],
[-1, 1, Conv, [64, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [128, 1, 1]], # 14
[-1, 1, MP, []], # 15-P4/16
[-1, 1, Conv, [128, 1, 1]],
[-2, 1, Conv, [128, 1, 1]],
[-1, 1, Conv, [128, 3, 1]],
[-1, 1, Conv, [128, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [256, 1, 1]], # 21
[-1, 1, MP, []], # 22-P5/32
[-1, 1, Conv, [256, 1, 1]],
[-2, 1, Conv, [256, 1, 1]],
[-1, 1, Conv, [256, 3, 1]],
[-1, 1, Conv, [256, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [512, 1, 1]], # 28
]
# YOLOv7-tiny head
head:
[[-1, 1, Conv, [256, 1, 1]],
[-2, 1, Conv, [256, 1, 1]],
[-1, 1, SP, [5]],
[-2, 1, SP, [9]],
[-3, 1, SP, [13]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [256, 1, 1]],
[[-1, -7], 1, Concat, [1]],
[-1, 1, Conv, [256, 1, 1]], # 37
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[21, 1, Conv, [128, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 1, Conv, [64, 1, 1]],
[-2, 1, Conv, [64, 1, 1]],
[-1, 1, Conv, [64, 3, 1]],
[-1, 1, Conv, [64, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [128, 1, 1]], # 47
[-1, 1, Conv, [64, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[14, 1, Conv, [64, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 1, Conv, [32, 1, 1]],
[-2, 1, Conv, [32, 1, 1]],
[-1, 1, Conv, [32, 3, 1]],
[-1, 1, Conv, [32, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [64, 1, 1]], # 57
[-1, 1, Conv, [128, 3, 2]],
[[-1, 47], 1, Concat, [1]],
[-1, 1, Conv, [64, 1, 1]],
[-2, 1, Conv, [64, 1, 1]],
[-1, 1, Conv, [64, 3, 1]],
[-1, 1, Conv, [64, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [128, 1, 1]], # 65
[-1, 1, Conv, [256, 3, 2]],
[[-1, 37], 1, Concat, [1]],
[-1, 1, Conv, [128, 1, 1]],
[-2, 1, Conv, [128, 1, 1]],
[-1, 1, Conv, [128, 3, 1]],
[-1, 1, Conv, [128, 3, 1]],
[[-1, -2, -3, -4], 1, Concat, [1]],
[-1, 1, Conv, [256, 1, 1]], # 73
[57, 1, Conv, [128, 3, 1]],
[65, 1, Conv, [256, 3, 1]],
[73, 1, Conv, [512, 3, 1]],
[[74,75,76], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
]
三、评估过程:评估将iou_thres=0.5,得到[email protected]的值。
预告一下:该系列下一篇将分享YOLOv7其他的轻量化的配置文件。
如果觉得对大家有帮助,欢迎点赞收藏关注,我会继续给大家做实验提供参考。有问题也欢迎私信我。
需要更多程序资料以及答疑欢迎大家关注——微信公众号:人工智能AI算法工程师