So I'm trying to contruct a simple binary classifier.
Problem: Classify an image as containing the apple logo, or not.
I'd like it to be distortion, color, size and rotationally invariant. I'm sure that Classify[] should be able to handle this problem given the data. I have a set of positively and negatively labeled images you can download from this link, it's a file called PositiveAndNegativeAppleData.zip (about 20 mb).
Here's how to get my code going:
dir =(*path to dir containing unzipped folders*);
ndir = FileNameJoin[{dir, "negative"}];
pdir = FileNameJoin[{dir, "positive"}];
nfiles = FileNameJoin[{ndir, #}] & /@ Import[ndir];
pfiles = FileNameJoin[{pdir, #}] & /@ Import[pdir];
CloseKernels[]; LaunchKernels[16];
negative = ParallelMap[Import, nfiles];
positive = ParallelMap[Import, pfiles];
trainingData = <|"Apple" -> positive, "None" -> negative|>;
c = Classify[trainingData,
Method -> {"SupportVectorMachine",
"KernelType" -> "RadialBasisFunction",
"MulticlassMethod" -> "OneVersusAll"},
PerformanceGoal -> "Quality"]
I still haven't been able to obtain a ClassifierFunction with high accuracy. I'd really appreciate some insight here, seems like a standard problem.
Classify
do. May be a combination withMorphologicalComponents
will give you better results. P.S. I'm not a professional in this area. $\endgroup$