Training neural networks based on images
Show older comments
I trained neural networks with images as inputs. I was not sure how to do that. I did like this
a=imread('A.bmp'); %I have these image files
b=imread('B.bmp');
a=a(:); %To convert this into one column matrix
b=b(:);
x=[a b];
x1=double(x); %Input to the neural network
t=eye(2); %Target and there are two classes 'a' and 'b'
After this I trained the neural network(pattern recognition) and then it got trained and I stored the network in 'net'.
After this I tried this code to check my neural network
input=a; output=sim(net,input);
I got this error
Error in ==> network.sim>simargs at 236 switch class(P)
??? Output argument "Pi" (and maybe others) not assigned during call to "D:\MATLAB\toolbox\nnet\nnet\@network\sim.m>simargs".
Error in ==> network.sim at 173 case 2, [err,X,Xi,Ai,T,Q,TS,matrixForm] = simargs(net,X);
What is the problem? Is there any other way to solve my question which is training neural networks based on images.
Basically I don't know that much about neural networks in matlab so I would like to know if there is any tool in neural network that is specially used for image recognition.
NOTE: I trained neural networks without using images (just using normal sequences) and it worked perfectly. But I don't get the same for images. Plz help me.
Accepted Answer
More Answers (1)
padmavathi vattikonda
on 19 Dec 2016
0 votes
how to give an image as input for neural network and how to train it in matlab
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!