当前位置:网站首页>Improvement 16 of yolov5: replace backbone network C3 with lightweight network pp-lcnet
Improvement 16 of yolov5: replace backbone network C3 with lightweight network pp-lcnet
2022-07-28 22:49:00 【Artificial Intelligence Algorithm Research Institute】
front said : As the current advanced deep learning target detection algorithm YOLOv5, A large number of trick, But there is still room for improvement , For the detection difficulties in specific application scenarios , There are different ways to improve . 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 The backbone feature extraction network adopts C3 structure , Bring a large number of parameters , The detection speed is slow , Limited application , In some real application scenarios, such as mobile or embedded devices , Such a large and complex model is difficult to be applied . The first is that the model is too large , Facing the problem of insufficient memory , Second, these scenarios require low latency , In other words, the response speed should be fast , Imagine the pedestrian detection system of self driving cars. What terrible things will happen if the speed is slow? . therefore , Research small and efficient CNN Models are crucial in these scenarios , At least for now , Although the hardware will be faster and faster in the future . This paper attempts to replace the backbone feature extraction network with a lighter PP-LCNet The Internet , To realize the lightweight of the network model , Balance speed and accuracy .
YOLOv5 Improvement 12 : Backbone network C3 Replace with lightweight network ShuffleNetV2_ AI algorithm engineer 0301 The blog of -CSDN Blog https://blog.csdn.net/m0_70388905/article/details/125612052YOLOv5 Improvement Xi : Backbone network C3 Replace with lightweight network MobileNetV3_ AI algorithm engineer 0301 The blog of -CSDN Blog https://blog.csdn.net/m0_70388905/article/details/125593267
principle :
arXiv:https://arxiv.org/pdf/2109.15099.pdf
code: https://github.com/PaddlePaddle
Baidu team aims at Intel-CPU High reasoning speed designed for end acceleration & High performance LCNet. This article is a combination of Baidu team Intel-CPU A lightweight and high-performance network designed for end-to-end reasoning PP-LCNet, The proposed scheme achieves better results in image classification task ShuffleNetV2、MobileNetV2、MobileNetV3 as well as GhostNet Better delay - Precision equalization .
Fang Law :
Step 1 modify common.py, increase DepthSepConv modular .
class DepthSepConv(nn.Module):
def __init__(self, inp, oup, dw_size, stride, use_se):
super(DepthSepConv, self).__init__()
self.stride = stride
self.inp = inp
self.oup = oup
self.dw_size = dw_size
self.dw_sp = nn.Sequential(
nn.Conv2d(self.inp, self.inp, kernel_size=self.dw_size, stride=self.stride, padding=(dw_size - 1) // 2, groups=self.inp, bias=False),
nn.BatchNorm2d(self.inp),
SeBlock(self.inp, reduction=16) if use_se else nn.Sequential(),
nn.Conv2d(self.inp, self.oup, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(self.oup),
nn.Hardswish())
def forward(self, x):
y = self.dw_sp(x)
return yThe second step : take yolo.py Registration module in .
if m in [Conv,MobileNetV3_InvertedResidual,ShuffleNetV2_InvertedResidual,ghostc3,DepthSepConv
]:The third step : Make changes yaml file
backbone:
# [from, number, module, args]
[[-1, 1, Conv, [16, 3, 2, 1]], # 0-P1/2 ch_out, kernel, stride, padding
[-1, 1, DepthSepConv, [32, 3, 1, False]], # 1
[-1, 1, DepthSepConv, [64, 3, 2, False]], # 2-P2/4
[-1, 1, DepthSepConv, [64, 3, 1, False]], # 3
[-1, 1, DepthSepConv, [128, 3, 2, False]], # 4-P3/8
[-1, 1, DepthSepConv, [128, 3, 1, False]], # 5
[-1, 1, DepthSepConv, [256, 3, 2, False]], # 6-P4/16
[-1, 5, DepthSepConv, [256, 5, 1, False]], # 7
[-1, 1, DepthSepConv, [512, 5, 2, True]], # 8-P5/32
[-1, 1, DepthSepConv, [512, 5, 1, True]], # 9
[-1, 1, SPPF, [1024, 5]], # 10
]junction fruit : I have done a lot of experiments on multiple data sets , For different data sets, the effect is different ,map Value down , But the size of the weight model decreases , The parameter quantity decreases .
Let me know : The next content will continue to share the sharing of network lightweight methods . Interested friends can pay attention to me , If you have questions, you can leave a message or chat with me in private
PS: The replacement of backbone network is not only applicable to improvement YOLOv5, You can also improve others YOLO Network and target detection network , such as YOLOv4、v3 etc. .
Last , I hope I can powder each other , Be a friend , Learn and communicate together .
边栏推荐
- Es learning directory
- PHP库neo4j怎么安装及使用
- 使用PCL批量显示PCD点云数据流
- The blueprint of flask complements openpyxl
- STM32 - Basic timer (tim6, tim7) working process, interpretation function block diagram, timing analysis, cycle calculation
- How to use sprintf function
- Quadruped robot | gem (elevation map) + fast_ Deployment records of Leo (odometry) environment
- redis相关
- Yolov5 improvement 4: add ECA channel attention mechanism
- Draem+sspcab [anomaly detection: block]
猜你喜欢

PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)

Imx6q GPIO multiplexing

What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition

Migration from IPv4 to IPv6

Multi activity disaster recovery construction after 713 failure of station B | takintalks share
![Draem+sspcab [anomaly detection: block]](/img/97/75ce235c2021b56007eecb82afe4b0.png)
Draem+sspcab [anomaly detection: block]

STM32 - Communication

LVS+KeepAlived高可用部署实战应用
![Paddlenlp is based on ernir3.0 text classification. Take the crime prediction task of cail2018-small dataset as an example [multiple tags]](/img/87/d943cc1e8169bb670414fbf7a322c5.jpg)
Paddlenlp is based on ernir3.0 text classification. Take the crime prediction task of cail2018-small dataset as an example [multiple tags]

PaddleNLP基于ERNIR3.0文本分类:WOS数据集为例(层次分类)
随机推荐
Why doesn't the icon on the elment plus icon input display
OSV_ q AttributeError: ‘numpy. ndarray‘ object has no attribute ‘clone‘
Gd32f303 firmware library development (10) -- dual ADC polling mode scanning multiple channels
C语言学习内容总结
STM32 - external interrupt application (exti) (use cubemx to configure interrupts)
Torch.fft.fft 2. () error reporting problem solution
Detection and tracking evaluation index
CS flow [abnormal detection: normalizing flow]
STM32 board level support package for keys
【转载】token令牌在登录场景使用
842. 排列数字
轮子六:QSerialPort 串口数据 收发
STM32 - Basic timer (tim6, tim7) working process, interpretation function block diagram, timing analysis, cycle calculation
【三维目标检测】3DSSD(二)
Container configuration starts redis cluster single machine 6 nodes 3 Master 3 slave
Use PCL to batch convert point cloud.Bin files to.Pcd
CFA [anomaly detection: embedded_based]
[3D target detection] 3dssd (I)
Morphology of image
Anomaly detection summary: intensity_ based/Normalizing Flow