Computer Vision for Packaging Defect Detection

Task

Develop a a video-based system to ensure quality control on a production line via AI technologies.

  • Computer Vision
  • Integrations
  • Analytics
  • AI/ML

Technologies

  • PyTorch

    PyTorch

  • Qt

    Qt

  • Rapid STP

    Rapid STP

  • C++ / C

    C++ / C

  • Restful API Backend

    Restful API Backend

  • JavaScript

    JavaScript

  • Ultralytics YOLO

    Ultralytics YOLO

  • OpenCV

    OpenCV

  • PostgreSQL

    PostgreSQL

  • TimescaleDB

    TimescaleDB

Technical Strategy

In collaboration with researchers from Saint Petersburg Electrotechnical University 'LETI', we built a system that uses computer vision and machine learning models to detect packaging defects.

The system is based on a neural network developed in PyTorch for model development and training, and Ultralytics YOLO for fast and accurate object detection. The interface is implemented in Qt and JavaScript. Component integration is achieved through a RESTful API, and controller management is based on C++ and Rapid STP.

The system is installed on the production line and ensures high accuracy in defect detection.

Conceptual Model

The conceptual diagram illustrates the components integrated into the video control system. Each component is described by a number.

Operational Workflow

Step-by-step process of the system on a single production line:

  1. The operator starts production, selects the product, and scans its code and order number.
  2. The system activates the assessment process and begins sending signals to the main process control controller.
  3. The controller monitors incoming data and initiates the rejection process for defective products.
  4. In the background, the system monitors the status of sensors to halt the line in case of an emergency.

Control System Layout

The inspection point is located directly on the conveyor section and is an integral part of the video control system. It sends signals whose duration is configured during integration.

Continuous System Performance

To adapt the system to real production conditions, where camera failures, lighting degradation, and angle changes are possible, we conducted a series of shoots that closely mimic situations on the conveyor line.

Experiments with changing viewing angles and lighting helped fine-tune the system and achieve the required defect detection accuracy without altering the without altering the production conditions.

Defect Detection and Colour Indication

Each defect is marked as GREEN, RED, or AMBER depending on the deviation from the set parameters.

  • GREEN: defect parameters within normal limits
  • AMBER: defect parameters above normal but not critical
  • RED: defect parameters significantly above normal

Similar works