Embedded & Software / Engineering / Product Development

AI Quality Assurance in Industrial Manufacturing

Multi-stage AI system for defect detection in industrial production — over 99% accuracy, running 24/7 for over a year.

AI Quality Assurance in Industrial Manufacturing

Development and implementation of a custom AI system for automatic defect detection in an industrial production line. Two cameras, three AI models, a two-stage inspection, industrial-grade hardware in custom stainless steel enclosures, and a dashboard application with remote maintenance — developed end-to-end, from hardware to trained models.

Challenge: Two production-critical defects in a component, not reliably detectable by the human eye — manual visual inspection was unreliable, defective parts were processed further, causing rejects and returns

Solution: Two-stage AI detection with two cameras and three models, retrofitted into an existing machine — including industrial hardware, embedded system, local display, and remote maintenance dashboard

Result: Running 24/7 in industrial operation on two machines for over a year, 1,500–2,000 parts inspected per day, detection accuracy over 99%

Project Info

  • Services: Concept, hardware design, embedded system configuration, AI model development, training, software, dashboard, installation, remote maintenance
  • Domain: Industrial image processing · Embedded systems · AI/Computer vision · Special machine construction
  • Industry: Industrial manufacturing (NDA)
  • Project type: Custom development · Retrofit · Continuous operation
  • Units deployed: Two machine installations, identical system
  • Development time: approx. 6 months incl. prototyping, testing, and adjustments
  • In operation since: over one year (as of 2026)

Background

In an existing production facility, small functional components are processed at high volume. Two production-critical defect types occurred:

Defect 1 – Missing internal component: Inside the component sits a small functional element that is occasionally missing from the manufacturer. Without it, the part is non-functional. The defect is not visible from the outside.

Defect 2 – Incorrect assembly: The component is installed into a fixture by the machine. Occasionally this happens at an angle, incompletely, or in the wrong position — also difficult to detect because the critical area is obscured by the machine structure and parts move quickly through the inspection zone.

Both defects led to further processing of faulty parts, causing rejects, rework, and customer returns. Manual visual inspection was not reliably feasible at the given volumes (1,500–2,000 parts/day per machine) — neither ergonomically nor economically.

The requirement: a retrofittable system that reliably detects both defects, integrates into the existing machine without mechanical modifications, and operates reliably in 24/7 industrial conditions in a humid, warm production hall. This resulted in two identical installations for two machines.

Requirements

  • Reliable detection of both defect types during live production
  • Retrofit into existing machine without mechanical modifications
  • Industrial-grade build for 24/7 continuous operation in a humid, warm environment
  • Clear, unambiguous indication for operators (visual and acoustic)
  • Data capture and reporting for production management
  • Remote maintenance and post-deployment model updates
  • Scalability — the system was designed identically for two machines

My Role

This project was implemented entirely by me — no external involvement in concept, hardware, software, or AI:

  • Overall concept and system architecture
  • Hardware design (enclosure, camera housings, light module, display unit)
  • Embedded system configuration on Raspberry Pi CM5
  • Operating system customization for industrial operation
  • Development of detection and control software
  • Concept, data collection, training, and validation of AI models
  • Development of the dashboard with live streams and analytics
  • On-site installation and commissioning
  • Ongoing maintenance, remote access, model updates in operation

System Architecture

The system is structured in two detection stages, following the machine’s processing sequence. Each stage uses dedicated camera technology, dedicated lighting, and dedicated AI models, tailored to the respective defect type.

The core is a Raspberry Pi Compute Module 5 (CM5) on a carrier board with terminal connectors, eMMC storage, and active cooling — mounted in a waterproof stainless steel enclosure along with power supplies, fuses, relay board, and WLAN antenna on DIN rail. All operator controls (shutdown, restart, power off) are implemented as IP-rated pushbuttons and switches on the enclosure.

Per installation, the system includes: one enclosure as control unit, two cameras (endoscope and global shutter), two custom camera housings, one custom light module, one custom display unit, and an industrial LED signal tower with buzzer.

Detection Stage 1: Internal Inspection via Endoscope Camera

The first stage detects whether the internal component is present — precisely the defect that is invisible from the outside. An endoscope camera with integrated LED lighting is positioned so it can view the component’s interior during the live machine process, at a location no human eye can reach.

Images are passed in real time to a classification model trained specifically for this distinction: component present / component missing. The result is immediately shown on the display and transmitted to the signal tower/buzzer unit.

Detection Stage 2: External Assembly Inspection

The second stage checks whether the component is correctly seated in the fixture — crooked, incompletely engaged, or in the wrong position. This stage was technically far more challenging, as several problems had to be solved simultaneously:

Preventing motion blur: The component moves quickly through the camera’s field of view. An industrial global shutter camera with manually adjustable lens is used. To keep exposure times short enough to “freeze” the motion, extremely strong illumination was required.

Custom light module: No suitable lighting system was available on the market. I developed a custom light module: multiple high-power LED strips mounted on an aluminum carrier plate (heat dissipation), passive heat sink on the back, all in a custom waterproof housing precisely angled toward the part. Black foil was installed in the background to create a consistent, high-contrast backdrop for detection.

Multi-stage AI detection: A single classification approach would not have been sufficient due to the motion, varying positions, and image crop variations. Instead, detection runs in several steps:

  1. An object detection model with bounding box continuously tracks the component in the camera feed.
  2. When the component crosses a defined line (ROI), multiple frames are captured just before and after.
  3. Using the bounding box, only the relevant component area is cropped from each image — centered, large, without distracting background.
  4. From these approximately 10 images, only the sharpest are selected using a Laplace algorithm (blurry images are discarded).
  5. The sharp images are each individually passed through the classification model, which evaluates assembly quality.
  6. The individual results are averaged and output as the final result.

This multi-stage pipeline compensates for the difficulties of motion-based detection and is the key reason for the high accuracy.

Training Data and Model Pipeline

The AI models were trained with self-collected training data captured under real production conditions. A custom training data tool was written that automatically captures images during operation, crops them using the bounding box detection, auto-labels them, applies augmentation, and prepares them for training.

This pipeline is also why models can be refined during ongoing operation: new images feed into the training set, models are selectively retrained, and updates are deployed via remote access. This allows the system to continuously improve with increasing runtime and adapt to changes in production conditions.

Custom-built system for collecting training data, with camera and multiple valves and automatic changeover via servo motor

Industrial-Grade Hardware

Stainless steel enclosure: Waterproof enclosure in IP-rated design, built for the humid, warm production hall environment. Inside: full DIN rail mounting with power supplies, fuses, relay board, Raspberry Pi CM5, WLAN antenna. Outside: all operator controls as IP-rated pushbuttons — shutdown, restart, power off.

Camera housings: Both cameras (endoscope and global shutter) are housed in custom-designed 3D-printed, waterproof enclosures — with seals, glass pane, and precise geometry for each camera’s position on the machine. The global shutter camera was originally just a PCB; the housing is what makes it field-deployable.

Camera housing view 1 Camera housing view 2 Camera housing view 3

Light module: Multiple high-power LED strips on an aluminum carrier with heat sink, in a waterproof, angle-matched 3D-printed housing.

Light module view 1 Light module view 2

Display unit: An open-frame display in a custom waterproof 3D-printed housing with seals and acrylic glass pane. The display shows the detection result large and immediately recognizable: red or green border with a clear symbol, plus an enlarged view of the current camera image for visual follow-up by the operator.

Display unit view 1

Display unit view 2 Display unit view 3

Signaling module: Directly on the display unit housing, a small industrial LED signal tower (red/green) with buzzer is integrated. This gives operators both visual and acoustic feedback, allowing them to rely on the system while working at an adjacent station without constantly watching the display.

Embedded System and Operating System

The system runs on a Raspberry Pi Compute Module 5 on an industrial-grade carrier board with screw terminals, eMMC storage, and active fan. The operating system was specifically customized for 24/7 continuous operation:

  • Autostart of the entire detection and dashboard software on system boot
  • Watchdog function with automatic recovery on software hangs or unexpected restarts
  • Disabled unused system components to improve stability and reduce attack surface
  • Robust error handling for hardware failures (camera unavailable, display disconnected, connection loss)
  • Remote maintenance access via secure network connection

These customizations distinguish the system from a typical Raspberry Pi setup: it is not a “hobbyist computer with AI,” but an industrial embedded system with all the properties required in production environments.

Dashboard and Data Analytics

Since all inspection data is generated during ongoing operation anyway, an interactive dashboard was additionally developed that makes this data actionable for production management — accessible via browser, also mobile-optimized.

Dashboard

Live overview: Status of each individual machine (online, offline, ready, production active), including immediate alerts for hardware faults (camera unavailable, display disconnected, etc.). Live streams of both cameras per machine, accessible remotely by management or service.

Daily metrics: Number of parts produced and inspected on the current day, defect count, average per hour, trend chart over the day with visible production and defect spikes.

Analytics page: Interactive chart with filter by machine/station, selection of days, weeks, months, various visualization modes, comparisons between time periods. Averages per day, week, month. Allows identification of production fluctuations and systematic defect causes.

Event log: Complete list of all inspection events with timestamp and result. Full CSV data export for further processing.

The dashboard runs on the same system as the detection and requires no external infrastructure.

Remote Maintenance and Ongoing Operation

The system has been running in 24/7 industrial operation in both installations for over a year. All ongoing maintenance is handled fully via remote access: model updates are applied based on newly collected data, parameters are adjusted, software updates are deployed, and faults are diagnosed without on-site visits. This keeps service requirements minimal for the customer.

Results

  • Detection accuracy above 99% in both detection stages
  • 1,500–2,000 inspected parts per day per machine in real industrial operation
  • Running for over a year continuously in two identical installations in 24/7 operation
  • Both defect types reliably detected before further processing — no defective parts continuing through the production line
  • Full data transparency for production management via the dashboard
  • Post-deployment model improvement through the integrated training data tool without new hardware
  • Maintenance and model updates run entirely via remote access

Applicability to Other Projects

This approach — integrating an industrial embedded system with computer vision and multi-stage AI into an existing machine — can be applied to many areas of industrial quality assurance and process monitoring:

  • AI-based inline quality inspection for components, assemblies, or packaging that cannot be reliably controlled with conventional sensors or manual visual inspection.
  • Industrial retrofit for Industry 4.0 — adding intelligent detection, data collection, and connectivity to existing machines and systems without changing the core process.
  • Embedded systems for harsh industrial environments — computer vision applications running in 24/7 operation under real conditions (humidity, heat, dust, vibration).
  • Multi-stage AI pipelines for difficult detection tasks — combinations of object detection, tracking, image selection, and classification when a single model cannot solve the problem.
  • Self-improving systems with continuous retraining — solutions that capture their own training data during operation, automatically prepare it, and adapt to changing production conditions.
  • Complete solutions from a single source — projects where hardware design, embedded system, AI model, and operator/analytics software are developed together in one concept rather than by separate contractors.

If you have a similar quality assurance or detection challenge in your production, want to retrofit an existing machine intelligently, or need a computer vision system for industrial environments — let’s talk.

Similar requirements or your own idea?

I support with concept, engineering, and realization.

Start a project ✅ Free & non-binding