NanoEdge AI Studio V3 - Anomaly Detection demo

STMicroelectronics
25 Feb 202219:38

Summary

TLDRThe video introduces Nano Aji Studio, a tool that enables developers to integrate machine learning into C code without prior knowledge in the field. It focuses on creating an anomaly detection project using a 3-speed USB fan and the ST Win board. The step-by-step process covers project creation, data logging, signal analysis, library benchmarking, and deployment. The system adapts to changing conditions and can detect abnormal behaviors in real time. With embedded learning, the Nano AI libraries provide efficient, adaptable solutions for various use cases.

Takeaways

  • 💻 Nano Aji Studio is a search engine for machine learning libraries, enabling developers to embed smart features into C code.
  • 📊 The studio offers four types of projects: anomaly detection, one-class classification, n-class classification, and extrapolation.
  • 🛠️ A project example involves using the ST Win board to monitor vibration patterns on a three-speed USB fan.
  • 🔧 The Data Logger feature allows for easy configuration and logging of data from sensors like accelerometers.
  • 📈 Anomaly detection is demonstrated by collecting data representing normal fan behavior and using it as a baseline for comparisons.
  • 🚀 The studio benchmarks Nano AI libraries, optimizing pre-processing, machine learning models, and hyperparameters to find the best fit for a use case.
  • 🎛️ Nano AI libraries are adaptable and can be trained incrementally in the microcontroller to detect anomalies in real-time.
  • 🔄 The learning process can be dynamic, allowing for continuous adaptation to new conditions or regimes on the machine.
  • 🧠 The main focus of Nano AI libraries is embedded learning, making them highly effective in detecting anomalies that haven't been seen before.
  • 📦 After benchmarking, developers can deploy their custom Nano AI library and test it on real devices like the ST Win board.

Q & A

  • What is Nano Aji Studio?

    -Nano Aji Studio is a search engine for machine learning libraries that allows developers to easily embed smart features into C code. It provides a named AI Library optimal for a given use case with minimal data input.

  • What types of projects can be created with Nano Aji Studio?

    -Nano Aji Studio supports four types of projects: anomaly detection, one-class classification, n-class classification, and extrapolation.

  • How does the anomaly detection project work?

    -The anomaly detection project provides a dynamic model that learns patterns incrementally and infers directly within the target microcontroller, identifying deviations from learned patterns.

  • What is the purpose of the Data Logger feature in Nano Aji Studio?

    -The Data Logger feature allows users to configure their STM32 boards to log sensor data easily. It simplifies the process of collecting data for machine learning model training.

  • What is the process for creating a new anomaly detection project in the script?

    -The process involves defining general project settings, importing signals representing normal and abnormal behaviors, running a benchmark to find the best AI library for the use case, and then deploying the library to the target device.

  • How does the script demonstrate the use of an accelerometer with the STM32 board?

    -The script demonstrates using an accelerometer by placing an STM32 board on top of a USB fan to monitor vibration patterns, capturing raw data, and using it as input for the anomaly detection project.

  • What is the significance of the buffer size and sampling frequency in the data logging process?

    -The buffer size of 256 XYZ samples and a sampling frequency of 833 Hz ensure that each buffer represents approximately 300 milliseconds of data, which is sufficient to capture the essence of the fan's vibration patterns.

  • How does the script simulate abnormal behavior for the anomaly detection project?

    -The script simulates abnormal behavior by changing the orientation of the fan by 90 degrees to introduce unusual vibration patterns, which are then used as input for the anomaly detection model.

  • What performance indicators are used to evaluate the anomaly detection library?

    -The performance indicators used are balanced accuracy, which measures the library's ability to correctly classify signals as normal or abnormal, and confidence, which reflects the mathematical distance between normal and abnormal signals.

  • How is the final library tested before deployment?

    -The final library is tested using an emulator that allows for easy testing without needing to download, link, or compile anything. It involves initializing the library, running an initial learning cycle, and then performing inference to check for anomalies.

  • What adaptability does the Nano AI library offer for anomaly detection?

    -The Nano AI library offers adaptability through embedded learning, allowing the library to learn new patterns and adapt to changes in the operational regime of the device, making it suitable for dynamic environments.

Outlines

00:00

🔍 Introduction to Nano AI Studio and Project Overview

Nano AI Studio is a powerful tool designed for developers to easily embed machine learning features into C code. It outputs a small AI library optimized for specific use cases. This video demonstrates creating an anomaly detection project using a USB fan and the ST WIN board to monitor vibration patterns. Nano AI Studio offers four project types: anomaly detection, one-class classification, n-class classification, and extrapolation. The tutorial begins with a quick overview of the platform and its features, including use case inspirations and how the studio performs on various datasets.

05:00

⚙️ Initial Project Setup and Data Collection

In this step, the project is set up to monitor normal fan behavior at speed one using an accelerometer. The focus is on selecting the ST WIN sensor tile board and configuring it for data logging. The tutorial explains how to import data using three different methods (file, SD card, or serial). For this demo, the serial input method is used to collect normal fan vibration data. The tutorial emphasizes that for more complex applications, data representing all possible states (e.g., different fan speeds) could be logged and concatenated.

10:00

🔄 Collecting Abnormal Data and Preparing for Training

The tutorial moves on to simulate abnormal fan behavior by changing the fan's orientation. This is done to introduce abnormal vibration patterns, which are collected and imported as signal examples. Importantly, these abnormal signals are not used for training but rather to provide context for the studio's search during library creation. The tutorial highlights the adaptive nature of Nano AI libraries, which can detect unseen anomalies during real-world use.

15:02

🏁 Running Benchmarks to Find the Best Library

A benchmark is run to find the best Nano AI library for anomaly detection. The process involves testing many possible library configurations, combining signal pre-processing, machine learning models, and hyperparameters. Key performance indicators include balanced accuracy, confidence, and resource usage (RAM and Flash memory). The tutorial explains how to interpret the benchmark results, aiming for high similarity for normal signals and low similarity for abnormal ones, while optimizing for memory efficiency.

🤖 Testing the Anomaly Detection Library

The newly created library is tested using the ST WIN board and fan setup. After an initial learning phase, the library successfully detects normal and abnormal fan behavior in real time, including subtle anomalies like obstructed airflow. The tutorial highlights the library's adaptability through embedded learning, allowing it to adjust to new norms dynamically. Developers can easily implement more complex learning strategies, such as learning multiple regimes or enabling user-triggered learning.

🚀 Deploying the Nano AI Library

The final step involves deploying the Nano AI library onto a device. The tutorial demonstrates how to compile and integrate the library into an STM32CubeIDE project. Simple pseudocode is provided to illustrate how the library is used for initialization, learning, and detection in an infinite loop. The tutorial concludes by showcasing how easy it is for developers to deploy smart features into their devices without needing extensive knowledge of machine learning or data science.

Mindmap

Keywords

💡Nano Aji Studio

Nano Aji Studio is a search engine for machine learning libraries designed to simplify the process of embedding AI capabilities into C code. It allows developers to create projects that can learn and infer patterns directly within microcontrollers. In the video, it is used to create an anomaly detection project from scratch, demonstrating how to integrate smart features into devices without prior knowledge in machine learning.

💡Anomaly Detection

Anomaly detection is a machine learning application that identifies patterns in data that do not conform to expected behavior. In the context of the video, it is used to monitor vibration patterns of a USB fan to detect any abnormal operation. The project created in Nano Aji Studio learns normal patterns and then infers whether new data points are normal or anomalous.

💡STD WIN Board

The STD WIN Board is a development board used in the video to monitor vibration patterns. It is equipped with various sensors, including an accelerometer, which is used to collect data for the anomaly detection project. The board is connected to a PC to configure the Data Logger and to collect data that will be used to train the AI model.

💡Data Logger

A Data Logger in this context is a feature that allows for the collection of sensor data, which can be used for logging and analyzing over time. In the video, it is mentioned as a feature of the STD WIN Board, which can be configured to log data from selected sensors. The data is then downloaded to an SD card in a specific format for use in training the AI model.

💡Microcontroller

A microcontroller is a small computer on a single integrated circuit that is used to control a specific operation in an embedded system. In the video, the microcontroller is the target environment where the AI library will be embedded after being trained, allowing the device to perform anomaly detection on the fly.

💡Accelerometer

An accelerometer is a type of sensor that measures acceleration and can be used to detect vibrations. In the video, the accelerometer on the STD WIN Board is used to collect vibration data from the USB fan, which will be analyzed by the anomaly detection AI library to identify any abnormal patterns.

💡Inference

Inference in machine learning refers to the process of making predictions or decisions based on a trained model. In the video, inference is used to determine whether new vibration data from the fan is normal or abnormal after the AI library has been trained on initial data.

💡Buffer Size

Buffer size refers to the amount of data that can be held in a buffer, which is a temporary data storage area. In the video, a buffer size of 200 is mentioned, meaning each data set consists of 256 XYZ samples collected from the accelerometer. This size determines the amount of data processed at one time by the AI library.

💡Sampling Frequency

The sampling frequency is the rate at which data is collected per second, measured in Hertz (Hz). In the video, the accelerometer has a sampling frequency of 833 Hz, meaning it collects data 833 times per second. This frequency determines the resolution of the data collected for analysis.

💡Signal Pre-processing

Signal pre-processing is the initial treatment of raw data to make it suitable for further analysis. In the video, it is mentioned as an optional step in the AI library composition, where data can be normalized or filtered to remove unwanted frequency components before being used for training or inference.

💡Hyperparameters

Hyperparameters are configuration settings of a machine learning model that are set before the model is trained. In the video, hyperparameters are part of the AI library composition, where they are optimized to best solve the anomaly detection problem by adjusting settings like the decision boundary for classifying signals as normal or abnormal.

Highlights

Nano Aji studio is introduced as a search engine for machine learning libraries, simplifying the integration of AI into C code.

The tool requires minimal data input and outputs an AI Library tailored to specific use cases.

A new anomaly detection project is demonstrated using the STD wind board to monitor a USB fan's vibration patterns.

The homepage of Nano Aji studio is showcased, highlighting the creation of new projects and available project types.

The inspiration section on the studio's homepage provides use case ideas and links to the use case explorer.

Four types of Nano AI projects are explained: anomaly detection, one class classification, n-class classification, and extrapolation.

The Data Logger feature is described, allowing for easy configuration and data logging from sensors.

A simple three-speed USB fan is used as a model to simulate an industrial vibrating machine for the project.

The process of creating a new anomaly detection project in the studio is detailed, starting with general settings.

Signals representing normal fan behavior are imported from the serial port, using a specific buffer size and sampling frequency.

Abnormal behavior signals are collected by altering the fan's orientation to introduce different vibration patterns.

The Benchmark step is explained, where the studio searches for the best AI library based on the provided normal and abnormal signals.

The Nano AI library is composed of a pre-processing algorithm, a machine learning model, and a set of hyperparameters.

The importance of providing context with abnormal signals during the Benchmark step is emphasized for the automatic search process.

The performance indicators for anomaly detection libraries, such as balanced accuracy and confidence, are discussed.

The process of testing the library using an emulator without downloading or compiling is demonstrated.

The final deployment step is shown, where the Nano AI library is compiled and ready to be integrated into the target device.

The adaptability of the Nano AI library due to embedded learning is highlighted, allowing for dynamic updates to what is considered normal behavior.

The Nano AI documentation on the ST Wiki is mentioned as a resource for further information about the studio and libraries.

Transcripts

play00:00

[Music]

play00:05

Nano Aji studio is a search engine for

play00:08

machine learning libraries it provides

play00:11

any developer with a simple way to start

play00:13

embedding smart features into any c code

play00:16

this tool takes as input minimal amounts

play00:19

of data and as output provides a naned

play00:22

AI Library which is optimal for a given

play00:25

use case today we will get familiar with

play00:27

the studio by creating a new anomaly

play00:30

detection project from scratch we will

play00:32

use the STD wind board to monitor some

play00:34

vibration patterns on a three-speed USB

play00:39

fan here's the studios homepage where

play00:42

you can create new projects out of the

play00:44

four available

play00:45

types below is the list of all available

play00:49

projects on the right side the

play00:51

inspiration section lists many use case

play00:53

ideas which link directly to st's use

play00:56

case

play00:57

Explorer there you will find out how nji

play01:00

Studio performs on these data sets which

play01:02

are all available to download for

play01:05

free there are four types of Nano AI

play01:09

projects anomaly detection which

play01:11

provides a dynamic model that learns

play01:13

patterns incrementally and infer both

play01:16

directly within the target

play01:18

microcontroller one class classification

play01:21

which is used to detect outliers within

play01:23

data and is especially useful when no

play01:25

examples of abnormal behaviors can be

play01:27

provided on the system

play01:30

n-class classification which enables

play01:32

automatic identification of a machine

play01:34

State among many different possible

play01:37

States and extrapolation which uses

play01:40

mathematical regression models in order

play01:41

to estimate a Target value using other

play01:44

known

play01:47

features Additionally the Data Logger

play01:49

feature provides a quick and easy way to

play01:51

configure your St win data loger simply

play01:55

connect your STD win and STD link to

play01:57

your PC as indicated and click load

play02:02

binary then click configure Data Logger

play02:05

and select the sensors that you wish to

play02:07

use for data logging as well as their

play02:11

configuration finally click download

play02:14

configuration to get the device

play02:16

config.js file which needs to be copied

play02:19

to the root of your SD wins SD

play02:23

card you're now ready to log some data

play02:26

onto your s wins SD card in that format

play02:31

D of course this is just one way out of

play02:34

many to log some data for instance today

play02:36

we will not use this feature but instead

play02:38

a more standard serial Data Logger

play02:42

procedure let's get started with the

play02:44

creation of our smart vibration

play02:48

sensor here we have a very simple

play02:50

three-speed USB fan that will be used as

play02:52

a basic model to simulate an industrial

play02:55

vibrating

play02:56

machine we also have the St winds sensor

play02:59

tile board the reference is St eval St

play03:02

win KT

play03:03

1B this board features many different

play03:06

sensor types but today we'll only use

play03:08

the

play03:09

accelerometer we will just place the St

play03:11

win on top of the fan and secure it

play03:14

using some blue

play03:16

tack at the moment on the St win we have

play03:19

some very basic data logging code

play03:21

there's no intelligence yet the logger

play03:23

reads raw accelerometer data as XY Z

play03:27

instantaneous samples and then formats

play03:30

it into a buffer which is nothing more

play03:32

than a collection of many XYZ samples

play03:35

which we also call a signal example or a

play03:37

learning

play03:38

example and finally it outputs this

play03:40

buffer or signal example directly to the

play03:43

serial port or

play03:46

USB this serial stream of buffers can be

play03:49

read through the terminal and of course

play03:52

we will use it as an input to provide

play03:54

data to the

play03:56

studio here we're using a buffer size of

play03:59

200 156 which means that each line is

play04:02

composed of 256 XYZ

play04:05

samples the sampling frequency used on

play04:07

the accelerometer is 833 Herz it means

play04:12

that each buffer represents a temporal

play04:14

signal of approximately 300 milliseconds

play04:17

which seems to be sufficient to capture

play04:19

the essence of the Fan's vibration

play04:23

patterns let's create a new anomaly

play04:25

detection

play04:26

project in the first step we Define the

play04:29

general setting of our project we'll

play04:31

call it fan

play04:35

vibration then we select the St win in

play04:37

the list of available

play04:39

boards the Nano AI libraries are of

play04:42

course compatible with any stm32 board

play04:45

with a cortex M

play04:47

microcontroller and we choose our sensor

play04:50

a 3axis

play04:51

accelerometer the Nano AI libraries are

play04:54

completely sensor agnostic meaning that

play04:56

we can use any sensor type or even a

play04:58

combination of several

play05:00

sensors for instance we could have used

play05:02

a combination of accelerometer 3 AIS

play05:05

gyroscope 3 AIS and temperature sensor

play05:09

which is only one variable for a

play05:11

combined total of seven axes or seven

play05:13

variables for this we would have

play05:16

selected a generic sensor with seven

play05:19

axes we could also decide to restrict

play05:22

the maximum amounts of RAM and Flash

play05:24

memories that our library will use if we

play05:26

have specific constraints in our

play05:28

application but today it's not the case

play05:31

so we'll just leave it as it is and even

play05:33

increase the maximum amount of ram to 32

play05:36

kiloby because we don't want to limit

play05:38

the search space in any way during

play05:42

Benchmark then we move on to step number

play05:44

two where we will import signals

play05:46

representing the normal behaviors of the

play05:49

fan to add signals we can import from

play05:52

three different sources from file in

play05:55

text or CSV format

play06:01

from an SD wins data loggers SD card in

play06:04

that format as explained briefly

play06:08

earlier in which case we select a sensor

play06:11

we choose a buffer

play06:14

size and we import the

play06:17

data or finally we can choose serial

play06:20

from USB which is what we'll do

play06:24

today we plug the S2 in select the right

play06:28

Port the B rate and and turn the fan on

play06:31

at speed number

play06:32

one we'll consider that the normal

play06:35

behavior of the fan is when it is

play06:37

running at speed number one then we can

play06:40

start collecting signals we'll stop

play06:42

after we've got approximately 30

play06:45

buffers here for the Simplicity of the

play06:48

demo we only collect data representing

play06:50

one single mode of operation or regime

play06:53

on Ouran which is speed number one but

play06:56

of course we could gather data

play06:58

representing all the different states

play07:00

that we' like to consider as the norm on

play07:02

our machine it could be for instance

play07:05

signals representing all speeds not only

play07:07

one but also number two and three in

play07:11

that case we would just concatenate all

play07:13

signal examples representing all the

play07:15

normal regimes in one single nominal

play07:17

signal

play07:19

file then we click continue and make

play07:21

sure that our data looks fine and click

play07:26

import the signal screen summarizes the

play07:29

contents of the data we've just logged

play07:31

on the right hand side we have previews

play07:33

of the imported data with both temporal

play07:36

and frequency plots or ffts for all

play07:39

sensor axes so here we have the X Y and

play07:43

Z accelerometer

play07:45

axes it is possible to use a manual

play07:47

filter if we'd like to remove some of

play07:49

the unwanted frequency components within

play07:51

our

play07:52

signal just click filter settings

play07:55

activate the

play07:56

filter then input the sampling frequency

play07:59

us used here we are at 833 Herz and

play08:04

choose the low and high cut off

play08:05

frequency values for example we may want

play08:08

to remove all frequencies above 200

play08:11

Hertz like

play08:12

so and we can see how our changes are

play08:15

reflected on the fft

play08:18

plots but today we don't want to filter

play08:20

frequencies so we'll just deactivate the

play08:25

filter then we move on to the third step

play08:28

where we import signals representing

play08:30

abnormal behaviors on our system we

play08:32

follow the exact same procedure as

play08:35

before but this time we'll change the

play08:37

behavior of a fan so that it functions

play08:39

in a way that is

play08:41

unusual for Simplicity we will simulate

play08:44

this abnormal behavior by changing the

play08:46

orientation of the fan by 90° to

play08:49

introduce abnormal vibration patterns we

play08:52

turn the fan on and collect

play08:54

approximately 30 signal

play08:56

examples the signal examples we provide

play08:59

at this point are not used to train the

play09:01

library it is very important they are

play09:04

only used to provide some context for

play09:06

the automatic search that will happen in

play09:08

the next step because all the learning

play09:10

will happen later on in the

play09:12

microcontroller after the library has

play09:14

been embedded on the target machine the

play09:16

examples of anomalies provided here

play09:19

don't need to be exhaustive for a real

play09:21

use case for instance they could be

play09:23

collected on a faulty machine or in

play09:26

conditions that are known to be

play09:28

abnormal or or depending on the case

play09:30

they could even be created

play09:32

artificially when testing our library we

play09:34

will see that in fact we are able to

play09:36

detect anomalies that were never seen

play09:38

before because the embedded learning is

play09:40

what makes Nano AI libraries especially

play09:43

for anomaly detection particularly

play09:47

adaptable let's import these abnormal

play09:50

signals check our graphs and

play09:57

proceed here we get to the four step

play10:00

Benchmark we click run new Benchmark

play10:03

select our couple of signals both Normal

play10:06

and abnormal the number of cores we wish

play10:08

to use on the CPU and

play10:12

start at this point the studio will

play10:14

start working hard to find the best

play10:16

possible library for our use case given

play10:19

the signals that we provided the

play10:21

nanoedge library is composed of three

play10:23

main blocks first there's an optional

play10:26

signal pre-processing algorithm this

play10:28

could be very simple such as offsetting

play10:31

or normalizing or more complex like fft

play10:34

or PCA and so

play10:36

on second we have the choice of the

play10:39

machine learning model in the pool of

play10:41

available models we have Classics of

play10:43

machine learning such as K&N svm neuron

play10:46

networks and so on but we also have more

play10:49

specific models developed inhouse and

play10:51

patented by STD which were designed for

play10:53

microcontrollers and are therefore

play10:55

extremely well

play10:56

optimized and third we have a set of

play10:59

hyperparameters for the machine learning

play11:01

model so that it can solve the problem

play11:03

at hand as effectively and efficiently

play11:06

as

play11:07

possible so for each Library made of

play11:09

these three blocks pre-processing

play11:12

machine learning model and

play11:13

hyperparameters there are many

play11:15

possibilities which results in millions

play11:17

of possible combinations and millions of

play11:20

possible

play11:21

libraries during Benchmark each

play11:23

candidate library is tested using the

play11:25

couples of signals imported previously

play11:28

we learn the normal signals and then run

play11:31

inference on both the Normal and

play11:33

abnormal signals this whole process

play11:36

happens many times for each Library

play11:38

using random subsets of the data

play11:39

provided to minimize any possible

play11:42

bias the results are displayed here on

play11:45

this graph on the xais there's the

play11:48

signal number and the Y AIS is the

play11:51

percentage of similarity which is the

play11:53

raw output of the inference or detection

play11:56

function of course would like all the

play11:58

blue points with which corresponds to

play12:00

the normal signals imported in step two

play12:02

to be as close to 100% similarity as

play12:05

possible and would like all the red

play12:07

points the abnormal signals from step

play12:09

three to be close to

play12:12

0% the most important performance

play12:14

indicator for the anomaly detection

play12:16

candidate library is the balanced

play12:19

accuracy which translates the ability of

play12:21

the library to correctly attribute the

play12:23

input signals to the correct class

play12:26

either normal or

play12:28

abnormal one 100% accuracy would mean

play12:31

that all the blue points are above the

play12:32

90% decision boundary the gray dash line

play12:36

here and all red points are

play12:39

below the second performance indicator

play12:42

is confidence which translates how much

play12:45

mathematical distance the library is

play12:47

able to put between the Normal and

play12:49

abnormal

play12:51

signals 100% confidence would mean that

play12:53

all the blue points are at exactly 100%

play12:56

similarity while all the red points are

play12:59

exactly at

play13:01

zero finally the amount of RAM and Flash

play13:04

memories are also optimized previously

play13:07

in Project settings we put a constraint

play13:09

on maximum RAM at 32 kiloby but here we

play13:12

see that the best Library found so far

play13:14

only takes much much

play13:16

less The Benchmark process can take

play13:19

anywhere from a few minutes to a few

play13:21

hours here we've already obtained

play13:23

excellent results so we'll stop The

play13:24

Benchmark

play13:26

manually now we have our best Nano AGI

play13:28

Library

play13:29

which is the only one kept by default

play13:32

but we can also access the list of the

play13:34

best candidate libraries found during

play13:36

Benchmark by clicking

play13:38

here we may select another one for

play13:40

example one which has lower memory

play13:43

Footprints despite slightly worse

play13:45

accuracy or

play13:47

confidence before testing our library

play13:50

let's have a quick look at the functions

play13:52

that it

play13:53

provides for anomaly detection we have

play13:56

the initialization function which needs

play13:58

to be run first

play13:59

first then we have the learn function

play14:02

which is incremental Dynamic and can be

play14:04

called at any time and finally the

play14:07

inference function detect which outputs

play14:10

a similarity percentage which measures

play14:12

how much any given signal matches with

play14:15

what was learned

play14:16

before now we can test our library using

play14:19

the

play14:20

emulator each library has its own

play14:22

emulator which allows for easy testing

play14:25

without the need to download link or

play14:27

compile anything we first initialize our

play14:31

library and then learn some basic

play14:33

knowledge we'll use our serial Data

play14:37

Logger turn the fan on at speed number

play14:42

one and start logging data we'll take

play14:45

approximately 15

play14:48

signals remember that anomaly detection

play14:51

libraries come untrained out of the

play14:53

Benchmark that's why we need to run an

play14:55

initial learning cycle first

play14:59

now that we have our reference knowledge

play15:01

let's go to detection to see how the

play15:03

library

play15:05

behaves again we'll use serial

play15:11

data and here the inference results

play15:14

shows 100% similarity which was expected

play15:17

since our fan is still running normally

play15:20

now if we start tapping on the fan the

play15:22

similarity drops

play15:26

instantly same if we change the fans

play15:32

orientation and back to normal if we

play15:34

leave it

play15:37

alone our library is behaving as

play15:39

expected so we can move on to the final

play15:41

step

play15:43

deploy here we have a few developer

play15:46

options available for the S win we only

play15:48

need to check the first

play15:50

one and then we can click the compile

play15:55

button we will get a zip file

play15:59

which contains the Nano Library which is

play16:02

a static precompiled C language Library

play16:05

here lib ne. a as well as the header

play16:09

file Nano

play16:10

A.H we need to import both of these into

play16:14

our favorite

play16:15

IDE here I'm using stm32 Cube

play16:20

IDE and I will recompile my S wi to

play16:24

transform it into a smart device and

play16:26

we'll be ready to test it

play16:31

here's a quick overview of the code that

play16:32

we've prepared for our

play16:35

device these are just Snippets of pseudo

play16:38

code it is not full working

play16:40

code first we initialize the

play16:43

library then we run the initial learning

play16:46

phase with only 15

play16:48

iterations each time we get fresh

play16:51

accelerometer data and pass it to the

play16:53

learn

play16:55

function after that we have the detect

play16:57

function which runs in in an infinite

play16:59

loop as soon as the learning is

play17:02

over here we take the inference output

play17:06

similarity and if it's higher than 90%

play17:08

we say that everything is normal

play17:10

otherwise under 90% we say anomaly of

play17:13

course this is the simplest possible

play17:15

logic and we could have coded something

play17:17

much more

play17:19

elaborate now that the S win is flashed

play17:21

and the device ready let's see how it

play17:24

works we turn the fan on reset the board

play17:28

learning is in

play17:30

progress and

play17:33

finished everything is nominal and if we

play17:37

change the orientation we start getting

play17:40

anomalies and back to the original

play17:44

states we're back to

play17:47

nominal now let's introduce a more

play17:49

subtle anomaly which was never seen

play17:52

before we'll simulate that with a piece

play17:55

of paper obstructing the airflow of the

play17:57

fan

play17:59

when we approach the paper the

play18:00

similarity drops instantly and we get

play18:02

anomalies as

play18:05

expected note that here the piece of

play18:08

paper is not even touching the

play18:12

fan now the most important aspect of the

play18:15

Nano library is its adaptability due to

play18:18

the embedded learning for instance if we

play18:21

suddenly change regimes and decide that

play18:23

this is the new Norm we just have to

play18:25

reset the board and learn this instead

play18:28

as the new

play18:31

norm and we get a nominal

play18:34

result if we change back to the normal

play18:37

orientation which we haven't learned yet

play18:40

as expected the library returns

play18:44

anomalies here we could imagine more

play18:46

complex learning strategies for example

play18:48

learning multiple regimes or enabling

play18:51

the user to start a complimentary

play18:53

learning phase with the Press of a

play18:54

button for example

play18:59

so hopefully today we've demonstrated

play19:02

how easy it is using nooi Studio for any

play19:05

developer to start embedding smart

play19:07

features into their devices without any

play19:10

prior knowledge in machine learning or

play19:12

data science and all that in less than

play19:15

an hour for any information about the

play19:18

studio or the libraries please refer to

play19:21

the Nano AI documentation which is

play19:22

available on the St Wiki

play19:29

[Music]

play19:35

[Music]

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
AI LibrariesMachine LearningEmbedded SystemsAnomaly DetectionData LoggingSensor DataSTM32 BoardAccelerometerSmart DevicesNano AI
هل تحتاج إلى تلخيص باللغة الإنجليزية؟