Pollen Notebook, Spring 2008
Jan 17
Changes to labelGUI
- There is a "Next" button which automatically jumps to the next image - Jim had to spend hours selecting the next image by hand each time.
- Sometimes the pollen grains are almost impossible to see so I implemented a new high-contrast mode.
Jan 15
Pietro reminds me that we need to document not just how classifypollen
works, but how th learning phase works too.
I'll write this in a more complete form but, for now, this is what needs to be run:
- Generate sift features for training set
>> cd ~/pollen/images3 % put test images here >> siftargs= {[48 48] 1.0 0.9 .1 [6 2]}; % this must match the values used at runtime in <code>classifypollen >> makesift(0,1,getcategories,'~/pollen/sift3',siftargs{:}); % convert images to sift features
- Pick training set and generate histograms and matching kernel:
>> cd ~/pollen/sift3; >> files1600= pickfiles(getcategories,1600); >> makehist(getcategories,'../hist3/1','1600_000_200',files1600,{});
The reason for using the above syntax is that the usual makehist
syntax, ie.
makehist(getcategories,'../hist/1',1600,0,200)
,
assumes that ntrain is the same across all categories. That was my usual approach in the Caltech-101/256. In the pollen dataset there are vastly different numbers of images in each category, which is why I'm using a slightly more "manual" approach by running pickfiles
to get different numbers of training images per category.
I've actually run 5 different instances of the above: 1 each of ntrain=1600,9999 and 3 each of ntrain=400. This is so that I can compare performance as a function of ntrain, but also so that I can try a "best 2 guesses out of 3" approach. But in practice you need only run ntrain=1600 as shown above - this is a high enough value of ntrain for good classification results.
- Learn classifier. This takes about 6 minutes for ntrain=400 and 30 minutes for ntrain=1600:
cd ~/pollen/hist3; hist= loadmat('hist',1600,0,200); [ctrain,cats]= file2class(hist.ftrain); makesvm(1600,0,200,'ctrain',ctrain,'skiptest',true);
For the impatient, here's a shortcut that does the same thing:
cd ~/pollen/hist3; pollensvm(1600,0,200);