当前位置:网站首页>Yolov5 improvement 6: add small target detection layer
Yolov5 improvement 6: add small target detection layer
2022-07-28 22:48:00 【Artificial Intelligence Algorithm Research Institute】
front said : As the current advanced deep learning target detection algorithm YOLOv5, A large number of trick, But when dealing with some complex background problems , It is still prone to the problem of mistakes and omissions . Subsequent articles , Focus on YOLOv5 How to improve is introduced in detail , The purpose is to provide their own meager help and reference for those who need innovation in scientific research or friends who need to achieve better results in engineering projects .
solve the problem :YOLOv5 One reason for the poor detection effect of small targets is that the size of small target samples is small , and yolov5 The lower sampling multiple of is relatively large , It is difficult to learn the characteristic information of small targets from deep feature maps , Therefore, it is proposed to add a small target detection layer to detect the shallow feature map and the deep feature map after splicing . Add small target detection layer , It can make the network pay more attention to the detection of small targets , Improve the detection effect .
Fang Law :
The implementation of this method is very simple and effective , It just needs to be modified yolov5 Model files for yaml Small target detection layer can be added , But after adding the detection layer , The problem is that the amount of computation increases , The speed of reasoning detection is reduced . But for small targets , There are really good improvements , modify yaml file , The feature fusion network needs to be modified .
backbone:
# [from, number, module, args]
[[-1, 1, Focus, [64, 3]], # 0-P1/2
[-1, 1, Conv, [128, 3, 2]], # 1-P2/4
[-1, 3, C3, [128]],
[-1, 1, Conv, [256, 3, 2]], # 3-P3/8
[-1, 9, C3, [256]],
[-1, 1, Conv, [512, 3, 2]], # 5-P4/16
[-1, 9, C3, [512]],
[-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
[-1, 1, SPP, [1024, [5, 9, 13]]],
[-1, 3, C3, [1024, False]], # 9
]
# YOLOv5 head
head:
[[-1, 1, Conv, [512, 1, 1]],#20*20
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 6], 1, Concat, [1]], # cat backbone P4
[-1, 3, C3, [512, False]], # 13
[-1, 1, Conv, [512, 1, 1]], #40*40 14
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 4], 1, Concat, [1]], # cat backbone P3 80*80
[-1, 3, C3, [512, False]], # 17 (P3/8-small) 80*80
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 2], 1, Concat, [1]], # cat backbone P3
[-1, 3, C3, [256, False]], # 17 (P3/8-small)21
[-1, 1, Conv, [256, 3, 2]],
[[-1, 18], 1, Concat, [1]], # cat head P4
[-1, 3, C3, [256, False]], # 20 (P4/16-medium)24
[-1, 1, Conv, [256, 3, 2]], #22 80*80
[[-1, 14], 1, Concat, [1]], #23 80*80
[-1, 3, C3, [512, False]], #24 80*80
[-1, 1, Conv, [512, 3, 2]],
[[-1, 10], 1, Concat, [1]], # cat head P5
[-1, 3, C3, [1024, False]], # 23 (P5/32-large)
[[21, 24, 27,30], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
]
Step four : take train.py In this article yaml File can , Start training .
junction fruit : I have done a lot of experiments on multiple data sets , For different data sets, the effect is different , There are also differences in the methods of adding locations to the same dataset , You need to experiment . Most cases are effective and improved .
Let me know : Improvement of the loss function of content sharing in the next article . Interested friends can pay attention to me , If you have questions, you can leave a message or chat with me in private
PS:, The method of adding detection layer is not only applicable to improvement YOLOv5, You can also improve others YOLO The Internet , such as YOLOv4、v3 etc. .
Last , I hope I can powder each other , Be a friend , Learn and communicate together .
边栏推荐
- Closure, prototype and original link
- The function of wechat applet to cut pictures
- Lenovo r9000p installation matlab2018a+cuda10.0 compilation
- LVS+KeepAlived高可用部署实战应用
- Differernet [anomaly detection: normalizing flow]
- PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
- GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道
- When can I sign up for the 2022 class I constructor examination?
- PaddleNLP基于ERNIR3.0文本分类以CAIL2018-SMALL数据集罪名预测任务为例【多标签】
- Summary of recent bugs
猜你喜欢
Paddlenlp text classification based on ernir3.0: take wos dataset as an example (hierarchical classification)
842. Arrange numbers
Command line agent: proxychains configuration
Mspba [anomaly detection: representation_based]
How do we do full link grayscale on the database?
Paddlenlp is based on ernir3.0 text classification. Take the crime prediction task of cail2018-small dataset as an example [multiple tags]
STM32 - advanced control timer (time base unit, functional block diagram, input, capture, output, open circuit)
Simple es highlight practice
STM32CUBEIDE(10)----ADC在DMA模式下扫描多个通道
B站713故障后的多活容灾建设|TakinTalks大咖分享
随机推荐
Memseg [anomaly detection: embedded based]
Morphology of image
Evaluation index of anomaly detection: rocauc et al. [tips]
STM32 - interrupt overview (interrupt priority)
imx6q gpio复用
How to install and use PHP library neo4j
基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务
Detection and tracking evaluation index
Vscode ROS configuration GDB debugging error record
[reprint] the token token is used in the login scenario
Using PCL to batch display PCD point cloud data flow
Binary source code, inverse code, complement code
Anomaly detection summary: intensity_ based/Normalizing Flow
775. 倒排单词
PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)
[get mobile information] - get mobile information through ADB command
Mspba [anomaly detection: representation_based]
1e3是浮点数?
Fastflow [abnormal detection: normalizing flow]
PC side web page effects (client series, scroll series, immediate function execution, sidebar effects)