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 Bees Monitor With Predators Repellent # 3 - Edge Impulse
  • 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: guillengap
  • Date Created: 6 Mar 2023 12:43 PM Date Created
  • Views 748 views
  • Likes 7 likes
  • Comments 2 comments
  • save the bees
  • savethebeesch
  • nicla vision
  • openmv
  • lora
  • edge impulse
  • mkr1310
  • arduino
Related
Recommended

Bees Monitor With Predators Repellent # 3 - Edge Impulse

guillengap
guillengap
6 Mar 2023
Bees Monitor With Predators Repellent # 3 - Edge Impulse

Table of Contents

  • Introduction
  • Getting Started
  • Edge Impulse
  • Improving Edge Impulse Model
  • Testing The Machine Learning Model With OpenMV
  • Adding The Water Sprayer System
  • Testing The Water Sprayer System
  • IoT Ambient Monitoring System | Part1
  • IoT Ambient Monitoring System | Part2
  • Summary

**********************************************************************************************************************

In this post I will show you the first approaching to Edge Impulse to implement it in my project. Edge Impulse provides the ultimate development experience for ML on embedded devices for sensors, audio, and computer vision, at scale. It enables the deployment of highly-optimized ML on hardware ranging from MCUs to CPUs and custom AI accelerators.

image

All Edge Impulse developed algorithms are licensed under Apache 2.0, without royalties. This means that you completely own your algorithms, and no royalties exist when it comes to deploying them. For Developer Community, I opened Free account for individual developers which is used to deploy innovative ML on any edge device. Project main features: 20 min per job, and 4GB or 4 hours of data per project. Here you can open the account: https://www.edgeimpulse.com/
Once we enter the account, I have created the "bee-or-spider" project which will help me to detect a bee or a spider, we simply click on the "Create new project" icon as shown below.
image

Adding Devices

In the "Devices" tab I have connected the Arduino Nicla Vision board as shown below.

image

Arduino CLI Installation

How to connect the device? I followed the steps indicated in the official documentation at this link: Arduino Nicla Vision

I installed Edge Impulse CLI Windows version. All the steps to install Edge Impulse CLI you can find here: Edge Impulse CLI

Another option to Install Arduino CLI with pre-built binaries: Arduino CLI

Here I show you the downloaded files:

image

Open command prompt and run "flash_windows.bat".

image

We can check the installation by running: "arduino-cli" as shown below

image

Once the Arduino CLI is installed, you can connect to edge impulse with the command edge-impulse-daemon. I type my username and password, and once the Nicla Vision device is connected I choose the "bee-or-spider" project.

image

Finally, the system asks me what name I want to give to the connected device? I wrote "nicla-vision-gp"

image

Now the device is ready to use the Arduino CLI.

image

Data Acquisition

A good training model with Machine Learning needs a lot of images, hundreds or maybe thousands of photos. In addition, the images must be different, and its not possible to put repeated images. I got a lot of dataset bee and spider images on the kaggle website

There are two ways to upload images to the project created in Edge Impulse, the first is using the tab tool: Upload data - Upload existing data

image

The other method is to use OpenMV with the tab: Tools - Dataset Editor - Export - Login to Edge Impulse Account and Upload to Project

image

Here I show you the image class called: bee

image

Now, the image class called: spider

image

And finally the image class called: blank, which helps us to identify any object that is not a bee or a spider.

image

In total I uploaded 1200 images as follows: 500 images of the bee class, 500 images of the spider class, and 200 images of the blank class.
For the system to generate a good model, it is necessary to use 80% of the images as training and 20% as test.

Impulse Design - Create Impulse

In the "Impulse design" tab, we open the "Create Impulse" section. We leave the default values of the Image data resource of 92x96 pixels. Add the resources "Image" and "Transfer Learning (Images)" as shown below. Finally click on the "Save Impulse" button

image

Create Impulse - Image

Now we open the "Image" section to verify the images of the classes and click on the upper section "Generate features"

image

Click on the "Generate features" button

image

After a few minutes the next features are generated.

image

Impulse design - Transfer learning

Now we open the "Transfer learning" section and leave the default values.

image

Click on the "Start training" button and after a few minutes the following training model is generated.

image

As we can see there is a precision of 70.5% and a loss value of 0.89. This means that its an average model, that is to say that its not good but its not bad either, so it needs changes to improve the model, and I will make these changes later. In the confusion matrix describes the performance of the classification model, and I can figure out where changes need to be made to improve the model.

image

Deployment

Finally we go to the "Deployment" tab. Here I select to create the "OpenMV" library and click on the "Build" button.

image

After a few minutes, the library is successfully generated and the next message opens:

image

The library is automatically downloaded to our PC computer (ei-bee-or-spider-openmv-v1.zip).

Conclusion:

  1. I already showed you the first steps of how I am going to use Edge Impulse to make a machine learning model in my project;
  2. In my first attempt I reached 70.5% accuracy, and loss of 0.89 for the moment;
  3. But my goal is to get an accuracy above 94%, and a loss below 0.10; and
  4. As you can see this is not as easy. For now, I have finished this post, and in the next post I will improve my model and show you how to implement it on my "Nicla Vision" board.
  • Sign in to reply
  • guillengap
    guillengap over 2 years ago in reply to dougw

    Thanks for your comment! Have a nice day!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 2 years ago

    Nice description of your process.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
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