홈

전자제품

전력 공학

임베디드 시스템

엔지니어링 도구

기술 및 AI

PowerTechGuide

Introduction

Manufacturing companies increasingly use machine vision to inspect products, identify defects, and improve production quality. Traditional inspection systems often depend on fixed image-processing rules, while modern systems can use artificial intelligence (AI) to recognize more complex patterns.

Edge AI takes this technology one step further by running the AI model directly on an industrial computer or embedded development board near the production equipment.

This allows inspection results to be generated locally without sending every image to a cloud server.

In this article, we will explain how to design and build an Edge AI machine-vision inspection system, using electronic component and PCB inspection as practical examples.

The discussion covers system architecture, camera and lighting selection, AI model development, embedded hardware, PLC communication, testing, and production deployment.

1. What Is an Edge AI Machine-Vision Inspection System?

An Edge AI machine-vision inspection system uses a camera to capture product images and an AI model to determine whether a product meets defined quality requirements.

For example, a PCB inspection system may identify:

  • Missing electronic components
  • Incorrect component orientation
  • Incorrect component placement
  • Visible soldering defects
  • Damaged connectors
  • Scratches or surface contamination
  • Incorrect product assembly

Unlike a conventional inspection system that relies entirely on predefined image-processing rules, an AI-based system learns visual patterns from a collection of training images.

The AI model runs on an embedded computer, NPU-based platform, or GPU-based system installed near the production line.

Why Use Edge AI Instead of Cloud AI?

There are several reasons to process inspection images locally.

Low latency: The system can analyze images without waiting for a remote cloud server.

Reliable operation: Inspection can continue during an internet connection failure, provided the local equipment remains operational.

Data privacy: Production images can remain inside the factory network.

Reduced network traffic: Images do not need to be uploaded continuously.

Local equipment integration: Inspection results can be sent directly to a PLC or machine controller.

For many manufacturing applications, local processing provides a practical combination of response time, reliability, and data control.

2. System Architecture

Block Diagram

A practical Edge AI inspection system consists of six major sections.

  1. Camera and lens
  2. Lighting system
  3. Image acquisition computer
  4. Edge AI processor
  5. PLC or machine controller
  6. Reject mechanism or operator interface

Basic System Block Diagram

Product → Camera and Lighting → Image Acquisition → Edge AI Inference → PLC → Pass / Fail Decision

The system operates as follows:

  1. A product arrives at the inspection position.
  2. A sensor detects the product and triggers image capture.
  3. The camera captures an image under controlled lighting.
  4. The embedded computer processes the image.
  5. The AI model identifies defects or classifies the product.
  6. The inspection result is communicated to the PLC.
  7. The PLC controls the reject mechanism or sends the result to the operator.

The AI computer should generally perform image processing and inference, while the PLC or dedicated machine controller handles deterministic equipment sequencing, interlocks, and time-critical control.

Safety-related functions must remain within an appropriately designed and validated safety system. Do not rely on an ordinary AI prediction as the only safety protection.

3. Selecting the Camera and Lens

The camera is one of the most important parts of a machine-vision system.

Even an advanced AI model cannot reliably detect a defect that is not clearly visible in the captured image.

Camera Selection Factors

Resolution

Camera resolution should be selected according to the smallest defect that must be detected.

For example, detecting a large missing connector may require less resolution than identifying a small soldering defect.

Frame Rate

The camera must capture images quickly enough to meet the production cycle time.

Sensor Type

Industrial cameras commonly use CMOS image sensors. Global-shutter cameras are often useful when products or cameras move during image capture because they reduce motion distortion compared with rolling-shutter capture.

Interface

Common camera interfaces include:

  • USB 3.x
  • GigE Vision
  • MIPI CSI-2
  • Camera Link
  • CoaXPress

The selected interface must be supported by the camera and the host computer.

Lens

Lens selection depends on working distance, field of view, sensor size, and required image detail.

A suitable lens helps ensure that the entire inspection area is sharp and consistently positioned.

Example Camera Configuration

For an initial PCB inspection prototype:

  • Industrial USB or GigE camera
  • 2–5 megapixel resolution as a starting range
  • Fixed-focus or adjustable industrial lens
  • Stable camera mounting
  • Controlled LED lighting

These are example starting specifications, not universal requirements. The actual camera should be selected after calculating the required field of view and minimum defect size.

4. Lighting Design: A Critical Part of Inspection Accuracy

Lighting is frequently underestimated during machine-vision development.

A change in illumination can make the same product appear different to the AI model. Reflections, shadows, and uneven brightness can reduce inspection accuracy.

Common lighting approaches include:

Ring Lighting

Ring lights surround the camera lens and provide relatively uniform illumination for many close-range inspection applications.

Bar Lighting

Bar lights can illuminate elongated products, connectors, and PCB areas from selected directions.

Backlighting

Backlighting is useful for identifying silhouettes, dimensions, holes, and missing material.

Dome Lighting

Dome lighting can reduce harsh reflections on some reflective surfaces.

Coaxial Lighting

Coaxial illumination can be useful for inspecting flat, reflective surfaces when the geometry is suitable.

The best lighting arrangement depends on the material, surface finish, defect type, camera angle, and working distance.

Practical recommendation: Test several lighting arrangements before collecting the final AI training dataset. Once the camera and lighting configuration is selected, keep it consistent during training and production.

5. Selecting the Edge AI Hardware

The AI processing board must support the model, image resolution, inference speed, and production requirements.

Three major hardware categories are worth considering.

Option A: MCU-Based System

A microcontroller is suitable for sensor monitoring and simple classification tasks.

However, high-resolution image processing and complex object detection generally require more memory and computing capability than a typical MCU can provide.

Use an MCU when the inspection task is simple or when it is part of a larger system that includes a separate vision computer.

Option B: NPU-Based System

An NPU accelerates supported neural-network operations.

Representative platforms include:

  • Raspberry Pi 5 with AI HAT+
  • NPU-equipped embedded Linux boards
  • Industrial processors with integrated AI acceleration

These platforms can be suitable for object detection and image classification, depending on the model and performance requirements.

Option C: Embedded GPU System

An embedded GPU platform is appropriate for more demanding vision applications.

Examples include NVIDIA Jetson platforms.

Potential applications include:

  • Multiple-camera inspection
  • High-resolution image processing
  • Object detection and tracking
  • More complex AI models
  • Advanced industrial vision prototypes

Hardware Comparison

Requirement MCU NPU-Based Platform Embedded GPU
Simple sensor classification Excellent Excellent Possible
Basic image classification Limited Suitable if supported Suitable
Object detection Usually limited Suitable if supported Suitable
Multiple cameras Usually unsuitable Platform dependent Often suitable
Power consumption Very low Low to moderate Moderate to high
Software environment Bare metal / RTOS RTOS or Linux Usually Linux
Development complexity Low to moderate Moderate Moderate to high

The final choice should be based on measured performance using the actual camera, model, and production data.

6. Developing the AI Model

The AI model is responsible for identifying defects in the captured images.

A typical development workflow includes:

  1. Image collection
  2. Image labeling
  3. Dataset preparation
  4. Model training
  5. Model validation
  6. Model optimization
  7. Deployment to the Edge AI board

Step 1: Collect Image Data

Collect images of both acceptable and defective products.

For PCB inspection, useful image categories may include:

  • Normal PCB
  • Missing component
  • Incorrect component orientation
  • Incorrect component position
  • Damaged component
  • Visible soldering defect

The dataset should represent actual production conditions.

Include variations in component batches, product position, lighting, and other expected operating conditions.

Step 2: Label the Images

Image labeling identifies the location and type of defects.

For example:

Image Label Description
PCB_001 Good Normal assembly
PCB_002 Missing Component Component not installed
PCB_003 Wrong Orientation Component direction incorrect
PCB_004 Damaged Component Visible physical damage

For object detection, defects are usually annotated with bounding boxes or another suitable localization format.

For classification, each image may receive a product-level label.

The labeling approach should match the inspection requirement.

Step 3: Choose an AI Model

Different models are suitable for different inspection tasks.

Image Classification

Determines whether an image belongs to a defined category, such as Good or Defective.

Object Detection

Identifies defect locations and defect categories within an image.

Segmentation

Identifies the precise pixels belonging to a defect. This can be useful when defect shape or area matters.

Anomaly Detection

Learns the appearance of normal products and identifies unusual patterns. This can be useful when defective examples are difficult to collect.

The choice depends on the defect type and how the inspection result will be used.

Step 4: Train and Validate the Model

Popular development tools include:

  • Python
  • PyTorch
  • TensorFlow
  • OpenCV
  • ONNX
  • Vendor-specific AI development tools

Divide the dataset into separate training, validation, and test sets.

Avoid placing nearly identical images from the same production sequence into both training and test sets. This can create misleadingly high evaluation results.

Evaluate the model using more than overall accuracy.

Important metrics include:

  • Precision
  • Recall
  • False acceptance rate
  • False rejection rate
  • Confusion matrix
  • Inference time

In manufacturing, a missed defect may be more serious than a false rejection. The acceptable balance depends on the product and quality requirements.

7. Optimizing the Model for Embedded Hardware

A model trained on a desktop computer may be too large or slow for the target embedded board.

Model optimization is therefore an important deployment step.

Quantization

Quantization reduces the numerical precision used by the model.

For example, a model may be converted from floating-point calculations to INT8 operations when supported by the target hardware.

Potential benefits include:

  • Reduced model size
  • Lower memory requirements
  • Improved inference speed
  • Better use of supported AI accelerators

However, quantization can reduce model accuracy. Always compare the optimized model against the original model using representative test images.

Model Conversion

The deployment format depends on the selected hardware.

Possible tools and formats include:

  • ONNX
  • LiteRT
  • TensorRT
  • Vendor-specific NPU conversion tools

Not every model can be converted directly. Some operators may require replacement or a different model architecture.

Benchmarking

Measure the following on the actual target board:

  • Model loading time
  • Inference latency
  • Total image-to-decision latency
  • RAM usage
  • CPU and accelerator utilization
  • Power consumption
  • Operating temperature
  • Sustained throughput

The total inspection time includes camera capture, image transfer, preprocessing, inference, postprocessing, communication, and machine response.

8. Integrating the AI Computer with a PLC

In an industrial environment, the Edge AI computer often needs to communicate with a PLC.

The PLC controls production equipment, conveyors, sensors, and reject mechanisms.

The AI computer provides inspection results.

Example Communication Architecture

Camera → Edge AI Computer → Ethernet / Digital I/O → PLC → Reject Mechanism

Possible communication methods include:

  • Industrial Ethernet protocols supported by both devices
  • Modbus TCP
  • OPC UA
  • Digital input/output
  • Serial communication, where appropriate

The selected method depends on the PLC, embedded computer, required response time, and factory network architecture.

Example Inspection Signals

Signal Direction Function
Inspection Trigger PLC → AI Computer Start image capture
Inspection Busy AI Computer → PLC Inspection is in progress
Inspection Complete AI Computer → PLC Result is available
Inspection OK AI Computer → PLC Product passed
Inspection NG AI Computer → PLC Product failed
Communication Fault AI Computer → PLC Communication or system error

A handshake sequence should be designed so that the PLC knows when a result is valid and which product it belongs to.

Include timeouts, fault handling, and recovery behavior. Avoid treating a missing result as a passing product.

Important Engineering Considerations

  • Use electrical isolation where required.
  • Protect communication interfaces against electrical noise.
  • Confirm grounding and cable-routing requirements.
  • Prevent duplicate or stale inspection results.
  • Define behavior during communication loss.
  • Keep safety interlocks independent of ordinary AI inference.

These details are essential when moving from a laboratory prototype to an actual production system.

9. Practical Example: PCB Component Inspection

Consider a small PCB assembly line.

The inspection system checks whether selected components are installed correctly.

Inspection Sequence

  1. A PCB enters the inspection station.
  2. A photoelectric sensor detects the PCB.
  3. The PLC sends an inspection trigger.
  4. The camera captures the PCB image.
  5. The Edge AI computer preprocesses the image.
  6. The AI model identifies missing or incorrectly positioned components.
  7. The computer sends an OK or NG result to the PLC.
  8. The PLC records the result and controls the next operation.

Example Inspection Requirements

Item Example Requirement
Product Electronic control PCB
Inspection target Selected component locations
Camera Industrial camera
Lighting Controlled LED illumination
AI task Component detection and classification
Edge hardware NPU or embedded GPU
Machine interface PLC
Output OK / NG / Fault

This is an example architecture. Actual inspection capability must be validated for the component size, PCB layout, camera resolution, and defect types.

What Should Be Recorded?

For production traceability, consider recording:

  • Product identification number
  • Inspection timestamp
  • Inspection result
  • Defect category
  • Defect location
  • Model version
  • Inspection station identification
  • Image or evidence reference, where permitted

This information can help engineers investigate recurring quality problems and monitor changes in production performance.

10. System Validation Before Production

A successful AI demonstration does not automatically mean the system is ready for manufacturing.

The complete inspection system must be validated under realistic production conditions.

Validation Checklist

  • Camera position is mechanically stable.
  • Lighting remains consistent.
  • All required defect types are represented in testing.
  • Test images are independent of training data.
  • False acceptance and false rejection rates are measured.
  • Inspection time meets production requirements.
  • PLC communication is reliable.
  • Communication failures produce a defined fault response.
  • Power interruption and restart behavior are tested.
  • Operating temperature remains within hardware limits.
  • Model version and configuration are controlled.
  • Long-duration operation is tested.

The acceptance criteria should be agreed upon with the manufacturing and quality teams before production release.

11. Common Problems and Troubleshooting

Problem 1: AI Detection Accuracy Changes During Production

Possible causes:

  • Lighting variation
  • Camera movement
  • Product position changes
  • New component batches
  • Different surface reflections

Recommended action:

Check image quality first. Compare production images with the training dataset before changing the AI model.

Problem 2: Inspection Is Too Slow

Possible causes:

  • Excessive image resolution
  • Large AI model
  • Slow image transfer
  • Inefficient preprocessing
  • Limited hardware acceleration

Recommended action:

Measure each stage separately. Optimize image size and model complexity, then benchmark the system again.

Problem 3: The System Occasionally Misses Defects

Possible causes:

  • Insufficient defective samples
  • Incorrect image labels
  • Defects smaller than the camera can resolve
  • Similar visual appearance between good and defective products

Recommended action:

Review missed-defect images, improve lighting and image resolution, and collect additional representative training data.

Problem 4: PLC Communication Is Unstable

Possible causes:

  • Incorrect communication settings
  • Network congestion
  • Electrical noise
  • Incorrect handshake timing
  • Missing timeout handling

Recommended action:

Check communication logs, cable routing, grounding, and signal timing. Add explicit fault detection and recovery logic.

12. A Practical 90-Day Development Plan

A small engineering team can organize an initial prototype project into three phases.

Days 1–30: Hardware and Image Acquisition

  • Define inspection requirements.
  • Select camera and lens.
  • Test lighting arrangements.
  • Capture sample images.
  • Select the initial Edge AI development board.
  • Build a basic image acquisition application.

Expected result: A repeatable image acquisition prototype.

Days 31–60: AI Model Development

  • Label good and defective images.
  • Train an initial AI model.
  • Evaluate detection performance.
  • Optimize the model for the selected hardware.
  • Measure inference time and memory usage.

Expected result: A working Edge AI inspection prototype.

Days 61–90: PLC Integration and Validation

  • Establish communication with the PLC.
  • Implement the inspection handshake.
  • Test OK, NG, and fault conditions.
  • Run repeated production-like inspections.
  • Measure false acceptance and false rejection.
  • Document hardware, software, and model versions.

Expected result: A validated prototype ready for a controlled pilot evaluation.

The schedule is an example. Actual development time depends on product complexity, dataset availability, hardware procurement, and production integration requirements.

13. Conclusion

An Edge AI machine-vision inspection system combines camera technology, controlled lighting, embedded computing, AI model development, and industrial equipment integration.

The most important lesson is that inspection performance does not depend on the AI model alone.

Camera resolution, lens selection, lighting stability, image quality, model accuracy, processing latency, PLC communication, and production validation all contribute to the final result.

For engineers developing industrial electronics, a practical approach is to start with one clearly defined inspection task, build a small prototype, collect real production images, and measure performance before expanding the system.

Edge AI can become a valuable tool for improving manufacturing quality when it is designed as a complete engineering system rather than simply adding an AI board to a camera.


Frequently Asked Questions

1. What hardware is best for an Edge AI machine-vision system?

An NPU-based board can be suitable for many image-classification and object-detection tasks. An embedded GPU platform is worth considering for more demanding vision workloads, multiple cameras, or complex models.

2. Can Raspberry Pi be used for PCB inspection?

Yes. A Raspberry Pi 5 with a compatible AI accelerator can be used to develop a PCB inspection prototype. Production deployment requires additional evaluation of reliability, image quality, thermal behavior, and industrial integration.

3. What is the difference between traditional machine vision and AI machine vision?

Traditional machine vision often uses manually configured image-processing rules. AI machine vision learns patterns from labeled or otherwise prepared image data. Both approaches can be useful, and a hybrid system may provide the best result.

4. Does Edge AI require an internet connection?

No. Once the model and application are installed, inference can run locally. Internet access may still be useful for remote monitoring, software updates, or centralized data analysis.

5. How do I improve AI inspection accuracy?

Start with image quality. Improve camera positioning, lens selection, lighting, and dataset quality. Then evaluate the model using independent production-like test images.

 

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다