Posted on: March 25, 2024 Posted by: wiki Comments: 0


Click here to watch on Youtube


Credits : DigiKey


Author Notes :

In this tutorial series, Shawn builds an artificial intelligence on the edge (Edge AI) project from beginning to end by collecting data, performing feature extraction, training several machine learning models, and deploying to an edge device (single board computer, microcontroller). Such an anomaly detection system could be useful for predicting faults in equipment as part of an Industrial Internet of Things (IIoT) ecosystem.

In the first part, we create an Arduino sketch for an ESP32 to collect raw data from a 3-axis accelerometer and pipe that data to a custom Python server. The server saves each 200-point sample as a separate file.

Code and example dataset for this video series can be found here: https://github.com/ShawnHymel/tinyml-example-anomaly-detection

Anomaly detection is an important area of focus in engineering, as it can be used to save lives and save potentially millions of dollars in costly repairs of machines, industrial equipment, robots, and so on. It also sees wide use in fraud prevention and network traffic analysis. For this series, we want to focus on using anomaly detection to predict problems in machinery before they occur.

An important step in any machine learning project is data collection. We need to collect a lot of data to train models. You can find pre-made datasets (such as the NASA PCoE datasets: https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository/), but nothing beats collecting your own if you wish to make a model that best represents your system.

In the video, we specifically look at using the ESP32 as an Internet of Things (IoT) node to perform data collection for us. Data is sent to a custom server running on our computer. Note that this is all accomplished on a local network but could be expanded to run on the Internet. The server collects and sorts the files for use in training on the next episode.

Before starting, we recommend you watch the following videos:
What is Edge AI – https://www.youtube.com/watch?v=Ejld8XZmvwE
Getting Started with Machine Learning Using TensorFlow and Keras – https://www.youtube.com/watch?v=HCG3hFe1KYY

Project Link: https://www.digikey.com/en/maker/projects/edge-ai-anomaly-detection-part-1-data-collection/7bb112f76ef644edaedc5e08dba5faae

Product Links:
Adafruit Feather Huzzah32 – https://www.digikey.com/product-detail/en/adafruit-industries-llc/3591/1528-2514-ND/8119805
Adafruit MSA301 Triple Axis Accelerometer – https://www.digikey.com/product-detail/en/adafruit-industries-llc/4344/1528-4344-ND/10419635

Related Videos:
Edge AI Anomaly Detection Part 2: Feature Extraction and Model Training – https://youtu.be/Mu3CzG-na4k

https://www.youtube.com/playlist?list=PLEBQazB0HUySNug4eRm-73hNyMcCRViRB

Related Project Links:
Edge AI Anomaly Detection Part 1: Data Collection – https://www.digikey.com/en/maker/projects/edge-ai-anomaly-detection-part-1-data-collection/7bb112f76ef644edaedc5e08dba5faae

Related Articles:
What is Edge AI?
https://www.digikey.com/en/maker/projects/what-is-edge-ai-machine-learning-iot/4f655838138941138aaad62c170827af

Getting Started with Machine Learning Using TensorFlow and Keras
https://www.digikey.com/en/maker/projects/getting-started-with-machine-learning-using-tensorflow-and-keras/0746640deea84313998f5f95c8206e5b

TensorFlow Lite Tutorial Part 1: Wake Word Feature Extraction
https://www.digikey.com/en/maker/projects/tensorflow-lite-tutorial-part-1-wake-word-feature-extraction/54e1ce8520154081a58feb301ef9d87a

TensorFlow Lite Tutorial Part 2: Speech Recognition Model Training
https://www.digikey.com/en/maker/projects/tensorflow-lite-tutorial-part-2-speech-recognition-model-training/d8d04a2b60a442cf8c3fa5c0dd2a292b

TensorFlow Lite Tutorial Part 3: Speech Recognition on Raspberry Pi
https://www.digikey.com/en/maker/projects/tensorflow-lite-tutorial-part-3-speech-recognition-on-raspberry-pi/8a2dc7d8a9a947b4a953d37d3b271c71

Low-Cost Data Acquisition (DAQ) with Arduino and Binho for ML
https://www.digikey.com/en/maker/projects/lowcost-data-acquisition-daq-with-arduino-and-binho-for-ml/bf39a39f07d145d297e60c0e1f257db3

Intro to TinyML Part 1: Training a Model for Arduino in TensorFlow
https://www.digikey.com/en/maker/projects/intro-to-tinyml-part-1-training-a-model-for-arduino-in-tensorflow/8f1fc8c0b83d417ab521c48864d2a8ec

Intro to TinyML Part 2: Deploying a TensorFlow Lite Model to Arduino
https://www.digikey.com/en/maker/projects/intro-to-tinyml-part-2-deploying-a-tensorflow-lite-model-to-arduino/59bf2d67256f4b40900a3fa670c14330

Leave a Comment