语义分割DEEPLAB V2开源代码走读

【语义分割系列:五】DeepLab v3 / v3+ 论文阅读翻译笔记 DeepLab v3 2017 CVPR Rethinking Atrous Convolution for Semantic Image Segmentation ❤ fregu856/deeplabv3 :PyTorch implementation of DeepLabV3, trained on the Cityscapes dataset. 官方开源 |Tensorflow Int... 阅读详情

DEEPLAB V2简介

论文路径
引用一篇博文:Semantic Segmentation –DeepLab(1,2,3)系列总结
DEEPLAB V2的相对于V1的特点在于:
1.使用RESNET101替代VGG16
2.使用ASPP的结构

开源代码走读:

对应的GITHUB地址:
https://github.com/DrSleep/tensorflow-deeplab-resnet

网络结构:

DEEPLAB V2是基于RESNET101实现的。
先看一下RESNET的结构:
这里写图片描述
代码在:MODEL.PY中实现

相对于基础的RESNET,主要又如下的几点不同:

1 使用空洞卷积代替卷积

在CONV4_x使用rate=2,在CONV5_x使用rate=4的空洞卷积。

2 CONV3_x之后,层之间不在做STRIDE=2的卷积

压缩8倍后不再做2倍的压缩。如默认321*321,最后结果矩阵是41*41而不是11*11.

3 使用ASPP加成。

        (self.feed('res5b_relu', 
                   'bn5c_branch2c')
             .add(name='res5c')
             .relu(name='res5c_relu')
             .atrous_conv(3, 3, num_classes, 6, padding='SAME', relu=False, name='fc1_voc12_c0'))

        (self.feed('res5c_relu')
             .atrous_conv(3, 3, num_classes, 12, padding='SAME', relu=False, name='fc1_voc12_c1'))

        (self.feed('res5c_relu')
             .atrous_conv(3, 3, num_classes, 18, padding='SAME', relu=False, name='fc1_voc12_c2'))

        (self.feed('res5c_relu')
             .atrous_conv(3, 3, num_classes, 24, padding='SAME', relu=False, name='fc1_voc12_c3'))

        (self.feed('fc1_voc12_c0', 
                   'fc1_voc12_c1', 
                   'fc1_voc12_c2', 
                   'fc1_voc12_c3')
             .add(name='fc1_voc12'))

训练

获取LABEL

label = tf.image.decode_png(label_contents, channels=1)

需要将彩色图先转成灰度图。。。。

# 将LABEL转换成网络大小
label_proc = prepare_label(label_batch, tf.stack(raw_output.get_shape()[1:3]), num_classes=args.num_classes, one_hot=False)

实现代码:

input_batch = tf.image.resize_nearest_neighbor(input_batch, new_size) # as labels are integer numbers, need to use NN interp.
        input_batch = tf.squeeze(input_batch, squeeze_dims=[3]) # reducing the channel dimension.

插值出来的数据可能大于最大NUM,需要限定一下。

    # Predictions: ignoring all predictions with labels greater or equal than n_classes
    raw_gt = tf.reshape(label_proc, [-1,])
    indices = tf.squeeze(tf.where(tf.less_equal(raw_gt, args.num_classes - 1)), 1)
    gt = tf.cast(tf.gather(raw_gt, indices), tf.int32)
    prediction = tf.gather(raw_prediction, indices)

计算LOSS

    # Pixel-wise softmax loss.
    loss = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=prediction, labels=gt)
    ### l2 loss add all.
    l2_losses = [args.weight_decay * tf.nn.l2_loss(v) for v in tf.trainable_variables() if 'weights' in v.name]
    reduced_loss = tf.reduce_mean(loss) + tf.add_n(l2_losses)

设定优化器参数

    all_trainable = [v for v in tf.trainable_variables() if 'beta' not in v.name and 'gamma' not in v.name]
    fc_trainable = [v for v in all_trainable if 'fc' in v.name]
    conv_trainable = [v for v in all_trainable if 'fc' not in v.name] # lr * 1.0
    fc_w_trainable = [v for v in fc_trainable if 'weights' in v.name] # lr * 10.0
    fc_b_trainable = [v for v in fc_trainable if 'biases' in v.name] # lr * 20.0
    assert(len(all_trainable) == len(fc_trainable) + len(conv_trainable))
    assert(len(fc_trainable) == len(fc_w_trainable) + len(fc_b_trainable))

这里代码有个TRACK,最后的4个FC和前面网络的LR是不一致的。(其实可以先冻结前面的层,只训练FC,然后再整体FINE-TUNE)

    # Define loss and optimisation parameters.
    base_lr = tf.constant(args.learning_rate)
    step_ph = tf.placeholder(dtype=tf.float32, shape=())
    learning_rate = tf.scalar_mul(base_lr, tf.pow((1 - step_ph / args.num_steps), args.power))

    opt_conv = tf.train.MomentumOptimizer(learning_rate, args.momentum)
    opt_fc_w = tf.train.MomentumOptimizer(learning_rate * 10.0, args.momentum)
    opt_fc_b = tf.train.MomentumOptimizer(learning_rate * 20.0, args.momentum)

    grads = tf.gradients(reduced_loss, conv_trainable + fc_w_trainable + fc_b_trainable)
    grads_conv = grads[:len(conv_trainable)]
    grads_fc_w = grads[len(conv_trainable) : (len(conv_trainable) + len(fc_w_trainable))]
    grads_fc_b = grads[(len(conv_trainable) + len(fc_w_trainable)):]

    train_op_conv = opt_conv.apply_gradients(zip(grads_conv, conv_trainable))
    train_op_fc_w = opt_fc_w.apply_gradients(zip(grads_fc_w, fc_w_trainable))
    train_op_fc_b = opt_fc_b.apply_gradients(zip(grads_fc_b, fc_b_trainable))

    train_op = tf.group(train_op_conv, train_op_fc_w, train_op_fc_b)

更多

msc– multi-scale inputs

基于基础的训练网络,训练3个大小不同的网络。获得最大值和训练数据比较。

    # Create network.
    with tf.variable_scope('', reuse=False):
        net = DeepLabResNetModel({'data': image_batch}, is_training=args.is_training, num_classes=args.num_classes)
    with tf.variable_scope('', reuse=True):
        net075 = DeepLabResNetModel({'data': image_batch075}, is_training=args.is_training, num_classes=args.num_classes)
    with tf.variable_scope('', reuse=True):
        net05 = DeepLabResNetModel({'data': image_batch05}, is_training=args.is_training, num_classes=args.num_classes)
   # Predictions.
    raw_output100 = net.layers['fc1_voc12']
    raw_output075 = net075.layers['fc1_voc12']
    raw_output05 = net05.layers['fc1_voc12']
    raw_output = tf.reduce_max(tf.stack([raw_output100,
                                         tf.image.resize_images(raw_output075, tf.shape(raw_output100)[1:3,]),
                                         tf.image.resize_images(raw_output05, tf.shape(raw_output100)[1:3,])]), axis=0)

CRF

引用了:
https://github.com/lucasb-eyer/pydensecrf
查看CRF分支,inference.py

    # CRF.
    raw_output_up = tf.nn.softmax(raw_output_up)
    raw_output_up = tf.py_func(dense_crf, [raw_output_up, tf.expand_dims(img_orig, dim=0)], tf.float32)
def dense_crf(probs, img=None, n_iters=10, 
              sxy_gaussian=(1, 1), compat_gaussian=4,
              kernel_gaussian=dcrf.DIAG_KERNEL,
              normalisation_gaussian=dcrf.NORMALIZE_SYMMETRIC,
              sxy_bilateral=(49, 49), compat_bilateral=5,
              srgb_bilateral=(13, 13, 13),
              kernel_bilateral=dcrf.DIAG_KERNEL,
              normalisation_bilateral=dcrf.NORMALIZE_SYMMETRIC):
    """DenseCRF over unnormalised predictions.
       More details on the arguments at https://github.com/lucasb-eyer/pydensecrf.

    Args:
      probs: class probabilities per pixel.
      img: if given, the pairwise bilateral potential on raw RGB values will be computed.
      n_iters: number of iterations of MAP inference.
      sxy_gaussian: standard deviations for the location component of the colour-independent term.
      compat_gaussian: label compatibilities for the colour-independent term (can be a number, a 1D array, or a 2D array).
      kernel_gaussian: kernel precision matrix for the colour-independent term (can take values CONST_KERNEL, DIAG_KERNEL, or FULL_KERNEL).
      normalisation_gaussian: normalisation for the colour-independent term (possible values are NO_NORMALIZATION, NORMALIZE_BEFORE, NORMALIZE_AFTER, NORMALIZE_SYMMETRIC).
      sxy_bilateral: standard deviations for the location component of the colour-dependent term.
      compat_bilateral: label compatibilities for the colour-dependent term (can be a number, a 1D array, or a 2D array).
      srgb_bilateral: standard deviations for the colour component of the colour-dependent term.
      kernel_bilateral: kernel precision matrix for the colour-dependent term (can take values CONST_KERNEL, DIAG_KERNEL, or FULL_KERNEL).
      normalisation_bilateral: normalisation for the colour-dependent term (possible values are NO_NORMALIZATION, NORMALIZE_BEFORE, NORMALIZE_AFTER, NORMALIZE_SYMMETRIC).

    Returns:
      Refined predictions after MAP inference.
    """
    _, h, w, _ = probs.shape

    probs = probs[0].transpose(2, 0, 1).copy(order='C') # Need a contiguous array.

    d = dcrf.DenseCRF2D(h, w, n_classes) # Define DenseCRF model.
    U = -np.log(probs) # Unary potential.
    U = U.reshape((n_classes, -1)) # Needs to be flat.
    d.setUnaryEnergy(U)
    d.addPairwiseGaussian(sxy=sxy_gaussian, compat=compat_gaussian,
                          kernel=kernel_gaussian, normalization=normalisation_gaussian)
    if img is not None:
        assert(img.shape[1:3] == (h, w)), "The image height and width must coincide with dimensions of the logits."
        d.addPairwiseBilateral(sxy=sxy_bilateral, compat=compat_bilateral,
                               kernel=kernel_bilateral, normalization=normalisation_bilateral,
                               srgb=srgb_bilateral, rgbim=img[0])
    Q = d.inference(n_iters)
    preds = np.array(Q, dtype=np.float32).reshape((n_classes, h, w)).transpose(1, 2, 0)
    return np.expand_dims(preds, 0)
Semantic Segmentation DeepLab v3 读取数据集(TFRecord)代码详解 本文主要介绍谷歌官方在Github TensorFlow中开源的官方代码DeepLab在读取TFRecord格式数据集所使用的方法。 配置DeepLab v3 首先,需要将整个工程拉取到本地的workspace。 1. 源码地址:https://github.com/tensorflow/models/tree/master/research/deeplab 2. Cloneyuan da... 阅读详情

相关推荐

deepLab-v2的模型评估:pixel accuracy /Iou

deeplab-v2自带的评估代码,主要永高这三个文件,按照自己的路我,需要的可以参考。

附代码 Deeplab V2(附迁移学习代码)

DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs 论文解读 V1链接:https://blog.csdn.net/weixin_44543648/article/details/122576853 论文链接:https://arxiv.org/pdf/1606.00915.pdf 代码链接:https://github.com/dont

weixin_44543648的博客 4134

Deeplab v2

deeplab-v2  基于vgg训练自己的数据的prototxt 和cityscapes的prototxt

SS-Model【3】:DeepLabv2

DeepLabv2是一个用于语义分割的架构,它建立在DeepLab的基础上,有一个无轨的空间金字塔集合方案。在这里,我们在输入特征图中应用了不同速率的平行扩张卷积,然后将它们融合在一起。由于同一类别的物体在图像中可能有不同的尺寸,ASPP有助于解释不同的物体尺寸。回顾下 DeepLab v1 ,其主要是在 FCN 的基础上对 VGG 网络进行调参 fine tuning,并在最后加上一个全连接的 CRF,保证对 FCN 得到的结果在局部细节(边界)上进行优化。

BUPTer 5514

半桥LLC谐振变换器及同步整流MATLAB仿真(一)

LLC工作原理详细解析,工作过程详细拆解

qq_55203246的博客 3万+

UsualToolCMS-验证码绕过漏洞复现

本文以UsualToolCMS为靶场,复现了验证码绕过漏洞

小小小屿屿屿的博客 930

深度学习语义分割篇——DeepLabV2原理详解篇

Hello,大家好,我是小苏👦🏽👦🏽👦🏽在上一节,我已经为大家介绍了DeepLabV1的原理,还不清楚的赶快点击☞☞☞了解详情。🍍🍍🍍那么这篇就和大家唠唠DeepLabV1的兄弟篇——DeepLabV2。其实呢,你要是清楚DeepLabV1的话,那么DeepLabV2对你来说就是小菜一碟了,改进点是比较少也比较好理解的。话不多说,让我们一起走进DeepLabV2的世界叭~~~🚖🚖🚖DeepLabV2论文🍵🍵🍵。

秃头小苏的博客 2885

WPS接入DeepSeek,实现AI辅助功能

总的来说,借助 WPS 中宏功能与 DeepSeek 大模型的结合,文档处理、内容创作和数据分析等任务都能更加智能化、自动化。这不仅大幅提升了工作效率,也为办公场景带来了全新的智能化办公体验。

运维老生常谈 3815

[语义分割] DeepLab v2(膨胀卷积、空洞卷积、多尺度信息融合、MSc、ASPP、空洞空间金字塔池化、Step学习率策略、Poly学习率策略)

膨胀卷积、空洞卷积、多尺度信息融合、MSc、ASPP、空洞空间金字塔池化、Step学习率策略、Poly学习率策略

Le0v1n 的博客 4334

HLM(多层线性模型)在stata中语句

在阅读CEPS中发现有些研究采用的是HLM模型,HLM简单来说用一个方程跑两个回归。举例,对学习成绩影响因素,不同层有不同的影响,如在个体层面上个体特征会对成绩产生影响,在学校层面学校排名等因素会对成绩产生影响,两种因素不在一个层面,每层造成的差异都不相同。 在找相关语句时候发现操作这个语句的软件大多是SPSS和HLM,对于stata操作者并不友好。因此,在有限资料中总结了HLM在stata中的语句,后面会附上学习视频和链接。 先放语句,后面对方程式一个大致解析。由于针对HLM有一本书的介绍,可能一篇文章无

weixin_44652251的博客 1万+

LTX-2.3 V1.6:8G显存本地AI视频生成工具与int8量化加速实践

这次我们来看一个本地部署的AI视频生成工具——LTX-2.3文字图片生成带音频视频工具V1.6版本。这个工具最大的特点是支持int8量化加速,相比原版提速2-4倍,效果更好,而且8G显存就能运行,不需要搭建复杂环境,解压即可使用。 对于想要在本地电脑上快速生成带音频视频内容的用户来说,这个工具解决了几个关键痛点:首先是硬件门槛低,8G显存意味着大多数主流游戏显卡都能胜任;其次是部署简单,避免了Python环境配置、依赖包冲突等常见问题;最后是性能优化明显,int8加速让生成速度大幅提升。 本文会重点演示如何

hqmln的博客 1241

DeepLabV1 V2 V3

DeeplabV3

qq_45051096的博客 633

电机瞬态分析基础(2):理想电机的基本假设和正方向规定

电机瞬态分析基础之理想电机假设条件和正方向规定

weixin_45670943的博客 1150

语义分割之FCN、Deeplab V3+

1、相关参考链接 基本概念: 语义分割 三维语义分割 空洞卷积 两篇综述 最新论文: LEDNet 这里将语义分割网络分为两类:一类是以FCN为代表的“encode-decode”,另一类是以Deeplab为代表的“dilate convolution”(空洞卷积网络)。 2、从FCN讲起 FCN(Fully Convolutional Networks for Semantic Segmenta...

DaGongJiGuoMaLu09的博客 6836

JS逆向-7881游戏平台Lb-Sign参数和Lb-Timestamp参数

本文是该专栏的第79篇,后面会持续分享python爬虫干货知识。本文以7881游戏平台为例,通过JS逆向获取它的lb-sign参数和lb-timestamp参数生成规律。针对lb-sign和lb-timestamp两个参数具体的“逆向”思路逻辑,笔者将在本文进行详细说明,并且将在正文结合“完整代码”来详细介绍。废话不多说,具体细节部分以及详细思路逻辑,跟着笔者直接往下看正文部分。(附带完整代码)

Python进阶专栏《爬虫实战进阶》,《Pyppeteer从入门到精通》原创作者 1225

如何在 UniApp 中接入讯飞语音听写功能 文末附vue3+vue2完整代码

在开发过程中,我遇到了讯飞接口返回空数据的问题。通过仔细检查传送的每一帧数据,我发现问题出在第一帧的配置信息以及 Base64 数据的切片。确保每一帧的数据正确且符合接口要求,问题就能够得到解决。希望这个过程能帮助你在项目中顺利对接讯飞语音识别。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1008

语义分割模型之DeepLab系列

语义分割模型之DeepLab系列 前言 DeepLab系列一共有四篇文章,分别对应DeepLab V1、DeepLab V2、DeepLab V3和DeepLab V3+。 DeepLab V1 论文题目:Semantic Image Segmentation with Deep Convolutional Nets and Fully Connected CRFs (https://arxiv.org/abs/1606.00915) 开源代码:TheLegendAli/DeepLab-Context (

wuli_xin的博客 2348

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

谷歌开源语义图像分割模型DeepLab-v3+ 上

DeepLab 是一种用于图像语义分割的顶尖深度学习模型,其目标是将语义标签(如人、狗、猫等)分配给输入图像的每个像素。经过三年左右的发展,目前 DeepLab 具有如下功能:DeepLabv1:结合深度卷积神经网络,使用空洞卷积(atrous convolution)进行语义分割DeepLabv2:基于 DeepLabv1 的优化,使用空洞空间金字塔池化(atrous spatial pyram...

fu6543210的博客 6973

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

语义分割网络DeepLab-v3的架构设计思想 上

深度卷积神经网络在各类计算机视觉应用中取得了显著的成功,语义分割也不例外。这篇文章介绍了语义分割的 TensorFlow 实现,并讨论了一篇和通用目标的语义分割最相关的论文——DeepLab-v3。DeepLab-v3 是由谷歌开发的语义分割网络,近日,谷歌还开源了该系列的最新版本——DeepLab-v3+。GitHub 地址:https://github.com/sthalles/deeplab...

fu6543210的博客 1万+

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

DeepLab-V3 开源项目教程

DeepLab-V3 开源项目教程 项目介绍 DeepLab-V3 是一个基于深度学习的语义分割模型,由 Google 开发并开源。该项目在 PASCAL VOC 2012 语义图像分割基准测试中表现优异,显著提升了分割精度。DeepLab-V3 通过在多个尺度上探测卷积特征,并结合图像级别的特征编码全局上下文,进一步提升了性能。该项目不依赖于 DenseCRF 后处理,且在性能上与其他最先进的模...

gitblog_00765的博客 1108

【语义分割 - DeepLab学习笔记】之DeepLab初体验

目录 前言 一、DeepLab简述 二、DeepLab怎么使用 1、配置 2、代码解析 前言 最近在接触一个项目,要用到语义分割,如果大家有什么问题,都可以跟我沟通交流。除了通过博客交流外,欢迎你加入我的QQ群,一起交流有关于区块链、机器学习、深度学习、计算机视觉有关内容。我现在处于广泛涉猎阶段,希望我们能够一起沟通。下图是我的群二维码: 一、DeepLab简述 Deepla...

水亦心的博客 2116

语义分割知识点:UNet、FCN、SegNet、PSPNet、DeepLab系列

语义分割、UNet、FCN、SegNet、PSPNet、DeepLab

FriendshipTang的博客 4264

语义分割源代码_深度学习|语义分割:DeepLab系列

DeepLab系列一共有三篇文章,分别对应DeepLab V1、DeepLab V2和DeepLab V3,这三篇文章一脉相承,而且官方出了一个PPT,对比了这三个版本的区别,所以我们在此处按照PPT的讲解顺序对这三篇文章一并介绍。DeepLab V1:论文题目:Semantic Image Segmentation with Deep Convolutional Nets and Fully C...

weixin_39629780的博客 417

深度学习图像语义分割:DeepLab V3

深度学习图像语义分割:DeepLab V3 DeepLab V3是一个开源的图像语义分割项目,基于TensorFlow框架,使用Python语言进行开发。该项目致力于实现并优化Google的DeepLab V3模型,用于图像的高精度语义分割。 基础介绍 DeepLab V3是图像语义分割领域的一个重要模型。它的主要贡献是引入了膨胀空间金字塔池化(ASPP)操作,这一创新使得模型在处理图像时能够达到...

gitblog_00640的博客 368

TensorFlow DeepLab-V3 开源项目教程

TensorFlow DeepLab-V3 开源项目教程 项目介绍 TensorFlow DeepLab-V3 是一个基于 TensorFlow 框架实现的高性能语义分割模型。该项目利用深度学习技术,特别是深度卷积神经网络(DCNN),来识别和分割图像中的不同对象。DeepLab-V3 通过引入空洞卷积(Atrous Convolution)和空间金字塔池化(ASPP)等技术,显著提高了模型在复杂...

gitblog_00343的博客 618

DeepLab-v3-plus-cityscapes 开源项目教程

DeepLab-v3-plus-cityscapes 开源项目教程 项目介绍 DeepLab-v3-plus-cityscapes 是一个基于深度学习的图像分割项目,专门针对城市景观(Cityscapes)数据集进行优化。该项目利用了DeepLab v3+架构,该架构结合了深度可分离卷积和Atrous空间金字塔池化(ASPP),以提高分割的准确性和效率。DeepLab v3+是一种先进的语义分割模...

gitblog_00072的博客 1260
上一篇: 基于FCN.tensorflow的实践
下一篇: 图像语义分割 DEEPLAB V3+的代码走读
magicyang1234
博客等级 码龄13年 65粉丝 51原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值