当前位置:网站首页>Yolov5 improvement 15: network lightweight method deep separable convolution
Yolov5 improvement 15: network lightweight method deep separable convolution
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 : One of the problems of deep learning target detection model is that it 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 transform ordinary convolution into deep separable convolution , To realize the lightweight of the network model , Balance speed and accuracy .
Same series of articles :YOLOv5 Improvement 13 : Backbone network C3 Replace with lightweight network EfficientNetv2_ AI algorithm engineer 0301 The blog of -CSDN Blog
https://blog.csdn.net/m0_70388905/article/details/125612096?spm=1001.2014.3001.5502YOLOv5 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/125612052
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
https://blog.csdn.net/m0_70388905/article/details/125593267
principle :
Conventional convolution : For one 5×5 Pixels 、 Three channels (shape by 5×5×3), after 3×3 The convolution layer of the convolution kernel ( Suppose the number of output channels is 4, Then convolution kernel shape by 3×3×3×4, Final output 4 individual Feature Map, If there is same padding Then the size is the same as the input layer (5×5), If not, the dimension becomes 3×3
Depth separates the convolution :Depthwise Convolution A convolution kernel of is responsible for a channel , A channel is convoluted by only one convolution kernel . a sheet 5×5 Pixels 、 Three channel color input picture (shape by 5×5×3),Depthwise Convolution First, after the first convolution operation ,DW Completely in a two-dimensional plane . The number of convolution kernels is the same as the number of channels in the upper layer ( The channel corresponds to the convolution kernel one by one ). So a three channel image is generated after operation 3 individual Feature map( If there is same padding Then the size is the same as that of the input layer 5×5), As shown in the figure below .
Fang Law :
Step 1 modify common.py, increase ghostC3 modular .
def DWConv(c1, c2, k=1, s=1, act=True):
# Depthwise convolution
return Conv(c1, c2, k, s, g=math.gcd(c1, c2), act=act)
class Conv(nn.Module):
# Standard convolution
def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in, ch_out, kernel, stride, padding, groups
super(Conv, self).__init__()
self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False)
self.bn = nn.BatchNorm2d(c2)
self.act = nn.SiLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
def forward(self, x):# Network execution sequence
return self.act(self.bn(self.conv(x)))
def fuseforward(self, x):
return self.act(self.conv(x))The second step : take yolo.py Registration module in .
if m in [Conv,MobileNetV3_InvertedResidual,ShuffleNetV2_InvertedResidual,ghostc3,DWconv
]:
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 . 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 .
边栏推荐
- Qt+FFmpeg环境搭建
- Draem+sspcab [anomaly detection: block]
- Wechat applet uses canvas drawing, round avatar, network background, text, dotted line, straight line
- ES6, deep copy, shallow copy
- STM32CUBEIDE(10)----ADC在DMA模式下扫描多个通道
- Use PCL to batch convert point cloud.Bin files to.Pcd
- Fastflow [abnormal detection: normalizing flow]
- hp proliant dl380从U盘启动按哪个键
- Install PCL and VTK under the background of ROS installation, and solve VTK and PCL_ ROS conflict problem
- MKD [anomaly detection: knowledge disruption]
猜你喜欢

The function of wechat applet to cut pictures

shell脚本基础——Shell运行原理+变量、数组定义
![MKD [anomaly detection: knowledge disruption]](/img/15/10f5c8d6851e94dac764517c488dbc.png)
MKD [anomaly detection: knowledge disruption]

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

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

Concise history of graphic technology

Att & CK Threat Intelligence

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

DIP-VBTV: Color Image Restoration Model Combining Deep Image Prior and Vector Bundle Total Variation

STM32 - Communication
随机推荐
1e3是浮点数?
776. String shift inclusion problem
Excel-vba quick start (XIII. Common usage of date)
Evaluation index of anomaly detection: rocauc et al. [tips]
Research cup element recognition multi label classification task based on ernie-3.0 cail2019 method
Qt+FFmpeg环境搭建
Using nodejs to operate MySQL
STM32 - interrupt overview (interrupt priority)
OSV_ q Expected all tensors to be on the same device, but found at least two devices, cuda:0
Intelligent control -- fuzzy mathematics and control
When can I sign up for the 2022 class I constructor examination?
高等数学解题常用公式笔记总结
JVM——自定义类加载器
shell脚本基础——Shell运行原理+变量、数组定义
PC side web page effects (client series, scroll series, immediate function execution, sidebar effects)
Paper reading vision gnn: an image is worth graph of nodes
PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)
Draem+sspcab [anomaly detection: block]
How to install and use PHP library neo4j
[reprint] the token token is used in the login scenario