Categories
Misc

TinyML Gearbox Fault Prediction on a $4 MCU

TinyML Gearbox Fault Prediction on a $4 MCU

I would like to share my project and show you how to apply tinyML approach to detect broken tooth conditions in the gearbox based upon recorded vibration data.
I used Raspberry Pi Pico, Arduino IDE, Neuton Tiny ML software
I will give an answer to such a questions as:
Is it possible to make an AI-driven system that predicts gearbox failure on a simple $4 MCU? How to automatically build a compact model that does not require any additional compression? Can a non-data scientist implement such projects successfully?

Introduction and Business Constraint

In industry (e.g., wind power, automotive), gearboxes often operate under random speed variations. A condition monitoring system is expected to detect faults, broken tooth conditions and assess their severity using vibration signals collected under different speed profiles.

Modern cars have hundreds of thousands of details and systems where it is necessary to predict breakdowns, control the state of temperature, pressure, etc.As such, in the automotive industry, it is critically important to create and embed TinyML models that can perform right on the sensors and open up a set of technological advantages, such as:

  • Internet independence
  • No waste of energy and money on data transfer
  • Advanced privacy and security

In my experiment I want to show how to easily create such a technology prototype to popularize the TinyML approach and use its incredible capabilities for the automotive industry.

https://preview.redd.it/9yqxlo08e5p81.png?width=1224&format=png&auto=webp&s=7e94e1cdc8fc3f9feff146052537faa6d887ffa1

Technologies Used

  • Neuton TinyML: Neuton**,** I selected this solution since it is free to use and automatically creates tiny machine learning models deployable even on 8-bit MCUs. According to Neuton developers, you can create a compact model in one iteration without compression.
  • Raspberry Pi Pico: The chip employs two ARM Cortex-M0 + cores, 133 megahertz, which are also paired with 256 kilobytes of RAM when mounted on the chip. The device supports up to 16 megabytes of off-chip flash storage, has a DMA controller, and includes two UARTs and two SPIs, as well as two I2C and one USB 1.1 controller. The device received 16 PWM channels and 30 GPIO needles, four of which are suitable for analog data input. And with a net $4 price tag.

https://preview.redd.it/i9hecq8be5p81.png?width=1265&format=png&auto=webp&s=324da97a54104f7b42ecc52e9679118c75d04580

The goal of this tutorial is to demonstrate how you can easily build a compact ML model to solve a multi-class classification task to detect broken tooth conditions in the gearbox.

Dataset Description

Gearbox Fault Diagnosis Dataset includes the vibration dataset recorded by using SpectraQuest’s Gearbox Fault Diagnostics Simulator.

Dataset has been recorded using 4 vibration sensors placed in four different directions and under variation of load from ‘0’ to ’90’ percent. Two different scenarios are included:1) Healthy condition 2) Broken tooth condition

There are 20 files in total, 10 for a healthy gearbox and 10 for a broken one. Each file corresponds to a given load from 0% to 90% in steps of 10%. You can find this dataset through the link: https://www.kaggle.com/datasets/brjapon/gearbox-fault-diagnosis

https://preview.redd.it/xyihhiwde5p81.png?width=1220&format=png&auto=webp&s=c5bbec2110bf62a3d89416ed4c7dbfc434912919

The experiment will be conducted on a $4 MCU, with no cloud computing carbon footprints 🙂

Step 1: Model training

For model training, I’ll use the free of charge platform, Neuton TinyML. Once the solution is created, proceed to the dataset uploading (keep in mind that the currently supported format is CSV only).

https://preview.redd.it/655xf0uhe5p81.png?width=920&format=png&auto=webp&s=6b4f87374ef3f21aad3cd79b64303b7b2334e67d

https://preview.redd.it/1m8dw3rie5p81.png?width=922&format=png&auto=webp&s=78ee80b7d7c9ae09f85c2490bc96e69e8687857d

https://preview.redd.it/ch9l64nle5p81.png?width=740&format=png&auto=webp&s=1d902649fb8ca03e7082ebc1c4d8803cf910db38

Number of coefficients = 397, File Size for Embedding = 2.52 Kb. That’s super cool! It is a really small model!Upon the model training completion, click on the Prediction tab, and then click on the Download button next to Model for Embedding to download the model library file that we are going to use for our device.

Step 2: Embedding on Raspberry Pico

Once you have downloaded the model files, it’s time to add our custom functions and actions. I am using Arduino IDE to program Raspberry Pico.

Setting up Arduino IDE for Raspberry Pico:

https://reddit.com/link/tkw3e1/video/qsmo4yepe5p81/player

https://preview.redd.it/w5paiptje5p81.png?width=880&format=png&auto=webp&s=ff61cb8124ec4a9d371c52adc6dd9cafb9bf25fc

https://preview.redd.it/k2scjbwse5p81.png?width=890&format=png&auto=webp&s=bad649ff88631896cf58acffdaee6700f581528f

Note: Since we are going to make classification on the test dataset, we will use the CSV utility provided by Neuton to run inference on the data sent to the MCU via USB.

Here is our project directory,

https://preview.redd.it/qqol86o3f5p81.png?width=903&format=png&auto=webp&s=b04430faf2f340a01d8a795e302f6db67eb1b2eb

https://preview.redd.it/dp85hfs4f5p81.png?width=645&format=png&auto=webp&s=fde676f02850c6ed9d56682668e765741bf58320

https://preview.redd.it/usq289n5f5p81.png?width=669&format=png&auto=webp&s=3ad529992b22473d1d773a5ad498acc145fb4e33

I tried to build the same model with TensorFlow and TensorFlow Lite as well. My model built with Neuton TinyML turned out to be 4.3% better in terms of Accuracy and 15.3 times smaller in terms of model size than the one built with TF Lite. Speaking of the number of coefficients, TensorFlow’s model has, 9, 330 coefficients, while Neuton’s model has only 397 coefficients (which is 23.5 times smaller than TF!).

The resultant model footprint and inference time are as follows:

https://preview.redd.it/89xwqbt8f5p81.png?width=740&format=png&auto=webp&s=7ad3b0ff53614a291d059214a20c0100ed6ccbac

submitted by /u/sumitaiml
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *