具有各种输入的完全卷积网络 [英] Fully Convolution Networks with Varied inputs

查看:70
本文介绍了具有各种输入的完全卷积网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个完全卷积的神经网络U-Net,可以在下面阅读.

I have a fully convolutional neural network, U-Net, which can be read below.

https://arxiv.org/pdf/1505.04597.pdf

我想用它对图像进行像素分类.我有两种尺寸的训练图像:512x512和768x768.我在初始步骤中使用前者大小为(256,256,256,256)的反射填充,而在后者中使用大小为(384,384,384,384)的反射填充.我在卷积之前进行连续填充,以获取输入大小的输出.

I want to use it to do pixelwise classification of images. I have my training images available in two sizes: 512x512 and 768x768. I am using reflection padding of size (256,256,256,256) in the former in the initial step, and (384,384,384,384) in the latter. I do successive padding before convolutions, to get output of the size of input.

但是由于我的填充取决于图像/输入的大小,所以我无法建立通用模型(我使用的是Torch).

But since my padding is dependant on the image/input's size, I can't build a generalised model (I am using Torch).

在这种情况下如何填充?

How is the padding done in such cases?

我是深度学习的新手,任何帮助都会很棒.谢谢.

I am new to deep learning, any help would be great. Thanks.

推荐答案

您的模型将仅接受第一层大小的图像.您必须对所有它们进行预处理,然后再将它们转发到网络.为此,您可以使用:

Your model will only accept images of the size of the first layer. You have to pre-process all of them before forwarding them to the network. In order to do so, you can use:

image.scale(img, width, height, 'bilinear')

img将是按比例缩放的图像,widthheight是模型第一层的大小(如果我没记错的话是572 * 572),'bilinear'是它的算法将用于缩放图像.

img will be the image to scale, width and heightthe size of the first layer of your model (if I'm not mistaken it is 572*572), 'bilinear' is the algorithm it is going to use to scale the image.

请记住,可能有必要提取图像的均值或将其更改为BGR(取决于模型的训练方式).

Keep in mind that it might be necessary to extract the mean of the image or to change it to BGR (depending on how the model was trained).

这篇关于具有各种输入的完全卷积网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆