I don't know if anyone here can help me understand the image classification sample that come with Accord.NET
I try it with the default images and everything is beautiful and perfect. Then, I modify the code a bit to load image that are not "dolphins" and put them in the test list for dolphins image.
I was very surprised that the multiple image of cats that I put in the test of dolphins turns out green ... The rate at the bottom was like 95% when almost half of the image were cats instead of dolphins...
Is it me that doesn't understand something or is this application very weak? I could understand that between a cats and a dog it could be difficult but between dolphins and cats, the difference seems obvious.
Anyone can help me understand what is going on?
Thanks a lot and have a good day!
J-F
If you give the algorithm 2 training classes, the testing data will be classified within these 2 classes. So if I put dolphin in the testing data but I only train for cats and sunflowers, it will need to decide if a dolphin looks more like a sunflowers or a cat.
So to have a system that is very precise, you must create a LOT of categories.
Hope it helps!
J-F
Thanks for the clarification. I will try ProbalisticOutputLearning and see if I can modify it for my needs.
Do you know if it's possible to use another feature detector than SURF for this algorithm? I know that the SURF algo is patented in the US (I am in canada but there are possibilities that someone in the u.s buy our product) and I would like to avoid dealing with lawyers to know if we can use it or not.
Thanks!
J-F
But do you have an example of how to specify FAST? I can't find the place where it's done. I've also started your suggestion about the probalisticOutputLearning but I'm still too much of a newbie in Accord.NET to be able to do this modification right now. :) Will try it later when I'll be better!
// Train the machines. It should take a while.
double error = ml.Run();
ml = new MulticlassSupportVectorLearning(ksvm, inputs, outputs);
// Configure the learning algorithm
ml.Algorithm = (svm, classInputs, classOutputs, i, j) =>
{
return new ProbabilisticOutputLearning(svm, classInputs, classOutputs);
};
double likelihood = ml.Run();
int actual = ksvm.Compute(input);
double probability;
int actual = ksvm.Compute(input, MulticlassComputeMethod.Voting, out probability);
In the code below, I don't understand how to change SURF for FAST(and it's version 2.8.2 so it should have the option). I've search the constructor and parameter but no luck...
// Create bag-of-words (BoW) with the given number of words
BagOfVisualWords bow = new BagOfVisualWords(bs);
if (cbExtended.Checked)
bow.Detector.ComputeDescriptors = SpeededUpRobustFeatureDescriptorType.Extended;
MoravecCornersDetector moravec = new MoravecCornersDetector();
CornerFeaturesDetector detector = new CornerFeaturesDetector(moravec);
var bow = new BagOfVisualWords<CornerFeaturePoint>(detector, numberOfWords: 10);
Is FREAK detector available in Accord.NET? I know it has been implemented in OpenCV and compared to SURF it seems very good (see this blog: http://computer-vision-talks.com/2012/08/a-battle-of-three-descriptors-surf-freak-and-brisk/ )
I will try the code you posted. Keep up the good work, very nice framework!
By the way, I sent you a message on your blog on the Decision Tree article that you did with some correction of the code and question about something.
Have a good day
double probability;
int actual = ksvm.Compute(input, MulticlassComputeMethod.Voting, out probability);
if (probability == 1)
{
item.BackColor = Color.LightGreen;
if (item.Group.Name.EndsWith(".train"))
trainingHits++;
else trainingHits++;
}
else
{
/*
if (expected == actual)
{
item.BackColor = Color.LightGreen;
if (item.Group.Name.EndsWith(".train"))
trainingHits++;
else testingHits++;
}
else
{*/
item.BackColor = Color.Firebrick;
if (item.Group.Name.EndsWith(".train"))
trainingMiss++;
else testingMiss++;
//}
}
Thanks a lot!