earthrise-media / plastics

Other
14 stars 7 forks source link

Create peak detection method as an alternative to blob detection #12

Closed clkruse closed 3 years ago

clkruse commented 3 years ago

The pixel classifier produces a classification heatmap. We've used blob detection to identify candidate points of interest from the heatmap. However, blob detection is slow, quite sensitive to unintuitive hyperparameters, and disqualifies candidates below a size threshold as a rule. Additionally, I had to create a system to

Here, I'm adding a peak detection method. Details on the method are at skimage.feature.peak_local_max.

Peak detection is more susceptible to single-pixel noise hotspots than blob detection. However, you can increase the threshold to a higher level than blob detection because the algorithm does not require multiple contiguous pixels to identify a candidate.

In a test on Bali, peak detection was able to find more dump sites than blob detection, but also had a greater false positive rate. I think this tradeoff is acceptable now that we have a second stage classifier.

Note: I'll need to incorporate the changes from #9 into this notebook, but they won't conflict.

Here's an example of a candidate identified by peak detection, but not blob detection: image

clkruse commented 3 years ago

@eboyda FYI, as we talked about this morning, I changed the peak detection thresholding from relative values to absolute. In tests on Bali, this did cause the classifier to miss one TPA site on Bali, but I still think it's the right thing to do.