当前位置:网站首页>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 .
边栏推荐
- Differernet [anomaly detection: normalizing flow]
- 842. Arrange numbers
- JS get the current time (year month day hour minute second)
- Excel-vba quick start (XIII. Common usage of date)
- 771. 字符串中最长的连续出现的字符
- 使用PCL批量将点云.bin文件转.pcd
- Mysql8.0 cannot authorize users or prompt you are not allowed to create a user with grant
- Multi activity disaster recovery construction after 713 failure of station B | takintalks share
- [3D target detection] 3dssd (I)
- Summary of the problem that MathType formula does not correspond in word
猜你喜欢
How do we do full link grayscale on the database?
![MKD [anomaly detection: knowledge disruption]](/img/15/10f5c8d6851e94dac764517c488dbc.png)
MKD [anomaly detection: knowledge disruption]

Intelligent control -- fuzzy mathematics and control
![[3D target detection] 3dssd (I)](/img/84/bcd3fe0ba811ea79248a5f50b15429.png)
[3D target detection] 3dssd (I)

WinForm jump to the second form case

STM32 - systick timer (cubemx configures systick)

Stm32subeide (10) -- ADC scans multiple channels in DMA mode

STM32 - Basic timer (tim6, tim7) working process, interpretation function block diagram, timing analysis, cycle calculation

Target segmentation learning

STM32 board level support package for keys
随机推荐
BOM (location object, navigation object)
Morphology of image
Qt+ffmpeg environment construction
[reprint] the token token is used in the login scenario
Es personal arrangement of relevant interview questions
Annaconda installs pytoch and switches environments
JVM——自定义类加载器
Memseg [anomaly detection: embedded based]
SSH password free login
Leetcode question brushing series - sum of majority type
Pictures are named in batches in order (change size /jpg to PNG) [tips]
[3D target detection] 3dssd (I)
STM32 - DMA direct memory access controller (cubemx configures DMA)
Yolov5 improvement 4: add ECA channel attention mechanism
Multi activity disaster recovery construction after 713 failure of station B | takintalks share
Awk blank line filtering
记录一下关于三角函数交换积分次序的一道题
Use PCL to batch convert point cloud.Bin files to.Pcd
Simple es highlight practice
Introduction to structure