Friday, April 19, 2024

An AIoT Based Object classification Using Edge Impulse & Raspberry Pi Platform

Comment errors or corrections found for this circuit, and get the chance to win big!

Object detection wherein every activity gets displayed in a live classification or IP address is a trending topic nowadays. Taking advantage of this, if machines can also recognize objects as humans do, then it would be very interesting.

Using the Edge Impulse platform, users can train their AI, ML models without possessing deep knowledge of programming or AI, ML concepts. Edge Impulse is a cloud-based platform that incorporates computing in Raspberry Pi for acquiring live videos and images via a camera interface.

It could run on both intranet and the internet, thus helping experimenters and hobbyists to project their designs and develop various problem-solving applications. Some examples are:

  1. Live entrance door monitoring
  2. Unknown person alert
  3. Industrial object classification and separation using robotic arms
  4. Fruit counting on a tree or machine separator

Components Required

  1. Raspberry Pi 3 B
  2. USB camera
  3. Keyboard
  4. Monitor
  5. Mouse
  6. Edge Impulse website
  7. SD adaptor (32 GB)
  8. HDMI to VGA cable
  9. 5 V power adaptor with USB Type-C connector
  10. SD card reader

Object Classification using Raspberry Pi

Development and Working

  1. Download the Debian-based Raspberry Pi desktop imager on any PC
  2. Launch Raspberry Pi Imager
  3. Choose OS as Raspberry Pi OS (32-bit)
  4. Choose SD card
  5. Select Write
  6. Insert SD card into Raspberry Pi
  7. Connect Raspberry Pi to power supply, keyboard, mouse and monitor
  8. If OS is properly installed, then a new window saying “Welcome to Raspberry Pi Desktop” will appear
  9. Connect USB camera to take a photo
  10. Go to the RPi terminal
  11. Install below commands
    • curl -sL https://deb.nodesource.com/setup_12.x | sudo bash –
    • sudo apt install -y gcc g++ make build-essential nodejs sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
    • sudo npm install edge-impulse-linux -g –unsafe-perm
  12. Next, go to https://www.edgeimpulse.com/
    Edge Impulse Website
  13. Enter your name and email id

    Edge Impulse Login
    Edge Impulse Login
  14. Sign up for free and login to your account
    Edge Impulse Command
  15. After that, run Edge Impulse using the following command
    • edge-impulse-linux
    Run Command in Edge Impulse
  16. If the connection is proper, then the Device section of the Edge Impulse Raspberry Pi cam will appear
    Edge Impulse Raspberry Pi camRaspberry Pi Edge Impulse Setup
  17. Here, you can take a photo of any object like a bottle, cup, or any face
    Raspberry Pi Configuration
  18. In the Data Acquisition section, take at least 100 photos of the different objects for training and testing purposes. You can rebalance your data with a splitting ratio of 70:30
    Object Classification with Edge Impulse Preparing Edge Impulse for Object ClassificationObject Classification Project
  19. After this, go to the dashboard and select Labeling Method. It should be bounding boxes (for object detection)
    Edge Impulse Setup for object detection
  20. Label all the objects via Labeling Queue
    Edge Impulse Labeling QueueLabeling Queue in Edge Impulse Object detection using Edge Impulse
  21. Now go to Impulse design
  22. The image width and height should be 320×320
  23. Change the object detection project name
    Edge Impulse Dashboard
  24. Save Impulse
  25. In the Image section, configure the processing block and select raw data at the top of the screen. You can save parameters either in RGB or grayscale
    Edge Impulse Raw Data Edge Impulse Raw Data Feature
  26. Now go to Feature generate
    Edge Impulse Data Collection
  27. Due to different image dimensions, the reduction will occur
  28. In the object detection section, the numbers for the Training Cycle and Learning Rate are 25 and 0.015, respectively
    Object Classification Model
  29. Start training
  30. After training the model, get a precision score
  31. For validating your model, go to Model Testing and select Classify all
    Edge Impulse Model Testing Object Classification Model Testing IoT based object Classification
  32. Now go to live classification. In real-time, an object is shown near the USB camera with the relevant label (like a bottle or cup)
  33. If you want to see with IP address, run the following command in the RPi terminal
    • edge-impulse-linux-runner
  34. Build and download model in Raspberry Pi
  35. Enter the IP address as http://192.168.1.19:4912 for live classification in Raspberry Pi

Object Classification with Raspberry Pi Object Classification System Object Classification DIY DIY object detection system

- Advertisement -

Akanksha Gupta is M.Tech in ECE from NIT Jalandhar. Currently, She is a Research Scholar in the Electrical Department at IIT Patna.

Sagar Raj is a Founder & Director at LIFEGRAPH BIOMEDICAL INSTRUMENTATION Pvt Ltd (incubated at IC-IIT Patna) and Shoolin Lab Jaipur. He works in the domain of IoT and Embedded systems.

SHARE YOUR THOUGHTS & COMMENTS

Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators