how to train a bag of words for pattern recognition problems in neural network

조회 수: 1 (최근 30일)
Newman
Newman 2016년 7월 7일
댓글: Greg Heath 2016년 8월 14일
hello I am using bag of words concept to encode images as 500 visual words to represent as feature vector.
I was partitioning the data set using 70 /30 percent criteria for training and testing. I was creating two bag of words and for training and testing and also encoding them with their respective results.This I think is a fundamental mistake as the vocabulary encoding has to be done from the whole image data set that is 400 images and not 320 and 80 or 280 and 120 images (70/30).
So I created an entire bag of words for 400 images total and with a default vocabulary of 500 visual words.And then I encoded 280 images for the training set from it and then 20 query images for testing phase from it (from the testing partition).
Is it method correct or do i need to separately create two bag of words?
  댓글 수: 1
circuit_designer5172
circuit_designer5172 2016년 7월 7일
What is the goal here? The input is the picture and you are trying to encode it as the BoW vector? You mention the feature vector is the BoW, so what is your output? You need to have a target in order to train the network. Thanks.

댓글을 달려면 로그인하십시오.

답변 (1개)

Greg Heath
Greg Heath 2016년 7월 7일
편집: Greg Heath 2016년 8월 14일
The general assumptions are
1. training and nontraining (i.e., validation, test and unseen data)
have the same summary statistics
2. Statistics of the training set are used to design the net.
3. Investigations of nonstationary statistics are implemented to
explain significant differences between performances
on training and nontraining data.
Hope this helps
Thank you for formally accepting my answer
Greg
  댓글 수: 2
Newman
Newman 2016년 7월 8일
Dear Sir are you saying this :
%creating a imageset of 400 faces of 40 individuals (10 images per image)
facedatabase=imageSet(imdataloc,'recursive');
%extracting SURF features fromeach image of the training data
extractorFcn = @exampleBag;
bagofall= bagOfFeatures(facedatabase,'CustomExtractor',extractorFcn );
% split the database in according to the user split
[training,testing]=partition(facedatabase,[0.7 (1-0.7)]);
%
featureVectortraining =(encode(bagofall,training))';
%creating the test feature vector
featureVectortest =(encode(bagofall,testing))';
The featureVectortest will the test set
Is this correct?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by