machine learning - Bag of features and Neural Networks in Matlab -


i've been trying implement neural network in matlab capable of recognizing images based on features. attempting use bag of features/words approach obtain discrete vector of features can feed neural network.

i have been using example guide - http://in.mathworks.com/help/vision/examples/image-category-classification-using-bag-of-features.html

one line in code (featurevector = encode(bag, img);) counts word occurrences in image. use "featurevector" matrix train neural network? , have encode every single image in training set?

yes that's possible. looking @ example, training dataset set of images , finding common vocabulary of 500 "words" / features describes of them adequacy. using featurevector = encode(bag, img);, doing determining fraction of each word exists describe input image img. specifically, if @ code in example section, plot bar graph horizontal axis represents word index , vertical axis represents fraction each word / feature in vocabulary used represent image.

specifically, bar graph gets produced (taking link):

therefore, similar images should described similar features / words , use input neural network.

however, before train neural network, suspected, must represent every image wish train feature vector. if intend use matlab's neural network toolbox, must make sure each column input sample , each row feature. featurevector return 1 x n vector n total number of features. however, if want more smartly, create imageset of of images want transform: http://www.mathworks.com/help/vision/ref/imageset-class.html, use 1 call encode create desired feature matrix:

imgfolder = '...'; %// specify image folder here imgset = imageset(imgfolder); %// create image set featurematrix = encode(bag,imgset).'; %// encode images - make sure transpose 

the result m x n matrix m total number of input images have , n total number of features. respect neural networks toolbox, must transpose matrix because each column needs input sample, not each row.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -