当前位置:网站首页>【目标检测】目标检测界的扛把子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非极大值抑制
判断相邻网格识别的是否是同一物体,消除掉多余检测框。
边栏推荐
- C language implementation [minesweeping game] full version (implementation source code)
- 女生适合学产品经理吗?有什么优势?
- [Tikhonov] image super-resolution reconstruction based on Tikhonov regularization
- 开源了!文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开
- MySQL data type learning notes
- Dirty reading, unreal reading and unrepeatable reading
- Problem solving: officeexception: failed to start and connect (I)
- 运维面临挑战?智能运维管理系统来帮您
- go-etcd
- C# 读写自定义的Config文件
猜你喜欢
WiFi settings for raspberry Pie 4
We found a huge hole in MySQL: do not judge the number of rows affected by update!!!
电脑有网络,但所有浏览器网页都打不开,是怎么回事?
Système de gestion de l'exploitation et de l'entretien, expérience d'exploitation humanisée
ctfshow-web354(SSRF)
Will Internet talents be scarce in the future? Which technology directions are popular?
【Tikhonov】基于Tikhonov正则化的图像超分辨率重建
EasyNVS云管理平台功能重构:支持新增用户、修改信息等
Dirty reading, unreal reading and unrepeatable reading
ctfshow-web355,356(SSRF)
随机推荐
ESP32深度睡眠电流怎样低于10uA
Stored procedure learning notes
Is it safe to buy funds on the brokerage account
Easynvs cloud management platform function reconfiguration: support adding users, modifying information, etc
Solve the problem that the class defined in meta-inf.services cannot be read
关于图灵测试和中文屋Chinese room的理解
Record an online interface slow query problem troubleshooting
了解ESP32睡眠模式及其功耗
Product learning (II) - competitive product analysis
Why are so many people turning to product managers? What is the development prospect of product manager?
[FPGA frame difference] FPGA implementation of frame difference target tracking based on vmodcam camera
We found a huge hole in MySQL: do not judge the number of rows affected by update!!!
Are there any practical skills for operation and maintenance management
Summary of the concept and advantages of 5g massive MIMO
Insufficient free space after clearing expired cache entries - consider increasing the maximum cache space
Problem: officeexception: failed to start and connect (II)
ESP32 ESP-IDF ADC监测电池电压(带校正)
【FPGA帧差】基于VmodCAM摄像头的帧差法目标跟踪FPGA实现
LeetCode+ 71 - 75
Using fuseki query when there are multiple models in TDB