4G remote monitoring for compactors & critical equipment
Free 1-month trial
Technical & AI

Edge AI: Deploying AI on Embedded Systems for Industry

22 juillet 202615 min readIOTINNOV Team

For years, the dominant model of connected industry was simple: send all sensor data to the cloud, process it on centralized servers, then send decisions back to the equipment. This model shows its limits as soon as an application requires a reaction in a few milliseconds, must continue to operate without a network, or produces a data volume that would make a 4G or satellite link too expensive.

Edge AI addresses these constraints: AI algorithms run directly on the embedded system, as close as possible to the sensors and actuators. The decision is made locally, without waiting for a round trip to a remote server. For an industrial SME, the expected benefits are concrete: early anomaly detection to reduce downtime, automated visual inspection to improve quality, transmission limited to only useful information.

This article presents the architecture of an industrial Edge AI system, details an example of an anomaly detection pipeline on a microcontroller, then reviews hardware platforms, software frameworks, security, and the deployment approach.

Edge AI: what exactly are we talking about?

Edge AI refers to running AI model inference, typically neural networks, on an embedded device rather than a remote server. Instead of sending raw data to a server for analysis, the equipment processes it locally and only reports relevant results: alerts, indicators, decisions.

This distinction matters for three reasons:

  1. Latency. A round trip to the cloud often adds tens to hundreds of milliseconds depending on connectivity, and more on an unstable cellular network. To stop a station or reject a defective part, this delay can be prohibitive. Safety functions in the strict sense (emergency stop) remain the responsibility of dedicated safety automation.
  2. Data sovereignty. Certain industrial data (manufacturing plans, recipes, customer data) must not leave the factory perimeter for contractual or regulatory reasons.
  3. Resilience. An Edge AI unit continues to operate if the connection is lost. The cloud becomes a supervision tool, not a critical dependency.

Edge AI does not mean the absence of the cloud. The most common architecture is hybrid: real-time inference runs on the embedded device, while model training, global supervision, history, and update distribution rely on the cloud or a local server.

Architecture of an industrial Edge AI system

An industrial Edge AI system is generally organized around four functional layers, connected by well-defined interfaces.

1. Sensors and acquisition

Cameras (industrial vision), microphones (acoustic analysis), MEMS accelerometers (vibration), temperature, pressure, or current sensors produce a continuous stream of raw data. The choice of sensor directly determines the quality of inferences: a 2-megapixel camera may suffice for a rough inspection, while fine quality control requires higher resolution (5 megapixels or more) and controlled lighting.

2. Preprocessing

Raw signals are rarely usable as-is by a model. The embedded board (ESP32-S3, STM32, Raspberry Pi, NVIDIA Jetson) handles signal conditioning: filtering, image normalization, time windowing, feature extraction (FFT for vibrations, MFCC for audio). This step is critical: poor preprocessing degrades model performance regardless of its sophistication.

3. Inference

The trained model runs locally: convolutional neural network (CNN) for vision, recurrent network (LSTM) or transformer for time series. The inference latency must be compatible with the process cadence, typically on the order of 1 to 50 ms per sample depending on model complexity and processor power.

4. Decision and action

The inference result triggers a local action (station stop, parameter adjustment, operator alert) and, where applicable, a report to supervision (dashboard, REST API, MQTT). This is where business value is created: a defect detected a few hundred milliseconds after it appears can prevent scrapping an entire batch of parts.

Detailed example: an anomaly detection pipeline on ESP32-S3

To make these principles concrete, here is a reference architecture for embedded predictive maintenance of mechanical and hydraulic equipment (compactor, pump, press): inertial sensor and pressure sensor connected to an ESP32-S3, 8-bit quantized LSTM model executed with TensorFlow Lite Micro, and MQTT alert sent only in case of anomaly. The values given are design choices and orders of magnitude, to be validated on each machine.

The problem: data volume and detection time

Consider a site of 50 machines, each equipped with a 3-axis accelerometer sampled at 200 Hz and a pressure sensor at 50 Hz, in 16 bits. Each machine produces about 1.3 KB/s, or nearly 170 GB of raw data per month for the site. Transferring it continuously to a cloud costs in bandwidth, storage, and processing.

But the main problem is detection time. A mechanical defect (bearing wear, progressive hydraulic seal leak, shaft misalignment) evolves over timescales of a few minutes to several hours. If detection goes through the cloud, the acquisition, transmission, processing, and alert chain can reach several tens of seconds on a cellular network with variable signal. The cloud remains essential for aggregation, visualization, and model retraining; detection itself benefits from being local.

Layer 1: acquisition

An inertial measurement unit (for example a BNO08x, 9 axes: accelerometer, gyroscope, magnetometer) detects abnormal vibrations; a differential pressure sensor tracks the state of the hydraulic circuit and seals. Sampling is clocked by a hardware timer on the ESP32-S3 (5 ms period, i.e., 200 Hz) and stored in a circular buffer of 512 samples, i.e., 2.56 s of history. For fine bearing analysis, whose signatures are often at higher frequencies, a sampling rate on the order of kilohertz may be necessary.

Layer 2: embedded preprocessing

Before reaching the model, the data passes through real-time signal processing: Butterworth filter to eliminate motor switching noise outside the useful band, normalization by sliding window (mean and standard deviation over 1 s), then extraction of 12 features, namely for each of the 3 axes the RMS value, kurtosis, skewness, and the amplitude of the dominant frequency peak. This processing uses only a small fraction of the processor (dual-core Xtensa LX7 at 240 MHz) and runs in a dedicated task, isolated from the network task.

Layer 3: inference with TensorFlow Lite Micro

The model is an int8-quantized LSTM, trained on recordings of machines in good condition and machines with known defects (worn bearing, hydraulic leak, shaft misalignment). Its architecture is deliberately compact: input of 32 time steps x 12 features, one LSTM layer of 32 units, one dense layer of 16 neurons (ReLU), and a binary output (normal / anomaly) with a decision threshold, for example 0.78. Such a network has a few thousand parameters: once quantized, it weighs less than 100 KB with its runtime and executes in a few tens of milliseconds per window.

On the memory side, the ESP32-S3 has 512 KB of internal SRAM, complemented on many modules by external PSRAM (up to 8 MB) that can accommodate the largest buffers.

Layer 4: decision and conditional transmission

If the anomaly probability exceeds the threshold, the system triggers two actions:

  • immediate sending of an MQTT alert (for example on the topic iot/compacteur/alert) with a JSON message containing the timestamp, the estimated anomaly type, the sensor values, and the confidence score;
  • saving the raw data segment preceding the alert (the 2.56 s from the buffer) to flash memory, for post-incident analysis.

If the model concludes normal operation, nothing is transmitted except a periodic heartbeat message (for example every 15 minutes). The transmitted volume then becomes a very small fraction of the raw stream.

Training, quantization, and on-site calibration

Training is done offline, on a server equipped with a GPU, with versioned source code. The typical procedure includes:

  1. z-score normalization of all features;
  2. splitting the dataset into training, validation, and test (for example 70 / 15 / 15);
  3. training with the Adam optimizer (learning rate 1e-3, batches of 128) and early stopping on validation loss;
  4. evaluation in precision, recall, and F1 score, more telling than accuracy alone when anomalies are rare.

The model is then quantized to int8 with the TensorFlow Lite converter. Going from 32-bit to 8-bit weights divides the model size by about four, speeds up inference on the microcontroller, and generally costs only a small loss of precision, to be measured on the test set.

One step is often overlooked: validation on the actual hardware with data from the site. Quantization can introduce systematic errors on certain features, particularly kurtosis, which is sensitive to rounding. Plan an on-site calibration phase, for example 48 hours per piece of equipment, before going into production. Also expect slight degradation compared to validation results, due to the noise specific to each environment.

Indicators to measure on the prototype

  • Inference time per window, to compare with the acquisition period;
  • Memory used (model, buffers, task stacks) versus available memory;
  • Average power consumption: a few hundred milliwatts makes solar panel and LiFePO4 battery power feasible;
  • Alert latency, from detection to MQTT publication, which depends mainly on the network;
  • Precision and false alarm rate in operation, tracked over time;
  • Transmitted data volume compared to continuous sending.

The LSTM is a good candidate for this type of data, as it captures the temporal dynamics of multivariate series while remaining compact. A 1D CNN can also give good results on signals with a strong frequency component: compare both on your own data.

Hardware platforms for industrial Edge AI

Hardware choice is the first trade-off of an Edge AI project. Options are classified by performance and consumption level.

Microcontrollers with AI acceleration (entry level)

ESP32-S3: the successor to the ESP32 adds vector instructions that accelerate neural network computations. With TensorFlow Lite Micro or Espressif's libraries, it runs simple classification models (keyword, gesture, vibrations) with consumption on the order of a few hundred milliwatts at most. It is suited to autonomous smart sensors, including battery-powered ones.

STM32N6: STMicroelectronics integrates an NPU (Neural Processing Unit) announced at up to 600 GOPS, capable of running medium-sized vision models (MobileNet, Tiny YOLO). The STM32Cube.AI tool converts Keras, TensorFlow Lite, or ONNX models into optimized code for the microcontroller.

Modules with GPU or accelerator (mid-range)

NVIDIA Jetson Orin Nano: up to 40 TOPS for 7 to 15 W in its 8 GB version. It is the most versatile platform for embedded vision: it runs complex models (YOLOv8, ResNet-50, Whisper) in FP16 and INT8 at video cadence. Its JetPack environment provides profiling, quantization, and deployment tools.

Raspberry Pi 5 with Coral accelerator: an economical solution combining an ARM Cortex-A76 processor with a Google Coral USB TPU, which delivers 4 TOPS in INT8 for about 2 W. This pair is suited to prototyping and small-scale deployments, with a few cameras.

Industrial PC with GPU (high-end)

For multi-camera inspection or complex sensor fusion, an industrial PC equipped with a dedicated GPU (for example NVIDIA RTX A2000 or Intel Arc) offers several tens of TOPS. Power consumption then often reaches 100 to 200 W, which requires mains power and active cooling: acceptable in a technical room, not on a mobile machine.

Software frameworks for deployment

TensorFlow Lite Micro

Google's framework for microcontrollers is the most mature. It supports INT8 quantization, which reduces model size by about 75% with generally limited precision loss, as well as hardware acceleration via DSP extensions and processor vector instructions. It runs on microcontrollers with a few tens of kilobytes of RAM.

Edge Impulse

This platform covers the entire cycle: data acquisition and labeling, training, optimization, deployment. It manages many hardware targets, from ESP32 to Jetson, and facilitates monitoring of data drift and retraining. Its main advantage for an SME is prototyping speed. It is particularly effective for vision and frequency-domain signals; for multivariate time series, a custom-designed model may perform better.

ONNX Runtime

The open ONNX (Open Neural Network Exchange) format allows designing a model with PyTorch, scikit-learn, or Keras, then running it on different targets via ONNX Runtime, optimized for ARM and x86 processors. It is relevant when the same model must run on multiple platforms, or when a device must run several different models. Its memory footprint is however larger than TensorFlow Lite Micro on the smallest microcontrollers.

OpenCV and its DNN module

For industrial vision, OpenCV's DNN module loads and runs TensorFlow, Caffe, Darknet, or ONNX models from a C++ or Python application. It is a lightweight solution for integrating an object detector (YOLO, SSD) into an existing OpenCV pipeline.

Typical Edge AI use cases in industry

The following examples illustrate typical scenarios; actual gains depend on each site and must be measured during a pilot.

Visual inspection on a production line

On a high-speed robotic welding line, visual inspection by an operator is tedious and lets defects through. A detection model (for example quantized YOLOv8) running on a Jetson Orin Nano, connected to two 5-megapixel cameras, can spot porosity, lack of penetration, or cracks in a few milliseconds per part. The operator is then reassigned to processing flagged parts and higher value-added tasks.

Predictive maintenance through vibration analysis

Electric motors equipped with MEMS accelerometers and connected to the cloud via 4G can generate several gigabytes of raw data per day per motor, with a high data bill. By running spectral analysis and an LSTM model directly on a low-power microcontroller (for example from the STM32U5 family), only alerts, a few kilobytes each, are transmitted. The volume drops by several orders of magnitude, and early detection of bearing defects allows planning maintenance rather than suffering the breakdown. To go deeper, see our article on predictive IoT maintenance.

Acoustic quality control of assemblies

On a hydraulic pump assembly line, the "by ear" conformity test is subjective and varies from one operator to another. A MEMS microphone connected to an ESP32-S3 running a CNN trained on a few thousand recordings (good and defective) can objectify this test, with a latency of a few tens of milliseconds and a hardware cost of a few tens of euros per station.

Video anomaly detection on remote sites

To monitor fleets of isolated equipment (intrusion, collision, degradation), sending the continuous video stream to a central server is expensive in bandwidth and delays detection. A Jetson Orin Nano running a convolutional autoencoder processes the stream locally and only reports sequences of interest: the transmitted volume drops from several gigabytes to a few tens of megabytes per day, and detection becomes nearly immediate.

Integration into a multi-equipment system

An industrial site rarely has a single piece of equipment. The pipeline described above is replicated on each unit (compactor, pump, generator set...) with parameters adapted to the machine type. Aggregation at the site level goes through an MQTT broker (Mosquitto or HiveMQ, for example) that only receives alerts and heartbeat messages from each unit. The supervision dashboard displays a consolidated status without processing raw streams.

This architecture relies on two principles: independence of local processing, each piece of equipment operating on its own even if the network is down, and network sobriety, only the useful signal crossing the network. It applies directly to remote monitoring systems, where the number of equipment and the reliability of connectivity are first-order constraints.

Securing the device and the pipeline

An Edge AI device connected to the industrial network is also a potential entry point. Three types of attacks must be considered:

  • data injection: the sensor stream is replaced with false data that masks a real anomaly;
  • MQTT spoofing: false alerts are published to trigger unnecessary interventions;
  • model extraction or modification, which constitutes an intellectual asset.

The corresponding countermeasures:

  • on the sensor link, use integrity checking (CRC) on each frame when the sensor allows it, and reject corrupted frames before they enter the buffer;
  • on the network, encrypt communications with TLS 1.3 with mutual authentication (mTLS): each device has an X.509 certificate signed by an internal certificate authority, verified by the broker before any connection;
  • restrict topics with ACLs: only the relevant device can publish its alerts, only supervision can subscribe to them;
  • verify the SHA-256 fingerprint of the model file at startup and, in case of a mismatch, switch to safe mode and report it to supervision;
  • sign firmware updates, store keys securely, and isolate devices in a dedicated network segment (VLAN).

These measures are detailed in our industrial IoT network security guide. For organizing real-time tasks on the microcontroller, also see our article on FreeRTOS in industrial environments.

Edge AI or cloud: finding the right balance

Edge AI and the cloud are complementary. The balance depends on several criteria:

CriterionEdge AI onlyHybrid edge + cloudCloud only
Decision latencyA few milliseconds to a few tens of millisecondsSame for local decisionsTens to hundreds of milliseconds, more on unstable networks
Offline autonomyTotalHigh (local decision and memory)None
Connectivity costNoneLow (alerts and indicators)High (continuous stream)
Model updatesManual or OTAOTA driven from supervisionImmediate and centralized
Centralized supervisionLimitedCompleteComplete
Infrastructure costLow (local hardware)MediumHigh (cloud and bandwidth)

Our recommendation: first process critical inference locally (defect detection, station safety), then gradually add indicator reporting to the cloud for supervision and historical analysis. This approach avoids connectivity and data sovereignty blockers, while allowing model improvement through retraining on real data.

Deploying Edge AI in an SME: the 5 key steps

  1. Target the need. Identify processes where a real-time decision brings a measurable gain: less scrap, higher cadence, bandwidth saved, breakdowns avoided. Start with a pilot on a critical station rather than transforming everything at once.
  2. Collect representative data. The system will operate in real conditions (vibrations, dust, temperature variations): training data must include them, as well as degraded cases. Expect often several hundred samples per class for classification, more for object detection.
  3. Choose the hardware-software pair. Start from the maximum admissible latency, decision included, to size the platform. Do not oversize: an ESP32-S3 suffices for many simple classifications; reserve Jetsons for multi-camera vision.
  4. Prototype. Edge Impulse or TensorFlow Lite Micro reduce the development of a first prototype to a few days, with a direct path to OTA deployment.
  5. Validate in real conditions. Run the system on site for a break-in period of a few weeks, under human supervision. Measure precision, false alarms, latency, and reliability, then adjust the model and thresholds before going into autonomous production.

Mistakes to avoid

Underestimating data collection

A model is never better than its training data. Data that is too clean or insufficiently varied produces a model that fails in the field. Time spent acquiring representative data, including in degraded operation, is the best investment in the project.

Neglecting quantization

A 32-bit floating-point model may be too large or too slow for the target. INT8 quantization divides its size by about four and accelerates inference, for a precision loss that is often small. It is essential on microcontrollers and useful even on more powerful platforms, where it reduces consumption and heat dissipation.

Forgetting model updates

Conditions evolve: machine wear, raw material changes, seasonal variations. A frozen model sees its performance degrade (drift). Plan an OTA update mechanism from the design phase, to avoid an on-site visit for each new version, and retrain the model with false alarms and new cases encountered in operation.

Ignoring cybersecurity

Encryption of communications, signing of updates, secure key storage, and network segmentation are prerequisites, not options, for any Edge AI device deployed in an industrial environment.

And for compactor remote monitoring?

Not all monitoring requires an embedded AI model. For waste compactors, the IOTINNOV box connects to the machine's 24 V cabinet and reports the controller's signals (powered on, 3/4 full, full, emergency stop, low oil level, container present) as well as a cycle counter, via 4G or Wi-Fi. It stores alerts in local memory in case of a network outage, and the web platform derives a prediction of the next full, with email alerts. To learn more, read how compactor remote monitoring works.

Conclusion

Edge AI does not replace the cloud: it is a local processing layer that makes an industrial system faster, more robust, and less bandwidth-hungry. Thanks to the maturity of frameworks (TensorFlow Lite Micro, Edge Impulse, ONNX Runtime) and platforms ranging from microcontrollers at a few euros to Jetson modules at a few hundred euros, an SME can run a first pilot in a few weeks.

For a technical decision-maker, the message is simple: anomaly detection no longer needs a data center. It needs a good sensor, an adapted model, validated in the field, and an architecture that knows when to transmit and when to stay silent.

An embedded IoT project?

Our team designs the box, its firmware and the platform. Let's discuss your needs.