Achieve better performances with FOMO

Hi everyone,

I’m working on a project where I try to distinguish an hornet from bee using edge impulse on a ESP32 Cam Wrover Module. So far I just tested the recognition of an hornet alone.
I can easily detect an hornet when there is one and no object when there is nothing. However, when I put an other object in front of the camera, I still get an hornet. Even when I put my hand, I get an hornet as a result.

Do you have any idea how I can get better performances ?

Do you think distinguish an hornet from a bee is achievable ?

I used 454 images to train the model and used this model : " FOMO (Faster Objects, More Objects) MobileNetV2 0.1"

Project ID: 188017

Thank your for your help

Hello @Clem_gro,

I just checked your project and it seems that there is not much variance in your background.
In the background a FOMO model also has a background class on which the model is trained on.

This mean you could add picture of the background (with or without any hornet object) with your hand and with other objects. The background class will therefore be able to grab more things and it will make your hornet class prediction more accurate.

I suspect now everything that is not plain white is then considered as a hornet because, on your dataset, the probability of being a hornet is bigger.

That being said, collecting datasets is often very time consuming, @jimbruges just recorded a video on how to create synthetic images. I think for your use case, it could be worth trying:

Let me know if I was not clear enough.



Thanks for your reply and suggestion about this method from @jimbruges, I’ll give it a try.
Just a little precision, what would you recommand the most :

  • taking pictures of an empty background
  • taking pictures of a background with a lot of various random objects
  • include the hornet in those background pictures ?
  • Do all of the propositions above



Hello @Clem_gro,

So it will depend on the use case, if “in-production”, your camera will be pointing at a “clean” background without much details then no need to put too many details in your training set.

However, it will be placed in an unknown environment, better to add various background to make the background class more robust.

You can include hornets in those background, just make sure to label them as hornets otherwise the background class will also learn hornet features.



Great advice from @louis here!

One thing I’d add is to say one of the best investments you can make is to spend time building a test set that’s as representative to the real world problem as possible. If you have a good test set then the performance on that will give you the best guidance…

  • model isn’t doing well on the test set across different backgrounds? Get some varied backgrounds and retrain…
  • model is ok with background, but is confusing bees vs hornets? Get more examples with both and retrain…
  • and so on…

Always keep in mind though that getting extra data based on the performance of the test set is argubably cheating and you need to be wary :slight_smile: machine learning - What does it mean by overfitting the test set? - Artificial Intelligence Stack Exchange

Cheers, Mat


Hi Louis, thank you for those precious details. I hope I can get better performances following your advices !

Have a good one,


Hello Mat,

I’m grateful for the details you added, I guess i’ll try to strenghten our test set from now.

Thank you very much !