How to Create Image Input Layer using Neural Network Using JPG Images ?

6 views (last 30 days)
How to Create Image Input Layer using Neural Network Using JPG Images ?

Answers (1)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH on 21 Sep 2017
You must take into account that an image is a matrix of pixels, if it's an colored imaged then its size is length*width*3 (which gives the number of elements of that matrix), if it's a grey scale image then its size is length*width (which gives the number of elements of that matrix). Each pixel should be used as an input, that's why you should convert your image so that it has only one column, like this:
A = imread('ngc6543a.jpg');
s=reshape(A,[],1);
The problem here is, that you have 1170000 input elements per image, and your neural network could run slowly or it couldn't handle that much data, so for this case it should be better to extract the most representative characteristics of an image, so that the amount of those characteristics can be used as the input for each image instead. Another alternative is to use an Convolutional Neural Network so you can work directly with images, but the proccessing time for this kind of neural network is longer.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!