当前位置:网站首页>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)
]
边栏推荐
- Memory Limit Exceeded
- Digital intelligent supplier management system solution for coal industry: data driven, supplier intelligent platform helps enterprises reduce costs and increase efficiency
- torch.roll
- ForkJoinPool
- 20220528【聊聊假芯片】贪便宜往往吃大亏,盘点下那些假的内存卡和固态硬盘
- Full recharge, im+rtc+x full communication service "feedback season" starts
- Construction and practice of full stack code test coverage and use case discovery system
- 亲测flutter打包apk后大小,比较满意
- 挖财账号开户安全吗?是靠谱的吗?
- 屏幕显示技术进化史
猜你喜欢

php利用队列解决迷宫问题

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

Countdowncatch and completabilefuture and cyclicbarrier

深度学习编译器的理解

金融服务行业SaaS项目管理系统解决方案,助力企业挖掘更广阔的增长服务空间

TCP packet sticking problem

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

PC wechat multi open

煤炭行业数智化供应商管理系统解决方案:数据驱动,供应商智慧平台助力企业降本增效

Geoffrey Hinton:我的五十年深度学习生涯与研究心法
随机推荐
分布式事务
Where do the guests come from
mysql for update 死锁问题排查
Personally test the size of flutter after packaging APK, quite satisfied
联想YOGA 27 2022,超强配置全面升级
20220528【聊聊假芯片】贪便宜往往吃大亏,盘点下那些假的内存卡和固态硬盘
Detailed single case mode
挖财账号开户安全吗?是靠谱的吗?
SaaS project management system solution for the financial service industry helps enterprises tap a broader growth service space
Troubleshooting MySQL for update deadlock
法国A+ 法国VOC标签最高环保级别
德国AgBB VoC有害物质测试
医疗行业企业供应链系统解决方案:实现医疗数智化供应链协同可视
3.10 haas506 2.0 development tutorial example TFT
Entry node of link in linked list - linked list topic
深度学习编译器的理解
torch.roll
「杂谈」如何改善数据分析工作中的三大被动局面
Pytorch learning (III)
Is it safe to open an account for goucai? Is it reliable?