matpalm / bnn

bee detection tensorflow conv net for a rasp pi on side of a hive
http://matpalm.com/blog/counting_bees/
MIT License
405 stars 67 forks source link

Detecting hornets #10

Open klorydryk opened 6 years ago

klorydryk commented 6 years ago

Hi,

I applied this process to an image sequence from a video of hornet attacking my hives. But in the end, nothing is detected in the "predict_example" series: frelon3304 png I can give a link to the training files I used: https://rogerlambda.info/nextcloud/index.php/s/oH7Ck8CGBDojg78 and the test files : https://rogerlambda.info/nextcloud/index.php/s/KKWZxBeYS8LMGAP

What do you think? Too few hornets in the image (one or 2 visible in the same time) ? Bad background? Too few images (70 and 90) labelled?

Thanks!

matpalm commented 6 years ago

one thing that i normally do just to make sure things are generally wired ok is to use just a single image as the training and test set. it should be the case that the model gets it perfect; and if it doesn't there is something going on. do you want to give that a go? (a single image should also be the fastest to converge)

i have a run_sample_training_pipeline.sh script that does a real quick sanity check, but i should port that to one that does full convergence on a single image... TODO! :)

klorydryk commented 6 years ago

This way seems to work. frelon3114 png

squeakus commented 6 years ago

I think there may be something wrong with the blurring in the label image. It normally has clear white pixels where the label is. Just check it is using nearest neighbour interpolation

On Thu, 4 Oct 2018 at 23:20, Klorydryk notifications@github.com wrote:

This way seems to work. [image: frelon3114 png] https://user-images.githubusercontent.com/1232047/46506370-4f5ab780-c834-11e8-8f56-8392effc7b05.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matpalm/bnn/issues/10#issuecomment-427188186, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKP9cHzKfgzl8IF8SK6dUJO60eE8_Axks5uhomSgaJpZM4XE7k9 .

matpalm commented 6 years ago

i've also committed 9969eada39ad549 which includes a --pos-weight flag for weighting the +ve case (a hornet) higher than the negative case (no hornet). i've added this to help with the class imbalance problem (a lot fewer hornets than not). for my bee case --pos-weight 5 really speeds up convergence. you might like to try 5 or 10 even too. cc @squeakus

klorydryk commented 6 years ago

New set of images, I hope better to find hornet because of the blue sky. Trying with only one picture : image Result of predict with train.py --pos-weight 5: yt2_65 jpeg

Is it the result I should be waiting for?