element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Save The Bees Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Save The Bees Design Challenge
  • More
  • Cancel
Save The Bees Design Challenge
Blog Bee Monitoring: Training the Model & Inferencing
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Save The Bees Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: aaryan2134
  • Date Created: 22 Apr 2023 9:41 PM Date Created
  • Views 429 views
  • Likes 5 likes
  • Comments 0 comments
  • save the bees
  • savethebeesch
  • nicla vision
  • Save The Bees - Design Challenge
  • edge impulse
  • mkr wan 1310
  • arduino
Related
Recommended

Bee Monitoring: Training the Model & Inferencing

aaryan2134
aaryan2134
22 Apr 2023

Blog List:

1. Bee Monitoring: Introduction

2. Bee Monitoring: System Design & Workflow

3. Bee Monitoring: Setting up Nicla Vision

4. Bee Monitoring: Training the Model & Inferencing

5. Bee Monitoring: Bee Hive Environmental Monitoring using Arduino MKR 1310

Introduction:

In this blog, I will carry forward from the last blog and work on completing the Bee Detection and counting model. I will also deploy the model on the Nicla Vision for offline inferencing. Other than that, I will work on and complete the bee hive sound model. Let's get started!

Bee Detection & Counting Model:

Impulse Design:

I used this post, to learn more about detecting and counting objects using Edge Impulse. It uses the FOMO model to do the task. FOMO (Faster Objects, More Objects) is a brand-new approach to run object detection models on constrained devices. FOMO is a ground-breaking algorithm that brings real-time object detection, tracking and counting to microcontrollers for the first time. FOMO is 30x faster than MobileNet SSD and can run in <200K of RAM.

I designed an impulse which detects the objects(bees) and provides the count as the output.

image

Generating features:

Next, I used the generate features function and the parameters to let edge impulse reduce the dimensions of the dataset.

image

Training:

Next part was the training of the model. The first training results were just better than 53% which wasn't too great. I tried it in the live classification and the results were all over the place.

image

image

Improved model: 

For making some improvements and to make the model usable, I did some hyperparameter tuning. The results got satisfactorily better though I believe there is scope to make it better with both, more data and more tuning.

image

image

image

Test the model:


Considering the small dataset of only 24 images, it was expected that the results would not be great. I was not surprised by the poor results. 

image

Offline Inferencing:

Once I design, train, and verify my impulse, I can easily deploy it to my Arduino Nicla Vision with Edge Impulse. This allows my model to run locally, without an internet connection, minimizing latency and power consumption. The entire impulse, including the signal processing code, neural network weights, and classification code, can be packaged into a single firmware that I can run directly on the Nicla Vision.

image

image

image

Finally done with this part!

Classifying sound around the bee hive:

For this part, I uploaded 6 sound files. I used a 50-50 split between training and testing for this case.

The 3 types of sounds were:

1. Active Day

2. Missing Queen

3. Queen Present

image

Impulse Design:

The process of impulse design was similar though the model was changed to Audio MFE and a classifier for the neural network. The ideas were taken from this post.

image

Feature Generation:

This was mostly about dimensionality reduction and pre processing data for finding patterns. This makes it easier for the neural network to clean and converge well.

image

image

image

Training:

The training results were pretty good. I kept a low learning rate to prevent overfitting and added some random noise to make it generalize better.

image

image

Testing & Evaluation:

This model produced pretty decent results though it struggled to identify the Missing Queen audio. This could be improved with more data and some more hyperparameter tuning. Though adding more data would increase the training times significantly so I couldn't do that here.

image

Live Classification also worked okayishly well. I run a few audio files that were not provided to the model and let them run through my PC's speaker and turned on live classification. The results were good mostly though the Missing Queen problem was still present in this scenario and no audio file was recognized as Missing Queen.

As previously, I built the offline build for this model as well and updated the firmware for the Nicla Vision.

Conclusion:

So, we are finally done with 2 models - one detecting and counting bees in images or video and the other classifying sounds around the bees to detect if the queen bee is there, they are having an active day or the queen is missing. Both models were tested and deployed to the Nicla Vision.

Though I don't have a real bee hive near me so I won't be able to test it out in the real life scenarios. But I tried to test those models out by running them at my PC and using the camera and inbuilt microphone to get the results. It was a fun good project to build. It needs some fine tuning for proper real time use though looks good enough for testing out in the real world.

Now, I will the conclude this blog series with building the Bee Environment monitoring system with Arduino MKR WAN 1310. Hoping to see you in the next blog!

Connect with Me:

Github - aaryan2134

Linkedin

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube