Computer Vision for Defect Detection

CLIENT

NDA

INDUSTRY

Manufacturing

SERVICE

Edge Computing / Machine Learning

Our Client

A regional PVC pipe manufacturer supplying construction materials to hardware stores and large-scale infrastructure projects. The company produces a wide range of pipe sizes used for drainage, water supply, and conduit installations.

Challenge

The client faced quality control challenges that resulted in increased product waste and rejected shipments. Surface cracks, often caused during extrusion cooling, were difficult to detect manually. Uneven cuts led to inconsistent lengths and jagged edges, contributing to product rejection. Additionally, diameter variations caused fitting issues for clients in construction projects, further impacting overall product reliability. These issues caused:

Product Returns and Rework Costs: Increasing customer dissatisfaction and financial losses.

Manual Inspection Bottlenecks: Quality control staff couldn’t keep up with the production speed.

Inefficiencies in Machine Calibration: Variations were often noticed after bulk production runs, leading to significant waste.

Solution: Real-Time Defect Detection

To address these challenges, we developed and implemented an affordable, edge-based Computer Vision system for real-time defect detection and quality control on the production line. It works by following workflow:

Step 1: Camera Installation

Two industrial cameras was mounted along the production line, positioned for both:

  • Top-down view for diameter consistency.
  • Side view for surface crack detection and cut analysis.

LED diffused lighting was added to eliminate glare and enhance defect visibility on the reflective PVC surface.

Step 2: Image Capture and Processing

An NVIDIA Jetson Orin edge device was used for real-time processing.

OpenCV (Python) handled:

    • Crack detection: Using contour analysis and edge detection.
    • Diameter measurement: Analyzed by measuring pixel width against a reference standard.
    • Cut length validation: Line detection was applied to check for uneven pipe ends and verify consistency with specified measurements.
Step 3: Defect Identification and Real-Time Alerts

A TensorFlow Lite model trained on thousands of defective and non-defective PVC pipes was integrated for enhanced detection accuracy. If a defect was identified, the system:

    • Displayed a real-time alert on a Grafana dashboard for the line operator.
    • Recorded the defect type and severity score for later analysis.
Step 4: Data Logging and Process Optimization

Defect data was automatically logged in a PostgreSQL database, including:

  • Timestamp, defect type, and batch number.
  • Measurements for each product (length, diameter consistency).

Grafana dashboards visualized real-time defect trends, helping the operations team identify when the extrusion machine required calibration or maintenance.

Technology Stack

Hardware:

Industrial camera

High-speed, high-resolution image capture

NVIDIA Jetson Orin

Edge AI device for real-time analysis.

LED Lighting

For clear visibility on reflective surfaces.

Software:

OpenCV (Python)

For image preprocessing and defect detection.

TensorFlow Lite

For lightweight defect detection models.

Python

 For pipeline scripting and automation.

Docker

For simplified, containerized deployment.

Data Handling & Feedback:

PostgreSQL

For defect data storage and trend analysis.

Grafana

Real-time dashboard.

Result

This scalable Computer Vision system allowed the PVC manufacturer to automate quality control, reduce material waste, and prevent defective products from reaching customers—all without requiring expensive infrastructure upgrades. By combining edge computing with machine learning models, the client achieved consistent quality assurance while improving operational efficiency.

Key Achievements

Defect Reduction

Surface cracks and diameter inconsistencies decreased more then twice.

Cost Savings

nnual material waste was reduced by $45,000 due to early defect detection.

Inspection Speed

Achieved 100% automated inspection without slowing production.

Data-Driven Maintenance

Real-time feedback allowed the production team to proactively adjust extrusion settings and avoid mass defects.