Deep Learning for Edge
Back to generator

Complete Guide

Everything you need to know to configure your deep learning model

What is Deep Learning for Edge?

This tool allows you to design an artificial neural network and generate optimized code that runs directly on a microcontroller (MCU). This is known as TinyML or Edge AI.

Instead of relying on cloud servers, your model runs locally on the device, which enables:

Low latency

Inference in milliseconds without internet connection

Privacy

Data never leaves the device

Efficiency

Low power consumption for battery-powered devices

Step-by-step process

1

Select your microcontroller

Choose the platform where the model will run. Each option generates code in a different language and format, optimized for that hardware's capabilities.

2

Configure training epochs

An epoch is one complete pass through the entire dataset. More epochs generally improve accuracy but increase training time and can cause overfitting. Start with 300-500 and adjust based on results.

3

Design the layer architecture

Define how many hidden layers your network will have and how many neurons each layer contains. More layers and neurons allow capturing more complex patterns, but also require more memory and inference time on the MCU.

4

Upload your training dataset

A CSV file with your training data. Columns represent features and the last column is the label that the model should predict.

5

Generate the model

The system processes your configuration, trains the neural network, and generates optimized source code ready to compile and upload to your microcontroller.

Video tutorial

Watch this video for a visual step-by-step explanation of how to use the tool:

Video tutorial thumbnail
Click the image above or open the video on YouTube

Activation functions explained

Activation functions determine how a neuron transforms its input. Without them, a neural network would be just a linear combination (unable to learn complex patterns).

The most popular activation for hidden layers. Fast to compute and works well in most cases. If the neuron receives a negative value, it converts it to 0. Very efficient on microcontrollers due to its computational simplicity.

Recommended for

Hidden layers in general, default first choice

Avoid for

Problems where dead neurons are an issue

A ReLU variant that allows a small gradient when x < 0 (typically α = 0.01). Prevents 'dead neurons' where neurons permanently stop learning.

Recommended for

When ReLU causes dead neurons or the model doesn't converge

Avoid for

If ReLU already works well (adds an extra parameter)

A piecewise linear approximation of the Tanh function. Much more efficient to compute than Tanh since it doesn't require exponentials. Ideal for resource-constrained microcontrollers.

Recommended for

MCUs with limited compute capacity, efficient Tanh replacement

Avoid for

If you need smooth outputs outside the [-1, 1] range

A piecewise linear approximation of the Sigmoid function. Eliminates the need to compute exponentials, making it ideal for resource-limited hardware. Produces outputs in the [0, 1] range.

Recommended for

Output layer for binary classification on MCUs, efficient Sigmoid replacement

Avoid for

Problems requiring very smooth gradients

CSV dataset format

The CSV file must follow a specific format for the system to process it correctly:

Required structure

ID,feature_1,feature_2,...,feature_n,label
1, 0.5, 1.2, ..., 3.4, 0
2, 0.8, 2.1, ..., 1.7, 0
3, 9.8, 1.1, ..., 1.7, 1
4, 1.8, 5.1, ..., 5.7, 1
6, 2.8, 3.1, ..., 2.7, 1
7, 8.8, 7.1, ..., 1.7, 2
8, 5.1, 8.9, ..., 6.3, 2
9, 3.1, 9.9, ..., 2.3, 2
........................
........................

Requirements

  • > First row: column names (header)
  • > First column: auto-increment row ID
  • > Last column: label/class to predict
  • > Label: value integer and starting from 0 with consecutive values
  • > unlimited Label/class to predict
  • > Numeric features (decimals with dot)
  • > No empty or null values
  • > Separator: comma (,)
  • > Maximum size: 1 MB

Recommendations

  • Normalize features to the [0, 1] range
  • Balance classes (same amount per label)
  • Minimum 50 samples per class
  • Check for outliers that may distort the model
  • Use UTF-8 encoding

Tips for better results

Start simple

Begin with 2-3 layers and few neurons. Increase complexity only if the model doesn't learn sufficiently.

Balance performance vs. resources

More neurons = more accuracy but more RAM and inference time. On an MCU with 264 KB of RAM, a model with 50+ neurons may not fit.

Adjust epochs gradually

If the model underfits, increase epochs. If it overfits, reduce them or add more data.

Dataset quality matters more

A clean, well-labeled dataset with 200 samples usually works better than a noisy one with 2000 samples.

Watch out for overfitting

If you use many epochs and few samples, the model memorizes the data instead of learning patterns. Sign: works perfectly on training but fails with new data.

Frequently asked questions

It depends on the problem complexity. For simple classification (2-3 classes, few features), 4-8 neurons per layer are usually enough. For more complex problems, try 10-16. Remember that each neuron consumes RAM on the MCU.
For hidden layers: start with ReLU (it's the default option and works in most cases). If you experience dead neurons, try Leaky ReLU. Hard Tanh and Hard Sigmoid are optimized versions for microcontrollers that avoid expensive exponential operations.
For most MCU problems, 2-4 layers are sufficient. Deeper networks capture more complex patterns but consume more memory. Only add layers if the model doesn't converge with fewer.
Reduce the number of layers or neurons. You can also use quantization techniques (converting weights from float32 to int8) which are automatically applied based on the selected MCU.
Yes, you use the generated library.
At minimum, 50 samples per class. Ideally 200+ per class for classification problems. For regression, at least 100 total samples distributed across the output range.
Yes. The generated models are optimized for fast inference. A typical model (3 layers, 8 neurons each) can execute a prediction in less than 1 ms on an RP2040 at 133 MHz.
Back to Model Generator

Contact mail

www.neoeduca.cl / www.torneorobotica.cl