当前位置:网站首页>Some interesting modules
Some interesting modules
2022-06-30 19:07:00 【Deepheherman】
Share a module I wrote , I am here VOC There are no rising points in the data set , But many people have increased their data sets , Then I will simply say the principle
At first my idea was simple , Just feel the original 6 × 6 6×6 6×6 The convolution parameters are too large , Then I want to use a 3 × 3 3×3 3×3 And a 5 × 5 5×5 5×5 Convolution substitution of , The main purpose is to save some parameters ( Although it's trivial ), Later, some students said that they could try empty convolution , Then I put 5 × 5 5×5 5×5 Instead of the normal convolution of, I'm going to replace it with 3 × 3 3×3 3×3 The void convolution of , This can keep the receptive field unchanged and further reduce the parameters
The schematic diagram is as follows ,(a) For the original 6 × 6 6×6 6×6 Convolution (b) Improved convolution for myself , I didn't add BN and SiLU, I tested , It is lower to add points than not ,

After the improvement, the parameters of the first layer are indeed reduced by more than half 

Source code :
class Inception_Conv(nn.Module):
# Standard convolution
def __init__(self, c1, c2, k=3, s=2, g=1, p=None): # ch_in, ch_out, kernel, stride, padding, groups
super().__init__()
self.conv1 = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False)
self.conv2 = nn.Conv2d(c1, c2, k , s, autopad(k+2 , p),dilation=2, groups=g, bias=False)
def forward(self, x):
x1 = self.conv1(x)
x2 = self.conv2(x)
x = torch.add(x1, x2)
return x
The configuration file :
# YOLOv5 by Ultralytics, GPL-3.0 license
# Parameters
nc: 80 # number of classes
depth_multiple: 0.33 # model depth multiple
width_multiple: 0.50 # layer channel multiple
anchors:
- [10,13, 16,30, 33,23] # P3/8
- [30,61, 62,45, 59,119] # P4/16
- [116,90, 156,198, 373,326] # P5/32
# YOLOv5 v6.0 backbone
backbone:
# [from, number, module, args]
[[-1, 1, Inception_Conv, [64, 3]], # 0-P1/2
[-1, 1, Conv, [128, 3, 2]], # 1-P2/4
[-1, 3, C3, [128]],
[-1, 1, Conv, [256, 3, 2]], # 3-P3/8
[-1, 6, C3, [256]],
[-1, 1, Conv, [512, 3, 2]], # 5-P4/16
[-1, 9, C3, [512]],
[-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
[-1, 3, C3, [1024]],
[-1, 1, SPPF, [1024, 5]], # 9
]
# YOLOv5 v6.0 head
head:
[[-1, 1, Conv, [512, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 6], 1, Concat, [1]], # cat backbone P4
[-1, 3, C3, [512, False]], # 13
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 4], 1, Concat, [1]], # cat backbone P3
[-1, 3, C3, [256, False]], # 17 (P3/8-small)
[-1, 1, Conv, [256, 3, 2]],
[[-1, 14], 1, Concat, [1]], # cat head P4
[-1, 3, C3, [512, False]], # 20 (P4/16-medium)
[-1, 1, Conv, [512, 3, 2]],
[[-1, 10], 1, Concat, [1]], # cat head P5
[-1, 3, C3, [1024, False]], # 23 (P5/32-large)
[[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
]
边栏推荐
- Classic problem of leetcode dynamic programming (I)
- Is it safe to open a mobile stock account? Is it reliable?
- mysql函数获取全路径
- What if the apple watch fails to power on? Apple watch can not boot solution!
- 一点比较有意思的模块
- The easynvr platform equipment channels are all online. What is the reason for the "network request failure" in the operation?
- 《Go题库·15》go struct 能不能比较?
- 「杂谈」如何改善数据分析工作中的三大被动局面
- Entry node of link in linked list - linked list topic
- 如何做好软件系统的需求调研,七种武器让你轻松搞定
猜你喜欢

华兴证券:混合云原生架构下的 Kitex 实践

Merged binary tree of leetcode

Pytorch learning (III)

浏览器窗口切换激活事件 visibilitychange

Construction and practice of full stack code test coverage and use case discovery system

3.10 haas506 2.0开发教程-example-TFT

联想YOGA 27 2022,超强配置全面升级

屏幕显示技术进化史

Adhering to the concept of 'home in China', 2022 BMW children's traffic safety training camp was launched

How to use AI technology to optimize the independent station customer service system? Listen to the experts!
随机推荐
一套十万级TPS的IM综合消息系统的架构实践与思考
Is it safe to open a mobile stock account? Is it reliable?
电子元器件招标采购商城:优化传统采购业务,提速企业数字化升级
充值满赠,IM+RTC+X 全通信服务「回馈季」开启
MRO industrial products procurement management system: enable MRO enterprise procurement nodes to build a new digital procurement system
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
rust配置国内源
mysql 递归
新版EasyGBS如何配置WebRTC视频流格式播放?
Glacier teacher's book
Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
《客从何处来》
AI chief architect 10-aica-lanxiang, propeller frame design and core technology
手机股票账号开户安全吗?是靠谱的吗?
如何做好软件系统的需求调研,七种武器让你轻松搞定
Entry node of link in linked list - linked list topic
Hospital online consultation applet source code Internet hospital source code smart hospital source code
Multipass Chinese document - setting graphical interface
sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
浏览器窗口切换激活事件 visibilitychange