Improved cat face cascades (lower false positive rate) #7097

Merged
merged 2 commits into from Aug 18, 2016

Conversation

4 participants
@JoeHowse
Contributor

JoeHowse commented Aug 12, 2016

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.

@StevenPuttemans

This comment has been minimized.

Show comment
Hide comment
@StevenPuttemans

StevenPuttemans Aug 12, 2016

Contributor

👍 nice update!

Contributor

StevenPuttemans commented Aug 12, 2016

👍 nice update!

@JoeHowse

This comment has been minimized.

Show comment
Hide comment
@JoeHowse

JoeHowse Aug 12, 2016

Contributor

@StevenPuttemans Thanks! I used your tips from OpenCV 3 Blueprints!

Contributor

JoeHowse commented Aug 12, 2016

@StevenPuttemans Thanks! I used your tips from OpenCV 3 Blueprints!

@StevenPuttemans

This comment has been minimized.

Show comment
Hide comment
@StevenPuttemans

StevenPuttemans Aug 12, 2016

Contributor

Could you expand on what you did exactly? Is it an example of the hard negative mining? Would be nice to have an actual sample that proves it works decently!

Contributor

StevenPuttemans commented Aug 12, 2016

Could you expand on what you did exactly? Is it an example of the hard negative mining? Would be nice to have an actual sample that proves it works decently!

@JoeHowse

This comment has been minimized.

Show comment
Hide comment
@JoeHowse

JoeHowse Aug 12, 2016

Contributor

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:

  • 9997 positive samples (same as the previous version). I used 90% of them per stage.
  • 8089 negative samples (including 3019 new samples). I used 90% of them per stage.
  • numStages=20
  • minHitRate=0.995
  • maxFalseAlarmRate=0.5

I will release the code for data acquisition, pre-processing, and training in another repo after the cascades are merged into OpenCV.

Contributor

JoeHowse commented Aug 12, 2016

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:

  • 9997 positive samples (same as the previous version). I used 90% of them per stage.
  • 8089 negative samples (including 3019 new samples). I used 90% of them per stage.
  • numStages=20
  • minHitRate=0.995
  • maxFalseAlarmRate=0.5

I will release the code for data acquisition, pre-processing, and training in another repo after the cascades are merged into OpenCV.

@StevenPuttemans

This comment has been minimized.

Show comment
Hide comment
@StevenPuttemans

StevenPuttemans Aug 12, 2016

Contributor

Great work! Thanks for the explanation!

Contributor

StevenPuttemans commented Aug 12, 2016

Great work! Thanks for the explanation!

@vpisarev vpisarev self-assigned this Aug 18, 2016

@vpisarev

This comment has been minimized.

Show comment
Hide comment
@vpisarev

vpisarev Aug 18, 2016

Contributor

thanks! 👍

Contributor

vpisarev commented Aug 18, 2016

thanks! 👍

@opencv-pushbot opencv-pushbot merged commit 00045bb into opencv:master Aug 18, 2016

1 check passed

default Required builds passed
Details

opencv-pushbot pushed a commit that referenced this pull request Aug 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment