Edge / IoT / Machine Learning

How I Built an ‘AIoT’ Project with Intel AI Vision X Developer Kit and Arduino Yun

11 Oct 2019 10:06am, by

IoT and AI are two independent technologies that have a significant impact on multiple industry verticals. While IoT is the digital nervous system, AI becomes the brain that makes decisions that control the overall system. The lethal combination of AI and IoT brings us AIoT (Artificial Intelligence of Things) that delivers intelligent and connected systems that are capable of self-correcting and self-healing themselves.

During the last couple of  years, AI has become extremely accessible to developers. From simple cognitive APIs to AutoML to the infrastructure required for training sophisticated deep learning algorithms, AI is not only accessible but also affordable. Industrial IoT is one of the key domains benefit from the infusion of AI.

To demonstrate the evolving concept of AIoT, I chose the combination of Intel AI Vision X Kit and Arduino Yun. For inferencing the ML model, I used Intel OpenVINO Toolkit.  For an introduction to Intel OpenVINO Toolkit, refer to my previous article.

A camera connected to the Vision AI X Kit acts as an intelligent image sensor that can detect objects through OpenCV and OpenVINO Toolkit. It publishes the labels of the detected objects to an MQTT topic to which the Arduino Yun devices are subscribed. When an object of interest is detected, Yun takes action by changing the state of an actuator. It could be as simple as changing the color of an LED or controlling a relay.

When it is deployed at a toll gate, the color of LED and the value shown in the display change based on the vehicle type.

This scenario also demonstrates how AI Vision X Kit is a powerful edge computing platform. In terms of hardware, the kit is powered by an Intel Atom x7-E3950 CPU, 8GB RAM, and 64 GB eMMC. The best thing about the kit is that it comes with an embedded Intel Movidius Myriad X Vision Processing Unit (VPU) to accelerate AI models. The OpenVINO Toolkit is configured to talk to the VPU through the Inferencing Engine plugin.

Being an x86 machine, the AI Vision X Kit runs fully-fledged Ubuntu 18.04 on which OpenVINO Toolkit is installed. I also installed Mosquitto MQTT server that acts as the message bus connecting the Arudino Yun-based microcontrollers. All the devices are connected to a local WiFi access point that provides the connectivity to the AIoT setup.

Below is a list of items used in this project:

Since the Intel AI Vision X Kit acts as an edge computing device responsible for object detection, we run an OpenCV-based application backed by Intel OpenVINO Toolkit that analyses the feed from the connected camera.

The deep learning model used for object detection is based on MobileNet SSD Caffe model.  We will download the model file using the downloader utility provided by OpenVINO Toolkit.

The below diagram depicts the high-level architecture of this solution.

You can find the MobileNet SSD V1 Caffe model in the ./model/object_detection/common/mobilenet-ssd/caffe/ directory.

The next step is to optimize this model using OpenVINO Toolkit’s Model Optimizer tool.

The FP16 directory under ./model directory has an optimized Caffe model that be used with OpenVINO Toolkit’s Inference Engine plugin. You will find the below files generated by the Model Optimizer:

We are now ready to utilize the optimized model with OpenCV.

The below lines of code load the optimized model and delegate the inferencing to Movidius Myriad X VPU.

When the detected object happens to be a car or a bus, a message gets published to MQTT topic with the actual label.

One of the Arudino’s controls the LED, based on the message published to the MQTT topic.

The other Arduino device shows the toll gate fee on a 7-segment display.

This tutorial leveraged AI along with IoT to demonstrate a real-world scenario.

Janakiram MSV’s Webinar series, “Machine Intelligence and Modern Infrastructure (MI2)” offers informative and insightful sessions covering cutting-edge technologies. Sign up for the upcoming MI2 webinar at http://mi2.live.

Feature image by SplitShire from Pixabay.

A newsletter digest of the week’s most important stories & analyses.

View / Add Comments
