如何将图像输入到神经网络? [英] How to input the image to the neural network?

查看:2420
本文介绍了如何将图像输入到神经网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解神经网络如何工作的方式,但如果我想使用它们进行图像处理,实际上是字符识别,我不能理解,我怎么能输入图像数据到神经网络,如果我可以有一个 A 信的非常大的形象!

I understand the way how neural networks work, but if I want to use them for image processing, actually character recognition, I can't understand, how can I input the image data to the neural net, if I can have a very big image of an A letter!

可能是我应该尝试从图像中获得一些信息,一些图像的规格,然后使用该规范的值的向量?

May be I should try to get some info from the image, some specifications of the image, and then use a vector of values of that specification?

它们将是神经网络的输入,他们已经做了这样的事情,请你能解释我的问题吗?

And they will be the input for the neural net, who have already done such a thing, please can you explain me my problem?

推荐答案

最简单的解决方案是将所有图像标准化,无论是训练和测试,都具有相同的分辨率。此外,每个图像中的字符应该大约相同的大小。使用灰度图像也是一个好主意,因此每个像素只会给你一个数字。然后,您可以使用每个像素值作为您的网络的一个输入。例如,如果您有大小为16x16像素的图像,您的网络将有16 * 16 = 256个输入神经元。第一个神经元将看到像素的值在(0,0),第二个在(0,1),等等。基本上,你把图像值放入一个向量,并将这个向量送入网络。这应该已经工作了。

The easiest solution would be to normalize all of your images, both for training and testing, to have the same resolution. Also the character in each image should be about the same size. It is also a good idea to use greyscale images, so each pixel would give you just one number. Then you could use each pixel value as one input to your network. For instance, if you have images of size 16x16 pixels, your network would have 16*16 = 256 input neurons. The first neuron would see the value of the pixel at (0,0), the second at (0,1), and so on. Basically you put the image values into one vector and feed this vector into the network. This should already work.

通过首先从图像中提取特征(例如边缘),然后在这些特征上使用网络,你可以提高学习速度,也使检测更加健壮。你在这种情况下做的是结合先验知识。对于字符识别,您知道某些相关的功能。因此,通过提取它们作为预处理步骤,网络不必学习这些特征。但是,如果您提供错误的,即不相关的功能,网络将无法学习图像 - >字符映射。

By first extracting features (e.g., edges) from the image and then using the network on those features, you could perhaps increase the speed of learning and also make the detection more robust. What you do in that case is incorporating prior knowledge. For character recognition you know certain relevant features. So by extracting them as a preprocessing step, the network doesn't have to learn those features. However, if you provide the wrong, i.e. irrelevant, features, the network will not be able to learn the image --> character mapping.

这篇关于如何将图像输入到神经网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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