当前位置:网站首页>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)
]
边栏推荐
- RFFE中MIPI协议
- 浏览器窗口切换激活事件 visibilitychange
- 删除排序链表中的重复元素 II[链表节点统一操作--dummyHead]
- 医院在线问诊小程序源码 互联网医院源码 智慧医院源码
- Is it safe to open an account for goucai? Is it reliable?
- Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 1)
- Solution of enterprise supply chain system in medical industry: realize collaborative visualization of medical digital intelligent supply chain
- Leader: who can use redis expired monitoring to close orders and get out of here!
- 华兴证券:混合云原生架构下的 Kitex 实践
- 「干货」数据分析常用的10种统计学方法,附上重点应用场景
猜你喜欢

ForkJoinPool
Do you really understand the persistence mechanism of redis?

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

20220528【聊聊假芯片】贪便宜往往吃大亏,盘点下那些假的内存卡和固态硬盘

sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户

Entry node of link in linked list - linked list topic

MySQL transaction concurrency and mvcc mechanism

System integration project management engineer certification high frequency examination site: prepare project scope management plan

拓維信息使用 Rainbond 的雲原生落地實踐

ForkJoinPool
随机推荐
Large file transfer software based on UDP protocol
Delete duplicate elements in the sorting linked list ii[unified operation of linked list nodes --dummyhead]
新版EasyGBS如何配置WebRTC视频流格式播放?
Detailed single case mode
PyTorch学习(三)
NEON优化2:ARM优化高频指令总结
Tensorflow2 ten must know for deep learning
屏幕显示技术进化史
4个技巧告诉你,如何使用SMS促进业务销售?
一套十万级TPS的IM综合消息系统的架构实践与思考
服务器之间传文件夹,文件夹内容为空
Redis入门到精通01
开发那些事儿:如何在视频中添加文字水印?
Classic problem of leetcode dynamic programming (I)
Go Redis连接池
云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
Courage to be hated: Adler's philosophy class: the father of self inspiration
Summary of methods for offline installation of chrome extensions in China
《所谓情商高,就是会说话》读书笔记
Do you really understand the persistence mechanism of redis?