web-based Application with Edge AI Inference

Introduction

In recent days the creation of various web-based application with AI implied the choice of using a cloud architecture This structure can be achieved by creating a REST-API like architecture. The generic structure of this process is the following:

  • There are sensors (i.e. a camera) which create information;
  • Secondly cloud receives the information from the collector;
  • Then cloud performs the AI tasks and return results;
  • Finally sender uses the results of the inference for its purposes.

However, previous proposed web-based application system has three drawbacks:

  • First, it needs an high speed internet connection (with its highly associated costs) to allow continuous server-client data interchange;
  • Second, it loses the property of real-time, due the transferring of multimedia content to the cloud;
  • Last it overloads the cloud with heavy tasks such as the ones needed by AI and ML.

In the following article we will briefly introduce how it is possible to mix web-based application and Edge AI, to soften the problems of the points 2 and 3 of the previous list.

Setup of the Web-Based application System

In order to use web-based application on our board, we will need two major dependencies:

  • Chromium, an open-source browser which is available also in linux-based systems;
  • Electron, an open-source framework to build web based GUI applications. It needs chromium and NodeJS as dependencies to be built.

Consequently, our choice is going to be toward a board with three main characteristics. It must:

  • be able to have a CPU capable of supporting Electron;
  • have an HDMI output with an integrated GPU capable of doing rendering operations on an external display;
  • have an embedded accelerator for our AI & ML operations.

From the previous we extracted as a possible candidate the new Xilinx KRIA SOM.

The systems perfectly fits our necessities for our web-based application with Edge AI. It has:

  • a Quad Core A53 at 1.5GHz, which is able to support Electron and Chromium CPU operations;
  • one HDMI output with a GPU Mali 400 dedicated;
  • a DPU B4096 in the PL which accelerates CNN operations.

To enable Chromium on the KRIA SOM, we need to append it during the petalinux config using the command “IMAGE_INSTALL_append = “packagegroup-petalinux-x11 chromium-x11” in the configuration file petalinuxbsp.conf. Just for sake of clarity, one of the dependencies of Chromium is X11 (video drivers).

Once having built Chromium with Petalinux we need to compile and install NodeJS on the board. The last step is to install Electron on the board, and then we are ready to go!

An industrial use case of Web-Based application

In this article we are going to give two use cases for a web-based application on KRIA SOM which also needs Edge AI: Predictive Maintenance.

Predictive Maintenance is the task of understanding or forecasting the motor status and health. To help us with this difficult task we take advantage of ML, and using a custom trained CNN we extract information regarding the motor status in real-time while controlling it. This is thanks to the versatility of FPGAs which are able to perform multiple tasks in hardware.

The partition of the system it will be the following:

  • In PL we will place both our motor controller and DPU
  • The CPU will be responsible to manage both PL (checking frequently its status) and Electron. Remember that this is possible thanks to the Quad Core A53, with littler CPUs we would have encountered many problems.
  • The Mali GPU will render the Electron application with the status of the current status motor (i.e. which is “live-checked” by an operator)

 

In this particular use case we will use the cloud for data storage and motor historical data analysis (i.e. for checking if there are some causes to some frequent faults).
If you are interested in more information regarding IIoT, Motor Control or Predictive Maintenance please check the our joint webinar with Xilinx at:

Conclusion

In this article we have explained a possible interaction between web-based application and Edge AI taking advantage of the new KRIA SOM.
The article is explicative also in how to build all the dependencies for Electron and which they are.
Hope the reader enjoy the article,

Enjoy your acceleration,
Guglielmo Zanni
Principal Scientist @MakarenaLabs S.R.L.