当前位置:网站首页>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 .
边栏推荐
- Using nodejs to operate MySQL
- Migration from IPv4 to IPv6
- STM32 - interrupt overview (interrupt priority)
- Multi activity disaster recovery construction after 713 failure of station B | takintalks share
- redis相关
- Torch.fft.fft 2. () error reporting problem solution
- Why doesn't the icon on the elment plus icon input display
- Ngx+sql environment offline installation log (RPM installation)
- shell脚本基础——Shell运行原理+变量、数组定义
- STM32 board level support package for keys
猜你喜欢

Vscode ROS configuration GDB debugging error record

LTE小区搜索过程及SCH/BCH设计

Simple es highlight practice

《Robust and Communication-Efficient Federated Learning From Non-i.i.d. Data》论文阅读

STM32 - systick timer (cubemx configures systick)

Paper reading: deep forest / deep forest /gcforest

STM32 - memory, I2C protocol

记录一下关于三角函数交换积分次序的一道题

STM32_ Hal library driven framework

Concise history of graphic technology
随机推荐
【转载】token令牌在登录场景使用
20-09-27 the project is migrated to Alibaba toss record (the network card order makes the service unable to connect to DB through haproxy)
776. 字符串移位包含问题
C language to realize string reverse order arrangement
Anomaly detection summary: intensity_ based/Normalizing Flow
842. Arrange numbers
Using PCL to batch display PCD point cloud data flow
Pictures are named in batches in order (change size /jpg to PNG) [tips]
LVS+KeepAlived高可用部署实战应用
The function of wechat applet to cut pictures
轮子七:TCP客户端
How to install and use PHP library neo4j
Padim [anomaly detection: embedded based]
轮子六:QSerialPort 串口数据 收发
Migration from IPv4 to IPv6
Es learning directory
Intelligent control -- fuzzy mathematics and control
770. Word replacement
Att & CK preliminary understanding
CFA [anomaly detection: embedded_based]