Edge AI Anomaly Detection Part 2: Feature Extraction and Model Training | Digi-Key Electronics

Поділитися
Вставка
  • Опубліковано 21 жов 2024
  • In this tutorial series, Shawn introduces the concept of Tiny Machine Learning (TinyML), which consists of running machine learning algorithms on microcontrollers.
    On the previous episode ( • Edge AI Anomaly Detect... ), we created an Internet of Things (IoT) data collection node using an Adafruit Feather Huzzah32 (ESP32) and MSA301 Triple Axis Accelerometer. We collected vibration data from a ceiling fan running at several different speeds with and without a coin attached to a fan blade (emulating an “anomaly”).
    This second episode introduces feature analysis and model training. We load the accelerometer data we collected in the previous episode and examine a number of statistical features, including mean, variance, skewness, kurtosis, median absolute deviation (MAD), correlation, and the Fast Fourier Transform (FFT).
    Code and example dataset for this video series can be found here: github.com/Sha...
    By examining the groupings of normal vs. anomalous samples, we can determine that the MAD (in all three axes) would make for the best feature, as it offered the greatest separation between the groups of normal samples and anomalies.
    Once we have chosen the feature(s), we can train our machine learning models. We first look at the Mahalanobis distance, which gives us an idea of the distance between a new sample and a group’s mean coordinates. If the Mahalanobis distance is too high, we can classify the sample as an “anomaly.”
    Next, we create a different type of detection system using a neural network. Specifically, the neural network is configured as an autoencoder, which attempts to recreate any input values at its output nodes. We compute the mean squared error (MSE) between the input and output values to determine how well the autoencoder performed. If the MSE is low, we classify the input as “normal,” and if the MSE is high, we classify the input as “anomaly.”
    These models are trained, tested, and saved for later use.
    Before starting, we recommend you watch the following videos:
    What is Edge AI - • Intro to Edge AI: Mach...
    Getting Started with Machine Learning Using TensorFlow and Keras - • Getting Started with T...
    Product Links:
    Adafruit Feather Huzzah32 - www.digikey.co...
    Adafruit MSA301 Triple Axis Accelerometer - www.digikey.co...
    Related Videos:
    Edge AI Anomaly Detection Part 1: Data Collection - • Edge AI Anomaly Detect...
    Edge AI Anomaly Detection Part 2: Feature Extraction and Model Training: • Edge AI Anomaly Detect...
    • Shawn Hymel presents
    Related Project Links:
    Edge AI Anomaly Detection Part 2: Feature Extraction and Model Training - www.digikey.co...
    Related Articles:
    What is Edge AI?
    www.digikey.co...
    Getting Started with Machine Learning Using TensorFlow and Keras
    www.digikey.co...
    TensorFlow Lite Tutorial Part 1: Wake Word Feature Extraction
    www.digikey.co...
    TensorFlow Lite Tutorial Part 2: Speech Recognition Model Training
    www.digikey.co...
    TensorFlow Lite Tutorial Part 3: Speech Recognition on Raspberry Pi
    www.digikey.co...
    Low-Cost Data Acquisition (DAQ) with Arduino and Binho for ML
    www.digikey.co...
    Intro to TinyML Part 1: Training a Model for Arduino in TensorFlow
    www.digikey.co...
    Intro to TinyML Part 2: Deploying a TensorFlow Lite Model to Arduino
    www.digikey.co...
    Edge AI Anomaly Detection Part 1: Data Collection
    www.digikey.co...

КОМЕНТАРІ • 12

  • @CraftableDan
    @CraftableDan 4 роки тому +2

    Great vid, can't wait for more!

  • @DanielHolmlund
    @DanielHolmlund 7 місяців тому

    Awesome video, Shawn!

  • @gtarheros8859
    @gtarheros8859 4 роки тому

    Mahalanobis distance....I always wondered how to pronounce that ....have not heard that one since my MSEE studies (studying speaker recognition) while at TI in the mid-80s! Fantastic job!

  • @jamesdriscoll9405
    @jamesdriscoll9405 4 роки тому

    Watching this gave me kurtosis :)

  • @yinzheliu9220
    @yinzheliu9220 2 роки тому

    Great video! Can I just ask one quesiton. In my project, my robotic arm will collect 6 samples every 0.8s. In this case how can I deploy the machine learning model to the edge machine? As in your project, the sample rate is much more larger than mine.

  • @alexambro4998
    @alexambro4998 2 роки тому

    Hi I have collected my own data through an mpu6050 module (discarding gyroscopic data for semplicity). when i try to compile your jupiter notebook with my own data It compiles, and seems to read the correct files, but when I try to plot them I get an empity plot, and when I try to calculate the statistical markers such as the mean it results "nen". what could be the problem?

    • @alexambro4998
      @alexambro4998 2 роки тому

      SOLVED: I used a powershell script to split the 20000 row csv file in 100 smaller samples and it messed up the enconding of the document . it appears jupiter can only read utf8 files

  • @merseyless
    @merseyless 4 роки тому

    Any links to further learning on the signal processing techniques?

  • @nilutpolkashyap
    @nilutpolkashyap 3 роки тому

    Can I do the same project with an Arduino Nano 33 IOT? The specs for the 33 IOT are much lower than the ESP 32. I was wondering if they would be the same for this particular project.

  • @toshb1384
    @toshb1384 4 роки тому +1

    would it be possible to run an sklearn model on an edge device? Great vid

    • @ShawnHymel
      @ShawnHymel 4 роки тому +1

      Thanks! It totally depends on the model (how much memory it takes up) and the speed at which inference needs to happen. Here's a paper talking about comparing a decision tree to other methods on a microcontroller (328p): proceedings.mlr.press/v70/kumar17a/kumar17a.pdf

  • @Masoudy91
    @Masoudy91 4 роки тому +1

    Man I feel stupid....