Injection molded product defect detection and sorting system and method based on machine vision
Patent Information
- Application Number
- CN202611038794.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-09-25
AI Technical Summary
[0006]由于在大规模生产的过程中普查的方法极其的耗费人力,通常采用抽检的方式,但抽检法存在着检测率低等问题
[0018]本发明与现有技术相比的优点在于:本发明在YOLOv8的Neck层创新性地嵌入了SCConv模块,显著提升了网络对注塑产品复杂缺陷(如飞边、裂纹等)的特征提取能力。同时采用数据增强技术(包括旋转、亮度调整和噪声添加)构建小样本高泛化数据集,有效解决了工业场景中样本不足的问题;
Smart Images

Figure CN122806764A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation inspection technology, specifically to a machine vision-based defect detection and sorting system and method for injection molded products. Background Technology
[0002] Injection-molded products have become an important choice for production and daily life due to their performance and price advantages. With the continuous expansion of their applications, injection-molded products have become a significant branch of the manufacturing industry.
[0003] Therefore, certain standards and requirements have been set for injection-molded products. They must not only meet the product's performance requirements but also possess a simple and aesthetically pleasing surface quality. During the injection molding process, due to complex processes, mechanical wear, and temperature control issues, the surface of the product is easily damaged, resulting in defects.
[0004] Defective injection molded parts mixed into finished products can seriously affect the product's lifespan, thereby impacting product competitiveness and corporate image. Therefore, defect detection in injection molded products will inevitably become a very important part of their processing and production.
[0005] Currently, most methods for dealing with surface defects in injection molded products still rely on manual screening.
[0006] Because census methods are extremely labor-intensive in large-scale production, random sampling is usually used, but random sampling has problems such as low detection rate.
[0007] Furthermore, manual methods are affected by personal experience and subjective factors, making it difficult to guarantee the consistency of detection results. Although machine vision technology is currently used for defect detection, traditional machine vision technology usually relies on manually designed feature extraction methods. These methods are effective when dealing with simple and regular defects, but when dealing with complex and diverse defects, they often fail to extract enough discriminative features. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to overcome the above-mentioned technical defects and provide a machine vision-based defect detection and sorting system and method for injection molded products that can work at a constant rate, significantly improve production efficiency, and effectively reduce labor costs.
[0009] To solve the above-mentioned technical problems, the technical solution provided by the present invention is: a machine vision-based defect detection and sorting system for injection molded products, including a hardware support layer, an execution layer and a human-machine interaction layer that work together; The hardware support layer includes an industrial camera, a robotic arm, an auxiliary light source, an industrial computer, and a product conveying mechanism. The execution layer includes a defect identification unit and a coordinate positioning unit deployed within an industrial control computer; The human-computer interaction layer is a visual control platform developed based on Python.
[0010] Preferably, the defect identification unit integrates the SCConv feature enhancement module in the Neck layer based on the improved YOLOv8 algorithm, including a spatial reconstruction unit and a channel reconstruction unit; The coordinate positioning unit is based on multi-step image processing and calibration technology to complete the conversion from pixel coordinates to robotic arm operation coordinates.
[0011] Preferably, the industrial camera uses a global shutter sensor with a resolution of ≥2 million pixels and a frame rate of ≥50fps; The robotic arm is a six-degree-of-freedom collaborative robot with a repeatability accuracy of ≤±0.1mm; The light source is a ring-shaped LED with a wavelength of 650nm.
[0012] Preferably, the training process of the YOLOv8 algorithm includes: Construct a dataset of defects in injection molded products; Data augmentation techniques were used to expand the dataset, and defective areas were labeled using the labelImg tool. The model was trained using the PyTorch framework, and the model weights were optimized using mAP@0.5 and recall as evaluation metrics. The defect dataset includes defect categories such as burrs, missing material, bubbles, and scratches.
[0013] Preferably, the coordinate positioning unit includes: Hand-eye calibration is completed using the nine-point calibration method, and the affine transformation matrix from camera coordinates to robotic arm coordinates is calculated. The acquired RGB images were subjected to grayscale conversion, Gaussian filtering, Otsu threshold segmentation, and Canny edge detection. Extract the target contour and calculate the coordinates of the center of the smallest circumcircle, then convert them into robot arm coordinates through affine transformation.
[0014] Preferably, the human-computer interaction layer includes a user login and registration module, a defect detection interface, a target location interface, and a database module; The defect detection interface displays the original image, processing results, and defect information in real time. The target positioning interface includes coordinate transformation and robotic arm control functions; The database module includes storage for defect types, detection times, and sorting records.
[0015] Another aspect of this invention discloses a machine vision-based method for defect detection and sorting of injection-molded products, including a complete process of image acquisition, defect recognition, coordinate positioning, sorting execution, and data management, as follows: S1: Acquire real-time images of the injection-molded product under test using an industrial camera and transmit them to an industrial control computer; S2: The improved YOLOv8 algorithm with embedded SCConv module is used to analyze the image acquired in S1 and output the detection results including defect category and spatial location. S3: Defect-free products are transferred from the robotic arm to the qualified product area. For defective products, the coordinate positioning unit is triggered to output the robotic arm's grasping coordinates. S4: Defective products are picked up by a robotic arm and sorted to a designated area; S5: The human-computer interaction interface enables real-time monitoring of the detection status, dynamic adjustment of camera parameters, and export and traceability of sorting data.
[0016] Preferably, step S1 further includes hardware connection status detection to verify the integrity of the communication link between the industrial camera and the robotic arm.
[0017] Preferably, in step S2, the YOLOv8 algorithm's single-frame image processing time is ≤0.3 seconds, and mAP@0.5 ≥90%. The coordinate positioning unit output in S3 includes grayscale conversion, filtering, contour extraction and coordinate transformation, and calculates the coordinates of the robotic arm grasping the defective product with an error ≤ ±1mm.
[0018] The advantages of this invention compared to existing technologies are as follows: This invention innovatively embeds the SCConv module into the Neck layer of YOLOv8, significantly improving the network's feature extraction capability for complex defects in injection molded products (such as flash, cracks, etc.). Simultaneously, data augmentation techniques (including rotation, brightness adjustment, and noise addition) are employed to construct a small-sample, high-generalization dataset, effectively solving the problem of insufficient samples in industrial scenarios. By combining the innovative nine-point calibration method with Hough transform circle detection technology, this invention achieves sub-millimeter level accurate mapping from pixel coordinates to robotic arm coordinates, significantly improving sorting and positioning accuracy. The modular hardware design, with optional global shutter industrial cameras and six-degree-of-freedom robotic arms, ensures that the system can flexibly adapt to the needs of different production lines. Based on the developed integrated human-machine interaction system, it fully covers functional modules such as user management, real-time detection, coordinate calibration and database visualization, realizing closed-loop management of the entire process from detection to sorting and data statistics. Attached Figure Description
[0019] Figure 1 This is the technical roadmap of the system invented in this patent.
[0020] Figure 2 This is a flowchart of the system invented in this patent.
[0021] Figure 3This is the login interface of the system invented in this patent. Figure 4 This is the registration interface of the system invented in this patent. Figure 5 This is the menu interface of the system invented in this patent. Figure 6 This is the defect detection interface of the system invented in this patent. Figure 7 This is the target positioning interface of the system invented in this patent. Figure 8 This is the database visualization interface of the system invented in this patent. Detailed Implementation
[0022] The present invention will now be described in further detail with reference to the accompanying drawings.
[0023] A machine vision-based defect detection and sorting system for injection molded products includes: hardware components: industrial camera, robotic arm, light source, industrial computer, and conveying mechanism; software components: defect detection algorithm, target localization algorithm, and human-machine interface based on improved YOLOv8; workflow: the system acquires images of injection molded products through the camera, identifies defects through the defect detection algorithm, calculates sorting coordinates by combining the target localization algorithm, and controls the robotic arm to complete the sorting.
[0024] The improved YOLOv8 algorithm embeds the SCConv module in the Neck layer, which includes spatial reconstruction units (SRU) and channel reconstruction units (CRU) to enhance the ability to extract defect features. The training process for the defect detection algorithm includes: Construct a dataset of defects in injection molded products, covering defects such as flash, short material, bubbles, and scratches; Data augmentation techniques were used to expand the dataset, and defective areas were labeled using the labelImg tool. The model was trained using the PyTorch framework, and the model weights were optimized using mAP@0.5 and recall as evaluation metrics.
[0025] The target localization algorithm includes the following steps: Hand-eye calibration is completed using the nine-point calibration method, and the affine transformation matrix from camera coordinates to robotic arm coordinates is calculated. The acquired RGB images were subjected to grayscale conversion, Gaussian filtering, Otsu threshold segmentation, and Canny edge detection. Extract the target contour and calculate the coordinates of the center of the smallest circumcircle, then convert them into robot arm coordinates through affine transformation.
[0026] The human-computer interaction interface is developed based on Python and includes: The user login and registration module supports access control. The defect detection interface displays the original image, processing results, and defect information in real time. The target positioning interface integrates coordinate transformation and robotic arm control functions. The database module stores defect types, detection times, and sorting records.
[0027] In actual use, the industrial camera uses a global shutter with a resolution of ≥2 million pixels and a frame rate of ≥50fps; the robotic arm is a six-degree-of-freedom collaborative robot with a repeatability accuracy of ≤±0.1mm; the light source is a ring LED with a wavelength of 650nm, used to enhance defect contrast.
[0028] In practice: The following steps are required: S1: Acquire real-time images of the injection-molded product under test using an industrial camera and transmit them to an industrial control computer; S2: The improved YOLOv8 algorithm with embedded SCConv module is used to analyze the image acquired in S1 and output the detection results including defect category and spatial location. S3: Defect-free products are transferred from the robotic arm to the qualified product area. For defective products, the coordinate positioning unit is triggered to output the robotic arm's grasping coordinates. S4: Defective products are picked up by a robotic arm and sorted to a designated area; S5: The human-computer interaction interface enables real-time monitoring of the detection status, dynamic adjustment of camera parameters, and export and traceability of sorting data. S1 also includes hardware connection status detection to verify the integrity of the communication link between the industrial camera and the robotic arm. In S2, the YOLOv8 algorithm has a single-frame image processing time of ≤0.3 seconds and mAP@0.5≥90%. The coordinate positioning unit output in S3 includes grayscale conversion, filtering, contour extraction and coordinate transformation, and calculates the coordinates of the robotic arm grasping the defective product with an error ≤ ±1mm.
[0029] like Figure 1 As shown, this invention integrates the YOLOv8-based injection molding product defect detection algorithm and target localization algorithm into an injection molding product defect detection and sorting system, and carries out software development and hardware selection.
[0030] like Figure 2As shown, the workflow of this invention first checks whether the camera and robot are connected. If the device is not connected, it returns to reconnect or is manually inspected. If the connection is successful, the robot is controlled to place the untested injection molded product from the product storage area into the detection acquisition area. It is then determined whether there is material in the detection area. If there is no material, the robot is controlled to repeat this step. If there is material, the camera begins to acquire images. The images are then entered into the defect detection function area and the target positioning function area. The images entering the defect detection function area are judged by a deep learning algorithm to determine whether there is a defect, and the detection results are stored. At the same time, the detection results affect the material placement position of the target positioning branch. The images entering the target positioning branch are processed by a traditional image processing algorithm to determine the position of the workpiece in the defect detection area. The position information is sent to the robot, which completes the grasping and sorting based on the defect detection results.
[0031] like Figure 3 , 4 As shown, the login interface has text input boxes for account and password, as well as three buttons: Login, Logout, and Register. It supports login with an administrator account and password, or with a registered account and password. The registration interface has three text input boxes: Registered Account, Registered Password, and Confirm Password. To meet usability requirements, the registration and login process is simple and intuitive, and error messages are provided.
[0032] like Figure 5 As shown, the menu interface of this invention guides users to various application interfaces.
[0033] like Figure 6 As shown, the defect detection interface of this invention includes: an original image display area, used to display the original image captured by the camera in real time, providing an intuitive reference for debugging hardware devices such as cameras and light sources, and ensuring image acquisition quality; a processed image display area, used to display the image after processing by the defect detection algorithm, in which the location and range of detected defects are clearly marked, helping users intuitively understand the specific situation of the defects; a camera status bar, which displays key camera parameter information in real time, including camera name, current frame rate, exposure time, etc., facilitating users to monitor the working status of the camera and make adjustments; a camera control bar, which provides adjustment functions for camera parameters, allowing users to adjust parameters such as frame rate and exposure time according to actual needs to optimize image acquisition effects; an interface control bar, which integrates commonly used functions such as image capture, saving, and clearing the display area, facilitating users to manage and operate image data; and a defect type area, which displays detailed information such as the type, location, and quantity of defects detected in the currently processed image in real time, providing users with comprehensive defect analysis results. These functional areas together constitute an efficient and intuitive defect detection interface.
[0034] like Figure 7As shown, the target positioning interface of this invention is crucial for the system to achieve accurate positioning. Its main functions are hand-eye calibration and target positioning. The interface is divided into three core areas: an image display area, used to display the processed image during the target positioning operation in real time, helping users to intuitively observe the positioning effect; a coordinate transformation area, the core functional area for hand-eye calibration, where users can input coordinate data, and the system will automatically complete the coordinate transformation to ensure precise coordination between the robotic arm and the vision system; and a function operation area, which integrates various control functions. Users can perform operations such as image grasping, coordinate calibration, and positioning execution through this area to ensure the smooth progress of the target positioning process.
[0035] like Figure 7 As shown, the database visualization interface of this invention is mainly used for data statistics and visualization in the database.
[0036] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
[0037] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0038] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature being directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature. The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A machine vision-based defect detection and sorting system for injection molded products, characterized in that: This includes the hardware support layer, execution layer, and human-computer interaction layer for collaborative work; The hardware support layer includes an industrial camera, a robotic arm, an auxiliary light source, an industrial computer, and a product conveying mechanism. The execution layer includes a defect identification unit and a coordinate positioning unit deployed within an industrial control computer; The human-computer interaction layer is a visual control platform developed based on Python.
2. The machine vision-based defect detection and sorting system for injection molded products according to claim 1, characterized in that: The defect identification unit integrates the SCConv feature enhancement module in the Neck layer based on the improved YOLOv8 algorithm, including a spatial reconstruction unit and a channel reconstruction unit; The coordinate positioning unit is based on multi-step image processing and calibration technology to complete the conversion from pixel coordinates to robotic arm operation coordinates.
3. The machine vision-based defect detection and sorting system for injection molded products according to claim 1, characterized in that: The industrial camera uses a global shutter sensor with a resolution of ≥2 million pixels and a frame rate of ≥50fps. The robotic arm is a six-degree-of-freedom collaborative robot with a repeatability accuracy of ≤±0.1mm; The light source is a ring-shaped LED with a wavelength of 650nm.
4. The machine vision-based defect detection and sorting system for injection molded products according to claim 2, characterized in that: The training process of the YOLOv8 algorithm includes: Construct a dataset of defects in injection molded products; Data augmentation techniques were used to expand the dataset, and defective areas were labeled using the labelImg tool. The model was trained using the PyTorch framework, and the model weights were optimized using mAP@0.5 and recall as evaluation metrics. The defect dataset includes defect categories such as burrs, missing material, bubbles, and scratches.
5. The machine vision-based defect detection and sorting system for injection molded products according to claim 2, characterized in that: The coordinate positioning unit includes: Hand-eye calibration is completed using the nine-point calibration method, and the affine transformation matrix from camera coordinates to robotic arm coordinates is calculated. The acquired RGB images were subjected to grayscale conversion, Gaussian filtering, Otsu threshold segmentation, and Canny edge detection. Extract the target contour and calculate the coordinates of the center of the smallest circumcircle, then convert them into robot arm coordinates through affine transformation.
6. The machine vision-based defect detection and sorting system for injection molded products according to claim 1, characterized in that: The human-computer interaction layer includes a user login and registration module, a defect detection interface, a target location interface, and a database module; The defect detection interface displays the original image, processing results, and defect information in real time. The target positioning interface includes coordinate transformation and robotic arm control functions; The database module includes storage for defect types, detection times, and sorting records.
7. A machine vision-based method for defect detection and sorting of injection molded products, applied to the defect detection and sorting system for injection molded products as described in any one of claims 1-6, characterized in that: The complete process, including image acquisition, defect identification, coordinate positioning, sorting execution, and data management, consists of the following steps: S1: Acquire real-time images of the injection-molded product under test using an industrial camera and transmit them to an industrial control computer; S2: The improved YOLOv8 algorithm with embedded SCConv module is used to analyze the image acquired in S1 and output the detection results including defect category and spatial location. S3: Defect-free products are transferred from the robotic arm to the qualified product area. For defective products, the coordinate positioning unit is triggered to output the robotic arm's grasping coordinates. S4: Defective products are picked up by a robotic arm and sorted to a designated area; S5: The human-computer interaction interface enables real-time monitoring of the detection status, dynamic adjustment of camera parameters, and export and traceability of sorting data.
8. The method for defect detection and sorting of injection molded products based on machine vision according to claim 7, characterized in that: S1 also includes hardware connection status detection to verify the integrity of the communication link between the industrial camera and the robotic arm.
9. The machine vision-based defect detection and sorting method for injection molded products according to claim 7, characterized in that: In S2, the YOLOv8 algorithm's single-frame image processing time is ≤0.3 seconds, and mAP@0.5≥90%; The coordinate positioning unit output in S3 includes grayscale conversion, filtering, contour extraction and coordinate transformation, and calculates the coordinates of the robotic arm grasping the defective product with an error ≤ ±1mm.