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

By Akanksha Gupta and Sagar Raj

- Advertisement -
 

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 recognise 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 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
- Advertisement -

Development and Working

  1. Download 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/
  13. Enter your name and email id
  14. Sign up for free and login to your account
  15. After that, run Edge Impulse using the following command
    • edge-impulse-linux
  16. If the connection is proper, then the Device section of the Edge Impulse Raspberry Pi cam will appear
  17. Here, you can take a photo of any object like a bottle, cup or any face
  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
  19. After this, go to dashboard and select Labeling Method. It should be bounding boxes (for object detection)
  20. Label all the objects via Labeling Queue
  21. Now go to Impulse design
  22. The image width and height should be 320×320
  23. Change the object detection project name

  24. Save Impulse
  25. In the Image section, configure the processing block and select raw data at top of the screen. You can save parameters either in RGB or grayscale
  26. Now go to Feature generate
  27. Due to different image dimensions, reduction will occur
  28. In the object detection section, the numbers for the Training Cycle and Learning Rate is 25 and 0.015, respectively

  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
  32. Now go to live classification. In real-time, an object is shown near the USB camera with the relevant label (like 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


Akanksha Gupta is M.Tech in ECE from NIT Jalandhar. Currently, She is a Research Scholar in the Electrical department from 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.

- Advertisement -

SHARE YOUR THOUGHTS & COMMENTS

Please enter your comment!
Please enter your name here

 
 

What's New @ Electronicsforu.com

Most Popular DIYs

Electronics Components

Design Guides

Truly Innovative Tech