This function saved me an incredible amount of time. Instead of taking crops of an image and then finding features in those crops, this function just finds features of an image.
In this function, we are given a folder full of images that we know to contain no faces. We run our detector on these images and any face detections we get we know to be wrong. We can then use the most confident of these detections to train against crops like this. So get_hard_negatives gets detections and then turns the detections into bounding boxes, which in turn becomes a crop. The crops with the highest confidence ratings are then returned back to the pipeline.
All the results below are achieved with a num_negative_examples of 5000, a step_size of 2, and a start_scale of 2 and a linear classifier
Only mining random negatives
Interesting errors:
Mining hard negatives 5x:
Interesting errors:
Mining hard negatives 1x with non-linear:
Previous errors fixed by running non-linear:
Matlab crashed after I found this one so I didn't have time to save any other images that fixed the errors shown above, but they were there I promise.