当前位置:网站首页>FCN: Fully Convolutional Networks for Semantic Segmentation
FCN: Fully Convolutional Networks for Semantic Segmentation
2022-07-05 17:51:00 【00000cj】
paper: Fully Convolutional Networks for Semantic Segmentation
创新点
提出了全卷积的结构,即将分类网络最后的全连接层换成卷积层,从而可以处理任意大小的输入。
通过反卷积或插值的方法进行上采样,将输出还原回原始输入大小。
在分类网络上进行修改,将全连接层换成卷积层,可以共享前面层的权重,从而进行finetune。
提出skip结构,通过融合浅层特征和深层特征,兼顾了浅层的空间细节信息和深层的语义信息,使得最终的分割结果更加精细。
实现细节解析
这里以MMSegmentation中的实现为例,和原论文相比,backbone由Vgg-16换成了ResNet-50,skip结构换成了膨胀卷积,pytorch官方的实现也是这样的。
Backbone
- 原始的ResNet-50中4个stage的strides=(1, 2, 2, 2),不采用膨胀卷积即dilations=(1, 1, 1, 1),而在FCN中4个stage的strides=(1, 2, 1, 1),dilations=(1, 1, 2, 4)。
- 另外有一个contract_dilation=True的设置,即当空洞>1时,压缩第一个卷积层。这里在第三个和第四个stage的第一个bottleneck中将膨胀率减半,即第三个stage的第一个bottleneck中不采用膨胀卷积,第四个stage的第一个bottleneck中dilation=4/2=2。
- 另外这里采用的是ResNetV1c,即stem中的7x7卷积替换成了3个3x3卷积。
- 最后,注意一下padding,在原始实现中除了stem中7x7卷积的padding=3,其它所有padding=1。在FCN中因为用了膨胀卷积,后两个stage的stride=1,为了保持输入输出分辨率一直,由下式可得padding=dilation。

- 假设batch_size=4,模型输入shape=(4, 3, 480, 480),则backbone四个stage的输出分别为(4, 256, 120, 120)、(4, 512, 60, 60)、(4, 1024, 60, 60)、(4, 2048, 60, 60)。
FCN Head
- 取ResNet第四个stage的输出(4, 2048, 60, 60),经过Conv2d(2048, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)、Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False) 两个conv-bn-relu得到 (4, 512, 60, 60)。
- 上一步的输出(4, 512, 60, 60)与输入(4, 2048, 60, 60)拼接得到(4, 2560, 60, 60)。
- 经过一个conv-bn-relu,Conv2d(2560, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False),得到(4, 512, 60, 60)。
- 采用dropout,dropout_ratio=0.1。
- 最后,经过Conv2d(512, num_classes, kernel_size=(1, 1), stride=(1, 1))得到模型的最终输出(4, num_classes, 60, 60),注意这里的类别数包括背景。
Loss
- 上一步的输出(4, 2, 60, 60)经过双线性插值resize成输入大小,得到(4, 2, 480, 480)。
- 采用CrossEntropy loss
Auxiliary Head
- 取ResNet第三个stage的输出(4, 1024, 60, 60),经过Conv2d(1024, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)一个conv-bn-relu得到(4, 256, 60, 60)。
- 采用dropout,dropout_ratio=0.1。
- 经过Conv2d(256, num_classes, kernel_size=(1, 1), stride=(1, 1))得到模型的最终输出(4, num_classes, 60, 60)得到该分支的输出。
边栏推荐
- 寻找第k小元素 前k小元素 select_k
- 模拟百囚徒问题
- Mask wearing detection based on yolov3
- 毫无章法系列
- [TestLink] testlink1.9.18 solutions to common problems
- Sophon KG升级3.1:打破数据间壁垒,解放企业生产力
- Leetcode daily question: merge two ordered arrays
- 读libco保存恢复现场汇编代码
- ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V
- 证券网上开户安全吗?证券融资利率一般是多少?
猜你喜欢

ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V

Sophon base 3.1 launched mlops function to provide wings for the operation of enterprise AI capabilities

「运维有小邓」用于云应用程序的单点登录解决方案
![[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business](/img/a6/aa0b8d30913dc64f3c0cd891528c40.png)
[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business

论文阅读_医疗NLP模型_ EMBERT

leetcode每日一练:旋转数组

JVM第三话 -- JVM性能调优实战和高频面试题记录

小林coding的内存管理章节

VBA drives SAP GUI to realize office automation (II): judge whether elements exist

nacos -分布式事务-Seata** linux安装jdk ,mysql5.7启动nacos配置ideal 调用接口配合 (保姆级细节教程)
随机推荐
Configure pytorch environment in Anaconda - win10 system (small white packet meeting)
职场进阶指南:大厂人必看书籍推荐
Matlab reference
南京大学:新时代数字化人才培养方案探讨
ISPRS2022/雲檢測:Cloud detection with boundary nets基於邊界網的雲檢測
Interpretation: how to deal with the current security problems faced by the Internet of things?
钉钉开放平台小程序API的缓存接口都有哪些内容?
「运维有小邓」用于云应用程序的单点登录解决方案
Eliminate the writing of 'if () else{}'
nacos -分布式事务-Seata** linux安装jdk ,mysql5.7启动nacos配置ideal 调用接口配合 (保姆级细节教程)
leetcode每日一题:字符串中的第一个唯一字符
Sophon base 3.1 launched mlops function to provide wings for the operation of enterprise AI capabilities
开户复杂吗?网上开户安全么?
Numerical calculation method chapter8 Numerical solutions of ordinary differential equations
MATLAB中print函数使用
在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
小林coding的内存管理章节
使用Jmeter虚拟化table失败
华夏基金:基金行业数字化转型实践成果分享
访问数据库使用redis作为mysql的缓存(redis和mysql结合)