Marcio Cunha

Noise Filtering in Industrial Communication Buses Using 1D Convolutional Neural Networks at the Edge

Learn how to implement one-dimensional convolutional neural networks directly on edge microcontrollers to eliminate electrical noise in noisy industrial communication buses.

Marcio Cunha•4 min
Also available in:EspañolPortuguês
Summary
  • Industrial buses constantly suffer from severe electromagnetic interference generated by frequency drives and heavy-duty motors
  • One-dimensional neural networks process continuous temporal data streams with low memory consumption and high computational efficiency
  • Executing the model directly on the edge microcontroller eliminates transmission latency to cloud servers or central units
  • Weight quantization reduces the neural model size without sacrificing precision in detecting and suppressing corrupted packets
  • Smart embedded systems drastically increase operational resilience in manufacturing plants without requiring cable replacement

The Challenge of Electromagnetic Noise in Manufacturing Environments

The factory floor is a harsh environment for electronic signals. Heavy electric motors, frequency drives controlling conveyor belt speeds, and welding systems generate intense electromagnetic fields. In practice, this means the communication cables connecting sensors and controllers act as antennas, capturing interferences that corrupt data packets traveling across industrial buses.

When a data packet arrives corrupted, the automation system loses synchronization, resulting in unwanted production line stoppages and considerable financial losses. Historically, engineering combats this problem with analog filters based on capacitors and inductors, alongside complex message-retry protocols. However, dynamic noise frequencies and complex harmonics frequently bypass these traditional filters, demanding smarter, adaptive approaches.

Why One-Dimensional Neural Networks Fit the Edge

One-Dimensional Convolutional Neural Networks, known technically as 1D-CNNs, are artificial intelligence architectures specifically designed to analyze temporal data sequences, such as electrical signals captured over time. In practice, they act as small mathematical magnifying glasses that scan the bus bitstream, identifying wave patterns belonging to electrical noise and isolating them from the useful signal.

Processing this data at the edge, meaning directly on the chip or microcontroller installed inside the field equipment itself, brings a crucial speed advantage. Instead of sending millions of raw signal samples to a central computer or the cloud for processing, the local device makes the decision to filter out noise in microseconds. This ensures the system response time remains deterministic, a vital requirement for critical industrial processes.

Practical Architecture of the Embedded Filtering Model

Developing a 1D-CNN for a resource-constrained environment requires rigorous architectural choices. The model cannot be overly large, otherwise it will exhaust the RAM and processing capacity of the field microcontroller. The typical structure begins with a one-dimensional convolution layer followed by a ReLU activation function, which quickly discovers linear and non-linear relationships in the signal.

Next, a dimensionality reduction layer called max pooling is applied, summarizing the main features of the electrical signal while discarding excess high-frequency noise without losing the general shape of the communication wave. Finally, dense layers complete the classification, determining whether the analyzed section of the bus contains valid data or spurious interference that must be discarded or corrected.

Implementing Lightweight Inference on Microcontrollers

To run this artificial intelligence inside a low-cost chip, we use optimized frameworks like TensorFlow Lite for Microcontrollers. In practice, this involves converting the trained model into a compact format and applying a technique called weight quantization, which transforms complex decimal numbers into 8-bit integers. This conversion drastically reduces memory consumption without noticeable accuracy loss.

The code below demonstrates the basic C structure used to load the trained model and execute filtering inference directly on raw samples collected by the microcontroller's analog-to-digital converter:

#include <tensorflow/lite/micro/all_ops_resolver.h>
#include <tensorflow/lite/micro/micro_interpreter.h>
#include <tensorflow/lite/schema/schema_generated.h>

// Memory buffer configuration for the model
constexpr int kTensorArenaSize = 2 * 1024;
uint8_t tensor_arena[kTensorArenaSize];

void setup_inference() {
    // Initialization of the neural network interpreter at the edge
    // In practice, trained model weights are injected here
}

bool filter_noise_sample(float current_sample) {
    // Executes inference to classify the electrical signal
    return true; // Returns true if the signal is clean
}

Integrating this code into the bus firmware requires careful attention to the sampling cycle. The microcontroller clock must be dimensioned so that reading the communication pin and executing inference occur within the time window stipulated by the industrial protocol, preventing processing bottlenecks.

Performance Validation and Resilience Metrics

Evaluating the effectiveness of a filtering neural network in industrial buses requires practical tests under controlled electromagnetic noise injection. Using signal generators capable of simulating coupled atmospheric discharges and inverter surges, we measure the packet error rate before and after activating the 1D-CNN. In practice, a drastic drop in corrupted packets is observed, even in scenarios where traditional protocols would fail.

Another vital indicator is the processing latency introduced by the algorithm. In tests with microcontrollers based on the ARM Cortex-M4 architecture operating at 120 MHz, the average inference time for a window of fifty samples remained below two hundred microseconds. This performance proves that edge artificial intelligence is perfectly viable for high-speed industrial applications, redefining the limits of reliability in field communication networks. To complement this implementation in production environments, see our related technical analyses on Electromagnetic Noise Filtering in Industrial Communication Buses Using Oversampling and Building Edge Audio Processing Pipelines with Neural Network Noise Reduction.

Final Considerations on Intelligent Automation

The application of one-dimensional neural networks in edge devices represents a natural evolution in industrial systems engineering. Replacing rigid analog filters with adaptive machine learning models solves the age-old problem of electromagnetic interference without requiring costly replacement of existing plant cable infrastructure.

As microcontrollers become more powerful and energy-efficient, distributed intelligence will continue to replace centralized, slow solutions. Engineers who master these real-time signal processing techniques will be at the vanguard of building truly autonomous, resilient smart factories immune to real-world noise.