当前位置:网站首页>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)得到该分支的输出。
边栏推荐
- Read libco save and restore the on-site assembly code
- 从XML架构生成类
- Clickhouse (03) how to install and deploy Clickhouse
- Teamcenter 消息注册前操作或后操作
- Easynmon Usage Summary
- 星环科技重磅推出数据要素流通平台Transwarp Navier,助力企业实现隐私保护下的数据安全流通与协作
- Compared with the loss of Wenxin, the performance is improved a lot
- LeetCode笔记:Weekly Contest 300
- IDC report: Tencent cloud database ranks top 2 in the relational database market!
- Data access - entityframework integration
猜你喜欢
南京大学:新时代数字化人才培养方案探讨
2022新版PMP考试有哪些变化?
Why is all (()) true and any (()) false?
最大人工岛[如何让一个连通分量的所有节点都记录总节点数?+给连通分量编号]
每日一练:关于日期的一系列
Sophon KG升级3.1:打破数据间壁垒,解放企业生产力
Elk log analysis system
ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V
GFS distributed file system
Sophon CE社区版上线,免费Get轻量易用、高效智能的数据分析工具
随机推荐
通过SOCKS代理渗透整个内网
Delete some elements in the array
使用QT遍历Json文档及搜索子对象
What are the changes in the 2022 PMP Exam?
PMP认证需具备哪些条件啊?费用多少啊?
Why is all (()) true and any (()) false?
Ten capabilities that cyber threat analysts should have
Access the database and use redis as the cache of MySQL (a combination of redis and MySQL)
开户复杂吗?网上开户安全么?
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
ISPRS2022/雲檢測:Cloud detection with boundary nets基於邊界網的雲檢測
GIMP 2.10教程「建议收藏」
Use QT designer interface class to create two interfaces, and switch from interface 1 to interface 2 by pressing the key
较文心损失一点点性能提升很多
rsync
Clickhouse (03) how to install and deploy Clickhouse
flask接口响应中的中文乱码(unicode)处理
VBA drives SAP GUI to realize office automation (II): judge whether elements exist
Why is February 28 in the Gregorian calendar
Teamcenter 消息注册前操作或后操作