Detection of close objects using CascadeObjectDetector

2 views (last 30 days)
I am trying to train a cascade object detector to work on non-human faces, but it doesn't detect them, especially when they are large (as in they take up a large part of the image). In my training set, I have around 50-something positive images per angle of face (front, 45 degrees, and profile. I have around 40 negative images, which are all backgrounds that do not contain positive instances. I've been running
trainCascadeObjectDetector('Front.xml', positiveimagestuctarray, negativeimagedirectory, 'FalseAlarmRate', 0.2, 'FeatureType', 'Haar', 'ObjectTrainingSize', [150,150]
to train the detector, but it fails after around 4 stages. When I try running it, it only detects small parts of the face, such as the eyes or random parts of the skin. Am I wrong to think that the object training size should be larger? When I try training at larger training sizes, it crashes with an out of memory error.

Answers (1)

Dima Lisin
Dima Lisin on 14 Jul 2014
The main issue here is that you need more training data. 50 positive samples and 40 negative images is very little, which is why training quits after 4 stages. It is simply running out of data. For a good detector you need hundreds, or better yet, thousands of positive samples, and a similar number of negative images.
Second issue: having a mix of front and profile faces in your training set is a bad idea, because they look very different. Typically you have to train separate detectors for front and profile.

Community Treasure Hunt

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

Start Hunting!