Chapter 12
Embedded, Edge and Industrial AI Deployment
Bachelors Program in Electrical Engineering
AI Applications in Electrical Engineering
•
Bachelor
Embedded, Edge and Industrial AI Deployment
Introduction
Artificial-intelligence systems used in electrical engineering do not operate only inside data centres. A protective relay, motor drive, photovoltaic inverter, battery-management system, robotic controller, or substation sensor must often make decisions close to the physical process. Such systems have limited memory, processing power, energy, communication bandwidth, and response time. Deploying a trained model therefore requires much more than exporting a neural-network file. It requires a coordinated design involving hardware, software, data movement, numerical precision, communications, safety, cybersecurity, and maintenance.
Embedded AI refers to machine-learning capability implemented within a constrained device such as a microcontroller, digital signal processor, FPGA, or system-on-chip. Edge AI places computation near the data source, possibly in an industrial gateway or local server. Cloud AI uses remote computing resources, generally for large-scale training, fleet analysis, model management, or computationally intensive inference. Industrial AI combines these forms with operational technology, real-time control, industrial networks, safety requirements, and long equipment lifetimes.
A useful engineering principle is to place each function at the lowest level that can satisfy its requirements. A fast overcurrent trip may belong in dedicated hardware or a local controller; vibration classification may belong in an edge gateway; fleet-wide prognostics may belong in the cloud. The choice is determined by latency, reliability, energy, privacy, cost, bandwidth, and maintainability rather than by computational capability alone.
Learning objectives
By the end of this chapter, a student should be able to:
Distinguish embedded, edge, fog, and cloud AI architectures.
Match AI workloads to microcontrollers, FPGAs, processors, edge gateways, and cloud platforms.
Explain pruning, distillation, low-rank approximation, and quantization.
Estimate memory, latency, throughput, and energy requirements.
Design an AI-enabled industrial communication and deployment pipeline.
Evaluate real-time, safety, cybersecurity, interoperability, and lifecycle constraints.
Propose and assess an industrial edge-AI solution.
1. Deployment as a systems-engineering problem
Training commonly occurs offline using a large data set and powerful processors. Deployment is inference: the repeated execution of a fixed model on new measurements. The deployment pipeline includes sensing, signal conditioning, feature extraction, inference, decision logic, actuation or reporting, data logging, and model maintenance.
A model that is accurate in a notebook may fail in practice because of sensor drift, changed operating regimes, numerical differences, communication delay, inadequate memory, or an unsuitable sampling rate. Consequently, deployment requirements should be written before hardware selection. Typical requirements include:
maximum end-to-end response time;
minimum classification or regression performance;
available flash, RAM, processor cycles, and energy;
permitted false-alarm and missed-detection rates;
operating temperature and electromagnetic environment;
network availability and cybersecurity controls;
functional-safety and certification obligations; and
update, rollback, monitoring, and support procedures.
Deployment locations
A microcontroller unit (MCU) is suitable for low-power sensing and deterministic control. It normally has limited RAM and may lack an operating system. A DSP is optimized for repetitive numerical operations such as filtering and transforms. An FPGA implements parallel datapaths and pipelines and is attractive when very low latency, high throughput, or custom interfaces are required. A CPU/GPU/NPU system-on-chip supports more complex models and operating systems. An industrial edge computer can aggregate many devices and connect operational technology to enterprise systems. Cloud platforms provide elastic storage and computation but depend on communications and governance.
Shared resources, local storage, protocol conversion
Higher power and cost than an MCU
Plant-wide condition monitoring
Cloud
Large-scale training, fleet analytics, model registry
Network delay, availability and privacy concerns
Predictive maintenance across sites
The architecture is often hybrid. Raw high-rate signals can be processed locally into features or events, while selected records and model statistics are sent to the cloud. This reduces bandwidth and preserves local operation during network failure.
Layered industrial AI deployment architecture
Figure: Layered industrial AI deployment architecture
Figure: A hybrid industrial AI architecture in which local inference supports immediate operation and the cloud supports fleet-level functions.
2. Resource constraints and performance models
Memory and computational workload
For a dense neural layer with input width n, output width m, and batch size one, the approximate number of multiply–accumulate operations is:
MACs ≈ n × m
A complete network has approximately the sum of the MAC counts of its layers. This estimate excludes activation functions, normalization, memory transfers, padding effects, and control overhead, so it is a planning estimate rather than a timing guarantee.
If a model has P parameters and each parameter uses b bits, parameter storage is:
Mparameters = P × b / 8 bytes
Additional memory is required for activations, buffers, stack, operating-system services, input windows, and temporary workspaces. During inference, peak memory is more important than the total size of all tensors because buffers may be reused.
Latency and real-time operation
For a sequential inference path, end-to-end latency can be approximated by:
Each term must use the same time unit. In a hard real-time system, the relevant quantity is the worst-case execution time (WCET), not the average. A system is schedulable only when its worst-case timing, including interrupts and communication, satisfies the control deadline.
For a periodic task with execution time C and period T, a simple single-task utilization is:
U = C / T
Here C and T are measured in seconds, and U is dimensionless. For several independent periodic tasks on one processor, total utilization is ΣCᵢ/Tᵢ. This ratio is a useful screening measure, but it does not by itself prove schedulability; task priorities, release jitter, blocking, deadlines, and scheduling policy must also be considered.
Throughput and latency are different. A pipeline may process many samples per second after it is filled while still having a large first-result delay. Industrial control generally requires bounded latency, whereas batch analytics emphasizes throughput.
Energy
Electrical energy consumed by a device is:
E = ∫₀ᵀ P(t) dt
where E is joules, P(t) is instantaneous power in watts, and T is the observation interval in seconds. If power is approximately constant, E ≈ P × T. Energy per inference is approximately total inference energy divided by the number of inferences, but sensor, memory, radio, and idle energy must not be omitted. In battery systems, reducing radio transmissions can save more energy than reducing arithmetic operations.
3. Model compression and numerical optimization
Compression should preserve the engineering decision, not merely a benchmark score. A small increase in classification error may be unacceptable if it produces missed protection events, whereas a modest change may be acceptable for maintenance prioritization.
Pruning
Pruning removes parameters or structures judged to contribute little to the output. Unstructured pruning creates sparse individual weights but may not accelerate inference unless the hardware and software exploit sparsity. Structured pruning removes complete filters, channels, neurons, or layers and usually produces more predictable speed and memory reductions. A common workflow is train, prune, fine-tune, and validate on representative operating conditions.
Knowledge distillation
In distillation, a smaller student model learns from a larger teacher model, often using both hard labels and teacher output probabilities. The student can reproduce useful class similarities while requiring fewer parameters. Distillation does not guarantee reliability under rare faults; rare and safety-critical cases must remain in validation data.
Quantization
Quantization represents values with fewer bits. In a simple uniform affine scheme, a real value x is mapped to an integer q by:
q = round(x / s) + z
and reconstructed by:
x̂ = s × (q − z)
where s > 0 is the scale, z is the zero-point, q is the stored integer, and x̂ is the reconstructed value. The zero-point is often chosen so that real zero is represented accurately. Scale and zero-point must be calibrated from representative ranges; otherwise clipping or excessive quantization error can occur.
Symmetric quantization commonly uses z = 0. Per-tensor quantization uses one scale for a tensor; per-channel quantization uses different scales for channels and often preserves accuracy better in convolutional networks. Post-training quantization is applied after training. Quantization-aware training simulates quantization during training and can improve the final result, especially for sensitive models.
A binary fixed-point format with n total bits and f fractional bits has a resolution of 2⁻ᶠ in the absence of saturation. The representable range depends on whether the format is signed and on the integer-bit allocation. Designers must explicitly test overflow and saturation because a numerically efficient model can become unsafe if a signal wraps around.
Worked example: quantization
Suppose a sensor feature lies in the range −1.28 to 1.27 and is stored as signed 8-bit integers from −128 to 127 using a symmetric scale. Taking s = 1.28/128 = 0.01 gives q = round(x/0.01). A value x = 0.63 becomes q = 63 and reconstructs as x̂ = 0.63. A value x = −1.30 lies outside the calibrated range and is clipped to approximately −1.28. The example illustrates why calibration data must include the expected operating envelope; otherwise saturation distorts the signal.
4. Hardware and software implementation
A deployment toolchain generally performs the following steps:
freeze preprocessing, feature order, normalization, and model parameters;
convert the model to a supported intermediate representation;
select kernels for the target CPU, DSP, NPU, or FPGA;
apply compression and numerical conversion;
generate firmware or a containerized service;
test numerical equivalence against a reference implementation;
measure timing, memory, power, and accuracy on target hardware; and
package, sign, deploy, monitor, and if necessary roll back the model.
The preprocessing implementation must be identical in meaning to the training implementation. Differences in scaling, window overlap, filtering phase, missing-value handling, or byte order are frequent causes of deployment failure.
Microcontrollers
MCU inference is appropriate when the model and working memory fit on-chip or attached memory and when deterministic execution is valuable. Integer kernels, direct memory access, circular buffers, fixed-point signal processing, and sleep modes are commonly used. The firmware should separate safety-critical control from non-critical inference so that a model fault cannot prevent a safe fallback controller from operating.
FPGAs
FPGAs can pipeline multiply–accumulate operations and exploit parallelism. Designers must balance logic cells, digital signal-processing blocks, block RAM, external memory bandwidth, clock frequency, and numerical precision. A streaming architecture can reduce memory traffic, but reconfiguration and verification are more demanding than software deployment. FPGAs are particularly useful for high-rate waveform processing, deterministic pipelines, and custom industrial interfaces.
Edge processors and containers
An edge computer can host several models, protocol adapters, databases, and dashboards. Containers improve packaging and reproducibility, but container isolation is not a substitute for secure configuration or real-time guarantees. GPU and NPU acceleration can reduce inference time, although data transfer and model conversion overhead may dominate small workloads.
5. Industrial communication and interoperability
AI systems are embedded in networks rather than isolated from them. Common links include UART, SPI, I²C, CAN and CAN-FD at the device level; Ethernet and industrial Ethernet in plants; and MQTT, OPC UA, HTTP, and fieldbus protocols at higher levels. Protocol selection depends on determinism, bandwidth, topology, interoperability, security, and existing plant standards.
A practical architecture often uses a gateway to translate between operational protocols and information models. OPC UA supports structured, semantically described industrial information and security mechanisms. MQTT uses a publish–subscribe pattern and is efficient for telemetry, but it does not by itself define the meaning or safety of a measurement. Modbus is widely deployed and simple, but semantic richness and security depend heavily on the surrounding design.
Every message should have an explicit data contract: variable name, engineering unit, timestamp, quality flag, source identifier, sampling rate, scaling, and version. Time synchronization is essential when correlating voltage, current, vibration, and control events. A timestamp should identify whether it represents sensor acquisition, gateway reception, or cloud ingestion.
AI should not directly command a dangerous actuator solely because a message arrived. Commands require authentication, range checking, freshness checks, interlocks, fail-safe states, and an independent safety layer. Communication loss should produce a defined local behavior rather than an undefined state.
6. Real-time, safety, and cybersecurity
Industrial systems may contain hard real-time tasks, in which missing a deadline can cause physical damage, and soft real-time tasks, in which delay degrades service quality. AI inference is often best treated as advisory unless it has been rigorously verified for the required safety function. A conventional protection mechanism can provide a deterministic boundary while AI supplies early warning or adaptive optimization.
Safety analysis should consider hazards, failure modes, safe states, diagnostic coverage, and independence. An AI model can fail silently under distribution shift, adversarial input, sensor failure, or unexpected combinations of variables. Useful mitigations include confidence thresholds, out-of-distribution checks, redundant sensors, plausibility rules, watchdogs, fallback models, human confirmation, and conservative operating limits.
Cybersecurity controls include secure boot, hardware-rooted keys, signed firmware and model packages, encrypted communication, least privilege, network segmentation, vulnerability management, audit logs, and protected update channels. Model files should be treated as software artifacts: their provenance, version, hash, approval status, and compatibility must be recorded. An attacker may alter a model, replay sensor values, inject false measurements, or exploit an edge service even when the neural network itself is mathematically correct.
Governance also requires data minimization, access control, retention rules, explainable operator interfaces, and clear accountability. A model that recommends maintenance must not obscure whether the recommendation came from a current model, stale data, or a communication failure.
7. Model lifecycle and validation
Deployment is a lifecycle rather than a one-time installation. A robust process includes:
data qualification: verify coverage, labels, units, sensor calibration, and class balance;
offline evaluation: test accuracy, precision, recall, confusion matrices, calibration, and rare events;
hardware-in-the-loop testing: connect the controller to simulated plant behavior and fault scenarios;
pilot operation: begin with monitoring or shadow mode before enabling decisions;
production monitoring: track data drift, missing data, confidence, false alarms, and resource use; and
change control: approve, sign, deploy, monitor, and roll back versions.
For a binary fault detector, recall and precision have different meanings. Recall is the fraction of actual faults detected; precision is the fraction of alarms that are true faults. In a rare-fault setting, accuracy can be misleading because a system that always predicts “normal” may appear accurate. Threshold selection should reflect the cost of missed faults, false trips, inspection effort, and safety consequences.
Concept drift occurs when the relationship between measurements and outcomes changes. Causes include ageing equipment, changed loads, new control settings, seasonal conditions, and sensor replacement. Retraining must be governed; automatic retraining without validation can introduce a new failure mode.
8. Illustrative case: edge AI for induction-motor condition monitoring
Background
Consider a fictional medium-sized manufacturing plant with 40 induction motors. The plant wishes to detect bearing and misalignment problems early. Vibration is sampled at each motor, while motor current, temperature, speed, and operating state are also available.
Problem
Sending all raw vibration samples to the cloud would consume bandwidth and would not guarantee operation during network interruptions. A maintenance alarm should be generated locally within a few seconds, while engineers also require long-term trends.
Analysis
The design team specifies a 1 s analysis window with 50% overlap, a local alarm latency below 3 s, operation for at least 24 h during network loss, and a false-alarm rate low enough to avoid unnecessary shutdowns. Because a missed severe bearing fault is more costly than an inspection, the operating threshold is selected for high recall, with a human review stage before planned maintenance.
Approach and solution
An MCU attached to each sensor performs anti-alias filtering, windowing, root-mean-square and spectral feature extraction. An eight-bit quantized classifier runs locally. The node publishes an event containing motor identity, timestamp, feature summary, model version, confidence, and data-quality status through an industrial gateway. The gateway uses OPC UA to expose structured plant data and MQTT to transmit selected events to the cloud. Raw waveforms are retained locally in a circular buffer and uploaded only when an alarm or diagnostic request occurs.
The controller does not shut down the motor directly. A rule-based protection system remains independent. If confidence exceeds the maintenance threshold, the gateway creates a work-order recommendation. If the sensor is invalid or communication fails, the system reports “unknown” rather than “healthy.” Model updates are signed and first released to two pilot motors.
Outcome
In the pilot, local inference meets the latency target and reduces routine network traffic substantially. Engineers discover that a loose sensor mount produces a pattern similar to a bearing fault. Adding a sensor-quality feature and a mounting inspection rule reduces false alarms. The case demonstrates that successful industrial AI depends on instrumentation, data contracts, fallback logic, and maintenance workflow—not only classifier accuracy.
Learning points
Local inference can preserve availability and reduce bandwidth.
Alarm decisions require context and quality flags.
Safety protection should remain independent of an advisory model unless the complete safety case supports AI use.
Pilot deployment exposes failure modes absent from laboratory data.
Model version, timestamp, and provenance are operational requirements.
9. Contemporary developments and best practices
TinyML brings inference to very small, low-power devices using compact architectures, integer arithmetic, and event-driven sensing. Federated learning can reduce centralization of raw data, but it introduces communication, aggregation, privacy, and non-identically distributed data challenges. Digital twins can provide simulated operating conditions for testing and predictive maintenance, although simulation-to-reality mismatch must be measured. Neuromorphic and approximate-computing approaches may reduce energy for suitable event-based workloads, but toolchains and verification practices remain less mature.
Recommended practice is to begin with requirements and a safe baseline, measure on target hardware, preserve a deterministic fallback, define data and protocol contracts, use representative and rare-event validation, secure the entire artifact chain, deploy gradually, and monitor both model quality and physical-system consequences. The best architecture is not necessarily the one with the newest accelerator; it is the one that remains correct, observable, maintainable, and safe under realistic failure conditions.
Chapter Summary
Embedded, edge, and industrial AI deployment connects trained models to physical processes under constraints on time, memory, energy, bandwidth, reliability, and safety. MCUs provide low-power deterministic inference, FPGAs provide parallel and predictable datapaths, edge gateways provide local aggregation and protocol integration, and cloud platforms support fleet-scale analytics and lifecycle management. Hybrid architectures are usually most effective.
Deployment performance must be evaluated using memory, MAC count, latency, throughput, WCET, utilization, and energy. Pruning, distillation, and quantization reduce resource requirements, but compression must be validated against engineering consequences. Industrial integration requires explicit data contracts, time synchronization, interoperable protocols, cybersecurity, functional separation, fallback behavior, and controlled model updates. Hardware-in-the-loop tests, pilot operation, monitoring, drift management, and rollback are essential parts of the model lifecycle. AI should complement, not casually replace, deterministic protection and safety mechanisms.
Key Terms
Embedded AI: AI inference implemented within a resource-constrained device.
Edge AI: AI computation performed near the data source.
Cloud AI: Remote, scalable computation used for training, storage, and analytics.
Inference: Applying a trained model to new input data.
Worst-case execution time: Maximum bounded execution time used in real-time analysis.
Latency: Time from input acquisition to the required output.
Throughput: Quantity of data or inferences processed per unit time.
Quantization: Representing numerical values with reduced precision.
Scale: Conversion factor between a real value and a quantized integer.
Zero-point: Integer representation of real numerical zero in affine quantization.
Pruning: Removal of model parameters or structures.
Knowledge distillation: Training a compact student model using information from a teacher model.
Structured sparsity: Removal of complete model structures such as channels or filters.
Interoperability: Ability of systems to exchange and correctly interpret information.
Data contract: Defined meaning, format, units, timing, and quality requirements for data.
Concept drift: Change over time in the relationship between inputs and outcomes.
Hardware-in-the-loop: Testing a controller with a simulated or emulated physical process.
Secure boot: Startup verification ensuring that authorized software is executed.
Fallback controller: Independent or simpler control strategy used when AI is unavailable or unreliable.
Model registry: Controlled repository of approved model versions and metadata.
Review Questions
Short Answer Questions
Distinguish embedded AI, edge AI, and cloud AI.
Why is worst-case latency more important than average latency in hard real-time control?
State two benefits and one limitation of FPGA-based inference.
What are the roles of scale and zero-point in affine quantization?
Why should an industrial AI message include a timestamp and a quality flag?
Long Answer Questions
Explain how a hybrid embedded–edge–cloud architecture can support both local control and fleet-wide predictive maintenance.
Compare pruning, knowledge distillation, and quantization, including their effects on accuracy, memory, and hardware implementation.
Describe a complete validation and lifecycle process for an AI model used in an industrial plant.
Discuss why an AI model should generally be separated from a deterministic safety or protection function.
Explain the roles of MQTT, OPC UA, and a data contract in an industrial AI system.
Analytical / Application Questions
A device executes four periodic tasks with execution/period pairs of 2/10 ms, 1/20 ms, 3/50 ms, and 4/100 ms. Calculate total utilization and discuss why the result alone does not prove schedulability.
Design an MCU-based vibration-monitoring pipeline for a motor. Specify sensing, preprocessing, model execution, local decision logic, communication, fallback behavior, and validation tests.
An eight-bit model performs well in laboratory tests but generates false alarms after installation. Analyze at least four possible causes and propose a structured investigation and corrective-action plan.
Multiple Choice Questions with Answers
Question 1
Which deployment location is generally best suited to a hard, low-latency local control decision?
A. Cloud data centre
B. Local MCU or FPGA
C. Enterprise data warehouse
D. Remote office workstation
Correct Answer: B. Local MCU or FPGA
Question 2
For a dense layer with n inputs and m outputs, the approximate number of multiply–accumulate operations for batch size one is:
A. n + m
B. n − m
C. n × m
D. n ÷ m
Correct Answer: C. n × m
Question 3
In affine quantization, the reconstructed value is represented by which relationship?
A. x̂ = s × (q − z)
B. x̂ = q + s + z
C. x̂ = s ÷ (q − z)
D. x̂ = q × z − s
Correct Answer: A. x̂ = s × (q − z)
Question 4
Which statement best describes structured pruning?
A. It removes complete channels, filters, or other model structures
B. It increases the number of model parameters
C. It changes only the communication protocol
D. It requires all weights to remain floating point
Correct Answer: A. It removes complete channels, filters, or other model structures
Question 5
Why can accuracy be misleading for a rare-fault detector?
A. Accuracy cannot be calculated for classifiers
B. A system predicting normal operation may appear accurate despite missing faults
C. Accuracy measures only energy consumption
D. Accuracy is always lower than recall
Correct Answer: B. A system predicting normal operation may appear accurate despite missing faults
Question 6
Which item is part of a useful industrial data contract?
A. Only the colour of the dashboard
B. Variable meaning, unit, timestamp, and quality flag
C. The physical location of the cloud provider only
D. The employee's preferred programming language
Correct Answer: B. Variable meaning, unit, timestamp, and quality flag
Question 7
A task executes for 2 ms every 10 ms. Its utilization is:
A. 0.02
B. 0.2
C. 2
D. 20
Correct Answer: B. 0.2
Question 8
Which control most directly helps prevent unauthorized model or firmware installation?
A. Secure boot and signed packages
B. Increasing the sensor sampling rate
C. Removing timestamps
D. Using a larger display
Correct Answer: A. Secure boot and signed packages
Question 9
What is the principal purpose of a fallback controller?
A. To increase cloud storage cost
B. To provide defined operation when AI is unavailable or unreliable
C. To eliminate all sensor calibration
D. To replace cybersecurity controls
Correct Answer: B. To provide defined operation when AI is unavailable or unreliable
Question 10
Which statement correctly distinguishes throughput from latency?
A. Throughput is processing rate, whereas latency is time to produce a required result
B. They are always numerically identical
C. Latency measures model memory and throughput measures voltage
D. Throughput applies only to analogue systems
Correct Answer: A. Throughput is processing rate, whereas latency is time to produce a required result
AI Applications in Electrical Engineering
Chapter 12
of 14