Klaus Elk Books

AI in Embedded

Introduction

When it comes to embedded software, there are at least two distinct ways to use AI:

Even though I believe that there are plenty of low-hanging fruits in the first bullet above, the goal of this page is to dig into the second bullet - AI in the actual embedded system. Until recently, this has mostly been mimicked by letting the embedded system collect input data, send it to a cloud server that runs it through AI, and returns with an answer. This is known from e.g., Amazon's original Echo/Alexa and similar products.

In my book Embedded Software for the IoT I describe SPC - Statistical Process Control - in e.g., factories, as something that used to be driven by central computers, which can now run in smaller "edge" system locally in production. This is a solution that scales and is very resilient against single-point-of-failure scenarios. Still, in the SPC-scenario, the embedded "edge" system would be running classic SPC algorithms - written by human developers.

With AI we can harvest similar benefits - and more. AI can be used as the "next level", where a small specifically trained model can run in the embedded system and take local decisions. There are also hybrid solutions. In the SPC-case, the edge system would report statistics on e.g., an hourly basis (when possible) to a central SPC-system. The AI successor might do the same - creating overall statistics, graphs and images, in the cloud - integrating data from a complete factory.

So far I have used the acronym AI for Artificial Intelligence. There are many types of AI - like Expert Systems, Robots etc, but we will mainly be dealing with the subset known as Machine Learning - ML. When you don't need to write any actual code, but can feed the machine with data to make it work, it is Machine Learning. When Machine Learning is realised using Neural Networks in many layers it is called Deep Learning". This is our main subject here, but as many others I tend to use the umbrella-term "AI".

The work on "Artificial Intelligence" started in the 1950'ies. I remember in the late 1980'ies how it was revived in the form of neural networks and kind of died again, because it had little practical use (almost none in the embedded world) as it was then. This time it is clear that it can be used in a lot of fields - although it may be a bit hyped.

So what has changed, since it now is so useful? Basically two things: Software and Hardware.

Based on the literature, it seems that the current AI wave took off in 2017 with an article called "Attention is all you need" (see links) - probably a reference to Beatles "All you need is love". This is the software part of the change - or rather, it's the single step that really stands out when looking in the rearview-mirror.

Learning from ChatGPT

I am sure that we all know ChatGPT. The "GPT" part means "Generative, Pre-trained Transformer" - and in ChatGPT, this "transformer" can participate in a dialog with the user. This is a huge step forward compared to the now simple Google search, where each search-phrase (or prompt) is a fresh start, and where answers can only be links to existing pages. Let's look at the ChatGPT terms one-by-one: