当前位置:网站首页>【目标检测】目标检测界的扛把子YOLOv5(原理详解+修炼指南)
【目标检测】目标检测界的扛把子YOLOv5(原理详解+修炼指南)
2022-07-01 07:04:00 【魏宝航】
文章目录
1.YOLO输入端

1.1 Mosaic数据增强
Yolov5的输入端采用了和Yolov4一样的Mosaic数据增强的方式。
Mosaic数据增强提出的作者也是来自Yolov5团队的成员,不过,随机缩放、随机裁剪、随机排布的方式进行拼接,对于小目标的检测效果还是很不错的。
- 4张图片拼接
- 随机缩放
- 随机裁剪
- 随机排布
算法优点:
- 丰富数据集
- 减少GPU计算
1.2 自适应锚框计算
在Yolo算法中,针对不同的数据集,都会有初始设定长宽的锚框。
在网络训练中,网络在初始锚框的基础上输出预测框,进而和真实框groundtruth进行比对,计算两者差距,再反向更新,迭代网络参数。
Step1:读取训练集中所有图片的w、h以及检测框的w、h
Step2:将读取的坐标修正为绝对坐标
Step3:使用Kmeans算法对训练集中所有的检测框进行聚类,得到k个anchors
Step4:通过遗传算法对得到的anchors进行变异,如果变异后效果好将其保留,否则跳过
Step5:将最终得到的最优anchors按照面积返回
1.3 自适应图片缩放
在常用的目标检测算法中,不同的图片长宽都不相同,因此常用的方式是将原始图片统一缩放到一个标准尺寸,再送入检测网络中。
letterbox自适应图片缩放技术尽量保持高宽比,缺的用灰边补齐达到固定的尺寸。
2.YOLO总体架构图

2.1 BackBone
主要进行特征提取,将图像中的物体信息通过卷积网络进行提取,用于后面目标检测。
2.1.1 Focus模块
Focus层原理和PassThrough层很类似。它采用切片操作把高分辨率的图片拆分成多个低分辨率的图片/特征图,即隔列采样+拼接。
2.1.2 SPP模块
空间金字塔池化,能将任意大小的特征图转换成固定大小的特征向量。
2.1.3 CSP_X模块
backbone是较深的网络,增加残差结构可以增加层与层之间反向传播的梯度值,避免因为加深而带来的梯度消失,从而可以提取到更细粒度的特征并且不用担心网络退化。
2.2 Neck
对特征进行混合与组合,增强网络的鲁棒性,加强物体检测能力,并且将这些特征传递给Head层进行预测。
2.2.1 FPN

2.2.2 PAN

2.3 YOLO输出端
主要进行最终的预测输出。
2.3.1 Bounding Box损失函数
真实检测框和模型预测输出框的吻合程度,用于反向传播优化模型。
2.3.2 NMS非极大值抑制
判断相邻网格识别的是否是同一物体,消除掉多余检测框。
边栏推荐
- Product learning (II) - competitive product analysis
- 广发证券开户是安全可靠的么?怎么开广发证券账户
- H5 web page determines whether an app is installed. If it is installed, it will jump to the summary of the scheme to download if it is not installed
- Understand esp32 sleep mode and its power consumption
- SQL learning notes nine connections 2
- 【深圳IO】精确食品称(汇编语言的一些理解)
- JSP - 分页
- kdtree(kd树)笔记
- 8 张图 | 剖析 Eureka 的首次同步注册表
- WiFi settings for raspberry Pie 4
猜你喜欢
![[recommendation technology] matlab simulation of network information recommendation technology based on collaborative filtering](/img/fb/dc03f97f12488e53d706a05da9faea.png)
[recommendation technology] matlab simulation of network information recommendation technology based on collaborative filtering

关于图灵测试和中文屋Chinese room的理解

How to use SCI hub

比赛即实战!中国软件杯发布全新产业创新赛项,校企可联合参赛

Problem: officeexception: failed to start and connect (II)

电脑有网络,但所有浏览器网页都打不开,是怎么回事?

How to use Alibaba vector font files through CDN

Open source! Wenxin large model Ernie tiny lightweight technology, accurate and fast, full effect
![[Electrical dielectric number] electrical dielectric number and calculation considering HVDC and facts components](/img/7c/2b1d4797f367cced51f36e8a1bb199.png)
[Electrical dielectric number] electrical dielectric number and calculation considering HVDC and facts components

SQL learning notes nine connections 2
随机推荐
Understand esp32 sleep mode and its power consumption
ctfhub-端口扫描(SSRF)
MySQL table partition creation method
灰度何以跌下神坛?
rclone 访问web界面
Summary of the concept and advantages of 5g massive MIMO
Easynvs cloud management platform function reconfiguration: support adding users, modifying information, etc
ctfshow-web354(SSRF)
Servlet 和 JSP 中的分页
Pourquoi tant de gens sont - ils devenus des gestionnaires de produits? Quelles sont les perspectives de développement des gestionnaires de produits?
Is the account opening of GF Securities safe and reliable? How to open GF Securities Account
自动化测试平台(十三):接口自动化框架与平台对比及应用场景分析及设计思路分享
北漂程序员深夜emo发帖求助:女朋友走了我很孤独 ......
C language implementation [Sanzi chess game] (step analysis and implementation source code)
[network planning] (I) hub, bridge, switch, router and other concepts
LeetCode+ 71 - 75
Code practice - build your own diffusion models / score based generic models from scratch
在券商账户上买基金安全吗
Solve the problem that the class defined in meta-inf.services cannot be read
How to permanently configure local opencv4.5.5 for vs2019