当前位置:网站首页>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)得到该分支的输出。
边栏推荐
- 数值计算方法 Chapter8. 常微分方程的数值解
- Leetcode daily question: merge two ordered arrays
- Sophon base 3.1 launched mlops function to provide wings for the operation of enterprise AI capabilities
- GFS分布式文件系统
- Use QT designer interface class to create two interfaces, and switch from interface 1 to interface 2 by pressing the key
- Which platform of outer disk gold is regular and safe, and how to distinguish it?
- Clickhouse (03) how to install and deploy Clickhouse
- Career advancement Guide: recommended books for people in big factories
- Interpretation: how to deal with the current security problems faced by the Internet of things?
- 职场进阶指南:大厂人必看书籍推荐
猜你喜欢

ISPRS2022/雲檢測:Cloud detection with boundary nets基於邊界網的雲檢測

Thesis reading_ Medical NLP model_ EMBERT

吴恩达团队2022机器学习课程,来啦
![含重复元素取不重复子集[如何取子集?如何去重?]](/img/b2/d019c3f0b85a6c0d334a092fa6c23c.png)
含重复元素取不重复子集[如何取子集?如何去重?]

华夏基金:基金行业数字化转型实践成果分享

Nanjing University: Discussion on the training program of digital talents in the new era

LeetCode每日一题:合并两个有序数组

隐私计算助力数据的安全流通与共享

ELK日志分析系统

IDC report: Tencent cloud database ranks top 2 in the relational database market!
随机推荐
JVM第三话 -- JVM性能调优实战和高频面试题记录
Ten capabilities that cyber threat analysts should have
“12306” 的架构到底有多牛逼?
论文阅读_中文NLP_LTP
nacos -分布式事务-Seata** linux安装jdk ,mysql5.7启动nacos配置ideal 调用接口配合 (保姆级细节教程)
VBA drives SAP GUI to realize office automation (II): judge whether elements exist
隐私计算助力数据的安全流通与共享
检查命名空间和类
请问下为啥有的表写sql能查到数据,但在数据地图里查不到啊,查表结构也搜不到
Why is February 28 in the Gregorian calendar
【PaddleClas】常用命令
MATLAB查阅
leetcode每日一练:旋转数组
ELK日志分析系统
Neural network self cognition model
What are the requirements for PMP certification? How much is it?
访问数据库使用redis作为mysql的缓存(redis和mysql结合)
修复漏洞 - mysql 、es
Thesis reading_ Chinese NLP_ LTP
Sophon KG升级3.1:打破数据间壁垒,解放企业生产力