Quality control in plastic injection molding: structuring an industrial vision project

Acquisition architecture, model trade-offs, FP/FN calibration, PLC and MES integration. For quality and production managers assessing feasibility.

The critical variable most projects underestimate: lighting

The choice of CNN model matters less than the choice of lighting setup. A sink mark on a black PP part is invisible under frontal diffuse lighting, and perfectly discernible under grazing light at 15°. This is not a fine-tuning detail: it is an architecture decision you must make before collecting the first image pixel.

The lighting types to know for plastics:

  • Coaxial: reveals variations in surface reflectivity (stains, inclusions). Blind to relief.
  • Grazing (angle < 20°): reveals topographic defects (sink marks, flash, short shots). Creates shadows that amplify hollows.
  • Backlighting: crisp silhouette for dimensional inspection and detecting flash at the part edge.
  • Multispectral (NIR, UV): for defects not visible in the visible spectrum (contamination, certain inclusions).

The practical rule: test at least 3 lighting configurations on a representative batch of defective parts before freezing the architecture. This test takes 2 days and can save 6 weeks of labeling on the wrong setup.

Acquisition architecture: the choices that structure the project

Number of cameras and viewpoints

First identify the critical zones of the part and the defects to detect per zone. In injection molding, the at-risk zones are known: injection points, bonding points (weld lines), thin-wall zones, deep ribs. Every critical zone not covered by a camera is a blind inspection zone: document it and own it explicitly.

100% coverage of all faces is rarely necessary: and costly. Defining with the quality manager which zones are critical (scrap if defective) and which are cosmetic (rework or acceptance) lets you size the setup to what is strictly needed.

Synchronization with the PLC

The acquisition trigger must be synchronized to a deterministic signal from the PLC (ejection signal, limit switch, part-presence signal). A software or time-based trigger introduces jitter that degrades acquisition reproducibility and, ultimately, model performance. This is a hardwired connection: plan the wiring from the design phase.

Model choice: classification vs. segmentation vs. anomaly detection

Binary classification (conforming / non-conforming)

The simplest case. Suited when acceptance criteria are global (the part is accepted or rejected as a whole) and when you have a balanced dataset of conforming and non-conforming parts. High performance, fast inference (< 30 ms on Jetson).

Limitation: it does not localize the defect. Operator feedback is binary: no information on the zone or the type of defect.

Object detection (YOLO, EfficientDet)

Localizes and classifies defects with a bounding box. Suited for discrete defects (localized flash, point inclusions). Requires bounding-box labeling: faster than pixel segmentation.

Semantic segmentation (UNet, Mask R-CNN)

Pixel-by-pixel localization. Suited for diffuse defects (sink marks, decarburization zones) or when the precise position of the defect determines acceptance. Heavier labeling dataset, slower inference. Justified when the quality manager needs the localization to decide.

Unsupervised anomaly detection (PatchCore, FastFlow)

If you do not have labeled defective parts at the start: a common case at series launch or for rare defects. The model learns the distribution of conforming parts and flags deviations. Less accurate at classifying defects, but operational quickly. Useful as a first detection layer, combined with a supervised model on the most critical defects.

The false positive / false negative trade-off: the real work of the project

This is the step technical teams tend to treat as a tuning parameter, when it is a business decision. The trade-off:

  • Low threshold (sensitive): few defects get through. But the false positive rate rises: conforming parts are rejected. Cost: unwarranted scrap, manual review of rejects, lower throughput.
  • High threshold (specific): few false positives. But real defects get through. Cost: defects reaching the customer, IATF non-conformity, penalties.

Threshold calibration must be done with the quality manager based on the real cost of each type of error. Differentiating thresholds by defect type (critical crack vs. cosmetic defect) is almost always justified. Allow 2 to 3 weeks of real production to stabilize the thresholds.

PLC integration and traceability

The conformity decision must be communicated to the PLC in real time (digital signal for ejection) and logged with a timestamp for audit traceability.

For IATF 16949 requirements: each part must have a consultable inspection record, with timestamp, decision, confidence score, and ideally the mold cavity identifier (if the mold is multi-cavity). A log to the MES via REST is the most reliable means: do not depend on a file export.

Managing reference changes

A vision system on a multi-reference line must handle mold changes without full re-parameterization. The architecture must plan from the start a system of profiles per reference: acquisition configuration (lighting, trigger), associated model or thresholds. The profile change must be triggered automatically from the MES or manually from the operator interface.

Underestimating this aspect at design time forces costly modifications during the project or after delivery.

Studio23

Assessing an industrial vision project?

Tell us about the type of part, the defects to detect and the line throughput. We assess feasibility and propose an architecture within 48 hours.