Visual Inspection of Surface Defects in Plastic Bottle Caps: Technical Principles, System Construction, and Application Practice

2026/03/03 11:53

On high-speed packaging lines for beverages, food, pharmaceuticals, and daily chemical products, plastic bottle caps, as key components that directly contact the contents and ensure a secure seal, are of paramount importance in terms of quality. Even a minor surface defect—such as scratches, stains, bubbles, missing material, or printing errors—not only affects the product's appearance and brand image but can also lead to serious quality problems such as poor sealing, leakage, or contamination. Traditional manual sampling methods are inefficient, prone to fatigue, highly subjective, and have a high rate of missed inspections, failing to meet the modern industrial pursuit of "zero defects." Therefore, automated surface defect inspection technology based on machine vision has become an indispensable core element in ensuring the quality of bottle cap production.

Visual Inspection of Surface Defects in Plastic Bottle Caps.png

I. Defect Types and Detection Challenges


Before designing the technology, it is essential to first identify the common types of surface defects in plastic bottle caps and their characteristics:


1. Appearance Defects:


Scratches/Abrasions: Occur during transportation or molding, appearing as irregular bright/dark stripes.


1. Stains/Foreign Objects: Adherence of oil, dust, or other impurities, appearing as spots inconsistent with the background color.


2. Bubbles/Silver Streaks: Caused by improper injection molding process; bubbles appear as round dark spots, and silver streaks as radial bright lines.


3. Shortage/Shrinkage: Caused by incomplete injection molding, resulting in incomplete cap shape or localized dents.


4. Burrs/Flashes: Excess plastic edges caused by mold gaps, often appearing at parting lines or edges.



2. Dimensional and Structural Defects:


3. Dimensional Deviations: Out-of-Tolerance: Key dimensions such as inner/outer diameter, height, and number of teeth do not meet standards.



4. Warping/Deformation: The cap is bent, either entirely or partially, affecting the screw-on seal.



5. Bridging Breakage/Incompleteness: For caps with multiple ties (such as mineral water caps), the connecting bridge (anti-theft ring connection point) is missing or too weak.


3. Printing and Labeling Defects:


Misprinted/Incorrect Printing: Missing or incorrect information such as brand logo, production date, and batch number.


Unclear Characters/Ghosting: Blurred printing, broken lines, ink diffusion.


Misregistration: Color misalignment during multi-color printing.


Color Deviation: Significant color difference from the standard color sample.


Core Challenges:


• High Reflectivity: Smooth plastic surfaces can easily create highlight spots if the light source is not properly positioned, masking actual defects.


• High-Speed Inspection: Production line speeds often reach 1000-3000 pieces per minute, requiring the vision system to complete imaging, processing, and judgment in a very short time.


• Defect Diversity: Defect shapes, sizes, locations, and contrasts vary greatly, requiring algorithms with strong generalization capabilities.


• Background Interference: Bottle caps themselves may have complex textures, patterns, or colors, which need to be distinguished from actual defects.


II. Core Components of a Vision Inspection System


A complete visual inspection system for bottle cap surface defects typically consists of two main parts: hardware and software.


(I) Hardware System


1. Imaging Unit:


Industrial Camera: The "eyes" of the system. Select the following based on your inspection needs:


▪ Area Scan Camera: Used to inspect the appearance, printing, and dimensions of the top and sides of bottle caps. High resolution to capture minute defects.


▪ Line Scan Camera: Performs continuous scanning as bottle caps pass by at high speed, particularly suitable for 360° panoramic imaging of side walls, providing seamless image stitching.


Industrial Lens: The appropriate focal length must be selected based on the field of view (FOV), working distance (WD), and resolution. Telecentric lenses reduce perspective errors and are the preferred choice for precision dimensional measurements.


2. Illumination System: The "soul" of successful visual inspection. Its core task is to highlight defect features and suppress background interference.


Common Light Source Types:


▪ Ring Light Source: Illuminates uniformly from all sides, suitable for general inspection of flat areas on the top surface.


▪ Dome Light Source/Shadowless Dome Light Source: Provides extremely uniform illumination through a hemispherical diffuser, a powerful tool for solving the problem of high reflectivity in plastic bottle caps, perfectly eliminating reflections and highlighting surface texture and three-dimensional defects (such as scratches and dents).


▪ Coaxial Light Source: The light beam is parallel to the camera's optical axis via a beam splitter, particularly suitable for detecting scratches and unevenness on smooth surfaces.


▪ Backlight: The bottle cap is placed between the light source and the camera to produce a high-contrast outline, used for dimensional measurement, material shortage detection, and foreign object detection.


▪ Bar-Shaped Combined Light Source: Lights are emitted from a specific angle to enhance the contrast of sidewall characters or 3D structures.


Illumination Strategies: Multi-source, multi-angle combined illumination schemes are commonly used. For example, dome lighting is used to inspect the top surface appearance, bar lighting illuminates from the side to inspect sidewall printing, and backlighting is used for outline detection. Through time-division triggering, a single system can perform multiple tasks.


3. Synchronization and Control Unit:


Sensors: Photoelectric sensors or encoders are used to trigger the camera to take a picture when the bottle cap reaches a precise position.


Industrial PC (IPC): The core brain running image processing software and logic control programs, requiring powerful computing capabilities (multi-core CPU, high-performance GPU) and industrial-grade stability.


PLC and Sorting Mechanism: The PLC receives the inspection results (OK/NG) from the industrial control computer and controls the solenoid valve, push rod, or robotic arm to automatically reject defective products.


4. Mechanical Structure:


A precisely designed conveyor track, positioning mechanism (such as star wheel, V-block), and rejection device ensure stable and repeatable bottle cap posture at the imaging position.


(II) Software and Algorithm


The software is the "brain" of the system, responsible for image analysis, feature extraction, and final decision-making. The processing flow is typically standardized into the following steps:


1. Image Acquisition and Preprocessing:


Acquisition: Triggered by hardware, the raw image is acquired.


Preprocessing: The purpose is to improve image quality and prepare for subsequent analysis. This includes:


▪ Filtering and Denoising: Using Gaussian filtering, median filtering, etc., to eliminate random noise.


▪ Image Enhancement: Enhancing the contrast between defects and the background through contrast stretching, histogram equalization, etc.


▪ Distortion Correction: Eliminating lens distortion to ensure measurement accuracy.


2. Region of Interest (ROI) Localization and Image Segmentation:


Utilizing template matching, blob analysis (connected component analysis), or geometric search tools, quickly locate the position of each bottle cap in the image and segment it into different detection regions such as the top, sides, and teeth.


3. Feature Extraction and Defect Detection Algorithms:


This is the core of the technology, typically employing a multi-level, multi-algorithm fusion strategy.


For Size/Geometric Defects:


▪ Edge Detection (Canny, Sobel): Extract contours and perform pixel-level comparison with standard templates or geometric dimension measurement (diameter, roundness, angle).


For Appearance/Texture Defects (Scratches, Stains, Bubbles, etc.):


▪ Thresholding Segmentation: Binarize the image to separate the foreground (defect) and background. Suitable for defects with significant contrast.


▪ Texture Analysis: Analyze the uniformity of surface texture using algorithms such as Gray-Level Co-occurrence Matrix (GLCM) and Gabor filtering to identify texture anomaly regions.


▪ Frequency Domain Analysis: Performs Fourier transform on the image to detect periodic defects or anomalous frequency components in the frequency domain.


▪ Differential Method/Template Comparison: Performs pixel-by-pixel difference analysis between the image to be tested and a "perfect" standard template image. Areas with differences exceeding a threshold are considered defects. This method is simple and effective, but requires extremely high consistency in location and lighting.


For Printing and Character Defects:


▪ Optical Character Recognition (OCR): Reads and verifies the correctness and completeness of characters such as production dates and batch numbers.


▪ Color Analysis: Compares the color difference between the area to be tested and a standard color patch in a specific color space (such as Lab).


▪ Feature Point Matching: Compares whether the key feature points of logos and patterns match.


4. Integration of Artificial Intelligence and Deep Learning:


Traditional algorithms perform well on defects with obvious and regular features, but they are difficult to define for ambiguous and variable defects (such as stains of various forms and minor scratches). Deep learning, especially visual techniques based on Convolutional Neural Networks (CNNs), has become the mainstream and future direction.


◦ Working Principle: The CNN model is trained using a massive number of "OK" and "NG" (containing various defects) bottle cap image samples. The network automatically learns to extract multi-layered abstract features from pixels, from low to high (edge -> texture -> pattern -> object), ultimately learning to distinguish between normal and abnormal.


Common Models:


▪ Classification Networks: Classify the entire bottle cap or region as "acceptable" or "unacceptable" (and defect type).


▪ Object Detection Networks: Such as YOLO and Faster R-CNN, which can directly locate the position of defects in an image and outline them, while also providing the category.


▪ Semantic Segmentation Networks: Such as U-Net, which can classify every pixel in an image, accurately delineating the outline of defects, and is particularly suitable for analyzing the shape and area of defects.


Advantages: Strong anti-interference capabilities, adaptability to complex backgrounds, ability to detect unknown types of defects (by learning from normal samples, any pattern deviating from "normal" is judged as abnormal, i.e., "anomaly detection"), and reduced algorithm debugging complexity.


5. Judgment and Data Management:


Based on the conclusions from each inspection station, a final "pass/fail" judgment is made, and a signal is output to control sorting.


Record and store all inspection data (images, results, time), generate statistical reports (first-pass yield, defect type distribution, etc.), and achieve quality traceability and production process monitoring.


III. System Implementation and Integration Considerations


1. Production Line Integration: Seamless integration with the existing production line's cycle time and control logic is required. Inspection stations are typically located after the injection molding machine (online inspection) or before packaging (offline sampling inspection).


2. Inspection Standard Setting: Define clear and quantifiable inspection standards in collaboration with quality engineers. For example, what is acceptable for scratch length (in millimeters), stain area (in square millimeters), and color difference Delta E (below a certain value)? These standards will be translated into algorithm judgment thresholds or training data labels.


3. Human-Machine Interface: Design a simple and clear operating interface for easy parameter setting, standard switching, real-time monitoring, and result querying.


4. System Validation and Calibration: Regularly calibrate and validate the system using standard parts or defect samples to ensure detection stability.


IV. Application Benefits and Future Trends


Application Benefits:


• Quality Improvement: Achieve 100% full inspection, significantly reducing customer complaints and quality risks.


• Cost Savings: Reduce labor costs, rework costs, and material waste.


• Efficiency Improvement: Adapt to high-speed production lines, enabling continuous operation without fatigue.


• Data-Driven: Accumulated quality big data can be used for process optimization, predictive maintenance, and supply chain management.


Future Trends:


1. Application of 3D Vision Technology: Utilizing laser triangulation or structured light technology to acquire 3D point cloud data of bottle cap surfaces allows for extremely accurate measurement of 3D defects such as height, flatness, and warpage, providing a powerful supplement to 2D vision.


2. Higher Integration AI Chips and Edge Computing: Deploying AI algorithms within smart cameras or industrial control computers with NPUs achieves faster response times and lower system latency.


3. Cloud-based AI and Continuous Learning: Upload production line data to the cloud, utilize more powerful computing capabilities to train and optimize general models, and quickly deploy newly learned defect features to all production lines, achieving "learn once, upgrade the whole network."


4. Cross-modal Information Fusion: Combine information from multiple sensors, including vision, acoustics (detecting internal structural cracks), and even olfaction (detecting odor contamination), for comprehensive quality judgment.


Conclusion


Visual inspection of surface defects in plastic bottle caps is a comprehensive engineering technology integrating optics, mechanics, electronics, software, and artificial intelligence. From precise hardware selection and optical path design to robust image processing and intelligent algorithms, every step is crucial. With the continuous maturation of deep learning technology and the deepening of Industry 4.0, visual inspection systems are evolving from automated tools that "replace human eyes" to intelligent quality decision-making centers that "surpass the human brain," providing a solid and reliable technical guarantee for the high-quality development of the manufacturing industry.