Skip to content

Gimhan-AI/ML-ESP32S3-ArduinoIDE

Repository files navigation

Deploying an ANN Model on ESP32-S3 WROOM-1 DevkitC-1

This repository outlines the process for deploying an Artificial Neural Network (ANN) model on the ESP32-S3 WROOM-1 DevkitC-1, tailored for applications requiring real-time inference from inputs such as speed and torque to predict system efficiency.

Overview

The deployment process encompasses converting a trained ANN model into TensorFlow Lite (TFLite) format, suitable for execution on low-resource devices. This includes optional quantization for model size reduction and steps for preparing the model for deployment on the ESP32-S3 platform.

Model Architecture and Training

The model is a Sequential ANN trained to predict efficiency based on speed and torque inputs. The architecture consists of multiple dense layers, optimized for performance and accuracy.

Conversion to TensorFlow Lite

The conversion process transforms the trained model into a more compact and efficient format, enabling its deployment on microcontrollers.

Basic Conversion

A simple conversion to TFLite format is performed using TensorFlow's TFLiteConverter. This step is crucial for adapting the model to the constraints of embedded devices.

Conversion with Quantization

For larger models, quantization reduces the size without significantly compromising accuracy, ensuring the model fits within the limited memory of the target device.

Preparing for Deployment

Using XXD for Model Conversion The TFLite model is converted into a C header file (.h) using the xxd utility. This file is then included in the Arduino project for deployment.

xxd -i converted_model.tflite > model_data.h

Adjustments in the Header File

Modifications to the generated C header file may be necessary, such as defining the number of model inputs, outputs, and configuring memory requirements for TensorFlow Lite Micro operations.

Deploying on ESP32-S3

Deployment involves loading the model onto the ESP32-S3 WROOM-1 DevkitC-1 using the Arduino IDE. Instructions are provided for setting up the development environment, including necessary libraries and board configurations.

Input Data Format

The model expects input data in a specific format, typically as floating-point values representing speed and torque. Details on preparing and sending this data to the model for inference are included.

Inference and Output

Upon deployment, the model predicts the efficiency of the system based on the provided inputs. The output is accessible via serial communication, demonstrating the model's real-time inference capability on the ESP32-S3.

Prerequisites

TensorFlow installation for initial model training and conversion. Arduino IDE with ESP32 board support for deployment.

Getting Started

Convert the trained ANN model to TFLite format, applying optional quantization for size reduction.

Utilize the XXD tool to generate a C header file from the TFLite model.

Prepare the model for deployment following the provided guidelines.

Deploy the model to the ESP32-S3 WROOM-1 DevkitC-1 and test its real-time inference performance.

This guide assumes familiarity with TensorFlow for model training and the Arduino development environment for deployment. Specific steps related to these aspects are provided separately or upon request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published