How to choose an appropriate set of negative samples?

asked 2016-09-27 00:03:08 -0600

roboteyes gravatar image

updated 2016-09-27 01:20:57 -0600

So I'm not sure exactly how much time and effort I should be spending on preparing my negative picture sets.

I usually just choose backgrounds that I think I'll encounter, which don't contain the entity I'm searching for. Also, I don't have a general rule of what the general dimensions should be, relative to the positive sample sizes.

See my images below:

image description

Now my question is, how much does your negative set impact the overall quality of your detector? Does the trainer slice up the negative images into sub-windows, and then walk across it in some order, or is it random? Does the trainer scale or crop the negative images? Is it worth the time customizing the negative set? Not much is said in the Viola Jones paper, but from what I can surmise, it seems like they used random regions from random photos.

And thank you for spending your time on my question!

edit retag flag offensive close merge delete

Comments

what about: "any surroundings likely to contain a cat, but hasn't one in it" ? (which makes A a bad one)

you can rule out C (detection is multiScale already) and D (you need larger neg images, so it can randomly crop several negative windows from it)

berak gravatar imageberak ( 2016-09-27 00:09:05 -0600 )edit

I understand that DetectMultiscale scales the feature window when detecting; however, this is after the fact. I'm wondering if a specific negative set can influence the train, or if it's simply not worth the time and effort. Thoughts?

roboteyes gravatar imageroboteyes ( 2016-09-27 01:19:20 -0600 )edit
1

Simply said, YES it matters. The content of both positive and negative dataset define how the seperation plane is moddeled. Getting meaningful different samples for your case will always increase a cascades efficiency! BTW, the cropping of negative windows is NOT random in OpenCV, its in a sliding window manner with a fixed multiscale step size!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-09-27 06:57:22 -0600 )edit

Steven, ok, now this is a really interesting statement. I've verified this behavior in imagestorage.cpp... left-right-top-bottom. So what this means, is a 240x240 negative image with a window size of 24x24 has 100 samples. There is so much emphasis on having lots of negatives, but people might not realize that they can simply use slightly larger dimensions and get an increase by 2 orders of magnitude. What this means however, is that sample choice is a crucial step. If your negs are all 1280x720 for example, you would have several regions with extremely low frequency information when cropped to 24x24. Likewise small negs would have too much.

roboteyes gravatar imageroboteyes ( 2016-09-27 16:17:33 -0600 )edit