语义分割网络-Segnet

Segnet,由VijayBadrinarayanan等人于2015年提出,基于VGG16框架改进而成,采用编码器-解码器结构进行像素级图像分割。其创新之处在于利用下采样时的MaxValue位置信息进行上采样,加入BatchNormlization层提高分割效果,并使用Softmax损失函数。Segnet在MATLAB2016中作为内置算法,虽然之后被更深层的网络如Resnet所超越,但在语义分割领域仍具有一定影响力。

Segnet

介绍

2015年,Segnet模型由Vijay Badrinarayanan, Alex Kendall, Roberto Cipolla发表, 在FCN的语义分割任务基础上,搭建编码器-解码器对称结构,实现端到端的像素级别图像分割。

Segnet作为我接触的第一个网络,其模型框架和思路都比较简单,应用当年很火的VGG16框架,去掉全连接层,搭建对称模型,但是这在各种框架还没有大肆兴起的2014年,基于Caffe实现端到端的像素级别网络模型也是很不容易的。之后在MATLAB2016中,Segnet成为内置的用于语义分割的深度学习算法。2016年,Segnet研究组在原有网络框架基础加入了跳跃连接,算是有了进一步发展。不过之后兴起的各种规模更大层次更深的深度网络(以Resnet为主要框架)已经基本把Segnet碾压。
本文对Segnet只简要介绍,对详细原理不做太多描述。
文章链接: SegNet. Arxiv收录于 2 Nov 2015 (v1), last revised 10 Oct 2016 (this version, v3)

网络框架

框架

Segnet语义分割网络的关键在于下采样和上采样。在上采样的过程中,使用下采样时记录的Max Value像素位置指标。

Batch Normlization

在SegNet的每个卷积层后加上一个Batch Normlization层,Batch Normlization层后面为ReLU激活层。 文中指出,加入Batch Normlization层明显改善了语义分割效果。

Loss Function

使用Softmax 损失函数。

Segnet网络代码

基于Tensorflow :

	#####################
	# Downsampling path #
	#####################
	net = conv_block(inputs, 64)
	net = conv_block(net, 64)
	net = slim.pool(net, [2, 2], stride=[2, 2], pooling_type='MAX')
	skip_1 = net

	net = conv_block(net, 128)
	net = conv_block(net, 128)
	net = slim.pool(net, [2, 2], stride=[2, 2], pooling_type='MAX')
	skip_2 = net

	net = conv_block(net, 256)
	net = conv_block(net, 256)
	net = conv_block(net, 256)
	net = slim.pool(net, [2, 2], stride=[2, 2], pooling_type='MAX')
	skip_3 = net

	net = conv_block(net, 512)
	net = conv_block(net, 512)
	net = conv_block(net, 512)
	net = slim.pool(net, [2, 2], stride=[2, 2], pooling_type='MAX')
	skip_4 = net

	net = conv_block(net, 512)
	net = conv_block(net, 512)
	net = conv_block(net, 512)
	net = slim.pool(net, [2, 2], stride=[2, 2], pooling_type='MAX')


	#####################
	# Upsampling path #
	#####################
	net = conv_transpose_block(net, 512)
	net = conv_block(net, 512)
	net = conv_block(net, 512)
	net = conv_block(net, 512)
	if has_skip:
		net = tf.add(net, skip_4)

	net = conv_transpose_block(net, 512)
	net = conv_block(net, 512)
	net = conv_block(net, 512)
	net = conv_block(net, 256)
	if has_skip:
		net = tf.add(net, skip_3)

	net = conv_transpose_block(net, 256)
	net = conv_block(net, 256)
	net = conv_block(net, 256)
	net = conv_block(net, 128)
	if has_skip:
		net = tf.add(net, skip_2)

	net = conv_transpose_block(net, 128)
	net = conv_block(net, 128)
	net = conv_block(net, 64)
	if has_skip:
		net = tf.add(net, skip_1)

	net = conv_transpose_block(net, 64)
	net = conv_block(net, 64)
	net = conv_block(net, 64)

分割效果

在这里插入图片描述

数据集:SegNet (3.5K dataset training - 140K)
精确度结果:

类别精确度
Building89.6
Tree83.4
Sky96.1
Car87.7
Sign-Symbol52.7
Road96.4
Pedestrian62.2
Fence53.45
Column-Pole32.1
Side-walk93.3
Bicyclist36.5
Class avg.71.20
Global avg.90.40
mIoU60.10
BF46.84

作者:Freeverc
来源:优快云

03-10
### SegNet 架构概述 SegNet 是一种专为图像分割设计的深度卷积神经网络架构,其独特之处在于利用最大池化索引进行上采样,从而有效保留并恢复输入图像的空间信息[^1]。 #### 编码器-解码器结构 SegNet 的整体框架由两部分组成:编码器(Encoder)和解码器(Decoder)。编码器负责提取特征图中的高层次抽象表示;而解码器则通过逐步放大这些特征图来重建原始分辨率下的像素级分类结果。这种对称式的编解码机制有助于保持空间位置的一致性和准确性[^3]。 #### 特征映射与反向传播 在网络训练过程中,编码阶段会记录下每次执行最大池化的精确位置信息作为索引表,在后续解码环节中依据此索引来指导相应的逆运算——即非线性插值过程。这种方法不仅减少了参数量还提高了计算效率,同时也增强了模型对于细粒度物体边界的捕捉能力。 ```python import torch.nn as nn class SegNet(nn.Module): def __init__(self, input_channels=3, output_channels=32): super(SegNet, self).__init__() # Encoder layers with max pooling indices recording self.encoder = ... # Decoder layers using recorded indices for upsampling self.decoder = ... def forward(self, x): pool_indices = [] # Forward pass through encoder saving indices during MaxPool operations encoded_features, pool_indices = self.encoder(x) # Use saved indices within decoder path for precise unpooling steps decoded_output = self.decoder(encoded_features, pool_indices) return decoded_output ``` #### 应用领域 得益于上述特性,SegNet 已经被广泛应用于多个计算机视觉任务当中,尤其是在城市街景解析、医学影像分析等领域表现尤为突出。例如,在自动驾驶辅助系统里可以用来识别道路标志物以及行人车辆等目标对象;而在医疗成像方面可用于肿瘤检测或者器官轮廓勾勒等工作[^2]。
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苏沐昇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值