Training neural networks based on images
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Walter Roberson
2011-10-9
This has been asked by several people in several years, but solid answers seem to be scarce on this.
I did find a posting in which one person discovered that things started to work for them when they changed their input data type to double. See http://www.mathworks.com/matlabcentral/newsreader/view_thread/99987
Notice that in your code, "a" is still the data type of the original image.
更多回答(1 个)
padmavathi vattikonda
2016-12-19
how to give an image as input for neural network and how to train it in matlab
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Pattern Recognition and Classification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!