Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improved cat face cascades (lower false positive rate) #7097
This pullrequest changes
Re-trained the cat face cascades with more negative samples and more stages. False positives are much rarer now. If you tailored your code for the previous version of one of the cat face cascades, now you should re-adjust the arguments of CascadeClassifier::detectMultiScale. For example, decrease the value of the minNeighbors argument. You do not need to use a human face detector to cross-check the positives anymore.
haarcascade_frontalcatface_extended.xml has the lowest false positive rate but you should set its scaleFactor and minNeighbors relatively low to enhance its sensitivity. If you tweak the parameters carefully, you can probably get the most accurate results from this cascade but it is computationally relatively expensive.
haarcascade_frontalcatface.xml and lbpcascade_frontalcatface.xml are more sensitive but they need higher scaleFactor and minNeighbors values to keep the false positive rate low. lbpcascade_frontalcatface.xml is computationally cheapest.
I haven't used hard negative mining (though I will keep it in mind for the next version). I used your advice about choosing the number of stages based on a reported acceptance ratio of close to 10^(-5). I also saw that you recommended a higher proportion of negative samples than I was using, so I added a lot more negative samples of generic indoor and outdoor scenes. Finally, on your advice, I lowered the minHitRate from 0.999 to 0.995.
I ended up with the following inputs and parameters:
I will release the code for data acquisition, pre-processing, and training in another repo after the cascades are merged into OpenCV.