使用MobileOne优化YOLOv5n

一、测试环境

       Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz   2.30 GHz

       GeForce MX350  2048MiB, CUDA-10.2

       使用Pycharm,Python-3.7.1 Pytorch-1.10.1。

二、测试过程

       具体代码参考:

yolov5改进系列之轻量级mobileoneicon-default.png?t=N7T8https://zhuanlan.zhihu.com/p/667134683       分别使用和不使用Mobileone对YOLOv5n进行训练,每个训练20个Epoch。

       YOLOv5n是YOLOv5网络深度和宽度最小但检测速度最快的模型

YOLOv5n+MobileOne

       训练前: 213 layers, 1867405 parameters, 0 gradients, 4.5 GFLOPs

       训练后: 266 layers, 1679795 parameters, 0 gradients, 4.0 GFLOPs

YOLOv5n

训练前: 214 layers, 1772035 parameters, 1772035 gradients, 4.2 GFLOPs

训练后: 157 layers, 1767283 parameters, 0 gradients, 4.2 GFLOPs

MobileOne在Kitti数据集使用YOLOv5n训练20Epoch训练参数对比表

网络层数

参数量

FLOPs

YOLOv5n+MobileOne

训练前

213

1867405

4.5 G

训练后

266(+25%)

1679795(-10%)

4.0 G(-11%)

YOLOv5n

训练前

214

1772035

4.2 G

训练后

157(-27%)

1767283(-0.3%)

4.2 G(=)

对比

+69%

-5.0%

-4.8%

三、测试结果

YOLOv5n+MobileOne

YOLOv5n

       在Kitti数据集使用YOLOv5n训练20Epoch条件下,测试准确率、召回率不使用MobileOne显著高于使用MobileOne。

YOLOv5n+MobileOne推理测试:

YOLOv5n推理测试:

MobileOne在Kitti数据集使用YOLOv5n训练20Epoch延迟时间对比表

Latency

Pre-Process

Inference

NMS at Shape

All

YOLOv5n+MobileOne

Val

0.3ms

5.3ms

1.4ms

7.3ms

Test

0.7ms

7.3ms

1.2ms

9.2ms

YOLOv5n

Val

0.3ms

4.0ms

1.1ms

5.4ms

Test

0.6ms

6.5ms

1.2ms

8.3ms

       在Kitti数据集使用YOLOv5n训练20Epoch条件下,延迟时间不使用MobileOne显著低于使用MobileOne。

(a)YOLOv5n+MobileOne

(b)YOLOv5n

(c)Original

推理结果图

MobileOne在Kitti数据集使用YOLOv5n训练20Epoch综合参数对比表

Prams

FLOPs

Top-1 Acc

mAP

Latency

YOLOv5n+MobileOne

1679795

4.0

60.6%

40.6%

9.2ms

YOLOv5n

1767283

4.2

93.5%

82.1%

8.3ms

对比

-5.0%

-4.8%

-35%

-50%

+11%

四、结果反思与二次测试

       在  MobileOne: An Improved One millisecond Mobile Backbone  论文中,测试人员都是采用在300Epoch中完成对模型的训练,考虑是训练次数不足的原因导致结果不理想,遂在50Epoch进行二次测试。(由于训练时间过长,没有选择300Epoch进行训练,使用50Epoch仍然花费了快一天的时间。

 MobileOne在Kitti数据集使用YOLOv5n延迟时间对比表

Latency

Pre-Process

Inference

NMS at Shape

All

YOLOv5n+MobileOne

50Epoch

Val

0.3ms

5.3ms

1.2ms

6.7ms

Test

0.8ms

7.1ms

1.3ms

9.2ms

YOLOv5n+MobileOne

20Epoch

Val

0.3ms

5.3ms

1.4ms

7.3ms

Test

0.7ms

7.3ms

1.2ms

9.2ms

YOLOv5n

20Epoch

Val

0.3ms

4.0ms

1.1ms

5.4ms

Test

0.6ms

6.5ms

1.2ms

8.3ms

MobileOne在Kitti数据集使用YOLOv5n综合参数对比表

Epoch

Prams

FLOPs

Top-1 Acc

mAP

Latency

YOLOv5n+MobileOne5016797954.083.5%64.1%9.2ms

YOLOv5n+MobileOne

20

1679795

4.0

60.6%

40.6%

9.2ms

YOLOv5n

20

1767283

4.2

93.5%

82.1%

8.3ms

对比

-5.0%

-4.8%

-11%

-22%

+11%

       可以看出训练周期上去以后稍好,但是准确率和推理时间还是比较长。

       综合以上,可以看出MobileOne在YOLOv5n上能够减少参数量和FLOPs,但是增加了layer从而增加了推理时间,并且由于参数量下降降低了识别准确率。

  • 24
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
YOLOv7 MobileOne是基于YOLOv7算法改进的一种轻量高效的物体检测模型。研究人员通过引入MobileOne结构和苹果Backbone主干网络模型进行优化,提高了YOLOv7的性能和效率。MobileOne是一种超轻量型架构,由苹果公司提出并在iPhone 12上进行了优化。它在ImageNet数据集上取得了很好的速度和准确率表现。 此外,YOLOv7 MobileOne还兼容MobileOne官方的预训练权重,这样可以更方便地在YOLOv7项目中使用。 你可以在GitHub上找到相关的官方预训练权重文件。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [YOLOv7_轻量高效MobileOne结构与苹果Backbone主干网络模型](https://blog.csdn.net/wellcoder/article/details/130995184)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [MobileOne实战:使用MobileOne实现图像分类任务.zip](https://download.csdn.net/download/hhhhhhhhhhwwwwwwwwww/87218460)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [【YOLOv7改进轻量化】第一章——引入轻量化骨干网络MobileOne](https://blog.csdn.net/weixin_44994302/article/details/128156130)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值