AOI Defect Detection
Algorithm Development
Designing and implementing computer vision algorithms to detect shallow dip and deep dip defects in latex-coated cloth gloves at Ansell — a hybrid pipeline combining YOLO-based deep learning segmentation with classical image analysis for real-time production inspection.
Project Overview
As part of the Automated Optical Inspection system at Ansell Lanka, I was responsible for developing computer vision algorithms to detect two critical manufacturing defects — shallow dip and deep dip — occurring during the latex dipping process of cloth gloves.
These defects directly impact coating quality, product durability, and compliance with safety standards. The solution combines a YOLO deep learning model for region-of-interest extraction with classical computer vision techniques for defect quantification — implemented first in Halcon, then converted to Python for production integration.
Problem Context
Both defects arise from process variations during the latex bath dipping step — but manifest differently and require different detection strategies.
Shallow Dip
Under-coatingInsufficient latex coating — thin or missing regions on the glove surface. Caused by insufficient dipping depth, low viscosity, or fast withdrawal speed.
- Low-intensity regions on coated surface
- Reduced area of latex coverage
- Patchy or uneven coating distribution
Deep Dip
Over-coatingExcess latex coating beyond the acceptable boundary. Caused by excessive dip depth or slow withdrawal. Results in material waste and dimensional non-compliance.
- Coating overflow beyond defined boundary
- Excess coated area above threshold
- Contour deviation from nominal dip line
Algorithm Pipeline
Hybrid approach: deep learning handles region extraction, classical CV handles defect quantification. Each stage is separately optimised for robustness and speed.
Detection Approach Detail
Each defect type uses a separate analysis pipeline tuned to its distinct visual signature.
Shallow Dip Detection
Deep Dip Detection
Parallel Processing Architecture
Concurrent pipelines separate detection and analysis stages to meet real-time throughput requirements on the production line.
Technical Deep Dive
YOLO Integration
- YOLO model detects and localises gloves in each frame
- Segmentation isolates inspection region from background
- Robustness to lighting variation and conveyor movement
- Eliminates false detections from non-glove objects
Halcon → Python Migration
- Prototype algorithms developed in Halcon (MVTec)
- Logic translated to Python using OpenCV and NumPy
- Validated pixel-level equivalence between implementations
- Python version integrated into the broader AOI pipeline
Feature Engineering
- Shallow: intensity thresholding and under-coated area metrics
- Deep: contour analysis and overflow boundary deviation
- Separate tunable threshold parameters per defect class
- Region-based metrics normalised against glove dimensions
Parallel Processing
- Concurrent threads for YOLO and CV analysis stages
- Shared result queue for synchronisation before decision
- Reduced per-frame latency to meet production throughput
- Decoupled stages allow independent optimisation
Results & Impact
Reliable detection of both shallow and deep dip defect classes in production conditions
Improved inspection consistency over manual visual checks — eliminated operator subjectivity
Parallel processing reduced per-frame latency to meet real-time production line throughput
Hybrid CV + DL architecture contributed to a scalable, maintainable AOI pipeline