Edge AI: Inference of Tensorflow Mobilenet SSD Model on BrainyPi

by svibhav03 in Circuits > Raspberry Pi

119 Views, 4 Favorites, 0 Comments

Edge AI: Inference of Tensorflow Mobilenet SSD Model on BrainyPi

image_2024-05-08_005046851.png

In modern manufacturing companies, there is a need for efficient and reliable classification and counting of packaged products as they pass on a conveyor belt. A well trained object detection model will make this highly efficient and minimize human error.

After training such an object detection model, it is equally crucial to be able to deploy it efficiently on the target device, a conveyor belt monitoring apparatus in this case. This is where Edge AI comes in.

Edge AI is nothing but the deployment of artificial intelligence algorithms and models directly onto remote devices or edge devices, such as smartphones, IoT etc. instead of relying on pulling in data from the cloud.

Supplies

brainypi_breadboard_front-1-1024x1024.png
  • BrainyPi
  • Linux OS Terminal

Containerize

Docker containerization is a technique used to package software applications along with all their dependencies into standardized units called containers. Using Docker to run inference code on a Linux VM provides an efficient and consistent environment for deploying AI models, and developers can verify the proper model inference on docker before actual remote deployment on edge device. Refer to https://gitlab.iotiot.in/interns-projects/monitoring-assembly-line for steps to containerize your model.


Remote Connection to BrainyPi

ssh.PNG

Brainy Pi is a new cutting-edge ARM Single Board Computer built for AI on Edge and IoT applications. It offers enterprise-grade support to transition your prototypes into fully customized hardware and software solutions. With its robust capabilities, Brainy Pi enables real-time AI processing directly at the edge.

We will be using secure shell (SSH) to remotely establish connection to BrainyPi. We establish connection using the following command:

ssh -X pi@auth.iotiot.in -p 65530

after entering the connection password we have successfully established connection to BrainyPi.

Installing Dependencies

installing.PNG

Next, we clone our repository, which contains all the necessary files like test images, tensorflow SavedModel, tfrecords, inference code, etc.

git clone https://gitlab.iotiot.in/interns-projects/monitoring-assembly-line.git

Move into the project folder, and install all necessary dependencies like tensorflow, opencv-python-headless, tensorflow-object-detection-api etc. Refer to the Dockerfile in above repository for all necessary dependencies.

inference_done.PNG
output_image_8.jpg

Finally we create a new folder to save our output images, and run inference on our test images.