Training DMC Detection with Purely Synthetic Data: Achieving 100 FPS Real-Time Inference on CPU

Purely synthetic data trains YOLOX for DMC detection, achieving 100 FPS on CPU without any GPU.
A developer built a complete Data Matrix Code detection pipeline trained entirely on synthetic data, bypassing the need for real industrial datasets. Using YOLOX with axis-aligned bounding boxes and optimized inference via ONNX Runtime + OpenVINO, the system achieves stable 100 FPS on an 11th-gen Intel i5 desktop CPU with no GPU required. The project demonstrates a practical edge deployment path for resource-constrained scenarios, though the sim-to-real domain gap remains to be validated.
Project Background: Industrial Inspection Without Real Data
In industrial quality inspection scenarios, detecting Data Matrix Codes (DMC) and peened needle marks is a classic machine vision task. However, for independent developers, the biggest obstacle is often not the algorithm itself, but data acquisition — real industrial marking hardware and proprietary factory datasets are typically difficult to obtain.
Recently, a developer (GitHub: olesha-ai) shared a personal research project on Reddit, demonstrating how to build a complete DMC detection pipeline using purely synthetic data with absolutely no real-world data. The entire system runs on a consumer desktop CPU, achieving a stable 100 FPS inference performance. This project provides a valuable reference baseline for low-latency, CPU-side inference optimization.

Technical Breakdown: Synthetic Data and Model Selection
Synthetic Data Generation Strategy
The core idea behind this project is straightforward: since real industrial marked parts are inaccessible, start from geometric and spatial structures and train the detection network using purely synthetic data.
The developer used a standalone tool (DPM-Pattern-Image-Generator) to bootstrap training data, programmatically generating artificial patterns while simulating common defect types found in real industrial environments, such as:
- Missing dots: Simulating dot matrix gaps during the marking process
- Surface noise: Simulating reflections and impurity interference on metal surfaces
The key insight here is that the network learns the layout geometry and spatial structure of DMCs, rather than specific texture features. In theory, as long as the structural distribution of real samples is sufficiently close to the synthetic distribution, the model has a chance to achieve cross-domain generalization. Of course, this is also the greatest uncertainty in the entire approach — whether synthetic data can cover the complexity of real metal surfaces still requires practical validation.
Why YOLOX-ABB Instead of Oriented Bounding Box Detection
The model architecture uses YOLOX with standard Axis-Aligned Bounding Box (ABB) mode, rather than Oriented Bounding Boxes (OBB).
This is a pragmatic engineering decision. The developer pointed out that since target presentation angles are mechanically constrained (workpieces have relatively fixed placement positions on the production line), horizontal bounding boxes are sufficient to meet requirements, without introducing the additional computational overhead and annotation complexity that rotated boxes would bring.
This "good enough" trade-off philosophy is typical wisdom in edge deployment optimization — minimize model complexity while satisfying scenario constraints.
Inference Engine and CPU-Side Performance Optimization
The ONNX Runtime + OpenVINO Combination
The inference pipeline is powered by ONNX Runtime, using Intel's OpenVINO as the execution provider with multi-device mode enabled and strict latency priority hints configured.
The advantages of this combination include:
- ONNX Runtime provides a unified model format and inference interface, facilitating cross-platform deployment
- OpenVINO offers deep optimization for Intel hardware, particularly excelling at CPU-side operator acceleration
- Latency priority mode ensures controllable per-frame response time in real-time detection scenarios
Key Performance Metrics: 100 FPS on an i5 CPU
The project's published performance metrics are impressive:
| Metric | Value |
|---|---|
| Tracking loop (roi_track) average latency | ~10ms/frame |
| Stable frame rate | 100 FPS |
| Hardware | 11th Gen Intel i5-11400 desktop CPU |
| Discrete GPU required | No |
Achieving 100 FPS on an ordinary 11th-gen i5 desktop CPU without relying on any discrete GPU has strong practical value for cost-sensitive industrial deployment scenarios. Many factory production lines are unwilling to equip each inspection station with expensive GPUs, and a pure CPU solution can significantly lower the deployment barrier.
Memory Diagnostics for Long-Running Stability
Notably, the project also includes a lightweight profiling switch. When enabled, the system logs memory consumption data every 15 seconds, used to track and prevent potential memory leaks during extended runtime test cycles.
This detail reflects the developer's attention to industrial-grade long-running stability — in production line environments operating 24/7, memory leaks are a common culprit behind system crashes.
Open Source and Licensing Information
The project is entirely non-commercial, distributed under a strict Non-Commercial Research License. The developer has uploaded the following in the repository's Releases:
- Pre-compiled Windows executable binaries
- Lightweight trained model weights (3MB and 4MB)
The model sizes of only 3-4MB further confirm its edge deployment orientation.
Experimental Limitations: The Sim-to-Real Domain Gap Challenge
The developer showed admirable honesty in the discussion: since the network is trained entirely on synthetic structures, they strongly hoped that someone with access to real marking hardware or metal parts would download the binaries and test the model's performance on real surfaces.
This actually exposes the core unverified issue of the entire approach — the sim-to-real domain gap. While synthetic data solves the data acquisition challenge, whether complex factors like reflections, oil stains, and wear on real metal surfaces can be covered by synthetic defects remains unknown. The developer also explicitly invited the community to report bugs or validate accuracy through GitHub Issues.
Conclusion: An Engineering Path Under Resource Constraints
The value of this project lies not in being a highly polished product, but in clearly demonstrating an engineering path under resource-constrained conditions:
- Bypass data barriers with synthetic data, enabling individual developers to enter high-barrier fields like industrial inspection
- Pragmatic architecture choices (ABB instead of OBB), pursuing the simplest solution while satisfying scenario constraints
- Extreme CPU-side optimization (ONNX Runtime + OpenVINO), proving that real-time detection is achievable without GPUs
- Attention to long-running stability (memory diagnostics), embodying industrial-grade thinking
For developers focused on low-latency CPU inference optimization, this codebase is a solid reference starting point. And the biggest open question it leaves behind — whether a model trained on synthetic data can truly be deployed on real production lines — is precisely what makes this kind of exploration most interesting.
Project repository: https://github.com/olesha-ai/yolox-dmc-inference
Related articles

Gemini Conversation History vs. Google Activity Logs: A Hidden AI Data Transparency Concern
A user discovered persistent inconsistencies between Google Gemini's conversation history and account activity logs, raising AI data transparency and privacy compliance concerns.

Millwright: Redefining the Boundaries Between MLOps Tools with Rust
Millwright is a Rust-based open-source MLOps framework that composes ML lifecycle stages through a unified contract layer with a Python API. We analyze its architecture and the decoupling vs. unification tradeoff.

SVD (Singular Value Decomposition) for Beginners: From Theory to Practical Applications in Image Compression and Recommendation Systems
A beginner-friendly guide to SVD (Singular Value Decomposition), covering its mathematical principles and practical applications in image compression, noise removal, and recommendation systems.