当前位置:网站首页>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 .
边栏推荐
- OSV_ q Expected all tensors to be on the same device, but found at least two devices, cuda:0
- PC side web page effects (client series, scroll series, immediate function execution, sidebar effects)
- ES6, deep copy, shallow copy
- Container configuration starts redis cluster single machine 6 nodes 3 Master 3 slave
- Att & CK preliminary understanding
- 轮子六:QSerialPort 串口数据 收发
- PaddleNLP基于ERNIR3.0文本分类:WOS数据集为例(层次分类)
- Multi activity disaster recovery construction after 713 failure of station B | takintalks share
- Memseg [anomaly detection: embedded based]
- Awk blank line filtering
猜你喜欢

STM32 - interrupt overview (interrupt priority)

STM32 single chip microcomputer drive L298N
![Memseg [anomaly detection: embedded based]](/img/10/aea2b6ecf55e04fe24f78e5fb897be.png)
Memseg [anomaly detection: embedded based]

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

Lenovo r9000p installation matlab2018a+cuda10.0 compilation

Qt+FFmpeg环境搭建
![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]

STM32_ Hal library driven framework
![[get mobile information] - get mobile information through ADB command](/img/ad/b10c5d09a21fb0cb22aa8a002fbd99.png)
[get mobile information] - get mobile information through ADB command

STM32 - DMA direct memory access controller (cubemx configures DMA)
随机推荐
es个人整理的相关面试题
Es learning directory
Qt+FFmpeg环境搭建
Solve various problems of sudo rosdep init and rosdep update
How to install and use PHP library neo4j
JS获取当前时间(年月日时分秒)
The blueprint of flask complements openpyxl
Differernet [anomaly detection: normalizing flow]
Summary of recent bugs
二进制的原码、反码、补码
CFA [anomaly detection: embedded_based]
Summary of common error types in JS
6K6w5LiA5qyh5pS75Ye75YiG5p6Q
PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
STM32 single chip microcomputer drive L298N
Padim [anomaly detection: embedded based]
Use the picture name to label the picture [tips]
使用PCL批量将点云.bin文件转.pcd
PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)
How do we do full link grayscale on the database?