当前位置:网站首页>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)得到该分支的输出。
边栏推荐
- GFS分布式文件系统
- Nanjing University: Discussion on the training program of digital talents in the new era
- Penetrate the whole intranet through socks agent
- Generate XML schema from class
- How to modify MySQL fields as self growing fields
- nano的CAN通信
- 使用QT设计师界面类创建2个界面,通过按键从界面1切换到界面2
- Sophon autocv: help AI industrial production and realize visual intelligent perception
- Leetcode daily question: the first unique character in the string
- Neural network self cognition model
猜你喜欢

Zabbix

Sophon autocv: help AI industrial production and realize visual intelligent perception

Redis Foundation

GFS分布式文件系统

Why is all (()) true and any (()) false?

What are the changes in the 2022 PMP Exam?

Find the first k small element select_ k

使用QT遍历Json文档及搜索子对象

JVM third talk -- JVM performance tuning practice and high-frequency interview question record

leetcode每日一练:旋转数组
随机推荐
Action avant ou après l'enregistrement du message teamcenter
Simple query cost estimation
mybash
LeetCode笔记:Weekly Contest 300
Daily exercise: a series of dates
神经网络自我认知模型
Huaxia Fund: sharing of practical achievements of digital transformation in the fund industry
Sophon CE Community Edition is online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool
EasyCVR平台通过接口编辑通道出现报错“ID不能为空”,是什么原因?
Delete some elements in the array
EPM相关
Redis Foundation
nano的CAN通信
Sophon Base 3.1 推出MLOps功能,为企业AI能力运营插上翅膀
Thesis reading_ Medical NLP model_ EMBERT
LeetCode每日一题:合并两个有序数组
数值计算方法 Chapter8. 常微分方程的数值解
Use QT designer interface class to create two interfaces, and switch from interface 1 to interface 2 by pressing the key
Tencent music launched its new product "quyimai", which provides music commercial copyright authorization
Teamcenter 消息注册前操作或后操作