Plastic product flaw online detecting and sorting system based on machine vision

By employing a depth-based visual recognition method based on multi-angle polarized illumination and material compatibility factors, combined with multi-scale texture enhancement and intelligent sorting modules, the system addresses the issues of poor adaptability and weak anti-interference capabilities in plastic product defect detection systems, achieving efficient and accurate defect detection and sorting.

CN121499378APending Publication Date: 2026-02-10WENLING DONGYA PLASTIC & RUBBER CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511929060.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing plastic product defect detection systems suffer from low detection efficiency, poor adaptability, insufficient defect identification accuracy, large sorting and positioning deviations, and weak anti-interference capabilities, making it difficult to meet the real-time detection needs of high-speed production lines.

Method used

By acquiring images under multi-angle polarized lighting conditions and combining them with a depth vision recognition method based on material adaptation factors, and through multi-scale texture enhancement and intelligent sorting modules, the system achieves accurate identification and sorting of cracks, dents, and flow marks.

Benefits of technology

It achieves high-precision and highly adaptable defect detection of plastic products, is compatible with the detection needs of different materials, has accurate and reliable sorting effect, strong anti-interference ability, and meets the real-time detection and sorting needs of high-speed production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121499378A_ABST
    Figure CN121499378A_ABST
Patent Text Reader

Abstract

The invention discloses a plastic product flaw online detecting and sorting system based on machine vision, and particularly relates to the technical field of plastic flaw detection.The plastic product flaw online detecting and sorting system is characterized in that an image acquisition module acquires multi-angle original images under polarized light illumination and establishes a reflection response indexing relation; the spectral reflection structure shaping module implements differential illumination processing based on the indexing relation to generate a primary processing image; the feature enhancement processing module constructs three types of defect structure response channels, and generates a defect feature enhanced image through multi-scale texture enhancement; the defect identification module introduces a material adaptation factor and combines plastic physical characteristic correction to realize accurate defect discrimination; and the intelligent sorting execution module completes online grading sorting according to the defect identification indexes. The system is suitable for plastic products with different transparency, refraction coefficients and surface roughness, the problems that traditional detection is poor in adaptability, low in precision and inaccurate in sorting are effectively solved, the industrial real-time production requirement is met, and the product quality and the production efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of plastic flaw detection, more particularly, the present application relates to an online detection and sorting system for plastic product flaws based on machine vision. BACKGROUND

[0002] Plastic products are widely used in industrial production, daily life and other fields due to their light weight, durability and low cost. The surface and internal flaws (such as cracks, depressions, flow marks, etc.) of plastic products directly affect the product performance and service life. Therefore, flaw detection is a key link in the production process of plastic products.

[0003] Currently, plastic product flaw detection mainly includes manual detection and machine vision detection. Manual detection relies on the visual judgment and experience of operators, which has the problems of high labor intensity, low efficiency, inconsistent detection standards, and is easily affected by factors such as fatigue and environmental light, resulting in high missed detection rate and false detection rate, which is difficult to meet the needs of large-scale automated production.

[0004] Although the existing machine vision detection system has improved the detection efficiency to some extent, it still has many shortcomings: first, the acquisition method is single, mostly using single-angle image acquisition, which cannot realize 360° coverage of plastic products without dead angles, and is easy to miss edge and side defects; second, it is not fully adapted to the differences in plastic materials, different transparency, refractive index and surface roughness of plastic products will produce different reflection interference, making it difficult to extract defect features and limiting the detection accuracy; third, the connection between defect recognition and sorting is not smooth, there is a lack of recognition and correction mechanism for the physical properties of plastics, and the sorting positioning deviation is large and the grading is not accurate, which cannot match the real-time detection needs of high-speed production lines; fourth, the anti-industrial environment interference ability is weak, factors such as vibration and light changes easily affect the acquisition accuracy and recognition stability, further reducing the detection reliability; these problems seriously restrict the improvement of plastic product production efficiency and product quality, and an efficient, accurate and highly adaptive online detection and sorting system is urgently needed. SUMMARY

[0005] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present application provide an online detection and sorting system for plastic product flaws based on machine vision, which solves the problems of low efficiency of manual detection, poor adaptability of machine vision detection, insufficient defect recognition accuracy, large sorting positioning deviation and weak anti-interference ability in the prior art by the following scheme.

[0006] To achieve the above purpose, the present application provides the following technical scheme: an online detection and sorting system for plastic product flaws based on machine vision, comprising an image acquisition module: for acquiring multi-angle original images under polarized light conditions during the continuous conveying of plastic products, and establishing a reflection response index relationship corresponding to the acquisition angle.

[0007] Spectrum reflection structure shaping module: based on the reflection response index relationship, the multi-angle original image is subjected to differential illumination characteristic processing to generate a preliminary processing image for subsequent feature analysis;

[0008] Feature enhancement processing module: based on the preliminary processing image, three types of structure response channels for cracks, depressions and flow marks are constructed, and a multi-scale texture enhancement method is used to generate defect feature enhancement image data;

[0009] Defect recognition module: based on the defect feature enhancement image data, a deep visual recognition method introducing a material adaptation factor is used to identify defects, and structure response correction is performed in combination with transparency, refraction characteristics and surface roughness difference to finally generate a defect recognition index;

[0010] Intelligent sorting execution module: according to the defect recognition index and its spatial positioning information, online sorting operation is performed on the plastic products.

[0011] Technical effects and advantages of the present application:

[0012] 1. High detection accuracy and strong adaptability: through multi-angle polarization image acquisition, index binding and differential illumination processing, the reflection interference caused by the difference in plastic material is effectively weakened; the three types of defect-specific response channels and the multi-scale enhancement algorithm accurately extract the defect features, combined with the deep model optimized by the material adaptation factor and the physical property correction, the accurate identification of cracks, depressions and flow marks is realized, and the plastic products with different transparency, refractive index and surface roughness are compatible, solving the problems of poor adaptability, defect missed detection and misdiagnosis of traditional systems;

[0013] 2. Efficient and accurate sorting with real-time performance: the intelligent sorting module uses PLC core control to realize high-precision positioning through coordinate mapping and motion compensation, and the grading and sorting unit is adapted to different defect types and severity, so that the sorting effect is accurate and reliable; the system modules use high-performance hardware devices and optimized algorithms, have fast response speed, can adapt to the operation rhythm of high-speed production line, meet the real-time detection and sorting requirements, and greatly improve the production efficiency;

[0014] 3. Strong anti-interference ability and traceability: the image acquisition module is optimized in terms of shock absorption design and polarized light suppression to reduce the interference of environmental factors such as industrial vibration and reflection; the sorting module has state closed-loop feedback and standby unit switching function to ensure the continuous and stable operation of the system; the sorting record and defect recognition data are stored in association with the unique identifier to provide strong support for production quality control and problem tracing, forming a complete industrial application closed loop from detection, recognition to sorting. BRIEF DESCRIPTION OF DRAWINGS

[0015] Fig. 1The schematic diagram of the overall system structure of the present application;

[0016] Fig. 2 The schematic diagram of the process of obtaining the defect identification index of the present application;

[0017] Fig. 3 The overall method step flow chart of the present application;

[0018] Fig. 4 The schematic diagram of the relationship between the experimental parameters and the material quality adaptation factor of the present application. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0020] As shown in the machine vision-based plastic product defect online detection and sorting system, comprising: Figs. 1 to 4

[0021] The image acquisition module is used to acquire multi-angle original images under the condition of polarized light illumination during the continuous conveying of the plastic product, and to establish a reflection response indexing relationship corresponding to the acquisition angle.

[0022] It should be specifically noted that the conveying link adopts a polytetrafluoroethylene material conveying belt with a thickness of 3mm, and the surface is sandblasted to a roughness Ra=0.8μm, which not only avoids scratching and adhesion of the plastic product, but also ensures the stability of the load; the driving end selects a MS1H1-10B30CB-A31N1 type servo motor, which is matched with a 1:10 reduction ratio planetary gear reducer, and realizes stepless speed regulation of 0.5-3m / min through PWM control, and the speed fluctuation error is controlled within ±0.5%; the E3Z-LS63 type photoelectric sensor is symmetrically installed on both sides of the entrance of the acquisition area, with a detection distance of 0-60cm and a response time of ≤1ms, which is used to trigger the acquisition action and record the initial position of the product; the conveying belt base is made of cast iron, and a shock-absorbing rubber pad with a Shore hardness of 60° is additionally installed at the bottom, so that the inherent frequency of the base avoids the acquisition working frequency band of 50-100Hz, and reduces the interference of industrial vibration on the acquisition accuracy.

[0023] ​It should be further explained that the polarized illumination system uses a SL-5050-120 high-brightness LED surface light source with a light-emitting area of ​​500mm×500mm, a color temperature of 5500K, and a color rendering index Ra≥90. Combined with a constant current drive module, it achieves continuous adjustment of luminous intensity from 0 to 100%. A PL-030 linear polarizer with an effective aperture of 30mm, polarization degree ≥99%, and extinction ratio ≥1000:1 is fixed to the front end of the light source via a threaded interface. The polarization direction can be infinitely adjusted from 0 to 360° with a precision of 1° via a rotating adjustment ring. The entire light source is mounted on an aluminum alloy angle adjustment bracket, supporting vertical (angle with the conveyor belt 30°-90°) and horizontal (angle with the conveyor direction -45° to +45°) angle adjustments. After adjustment, it is fixed with locking bolts, with an angle deviation ≤±0.5°, ensuring optimal adaptation between the polarized light illumination direction and the image acquisition angle.

[0024] Image acquisition utilizes a surround array of four MV-CA050-10GC high-speed industrial cameras. Each camera has a resolution of 2448×2048 pixels, a frame rate of ≥100fps, and a pixel size of 3.45μm×3.45μm. Two cameras are positioned along the conveyor direction at the front and rear ends of the acquisition area, while two are positioned perpendicular to the conveyor direction on the left and right sides, achieving 360° coverage of the upper surface, sides, and edges of the plastic product. Each camera is equipped with an M1214-MP2 fixed-focus lens with a focal length of 12mm. The camera features an adjustable aperture of F1.4-F16, a 50° field of view, and a distortion rate of ≤0.1%. A linear polarizer matching the light source is mounted on the front of the lens, and the reflection suppression effect is enhanced by adjusting the angle between the polarizer and the light source (0° parallel or 90° orthogonal). The camera is externally encased in a 304 stainless steel protective shell with an anti-reflective finish. Internally, it integrates a 2m / s cooling fan and a desiccant box, achieving an IP65 protection rating, suitable for industrial environments with temperatures ranging from -10℃ to 60℃ and relative humidity ≤85% (non-condensing).

[0025] It should be further noted that this module establishes communication with the host computer via an RS485 interface, and receives the core material parameters of the current batch of plastic products from the host computer in real time, including transparency level, refractive index and surface roughness. The data reception delay is ≤1ms, ensuring that the material parameters are synchronized with the product acquisition process.

[0026] It should be further explained that the reflection response indexing is implemented through an E6B2-CWZ6C absolute encoder, with one encoder configured for each camera. The encoder has a resolution of 1024 lines, outputs an RS485 signal, and has a response time of ≤0.1ms. The encoder is connected to the rotation shaft of the camera mounting bracket via a coupling, and acquires the camera's horizontal deflection angle (0°-360°) and vertical pitch angle (-45°-+45°) in real time, with a measurement accuracy of ≤±0.1°. The angle data is processed by an STM32H743VI embedded chip. After 5-point moving average filtering, a unique index code is generated for each frame of image, which includes the camera number (1-4), the horizontal / vertical angle value, and a microsecond-level acquisition timestamp, achieving precise binding between the image and the acquired angle.

[0027] Finally, original images from multiple angles are obtained, and a reflection response indexing relationship corresponding to the acquisition angle is established.

[0028] Spectral reflectance structure shaping module: Based on the reflectance response indexing relationship, differential illumination characteristic processing is performed on the original multi-angle image to generate a preliminary processed image for subsequent feature analysis;

[0029] It should be noted that this module is designed with the core concept of indexing relationship-driven + differentiated spectral shaping + material characteristic adaptation. Based on the 2448×2048 pixel multi-angle original image and reflection response indexing relationship (including camera number, horizontal / vertical acquisition angle, and microsecond-level timestamp) output by the image acquisition module, it weakens the reflection interference caused by the material differences (transparency, refractive characteristics, surface roughness) of plastic products through hardware device and algorithm collaboration, highlights the structural features of three types of defects: cracks, dents, and flow marks, and provides a high signal-to-noise ratio preliminary processed image for subsequent feature enhancement processing. The entire process meets the real-time requirements of online detection (single frame image processing time ≤5ms).

[0030] It should be further explained that the indexing relationship parsing uses an STM32H750VBT6 embedded microcontroller (480MHz main frequency, supporting Gigabit Ethernet interface) to directly establish communication with the image acquisition module, with a data reception delay of ≤2ms. During parsing, the microcontroller extracts key information such as the acquisition angle (horizontal 0°-360°, vertical -45°-+45°) and camera number (1-4) from the indexing code through a custom protocol. At the same time, it performs format verification (8 / 16-bit grayscale format) and data integrity verification on the original image, eliminating abnormal data such as packet loss and misalignment. After the verification is passed, the indexing information and the corresponding original image are stored in an 8GB dual-port RAM (read / write speed ≥200MB / s) for cache binding, ensuring that the processing of each frame of image can accurately match its acquisition angle parameters, providing data support for the adjustment of differentiated lighting characteristics.

[0031] Differential spectral shaping processing is based on an XC7K325T FPGA chip (210K LUTs and 1390K Flip-Flops, supporting parallel processing). It adjusts the reflection structure of raw images at different angles based on bound acquisition angle information. For images at vertical acquisition angles (80°-90° angle to the conveyor belt), a dynamic brightness equalization algorithm is used: by statistically analyzing the mean and variance of local grayscale values, the brightness gain is adaptively adjusted (range 0.5-2.0 times) to suppress overexposure of highlights and underexposure of shadows. For example, when the local mean grayscale value is below 50 (16-bit grayscale), the gain is automatically increased to 1. 5-2.0 times; For images acquired at tilted angles (30°-70° with respect to the conveyor belt), the polarization component of the image is corrected by digital filtering based on the light source polarization direction parameters in the indexing information, weakening specular reflection glare. During correction, the size of the filtering window is dynamically adjusted according to the polarization direction deviation (the window expands to 5×5 when the deviation is >10°); For images acquired at edge angles (≤29° with respect to the conveyor belt), they are divided into central and edge regions, and contrast enhancement coefficients are set separately (1.0-1.2 times for the central region and 1.2-1.5 times for the edge region) to compensate for the attenuation of reflection intensity during edge acquisition, ensuring that defect details in the edge region are not lost.

[0032] Material characteristic adaptation is a key aspect of the module's core design, requiring consideration of the plastic product's material properties. It receives material parameters (transparency level, refractive index 1.3-1.6, surface roughness Ra value) from the host computer via an RS485 interface, with a parameter update cycle ≤100ms, supporting online dynamic adjustment. Based on these parameters, the FPGA uses a built-in lookup table (LUT) to perform non-linear mapping on image pixel grayscale values: for high-transparency plastics (transmittance ≥85%), the high-frequency component gain is increased (1.2-1.4 times) to enhance the grayscale difference between defect edges and the background; for high-roughness plastics (Ra≥1.0μm), a 3×3 median filter is used to smooth surface texture noise while preserving the structural features of the defects; for plastics with a medium refractive index (1.3-1.6), grayscale values ​​are mapped to analog spectral channels to highlight the reflectance spectral differences in the defect area. For example, grayscale values ​​50-100 are mapped to the analog blue spectral band, and 101-150 to the analog green spectral band, amplifying defect features through spectral differences.

[0033] It should be further explained that through the entire process of precise analysis of indexing relationships, differential spectral shaping optimization, and material characteristic adaptation adjustment, preliminary processed images were finally obtained that are adapted to different acquisition angles, weaken material reflection interference, and clearly present the structural features of three types of defects: cracks, dents, and flow marks.

[0034] Feature enhancement processing module: Based on the pre-processed image, construct three types of structural response channels for cracks, dents and flow marks, and use a multi-scale texture enhancement method to generate defect feature enhanced image data;

[0035] It should be specifically noted that the feature enhancement processing module is designed with the core idea of ​​three-channel targeted extraction + multi-scale enhancement + precise highlighting of defect features. It receives the pre-processed image, constructs dedicated structural response channels for cracks, dents and flow marks, and combines multi-scale texture enhancement algorithms to remove background interference and amplify the details of defect features, generating feature-enhanced image data that meets the requirements of the defect recognition module.

[0036] It should be further explained that the pre-processed image is first further processed to perform image format standardization, converting the input image into a uniform 16-bit grayscale uncompressed format. At the same time, based on the material adaptation mark in the indexing information, a preset parameter configuration file (optimized for different materials such as high transparency and high roughness) is called. Subsequently, an adaptive Gaussian filtering algorithm is used for noise suppression. The filter kernel size is dynamically adjusted according to the local noise intensity of the image (range 3×3 to 7×7). When the local grayscale variance is >50, a 7×7 kernel is used, and when the variance is <20, a 3×3 kernel is used. This preserves the details of defects while reducing background texture noise. After processing, the background noise intensity of the image is reduced by more than 15% compared to the input.

[0037] It needs further explanation that the specific method of targeted extraction for the three types of defects—cracks, dents, and flow marks—is designed with differentiated feature extraction logic to construct dedicated structural response channels, achieving targeted capture of defect information based on the different structural characteristics of these three types of defects. Specifically, the crack response channel employs an improved Canny edge detection algorithm, dynamically adjusting dual thresholds based on the acquisition angle parameters in the indexing information: the high threshold for vertically acquired images is set to 80, and the low threshold to 30; for tilted and edge-acquired images, the high threshold is reduced to 60, and the low threshold to 20. Simultaneously, a morphological dilation operation (3×1 rectangular structuring element) is introduced to connect the edges of the fractured crack, ensuring that even minute cracks (width ≥ 1 image) are effectively captured. The image is fully extracted; the concave response channel is based on the principle of gray-level difference, which calculates the mean gray-level difference between each pixel in the image and the pixels in the 3×3 neighborhood. When the mean value is <-15 (16-bit gray-level system), it is marked as a concave candidate region. Then, the discrete candidate points are merged by the region growing algorithm (growing threshold ±5) to accurately locate the concave range; the flow mark response channel adopts a direction-controllable Gabor filter. According to the conveying direction of the plastic product in the indexing information, the filtering direction is set to be consistent with the conveying direction (error ≤5°), and the filtering scale is fixed at 5×5. By extracting the gray-level gradient features along the conveying direction, the striped texture of the flow mark is highlighted, effectively distinguishing the flow mark from the random background texture.

[0038] Multi-scale enhancement specifically refers to multi-scale texture enhancement algorithms, which are used to further enhance the defect features of the three types of response channel outputs. They adopt a layered processing strategy of "enhancing details at small scales, strengthening edges at medium scales, and solidifying regions at large scales".

[0039] Small-scale enhancement employs the Laplacian operator to perform convolution operations on each channel of the image. The 3×3 Laplacian operator kernel is defined as follows: The convolution operation formula is: Where K is the Laplacian operator kernel, I is the input channel image, and (x,y) are pixel coordinates. This operation amplifies the gray-level transitions at the crack edges and indentation boundaries, enhancing detail recognition.

[0040] Mesoscale enhancement involves magnifying the image by 1.5 times using bilinear interpolation, followed by Sobel edge detection with horizontal Sobel kernels. Vertical Sobel kernel The formula for calculating edge strength is: By jointly calculating and enhancing the contour differences between defects and the background, the image is then scaled back to its original size.

[0041] Large-scale enhancement employs morphological closing operations, which are defined as I... close = Where ⊕ represents the expansion operation, The erosion operation is represented by B, which is a 5×5 circular structuring element. This operation fills the small holes in the defect area while preserving the overall morphological features of the defect. The enhancement results at the three scales are weighted and fused to generate a single-channel feature image. The fusion formula is F=0.4F1+0.35F2+0.25F3, where F1, F2, and F3 are the enhancement results at the small, medium, and large scales, respectively, ensuring that both the details of the defect and the overall morphology are taken into account.

[0042] It should be further explained that the accurate highlighting of defect features is achieved after the multi-channel feature fusion is completed. Data format adaptation is required to ensure that the defect features are clearly presented. Before output, the single-channel defect feature enhancement image generated by fusion is first subjected to grayscale stretching to map the grayscale values ​​to the complete 16-bit range of 0-65535, which significantly improves the dynamic range of the image. The final output defect feature enhancement image data includes a 2448×2048 pixel image subject, defect type markers (existence markers of three types of defects), and enhancement parameter information (filter kernel size, fusion weight, etc.).

[0043] Defect identification module: Based on the enhanced image data of the defect features, the module uses a depth vision recognition method that introduces material adaptation factors to identify defects, and performs structural response correction by combining transparency, refractive properties and surface roughness differences, and finally generates defect identification indicators.

[0044] It should be specifically explained that the defect recognition module receives defect feature enhancement images (including defect type labels and enhancement parameter information), optimizes the input of the deep model by constructing a material adaptation factor, performs defect discrimination by an improved deep learning network, and corrects the recognition results by combining the multiple physical properties of plastic, and finally generates defect recognition indicators that include defect type, location and confidence level.

[0045] It should be further explained that, firstly, the defect feature enhanced image is received, and at the same time, the material parameters of the plastic product are obtained, including the transparency level (T, value 0-100%), refractive index (n, value 1.3-1.6), and surface roughness (Ra, value 0.1-2.0μm). A one-to-one correspondence is established with the material adaptation mark attached to the image, which provides data support for the subsequent construction of material adaptation factors.

[0046] It should be further explained that the material adaptation factor is constructed using a multi-parameter weighted fusion method. First, the material parameters are normalized to eliminate the influence of dimensions, specifically including:

[0047] Transparency normalization formula: T norm =T / 100, where T is the original transparency level of the plastic product (unit: %, value range 0-100%, directly obtained from the host computer), T norm The normalized transparency coefficient (unitless, mapped to the [0,1] interval);

[0048] Normalization formula for refractive index: n norm =(n-1.3) / (1.6-1.3), where n is the original refractive index of the plastic product (unitless, ranging from 1.3 to 1.6, representing the refractive index range of common plastics such as PP, PE, and PVC), 1.3 and 1.6 are the minimum and maximum reference values ​​within this range, respectively. norm The normalized refractive index (unitless, in the range [0,1]);

[0049] Surface roughness normalization formula: Ra norm =(Ra-0.1) / (2.0-0.1), where Ra is the original surface roughness of the plastic product (unit: μm, range 0.1-2.0 μm, covering common roughnesses of industrial injection molded parts), 0.1 and 2.0 are the extreme values ​​of the reference range, and Ra norm The normalized roughness coefficient (unitless, in the range [0,1]).

[0050] Subsequently, based on 100,000 sets of defect identification experimental data, the weights were determined as follows: transparency weight 0.4 (with the greatest impact on identification), refractive index 0.3, and surface roughness 0.3. The final material adaptation factor formula is: M = 0.4T norm +0.3nnorm +0.3Ra norm , where M is the material adaptation factor (unitless, in the range [0,1]), which will be used as an additional feature input to the depth model to adapt to different materials.

[0051] It should be noted that the deep vision recognition uses an improved YOLOv8-nano model, with an optimized network structure for plastic defect detection scenarios: The input layer receives 512×512×2 feature data (a 512×512×1 grayscale image + a 512×512×1 material adaptation factor feature map), and the dual-channel features are fused into a single-channel feature map through a convolutional layer (3×3 convolutional kernel, stride 1); the backbone network retains the C2f module, but the number of channels is reduced from 64 to 48 to improve speed, and an attention mechanism (ECA attention) is inserted after the third C2f module to enhance the extraction of defect region features; the neck network adopts an FPN+PAN structure to ensure effective recognition of multi-scale defects (1-100 pixels); the output layer is designed with 3 prediction branches, corresponding to the defect category (crack, dent, flow mark), bounding box coordinates, and recognition confidence, respectively. The CIoU loss function is used to optimize the bounding box regression accuracy, and the cross-entropy loss function is used to optimize the classification results.

[0052] The model training and optimization adopted a "transfer learning + incremental training" strategy: based on the YOLOv8-nano model pre-trained on the COCO dataset, 100,000 images of plastic defects covering different materials, defect types, and lighting conditions were used for fine-tuning, including 80,000 images in the training set, 10,000 in the validation set, and 10,000 in the test set. During the training process, online hard example mining (OHEM) was introduced to increase the training weight of samples with confidence scores below 0.5. At the same time, a cosine annealing strategy was adopted (initial learning rate 1e-3, minimum learning rate 1e-5) to avoid overfitting. After training, the model achieved an average accuracy of ≥97.2% on the test set, with crack recognition accuracy of 98.1%, dent recognition of 97.3%, and flow mark recognition of 96.5%, meeting the accuracy requirements of industrial inspection.

[0053] It should be further explained that the plastic multi-physical property correction is used to correct deviations in the depth model output. It performs targeted corrections by combining differences in plastic transparency, refractive properties, and surface roughness, specifically including:

[0054] High-transparency plastic correction (T≥85%): Light refraction can easily cause the predicted defect boundary to shift. A pixel offset correction algorithm is adopted, and the offset formula is d=2(n-1.3)×10, where the first parameter d is the bounding box offset (unit: pixels, value range 0-6 pixels, positively correlated with the refractive index), n is the original refractive index, and the coefficients 2 and 10 are the correction coefficients fitted by experiments. For example, for plastic with n=1.55, d=2×(1.55-1.3)×10=5 pixels, and the bounding box needs to be adjusted by 5 pixels along the offset direction.

[0055] Correction for high-roughness plastics (Ra≥1.0μm): Surface textures are easily misjudged as defects. By calculating the texture similarity between defects and the background (threshold 0.8), the confidence level is reduced by 0.2-0.3 when the similarity exceeds the limit, without the need for formula calculation;

[0056] Medium refractive index plastic correction (1.3 < n < 1.6): Blurred grayscale features are prone to missed detection. Grayscale response calibration is adopted, and the threshold formula is Th = 0.5 × (1 + M), where Th is the corrected defect grayscale recognition threshold (unitless, value range 0.5-1.0), 0.5 is the baseline threshold, and M is the material adaptation factor. For example, when M = 0.7, Th = 0.5 × (1 + 0.7) = 0.85. Areas below this threshold will be judged as background to ensure that defects are not missed. After correction, prediction results with confidence < 0.6 are removed to control the false positive rate within 0.8%.

[0057] It should be further explained that the final defect identification index includes 6 core pieces of information: unique defect identifier (UUID), defect type (1-crack, 2-dent, 3-flow mark), bounding box coordinates (normalized to the top left x / y and bottom right x / y of [0,1]), identification confidence (0-1), defect size (pixel area converted to actual area, based on camera calibration parameters: 1 pixel = 0.02mm), and material adaptation marker (corresponding to the input material parameter group).

[0058] Intelligent sorting execution module: Based on the defect identification indicators and their spatial positioning information, it performs online sorting operations on plastic products.

[0059] It should be specifically noted that the intelligent sorting execution module receives defect identification indicators and spatial positioning correlation data of plastic products synchronously transmitted by the image acquisition module. Through real-time positioning compensation, graded sorting action execution and status closed-loop feedback, it realizes accurate classification and sorting of plastic products with defects such as cracks, dents and flow marks.

[0060] Firstly, a Siemens S7-1516C PLC is used as the core control unit. This PLC supports both PROFINET and EtherNet / IP buses, with an instruction processing speed of 0.01μs / instruction. It establishes stable communication with the defect identification module through a gigabit Ethernet interface, ensuring real-time reception of JSON indicator data containing information such as the unique defect identifier, type, and bounding box coordinates. Simultaneously, it collects data from the encoder of the MS1H1-10B30CB-A31N1 servo motor on the conveyor belt through an RS485 interface to dynamically obtain the product conveying position. The parsing process focuses on six core pieces of information: defect type (1 corresponds to crack, 2 to dent, 3 to flow mark), normalized bounding box coordinates, identification confidence level (only ≥0.6 is considered valid), actual defect area (converted from pixel area to square millimeter by combining camera calibration parameters 1 pixel = 0.02mm), material compatibility mark, and spatial positioning association code. The parsing time is strictly controlled within 5ms. Invalid indicators with a confidence level <0.6 or missing parameters are directly marked "ignore" and written to the local log to avoid interference from invalid data in subsequent processes.

[0061] It should be further explained that the real-time positioning compensation eliminates the deviation between image coordinates and physical coordinates, as well as the positional offset caused by the conveyor belt movement, through "coordinate mapping + motion compensation". The coordinate mapping establishes a correlation using the Zhang Zhengyou calibration method. Based on the camera's field of view and the width of the conveyor line, a scaling factor of 500mm is determined along the conveyor line direction and 300mm in the vertical direction. Combined with the camera's installation position, a coordinate offset of 20mm along the conveyor line direction and 10mm in the vertical direction is set to convert the normalized coordinates in the index into physical coordinates of the conveyor line. The motion compensation calculates the displacement of the product during the total time of index transmission (≤2ms) and resolution (≤5ms) combined with the real-time speed of the conveyor belt fed back by the encoder. Finally, the mapped physical coordinates are superimposed with the displacement compensation to obtain the real-time sorting positioning coordinates of the product. The positioning error can be accurately controlled within ±2mm, providing a precise positional basis for subsequent sorting actions.

[0062] It should be further explained that the graded sorting execution is performed by matching three groups of sorting units arranged along the side of the conveyor line according to the defect type and severity, with a unit spacing of 500mm to avoid motion interference, achieving graded processing of "different defects corresponding to different sorting paths"; Unit 1 is specifically designed to handle cracks and dents with an area ≥5mm², equipped with an Airtac SC63×100 cylinder-driven nylon pusher (to prevent scratching the product surface), with a pusher stroke of 100mm and an action speed adjustable between 0.2 and 0.5m / s, directly connecting to the "non-conforming product A exit"; 2 Unit 1 is designed for flow marks and small indentations of 1-5mm², equipped with an SMCCDJ2B16×50 mini cylinder with a pusher stroke of 50mm, suitable for "non-conforming product B outlet"; Unit 3 is a backup mechanism, equipped with the same cylinder assembly as Unit 1. When Units 1 and 2 fail, the system automatically switches to activate it to ensure uninterrupted continuous production; Each unit is equipped with an E3Z-D61 diffuse reflection photoelectric sensor to detect the pusher's position in real time (response time ≤1ms), forming a complete closed-loop action of "trigger-action-positioning-reset".

[0063] It should be further explained that the sorting action control logic adopts a position triggering and timing linkage strategy. The PLC, as the control center, compares the real-time positioning coordinates of the product with the preset trigger coordinates of each unit in real time (1000mm for unit 1, 1500mm for unit 2). When the real-time coordinates of the product fall within the precise range of ±5mm of the trigger coordinates, the PLC immediately outputs a 24V DC control signal based on the analyzed defect type—the Y0 port is set to 1 when unit 1 is triggered, and the Y1 port is set to 1 when unit 2 is triggered. The corresponding cylinder quickly extends the push plate to push the product into the designated exit. After the photoelectric sensor returns the "push plate in place" signal, the PLC immediately controls the cylinder to reset (Y0 / Y1 ports are set to 0), with a reset time of ≤50ms. At the same time, the PLC establishes a linkage mechanism with the conveyor belt servo motor. At the moment the sorting action is triggered, a speed fine-tuning command of ±0.1m / min is sent to the motor to offset the positional offset caused by the inertia of the product. After the action is completed, the original speed is restored instantly, ensuring that the continuous operation of the conveyor line is not affected by the sorting action.

[0064] It should be further explained that the aforementioned closed-loop feedback is a crucial support for ensuring the stable operation of the system. The PLC collects core data in real time, including the working pressure of each cylinder (normal range 0.4-0.6MPa), photoelectric sensor signals, and motor operating parameters. When abnormal situations occur, such as cylinder jamming (pressure > 0.7MPa), sensor timeout of 100ms without response, or motor speed fluctuation exceeding ±0.5%, the system will immediately trigger an audible and visual alarm (220V buzzer combined with red LED indicator). At the same time, detailed information including the unique defect identifier, abnormality type, and occurrence time will be uploaded to the host computer, and the system will automatically switch to the backup sorting unit to minimize the risk of production interruption. After sorting is completed, the PLC automatically generates a sorting record, which includes information such as product ID, defect type, sorting exit, and action time. This record is stored in a 1TB SSD local database via industrial Ethernet and associated with the defect identification record through a unique identifier. The data is retained for 90 days, providing a reliable basis for production quality traceability.

[0065] Through the above-mentioned whole-process design, the module ultimately achieves the precise sorting effect of "qualified products flow normally along the main conveyor line, products with cracks and severe dents are sent to exit A, and products with flow marks and slight dents are sent to exit B". The sorting accuracy rate is ≥99.5% and the missorting rate is ≤0.3%, which fully matches the accuracy requirements of the preceding defect identification module. This forms a complete industrial application closed loop from defect detection, identification and judgment to sorting execution, meeting the high-efficiency quality inspection needs of plastic product manufacturing.

[0066] It should be further noted that some experimental data are shown in the table below:

[0067]

[0068] Secondly: The accompanying drawings of the embodiments disclosed in this invention only involve the structures involved in the embodiments disclosed in this invention. Other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of this invention can be combined with each other.

[0069] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A machine vision-based online detection and sorting system for defects in plastic products, characterized in that, include: Image acquisition module: used to acquire original images from multiple angles under polarized light conditions during the continuous conveying of plastic products, and to establish a reflection response indexing relationship corresponding to the acquisition angle; Spectral reflectance structure shaping module: Based on the reflectance response indexing relationship, differential illumination characteristic processing is performed on the original multi-angle image to generate a preliminary processed image for subsequent feature analysis; Feature enhancement processing module: Based on the pre-processed image, construct three types of structural response channels for cracks, dents and flow marks, and use a multi-scale texture enhancement method to generate defect feature enhanced image data; Defect identification module: Based on the enhanced image data of the defect features, the module uses a depth vision recognition method that introduces material adaptation factors to identify defects, and performs structural response correction by combining transparency, refractive properties and surface roughness differences, and finally generates defect identification indicators. Intelligent sorting execution module: Based on the defect identification indicators and their spatial positioning information, it performs online sorting operations on plastic products.

2. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The polarized illumination conditions are constructed by an illumination system comprising a high-brightness LED surface light source and a linear polarizer. The light source is mounted on an angle adjustment bracket for vertical and horizontal angle adjustment. The linear polarizer is respectively mounted on the front end of the light source and the front end of the camera lens of the image acquisition module.

3. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The reflection response indexing relationship is obtained by binding the camera number, camera horizontal deflection angle, vertical pitch angle and acquisition timestamp, and combining the angle information output by the encoder to construct the reflection response indexing relationship between the image and the acquisition posture.

4. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The differentiated illumination characteristic processing performs brightness equalization, polarization component correction, and regional contrast adjustment on images acquired from different angles based on the reflection response indexing relationship, ultimately obtaining a preliminary processed image.

5. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The structural response channels are constructed for different structural characteristics of cracks, dents, and flow marks. The crack response channel uses an improved edge detection algorithm combined with morphological dilation operation; the dent response channel is based on the gray-level difference principle combined with a region growing algorithm; and the flow mark response channel uses a filtering algorithm.

6. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The multi-scale texture enhancement method performs small-scale texture processing, medium-scale texture processing, and large-scale texture processing on each structural response channel, and then performs layered fusion of the processing results at different scales to finally obtain defect feature enhanced image data.

7. The online detection and sorting system for defects in plastic products based on machine vision according to claim 6, characterized in that: The small-scale texture processing constructs a detail enhancement model through local operators; the medium-scale texture processing establishes a contour enhancement model through interpolation amplification and edge detection; and the large-scale texture processing forms a region structure processing model through morphological operations.

8. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The deep visual recognition method first generates a material adaptation factor by weighted fusion of normalized parameters of transparency, refractive index, and surface roughness. Then, it adopts an improved YOLO series model. The input layer receives the grayscale image corresponding to the defect feature enhancement image data and the material adaptation factor feature map. An attention mechanism is inserted into the backbone network of the model. The output layer sets three prediction branches: defect category, bounding box coordinates, and recognition confidence.

9. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The structural response correction is based on the material adaptation factor to jointly correct the boundary position, response threshold and discrimination confidence in the defect identification results under different material conditions, so as to obtain the corrected defect identification index.

10. The online detection and sorting system for defects in plastic products based on machine vision according to claim 1, characterized in that: The online sorting operation maps the coordinate information in the defect identification index through calibration, performs motion compensation in combination with the real-time speed of the conveyor belt, sets up multiple sorting units arranged along the conveyor line to deal with defects of different types and severity, and forms a closed loop of action with photoelectric sensors.

Citation Information

Cited By

  • Protector defect detection system based on machine vision

    CN121830684A