当前位置:网站首页>Improvement 14 of yolov5: replace the backbone network C3 with the lightweight network GhostNet
Improvement 14 of yolov5: replace the backbone network C3 with the lightweight network GhostNet
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 Ghostnet 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 :
Address of thesis :[1911.11907] GhostNet: More Features from Cheap Operations (arxiv.org)https://arxiv.org/abs/1911.11907
Ghost Module plug and play , By stacking Ghost The module comes up with Ghost bottleneck, And then build a lightweight neural network ——GhostNet. stay ImageNet Classification task ,GhostNet In the case of similar computation Top-1 The accuracy is as high as 75.7%, higher than MobileNetV3 Of 75.2%.
Fang Law :
Step 1 modify common.py, increase ghostC3 modular .
class ghostC3(nn.Module):
# CSP Bottleneck with 3 convolutions
def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion
super(ghostC3, self).__init__()
c_ = int(c2 * e) # hidden channels
self.cv1 = Conv(c1, c_, 1, 1)
self.cv2 = Conv(c1, c_, 1, 1)
self.cv3 = Conv(2 * c_, c2, 1) # act=FReLU(c2)
# self.m = nn.Sequential(*[seGhostBottleneck(c_, c_, shortcut) for _ in range(n)])
self.m = nn.Sequential(*[GhostBottleneck(c_, c_, shortcut) for _ in range(n)])
# self.m = nn.Sequential(*[CrossConv(c_, c_, 3, 1, g, 1.0, shortcut) for _ in range(n)])
def forward(self, x):
return self.cv3(torch.cat((self.m(self.cv1(x)), self.cv2(x)), dim=1))
The second step : take yolo.py Registration module in .
if m in [Conv,MobileNetV3_InvertedResidual,ShuffleNetV2_InvertedResidual,ghostc3
]:
The third step : Make changes yaml file
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 —— Depth separates the convolution . 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 .
边栏推荐
- LVS+KeepAlived高可用部署实战应用
- The function of wechat applet to cut pictures
- npm run dev,运行项目后自动打开浏览器
- Solve various problems of sudo rosdep init and rosdep update
- Concise history of graphic technology
- [reprint] the token token is used in the login scenario
- 6K6w5LiA5qyh5pS75Ye75YiG5p6Q
- 高等数学解题常用公式笔记总结
- 简单的es高亮实战
- OSV_ q The size of tensor a (704) must match the size of tensor b (320) at non-singleton dime
猜你喜欢

Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem

STM32 - external interrupt application (exti) (use cubemx to configure interrupts)

The function of wechat applet to cut pictures

Quadruped robot | gem (elevation map) + fast_ Deployment records of Leo (odometry) environment

What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
![Fastflow [abnormal detection: normalizing flow]](/img/5e/984e5bd34c493039e3c9909fc4df05.png)
Fastflow [abnormal detection: normalizing flow]

How to delete and remove the first row of elements in PHP two-dimensional array
How do we do full link grayscale on the database?
Integrating database Ecology: using eventbridge to build CDC applications

Simple es highlight practice
随机推荐
Migration from IPv4 to IPv6
Multi activity disaster recovery construction after 713 failure of station B | takintalks share
STM32 - interrupt overview (interrupt priority)
Target segmentation learning
二进制的原码、反码、补码
c语言实现字符串逆序排列
STM32 - DMA direct memory access controller (cubemx configures DMA)
基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务
Integrating database Ecology: using eventbridge to build CDC applications
STM32 -- program startup process
Summary of C language learning content
Binary source code, inverse code, complement code
Vscode ROS configuration GDB debugging error record
STM32 single chip microcomputer drive L298N
简单的es高亮实战
771. The longest consecutive character in a string
STM32 - memory, I2C protocol
MKD [anomaly detection: knowledge disruption]
775. Inverted words
Anomaly detection summary: intensity_ based/Normalizing Flow