A method and system for visual quality inspection of plastic products
By combining visual and internal inspection data, the defect area characteristics of plastic products are obtained, solving the problem that existing systems have difficulty identifying minute defects in complex-shaped products, and achieving higher inspection accuracy and product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN GUOXINYUAN INTELLIGENT MANUFACTURING CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-07-31
AI Technical Summary
Existing plastic product inspection systems struggle to identify low-contrast surface defects such as tiny burrs when dealing with products with complex three-dimensional geometries, and are unable to comprehensively inspect the quality of internal structures, resulting in low inspection accuracy and poor product quality.
By combining visual inspection and internal inspection data, the defect area features are obtained through ultrasonic and X-ray data, and quality inspection results are generated, including features such as area, aspect ratio, bounding box coordinates, edge intensity, and average gray value. The results are then comprehensively judged using the management center server.
It improves the accuracy of plastic product testing and product quality, enabling the identification of surface and internal defects and achieving more comprehensive quality inspection.
Smart Images

Figure CN122492637A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of plastic product testing technology, and in particular to a visual inspection method and system for plastic product quality. Background Technology
[0002] In modern plastic product manufacturing, as product complexity increases, manufacturers are beginning to accept orders for high-precision plastic parts with complex three-dimensional geometries, such as internal brackets for electronic products with multiple clips, reinforcing ribs, grooves, and curved surfaces. Existing systems have significant limitations when dealing with such products: on high-speed production lines, shortening exposure time to avoid motion blur leads to decreased image brightness and signal-to-noise ratio, making it difficult to identify low-contrast surface defects such as tiny burrs only tens of micrometers in size; existing systems can only detect surface defects and are unable to detect internal structural quality. Furthermore, the heterogeneous data obtained through ultrasonic or X-ray detection are completely different, making it difficult to establish unified defect judgment standards, resulting in difficulty in comprehensively judging surface and internal defects, low detection accuracy, and low product quality.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The main objective of this invention is to propose a visual inspection method and system for plastic product quality, which can combine internal inspection data and regional features to identify defects and generate quality inspection results, thereby achieving quality inspection of plastic products and improving inspection accuracy and product quality.
[0005] On one hand, embodiments of the present invention provide a visual inspection method for the quality of plastic products, comprising the following steps: Acquire images and internal inspection data of plastic products, wherein the internal inspection data includes ultrasonic sensing data and X-ray detection data; Defect region analysis is performed on the image of the plastic product to identify the first defect region; Feature extraction is performed on the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. The internal inspection data, the first defect area, and the first area features are sent to the management center server. The management center server is used to perform quality inspection based on the internal inspection data, the first defect area, and the first area features, and generate quality inspection results.
[0006] On the other hand, embodiments of the present invention provide a visual inspection system for the quality of plastic products, comprising: The data acquisition module is used to acquire images and internal inspection data of plastic products, including ultrasonic sensing data and X-ray detection data. The defect area analysis module is used to perform defect area analysis on the image of the plastic product and identify the first defect area; The feature extraction module is used to extract features from the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. The quality inspection module is used to send the internal inspection data, the first defect area, and the first area features to the management center server. The management center server is used to perform quality inspection based on the internal inspection data, the first defect area, and the first area features, and generate quality inspection results.
[0007] The embodiments of this application include at least the following beneficial effects: First, the embodiments of this application acquire images of plastic products and internal inspection data. Then, defect area analysis is performed on the images of plastic products to identify a first defect area. Next, feature extraction is performed on the first defect area to obtain the first area features. Finally, the internal inspection data, the first defect area, and the first area features are sent to the management center server. The management center server performs quality inspection based on the internal inspection data, the first defect area, and the first area features to generate quality inspection results. This enables the identification of defects and the generation of quality inspection results by combining internal inspection data and area features, thereby achieving quality inspection of plastic products and improving inspection accuracy and product quality.
[0008] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description and the drawings. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below.
[0010] Figure 1 This is a flowchart of a visual inspection method for the quality of plastic products according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a visual inspection system for the quality of plastic products according to an embodiment of the present invention. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments.
[0012] In modern plastic product manufacturing, ensuring product quality is a crucial aspect of the entire process. While traditional manual inspection can detect some obvious defects, its efficiency is extremely low given the continuous flow of products on the production line. For very small, hard-to-detect defects, such as tiny scratches, slight color differences, or irregular burrs on the edges of injection molded parts, human eye fatigue after prolonged work can cause many defects to be missed, severely impacting product yield and brand reputation.
[0013] To address these challenges, the existing inspection system is installed on the injection-molded production line, where products are conveyed to a dedicated inspection station. At this station, an industrial camera is precisely fixed above the product, complemented by a uniform ring light source to ensure sufficient, shadow-free illumination of the product surface. As the product passes beneath the camera, it continuously captures images at a preset speed. These high-resolution images are then transmitted to a high-performance industrial computer. The computer runs an image processing and analysis program pre-loaded with various defect pattern recognition methods. These methods perform grayscale processing, edge detection, and feature extraction on the images, then compare them with preset defect standards. Once an area deviating from the standards is identified in the image, the system determines the product as defective and immediately sends a command to the pneumatic rejection device at the end of the production line, pushing the defective product off the main conveyor belt into a defective product collection bin, thus achieving automated sorting of defective products. Initially, the system primarily inspects relatively simple, flat-surfaced, and uniformly colored plastic covers. Under these relatively ideal working conditions, the existing detection system can improve detection speed, reduce labor costs, and reduce the risk of missed detections.
[0014] However, with intensifying market competition and accelerating product updates, new products are no longer simple flat covers, but rather precision structural components with complex three-dimensional geometries, such as internal brackets in electronic products with multiple clips, reinforcing ribs, grooves, and curved surfaces. Existing inspection systems struggle to handle these complex shapes. Furthermore, to meet growing market demand, production lines are required to operate at higher speeds to increase overall capacity. This increased production speed places enormous pressure on vision inspection systems. First, the high-speed movement of products makes image acquisition difficult. If the camera exposure time is too long, severe motion blur occurs, leading to loss of image details and unclear defect features, making accurate identification impossible. Shortening the camera exposure time also reduces image brightness and the ratio of effective signal to noise, especially in dark areas where light is difficult to reach, resulting in poor image quality. Second, the camera acquires a large number of high-resolution images in a very short time and transmits them to the backend computer, placing extremely high demands on data transmission bandwidth and computer processing power. This can lead to significant delays and stuttering, making it impossible to keep up with the production line pace, resulting in decreased inspection efficiency and even missed detections.
[0015] The false negative rate is particularly high when detecting defects that significantly impact product functionality (such as tiny plastic burrs or flash). These burrs typically appear on the parting line of the product or the mold parting line, are extremely small in size, and their color is close to that of the product itself. At low speeds, even faint shadows or edge irregularities can be detected by the system. However, under high-speed, short-exposure conditions, the contrast changes caused by light on these tiny burrs are extremely weak, and the slight deformations or jitter caused by high-speed movement make these subtle features even more difficult to discern in the image. When processing large numbers of images rapidly, the system often misjudges these low-contrast tiny burrs as normal surface texture or image noise and ignores them.
[0016] A further problem arises in the inspection of product structural integrity. As product complexity increases, many plastic parts are no longer single-injection molded, but rather assembled from multiple components or formed through secondary injection molding. For example, a plastic shell may require ultrasonic welding or thermoforming to connect multiple internal snap-fit structures. The quality of these connections directly affects the product's structural strength and lifespan. However, existing inspection systems primarily focus on surface defects, making it difficult to detect internal connection quality, incomplete welds, poor fusion, or internal stress concentrations, resulting in low inspection accuracy and low product quality.
[0017] The embodiments of this application will be explained in detail below with reference to the accompanying drawings: Figure 1 This is an optional flowchart of a visual inspection method for the quality of plastic products provided in this application embodiment. Figure 1 The method may include, but is not limited to, steps S101 to S104.
[0018] Step S101: Acquire images and internal inspection data of the plastic product. The internal inspection data includes ultrasonic sensing data and X-ray detection data. Step S102: Analyze the defect area of the plastic product image and identify the first defect area; Step S103: Extract features from the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. Step S104: Send the internal inspection data, the first defect area, and the first area features to the management center server. The management center server is used to perform quality inspection based on the internal inspection data, the first defect area, and the first area features, and generate quality inspection results.
[0019] Steps S101 to S104 shown in the embodiments of this application can combine internal detection data and regional features to identify defects and generate quality inspection results, thereby realizing the quality inspection of plastic products and improving the accuracy of inspection and product quality.
[0020] In some embodiments, steps S101-S104 can first acquire images and internal inspection data of the plastic product, including ultrasonic sensing data and X-ray detection data. When acquiring images, three 5-megapixel industrial area scan cameras can be used, positioned above, to the left, and to the right of the conveyor belt, respectively. Each camera is equipped with a high-brightness LED ring light source and a diffuser plate to ensure uniform illumination even in deep recessed areas. Specifically, the top camera vertically downwards to photograph the top surface, while the left and right cameras are symmetrically arranged at a 45-degree angle to photograph the sides. The camera trigger signal is synchronized with the conveyor belt encoder. An incremental rotary encoder can be installed on the conveyor belt drive shaft, capturing pulse signals through a high-speed counting card. A trigger signal is output to the camera I / O interface every N accumulated pulses (calculated based on the conveyor belt speed, ensuring the product movement distance equals the field of view width), ensuring that the image is frozen through short exposure during high-speed movement, avoiding motion blur. Alternatively, a linear scan camera can be used in conjunction with a rotating stage. After the product is precisely positioned, it rotates 360 degrees, and the linear scan camera continuously scans at high speed to obtain a high-resolution surface image after unfolding. Specifically, a Teledyne DALSA Piranha 4 series linear scan camera is used, paired with a white LED linear light source, and row-triggered synchronization is achieved through encoder feedback. This results in higher spatial resolution, capable of resolving surface undulations at the twenty-micrometer level.
[0021] Meanwhile, internal testing data can be acquired using various technical approaches. Ultrasonic testing can employ the immersion pulse-echo method, placing the product in a coupling water tank and using a focusing transducer (such as the Panametrics V312). A robotic arm drives the transducer along a preset trajectory (spiral or grid scanning), recording the scan waveform data, which includes interface and bottom surface echoes. Phased array ultrasonic technology can also be used, utilizing multi-element transducers (such as the Olympus 5L64-A32) to electronically control beam deflection and focusing. This allows for rapid electronic scanning without mechanical movement, and the focusing method can be set via software, enabling fan-shaped or linear scanning, significantly increasing testing speed to suit high-speed production lines. X-ray testing can use a microfocus X-ray source with a flat panel detector, adjusted according to the thickness and density of the plastic material (e.g., for polycarbonate, setting 80 kV for a 2 mm wall thickness) to obtain high-contrast radiographic images. For complex parts with uneven wall thickness, CT scanning can be used to collect multi-angle projection data by rotating 360 degrees. The 3D volume data can be obtained by the FDK (Feldkamp-Davis-Kress) reconstruction algorithm, with a voxel resolution of up to 50 micrometers.
[0022] Understandably, images of plastic products refer to digital image matrices acquired through industrial visible light imaging equipment, reflecting the surface geometry and optical properties of the product. Their pixel values are typically stored at eight or twelve-bit depth, covering the RGB color space or converted grayscale information. Ultrasonic sensing data refers to the sequence of reflected signals received after high-frequency mechanical waves are emitted to a plastic product via a piezoelectric transducer. This includes echo time, amplitude attenuation, and spectral characteristics, used to reveal internal porosity, delamination, or welding defects. X-ray detection data refers to transmission images formed after penetrating radiation is generated through an X-ray tube and received by a flat panel detector, reflecting the material's density distribution and internal structural morphology.
[0023] Then, defect region analysis is performed on the plastic product image to identify the first defect region. A threshold-based segmentation method can be used, followed by Gaussian filtering to reduce noise, calculation of the global grayscale histogram, and binarization of the image using the Otsu automatic thresholding method to extract dark or bright areas as candidate defects. Alternatively, an edge detection operator (such as the Canny operator) can be used to extract discontinuous boundaries in the image. Gaussian smoothing can be performed, gradient magnitude and direction calculated, and double thresholding used to detect edges. Boundary closure is then achieved using a contour tracking algorithm (such as the Suzuki algorithm). This method is more sensitive to linear defects such as scratches. Furthermore, a clustering-based region growing algorithm can be used. Starting from a seed pixel, neighboring pixels are merged according to a grayscale similarity criterion to form connected regions. Seed points can be randomly selected or determined through pre-detection (such as finding local extrema). The growth criterion can be set to a grayscale difference of less than fifteen gray levels between adjacent pixels and less than twenty gray levels between the seed pixel and the adjacent pixel. This method can handle irregularly shaped defects well. Understandably, the first defect region refers to the set of connected pixels marked as having suspected quality problems in the image space coordinate system, and its boundary is defined by a contour line.
[0024] Next, feature extraction is performed on the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. The feature extraction process involves geometric and photometric quantization of the identified defect region. The region area is obtained by counting the total number of pixels within the connected components, and can be converted to the actual physical area based on camera calibration parameters; for example, the calibration process can use a checkerboard calibration board, taking images from multiple angles, and using OpenCV's `calibrateCamera` function to calculate the camera intrinsic matrix and distortion coefficients, thereby establishing a mapping relationship from pixel coordinates to world coordinates. The aspect ratio is obtained by calculating the ratio of the width to the height of the region's minimum bounding rectangle (obtained through a rotating caliper algorithm or OpenCV's `minAreaRect` function), used to distinguish between narrow scratches and circular bubbles. The bounding box coordinates determine the spatial location of the defect in the image, facilitating subsequent spatial registration with internal detection data. Edge intensity is obtained by calculating the average magnitude of the gray-level gradient vector at the defect boundary. Specifically, for each pixel P on the boundary, the Sobel operator is used to calculate the horizontal and vertical gradients, the sum of squares is calculated, and the square root is taken. The average of these squares over all pixels on the boundary is then obtained to obtain the edge intensity. The maximum gradient magnitude among all pixels within the defect region can be taken as the maximum gray-level gradient magnitude, used to characterize the most significant optical discontinuities within the defect. The average gray-level value can be obtained by statistically analyzing the gray-level average of all pixels within the defect region, which helps distinguish between dark impurities and light flow lines. Understandably, the area refers to the defect coverage area expressed in pixel counts or physical units; the aspect ratio refers to the length-to-width ratio of the smallest bounding rectangle of the defect, reflecting the shape characteristics of the defect; the bounding box coordinates refer to the vertex position of the smallest bounding rectangle of the defect region in the image coordinate system; the edge intensity refers to the gray-level gradient at the defect boundary, characterizing the contrast between the defect and the background; the maximum gray-level gradient magnitude refers to the gradient magnitude at the point where the pixel gray-level change is most drastic within the defect region, used to characterize the most significant optical discontinuity inside the defect; and the average gray value refers to the arithmetic mean of the gray-level values of all pixels within the defect region, reflecting the optical reflectivity of the defect.
[0025] Finally, the internal inspection data, the first defect area, and the first area features are sent to the management center server. The management center server performs quality inspection based on the internal inspection data, the first defect area, and the first area features, and generates quality inspection results. Data transmission can be achieved via industrial Ethernet or a wireless network. Gigabit Ethernet can be used, and high-resolution images can be compressed into JPEG format before transmission. Lossless compression (such as TIFF format with LZW compression) or raw data transmission can also be used to ensure data integrity. Since the internal inspection data is relatively small, it can be transmitted synchronously or asynchronously with the image data, encapsulated via MQTT or OPC UA protocols, and includes metadata such as timestamps, device IDs, and product serial numbers. After receiving the data, the management center server executes the quality inspection logic. This logic can be based on a rule engine, defining conditions such as a region area greater than 0.5 square millimeters and an edge intensity greater than 30 gray levels per pixel as a serious defect. Alternatively, a machine learning-based classifier can be used, such as a support vector machine (using the RBF kernel function, with a penalty coefficient set to 100 and a kernel parameter set to 0.01) or a random forest (with 100 decision trees and a maximum depth of 20 layers). The model is trained using historical labeled data, and the input is the first region feature vector (six-dimensional features: [area, aspect ratio, bounding box center, bounding box center, edge strength, average gray value]), which outputs the defect category and severity as the quality inspection result.
[0026] Through the above technical solution, this embodiment fundamentally solves the limitations of a single inspection method by acquiring images and internal inspection data of plastic products. By analyzing defect areas in the images of plastic products and extracting features of the first region, this embodiment can accurately identify and quantify surface defects. By sending this visual information and internal inspection data together to the management center server for quality inspection, collaborative analysis of surface and internal defects is achieved. The management center server can make comprehensive judgments based on this multi-source data, overcoming the problem that traditional methods cannot comprehensively assess product quality. For example, a tiny bubble that appears in an X-ray image may be completely invisible in a visual image, but this embodiment can use a data fusion mechanism to associate internal defects with surface features, thereby providing more accurate quality inspection results. This multimodal data fusion and intelligent analysis strategy significantly improves the accuracy, comprehensiveness, and automation level of plastic product quality inspection, providing more reliable quality assurance for plastic product manufacturers.
[0027] In some embodiments, step S102, performing defect region analysis on the plastic product image to identify the first defect region, may include, but is not limited to, the following steps: The image of the plastic product is converted to grayscale to obtain a grayscale image; To iterate through and select each pixel in the grayscale image, perform the following steps: Use the currently selected pixel as the target pixel; Construct a local pixel region, centered on the target pixel and with a radius of a preset number of pixels; Calculate the average gray value of a local pixel region; If the gray value of the target pixel is less than the average gray value of the local pixel area, then the target pixel is determined to be a defect point. After the traversal is completed, the first defect region is identified based on multiple defect points.
[0028] In some embodiments, the image of the plastic product can be first converted to grayscale to obtain a grayscale image. A standard luminance formula can be used to weight the RGB channels with weights of 0.299, 0.587, and 0.114, respectively, i.e., Y = 0.299 × R + 0.587 × G + 0.114 × B, to obtain a grayscale value that conforms to human visual characteristics. In the formula, Y is the weighted grayscale value, and R, G, and B represent the red, green, and blue channels, respectively. Alternatively, only the green channel data can be extracted, as industrial cameras typically have the best response to the green spectrum and the highest signal-to-noise ratio, making it suitable for direct use after de-mosaicing of the green channel in monochrome cameras or Bayer format images. Furthermore, the maximum value method can be used, taking the maximum grayscale value among the three channels as the pixel value of the grayscale image, i.e., Y = max(R, G, B), which is suitable for enhancing highlight defects (such as reflective bright spots).
[0029] Then, iterate through each pixel in the grayscale image and perform the following steps: Using the currently selected pixel as the target pixel, construct a local pixel region. The local pixel region is centered on the target pixel and has a radius equal to a preset number of pixels. The construction method of the local pixel region directly affects the sensitivity of defect detection. A fixed circular neighborhood can be used, with a radius of five pixels, covering eighty-one pixels around the target pixel (including the center). Alternatively, an adaptive window can be used, dynamically adjusting the radius based on the local texture complexity of the image (by calculating local variance or gradient entropy). In textured areas, the window is reduced to a radius of three pixels to avoid over-smoothing, while in smooth areas, the window is expanded to a radius of seven pixels to enhance noise suppression. A cross-shaped or diamond-shaped neighborhood can also be used. A cross-shaped neighborhood includes the center point and extends N pixels upwards, downwards, left, and right (a total of 4N+1 pixels), reducing computation while maintaining directional sensitivity. The average grayscale value of the local pixel region is then calculated. The average grayscale value can be calculated using an arithmetic mean. Alternatively, a Gaussian weighted average can be used, giving higher weight to the center pixels and lower weight to the edge pixels. This can be achieved through a two-dimensional Gaussian kernel function, with the standard deviation set to 1.5 to 2 pixels.
[0030] If the target pixel's grayscale value is less than the average grayscale value of the local pixel region, the target pixel is determined to be a defect. This criterion is based on the assumption that defects typically manifest as local dark areas. The judgment threshold can be set as a fixed difference, such as a target grayscale value I being less than the local mean μ minus five grayscale levels (i.e., I < μ - 5), which is considered a defect. A relative threshold can also be used, such as a target grayscale value less than 90% of the local mean (i.e., I < 0.9 × μ). A dynamic threshold can also be introduced, adjusting the judgment strictness based on the local grayscale standard deviation σ, with the judgment condition being I < μ - k × σ, where k is a sensitivity coefficient (usually taken as 0.5 to 2.0). In areas with high noise (i.e., large σ), the threshold is automatically increased to reduce false detections.
[0031] After traversal, the first defect region is identified based on multiple defect points. Defect point aggregation can employ either 8-connectivity or 4-connectivity criteria, connecting adjacent defect points into connected regions. Eight-connectivity means that if any of the eight neighbors (top, bottom, left, right, and four diagonals) of pixel P is a defect point, it is considered connected to P; 4-connectivity only considers the top, bottom, left, and right neighbors. For discretely distributed noise points, morphological opening operations can be used to first erode (using a 3×3 structuring element to eliminate isolated points) and then dilate (restoring the shape of the defect region), removing isolated points while preserving the shape of the defect region. Alternatively, density-based clustering algorithms (such as DBSCAN) can be used to cluster defect points with a spatial distance of less than 10 pixels and similar gray levels (difference less than 10) into the same defect region.
[0032] Through the above technical solution, this embodiment can effectively distinguish minute defects in an image by comparing local grayscale values at the pixel level, avoiding the misjudgment or missed judgment problems that may exist in the global thresholding method. Especially when the surface of plastic products has uneven gloss or complex texture, judging based on the average grayscale value of local pixel areas can better adapt to local changes in the image, improve the accuracy and sensitivity of defect identification, and lay a solid foundation for subsequent quality inspection.
[0033] In some embodiments, step S104, performing quality inspection based on internal inspection data, the first defect area, and the characteristics of the first area to generate a quality inspection result may include, but is not limited to, the following steps: Step S201: Based on the features of the first region, use a semantic segmentation network to perform surface defect analysis on the first defect region and identify surface defect information, including scratches, burrs and flow lines. Step S202: Extract features from internal inspection data and identify non-defect structural features, including material batch features and process fluctuation features. Step S203: Based on surface defect information, non-defect structural features and internal inspection data, perform quality inspection and generate quality inspection results.
[0034] In some embodiments, surface defect analysis of the first defect region can be performed using a semantic segmentation network based on the features of the first region to identify surface defect information, including scratches, burrs, and flow lines. The semantic segmentation network can be implemented using various deep learning architectures. One approach is to use a U-Net network with an encoder-decoder structure. The encoder uses ResNet50 as the backbone network to extract multi-scale features, and the decoder restores spatial resolution through upsampling and skip connections, outputting a category label (background, scratch, burr, flow line) for each pixel. The network input is a superposition of the first region feature map and the original image, and the output is a category mask with the same resolution as the input. The specific network construction is as follows: The encoder part extracts high-level semantic features step by step through four downsampling stages (each stage contains two 3×3 convolutional layers and ReLU activation, followed by a 2×2 max pooling layer); the decoder part extracts high-level semantic features step by step through four upsampling stages (each stage contains 2×2 transposed convolution or bilinear interpolation upsampling, which is concatenated with the corresponding encoder layer features and then passed through two 3×3 convolutional layers), and finally outputs a 4-channel feature map (corresponding to four classes), which is normalized by the Softmax function to obtain the probability of each class.
[0035] The pre-defined semantic segmentation network was trained through the following process: At least 5,000 labeled images were collected, covering different lighting conditions, angles, and product batches. Professional quality inspectors used LabelMe or CVAT tools to annotate scratches, burrs, and flow lines at the pixel level, generating JSON-formatted mask files. Training and validation datasets were constructed (split in an 8:2 ratio). Images were preprocessed (normalized to the [0,1] interval, randomly horizontally flipped, rotated ±15 degrees, and enhanced with Gaussian noise). A weighted combination of cross-entropy and Dice loss functions was used as the optimization objective, with weights set to 0.5 and 0.5 respectively. The Adam optimizer was used, with an initial learning rate of 0.001, a batch size of 8, and 200 training epochs. When the mean intersection-union ratio (mIoU) on the validation set reached above 0.85 and the loss value no longer decreased for 20 consecutive epochs, the model weights were saved, resulting in a pre-defined semantic segmentation network model suitable for practical detection. Another implementation can employ the DeepLabv3+ architecture, introducing a dilated spatial pyramid pooling (ASPP) module. This module utilizes dilated convolutions with varying dilation rates to capture multi-scale contextual information, making it particularly suitable for processing defect regions of varying sizes. The dilation rate can be set to 6, 12, 18, etc., to cover different scales from tiny burrs to long scratches. Alternatively, a Transformer-based SegFormer network can be used, leveraging a self-attention mechanism to model long-range dependencies, which is advantageous for recognizing the global continuity of fine, elongated scratches.
[0036] Then, feature extraction is performed on the internal inspection data to identify non-defect structural features, including material batch characteristics and process variation characteristics. Material batch characteristics refer to the differences in physical properties of plastic granules from different raw material suppliers or different production batches, such as melt flow index, filler content, and colorant dispersibility. These differences manifest as subtle variations in sound velocity and attenuation coefficient in ultrasonic data, and as differences in average gray value and noise level in X-ray data. The mean, variance, skewness, and kurtosis can be extracted as batch fingerprints by calculating the statistical histogram of the internal inspection data for the entire batch of products. Process variation characteristics refer to the internal structural changes caused by small fluctuations in process parameters (such as melt temperature, mold temperature, holding pressure, and cooling time) during injection molding. In ultrasonic data, process variation manifests as a systematic shift in echo arrival time; in X-ray data, it manifests as a slight change in wall thickness distribution. Feature extraction can be performed using principal component analysis (PCA) to reduce dimensionality, retaining the first three principal components as quantitative indicators of process variation. In practice, internal testing data of no less than 100 products under normal process conditions are collected to construct an original feature matrix X (n×m, where n is the number of samples and m is the original feature dimension). The covariance matrix is calculated, and the eigenvalues and eigenvectors are solved. The three eigenvectors with the largest eigenvalues are selected to form a projection matrix W (m×3). The original features are projected onto a three-dimensional space to obtain the process fluctuation features. This low-dimensional representation effectively filters out noise and retains the main process variation information.
[0037] Then, based on surface defect information, non-defect structural features, and internal inspection data, quality inspection is performed to generate quality inspection results. The quality inspection logic needs to integrate three types of information. A decision-level fusion approach can be adopted, independently judging surface defects, material batches, and process conditions, and then reaching a final conclusion through a weighted voting mechanism, where the weights can be calibrated.
[0038] Through the above technical solution, this embodiment enables a more refined and comprehensive assessment of the quality of plastic products. Specifically, by utilizing a semantic segmentation network for pixel-level identification of surface defects, the detection accuracy and classification ability for specific surface defects such as scratches, burrs, and flow lines are significantly improved, avoiding potential misjudgments or missed detections. Furthermore, by extracting features from internal inspection data, material batch characteristics and process fluctuation characteristics are identified, enabling quality inspection not only to detect defects but also to deeply analyze their potential causes, providing valuable data support for production process optimization and quality control. This quality inspection method, which integrates surface defect information, non-defect structural features, and internal inspection data from multiple dimensions, greatly improves the accuracy and reliability of quality inspection results, helping enterprises to more effectively control product quality, reduce defect rates, and optimize production processes.
[0039] In some embodiments, step S203, based on surface defect information, non-defect structural features, and internal inspection data, performs quality inspection and generates quality inspection results, which may include, but is not limited to, the following steps: Step S301: Perform three-dimensional spatial correlation analysis on surface defect information and internal detection data to obtain spatial correlation relationships; Step S302: Based on the spatial correlation, compare the surface defect information with the non-defect structural features to identify the target defect information caused by the inherent properties of the material. The inherent properties of the material are used to represent the uneven stress distribution that exists after plastic injection molding. Step S303: Based on the target defect information and internal inspection data, perform quality inspection and generate quality inspection results.
[0040] In some embodiments, a three-dimensional spatial correlation analysis can be performed on the surface defect information and internal inspection data to obtain the spatial correlation relationship. The core of the three-dimensional spatial correlation analysis lies in establishing the mapping relationship between the surface image coordinate system and the internal inspection coordinate system. A rigid registration method can be used, which involves setting three or more non-collinear marker points on the product, determining the coordinates of the marker points in both the optical image and X-ray / ultrasonic coordinate systems, and using the least squares method to solve for the rotation matrix and translation vector, thereby converting the coordinates of the marker points in the optical coordinate system to the corresponding coordinates in the internal inspection coordinate system to achieve coordinate transformation. Alternatively, feature-based registration can be used, which extracts the geometric center or corner points of surface defects as feature points, finds the corresponding density anomaly center in the X-ray projection data, and optimizes the registration parameters using the Iterative Closest Point (ICP) algorithm. In practice, X-ray images are thresholded to extract high-density regions (such as metal inserts or markers) as reference features, and their centroid coordinates are calculated. In optical images, edge detection and morphological processing are used to extract the contours of corresponding features, and their geometric centers are calculated. After establishing the corresponding point set, the ICP algorithm iteratively optimizes (typically converging to a mean square error less than 0.05 mm) to solve for the optimal rigid body transformation matrix. For ultrasonic data, it can be converted into 3D point clouds or volume data, marking the position of the reflector in 3D space, calculating the distance to the 3D coordinates of surface defects, and determining spatial proximity.
[0041] Then, based on spatial correlation, surface defect information is compared with non-defect structural features to identify target defect information caused by inherent material properties, which represent the uneven stress distribution present after plastic injection molding. The comparison process requires analyzing the correlation between the location of surface defects and the internal structure. For example, if a surface scratch is located directly above a weld line shown on X-rays, and ultrasonic waves show abnormal sound velocity at that location, the scratch is likely due to surface cracking caused by material shrinkage stress, rather than external mechanical damage. By establishing a buffer zone in three-dimensional space, internal anomalies are searched within a radius of 5 mm (adjustable according to product size) centered on the surface defect location. If density unevenness or abnormal sound velocity is found, the defect is determined to be related to the inherent material properties.
[0042] Then, based on the target defect information and internal inspection data, quality inspection is performed to generate quality inspection results. The inspection logic needs to consider the nature of the defect. For defects caused by the inherent properties of the material, even if the size is small, it may indicate structural risks, and the acceptance threshold should be lowered (e.g., the maximum allowable length is reduced from 0.5 mm to 0.2 mm); while for scratches that are purely surface contamination, if the internal structure is intact, the standard can be appropriately relaxed.
[0043] Through the above technical solution, this embodiment can significantly improve the accuracy and depth of quality inspection of plastic products. Specifically, through three-dimensional spatial correlation analysis, the internal causes of surface defects can be more accurately located and understood, avoiding confusion between deep defects caused by inherent material properties and surface flaws caused solely by external factors. Therefore, the quality inspection results will be more reliable and can more effectively guide the optimization of the production process, such as targeted adjustments to material formulations or injection molding process parameters, thereby fundamentally improving the overall quality and reliability of plastic products. This embodiment helps reduce misjudgments and missed detections, lower production costs, and enhance the product's competitiveness in the market.
[0044] In some embodiments, step S303, performing quality inspection based on target defect information and internal inspection data to generate quality inspection results, may include, but is not limited to, the following steps: Step S401: Obtain the correlation fusion strategy and defect judgment criteria. The correlation fusion strategy is used to reflect the spatial alignment pattern and attribute fusion pattern between the target defect information and the internal detection data. Step S402: According to the correlation fusion strategy, the target defect information and internal detection data are correlated and fused to obtain defect fusion data; Step S403: Based on the defect judgment criteria and defect fusion data, perform quality inspection and generate quality inspection results.
[0045] In some embodiments, an association fusion strategy and defect judgment criteria can be obtained first. The association fusion strategy reflects the spatial alignment mode and attribute fusion mode between the target defect information and the internal detection data. The association fusion strategy defines how different data sources work together. The spatial alignment mode specifies the accuracy requirements of coordinate system transformation (e.g., the maximum allowable registration error is 0.1 mm) and the alignment method (e.g., rigid alignment based on marker points or non-rigid alignment based on deformation fields). The attribute fusion mode specifies the feature combination method, such as concatenated fusion (directly concatenating surface feature vectors with internal feature vectors), weighted summation, or attention-based adaptive fusion (automatically learning weights by training an attention network). This preset association fusion strategy is established through the following process: First, for a specific product model (e.g., the housing of an automotive electronic control unit), the optimal fusion method is determined experimentally. A sample set containing known defect types (no less than 200 pieces) is collected, and the detection accuracy of early fusion (data layer), mid-term fusion (feature layer), and late fusion (decision layer) are tested respectively. The fusion level that results in the highest F1-score is selected as the association fusion strategy for that product. In the spatial alignment mode, the spatial alignment tolerance is determined through Measurement System Analysis (MSA). The coordinate deviation from multiple repeated measurements of the same product is calculated, and six times the standard deviation is taken as the maximum allowable registration error. In the attribute fusion mode, the attribute fusion weights are determined through grid search or Bayesian optimization. The weight combination that minimizes the classification error rate is found on the validation set and recorded as preset strategy parameters. The defect judgment criteria include a multi-dimensional threshold system. For single defect types, a size threshold is set (e.g., a burr length greater than 0.3 mm is considered unacceptable); for compound defects, combination rules are set (e.g., if surface bubbles and internal pores exist simultaneously, even if their individual dimensions do not exceed the limit, it is still considered unacceptable); for batch defects, a statistical threshold is set (e.g., if ten consecutive products have the same type of defect, a process alarm is triggered). The preset judgment criteria are established through the following process: Based on product functional requirements and customer specifications, an initial threshold is set (such as customer drawing requirements); by collecting historical production data, the relationship between defect size and product failure probability is analyzed, and ROC curve analysis is used to determine the optimal threshold point (maximizing the difference between the true positive rate and the false positive rate); finally, through production verification, no less than 50 known state samples (25 qualified and 25 unqualified) are collected for testing, and the threshold is adjusted to achieve an accuracy rate of over 98%, forming the final defect judgment criteria.
[0046] Then, according to the correlation fusion strategy, the target defect information and internal detection data are correlated and fused to obtain defect fusion data. The specific implementation of the correlation fusion process depends on the strategy definition. Early fusion can be used, where the registered X-ray image is superimposed with the optical image at the data level to form a multi-channel input (e.g., four channels: optical R, G, B and X-ray grayscale), which is then directly input into the classification network. Mid-term fusion can also be used, where surface features and internal features are extracted separately, and joint feature representations are generated at the feature layer through bilinear pooling (calculating the outer product of feature vectors and flattening) or tensor fusion (reducing dimensionality through tensor ring decomposition). Late fusion can also be used, where evidence from different data sources is synthesized through Dempster-Shafer Theory after independent judgment, handling uncertainty, specifically calculating the trust function and likelihood function, and synthesizing the support of different evidence sources for various defects.
[0047] Then, based on the defect judgment criteria and defect fusion data, quality inspection is performed to generate quality inspection results. The final judgment is based on the comparison between the fused data and the standards. A configurable rule base can be maintained, containing judgment rules for different product models and different customer standards. For example, for automotive safety components, the most stringent standard (zero defect tolerance) is adopted; for consumer electronics product casings, slight flow lines are allowed. The judgment result not only includes a binary conclusion of pass / fail, but also a defect location map (marking defect coordinates on a 3D model), a 3D defect distribution heatmap (showing the internal defect density distribution), and suggested follow-up actions (such as rework, scrap, or special acceptance).
[0048] Through the above technical solution, this embodiment achieves refined and intelligent quality inspection of plastic products. Specifically, by employing a correlation fusion strategy, multi-source heterogeneous defect data can be effectively integrated, establishing a clear spatial and attribute correlation between surface defect information and internal inspection data. This enables a more comprehensive and accurate identification and assessment of potential quality problems in plastic products. Furthermore, the introduction of defect judgment criteria provides an objective and unified decision-making basis for quality inspection, significantly reducing the subjectivity and inconsistency of manual judgment and improving the accuracy and reliability of quality inspection results. Therefore, this embodiment effectively avoids misjudgments or missed detections caused by insufficient data fusion or ambiguous judgment criteria, thereby improving the overall quality control level.
[0049] In some embodiments, step S401, obtaining the correlation fusion strategy and defect judgment criteria, may include, but is not limited to, the following steps: Obtain current production parameters, which include plastic product design parameters, material batch information, and production process parameters; Based on the current production parameters, an association fusion strategy is selected from the association rule set, which contains patterns for spatial alignment and attribute fusion between target defect information and internal detection data. Based on the current production parameters, defect judgment criteria are selected from the judgment criteria set. The judgment criteria set includes the priority of different types of defects, the judgment rules for defect combinations, and the product qualification threshold.
[0050] In some embodiments, current production parameters can be obtained first. These parameters include plastic product design parameters, material batch information, and production process parameters. Design parameters can be automatically retrieved through the interface of a Manufacturing Execution System (MES) or Enterprise Resource Planning (ERP) system. These parameters include product model, wall thickness distribution, key assembly dimensions, and material type (e.g., PC / ABS alloy, nylon 66, or polypropylene). This information is retrieved from the Product Design Database (PLM system) in a structured data format (e.g., JSON or XML). Material batch information can be obtained in real-time by scanning the QR code or RFID tag on the raw material packaging bag. This information includes supplier code, batch number, melt flow index (MFI value), filler content percentage, and drying status. Production process parameters are obtained by directly communicating with the injection molding machine controller. The setpoint and actual values of melt temperature, mold temperature, injection pressure, injection speed, cooling time, and cycle time are collected via the OPC UA protocol. For example, when switching production batches, the operator scans the raw material QR code on the MES interface. The system automatically parses out the material batch number B2024001 and the MFI value of 12g / 10min. At the same time, it reads the current melt temperature setting value of 260℃ and the actual value of 258℃ from the injection molding machine controller, and the mold temperature setting value of 80℃ and the actual value of 79.5℃. These parameters are combined to form a snapshot of the current production parameters, which serves as the basis for subsequent strategy selection.
[0051] Then, based on the current production parameters, an association fusion strategy is selected from the association rule set. The association rule set contains patterns for spatial alignment and attribute fusion between target defect information and internal inspection data. The construction process of this association rule set is as follows: at least 500 historical inspection cases are collected. Each case includes complete product parameters (model, material, process), fusion strategy parameters (spatial alignment tolerance, feature weight), and final inspection accuracy. Process experts annotate the cases to identify the optimal strategy configuration under specific parameter combinations. For example, for thin-walled electronic casings with a wall thickness of less than 1.5 mm (product model identifier TH001), experts annotate its optimal strategy as a high-precision spatial alignment mode (registration error tolerance of 0.05 mm) and a surface feature priority fusion mode (surface feature weight of 0.7, internal feature weight of 0.3), because surface scratches on thin-walled parts are more likely to cause structural failure; for automotive functional parts containing internal metal inserts (product model identifier AU002), the annotation is an internal defect priority mode (internal feature weight of 0.8, surface feature weight of 0.2). These mapping relationships are stored as rules in a relational database (such as MySQL) or knowledge graph. Each record contains fields such as rule ID, applicable product model, material MFI range, mold temperature range, spatial alignment tolerance value, surface weight, and internal weight. After obtaining the current production parameters, the system executes a rule matching algorithm to select a strategy. The specific processing is as follows: The product model is parsed, and all candidate strategies applicable to that model are retrieved from the association rule set, forming a candidate set C; strategies matching the current material batch MFI value are filtered. For example, if the current MFI value is 13g / 10min, rules with an MFI range of 10-15 are selected; then, further refinement is made based on the mold temperature. If the current mold temperature is 82℃, higher than the 80℃ threshold, a high-temperature compensation strategy is selected (adjusting the spatial alignment tolerance to 0.08mm to compensate for thermal expansion); if multiple matching rules exist, the nearest neighbor algorithm is used to calculate the Euclidean distance between the current parameter and the rule center point, and the rule with the smallest distance is selected as the optimal strategy. For example, for the current state of product model ECU_Housing, MFI=13, and mold temperature 82°C, the system matches the association fusion strategy with rule ID STR_003, which is configured as follows: spatial alignment tolerance is 0.08mm, surface weight is 0.6, and internal weight is 0.4.
[0052] Based on current production parameters, defect judgment criteria are selected from a set of judgment criteria. This set includes the priority of different defect types, judgment rules for defect combinations, and product acceptance thresholds. The construction of the judgment criteria set is based on industry standards and customer specifications. A tiered threshold system can be established according to customer drawing requirements: automotive grade (zero tolerance, burr length threshold ≤ 0.1mm), industrial grade (general purpose, burr length threshold ≤ 0.3mm), and consumer grade (appearance parts, burr length threshold ≤ 0.5mm). A decision tree structure is used to represent the composite defect judgment logic, and product acceptance thresholds are set. Critical safety parts require zero defects, while non-critical parts are allowed no more than three minor defects per square centimeter. These standards are stored in a database table, containing fields such as standard ID, applicable product type, material grade, production mode, various defect thresholds, and combination rule logical expressions. The selection process is implemented through structured queries. An example query is: `SELECT * FROM Judgment_Standards WHERE Product_Type='ECU_Housing' AND Material_Grade='V0_Flame_Retardant' AND Production_Mode='High_Speed'`. After executing this query, the system returns the corresponding set of threshold parameters, including a burr threshold of 0.2mm, a bubble threshold of 0.15mm, and a flow pattern allowable area of 2mm². The system loads this standard into a memory-based rule engine (such as Drools) for subsequent real-time judgment.
[0053] Through the above technical solution, this embodiment can dynamically acquire the most suitable correlation fusion strategy and defect judgment criteria based on the specific conditions of the plastic products currently being produced. This embodiment significantly improves the accuracy and adaptability of quality inspection, effectively avoiding inspection deviations caused by changes in production conditions. This not only improves the efficiency and reliability of quality inspection but also reduces the need for manual intervention, thereby bringing higher production efficiency and product quality assurance to plastic product manufacturers.
[0054] In some embodiments, after performing quality inspection based on defect judgment criteria and defect fusion data to generate quality inspection results, the method may further include, but is not limited to, the following steps: Obtain the results of manual re-inspection of plastic products; The results of manual re-inspection are compared with the results of quality inspection to identify spatial alignment mode deviation and attribute fusion mode deviation; Based on the spatial alignment mode deviation, the spatial alignment tolerance in the correlation fusion strategy is adjusted; Based on the attribute fusion mode deviation, the attribute fusion weights in the association fusion strategy are adjusted; Add the adjusted association fusion strategy to the association rule set.
[0055] In some embodiments, since the preset rule set may not fully cover all edge cases, especially during the new product introduction (NPI) phase or when there are subtle changes in the process window. For example, a certain new type of plastic material may have special acoustic properties, resulting in a deviation in the spatial correspondence between ultrasonic data and visual data compared to conventional materials; or, due to changes in the burr morphology caused by mold wear, the original attribute fusion weights may no longer be applicable. Without a feedback correction mechanism, the system will continue to use inaccurate strategies, leading to systematic misjudgments.
[0056] Therefore, the manual re-inspection results of plastic products can be obtained first. The manual re-inspection results are obtained through an independent quality inspection station. When the system gives a quality inspection result for a certain plastic product, whether it is judged as qualified or unqualified, the product is transferred to the manual re-inspection area. The quality inspector is equipped with a high-magnification stereomicroscope (with a magnification of 20 to 40 times) or a portable industrial endoscope (such as the Olympus IPLEX series) to recheck the defect positions marked by the system. On the human-machine interface (HMI), the quality inspector enters the re-inspection conclusion through the touch screen. The interface design includes the following options: confirm that the system's judgment is correct, false alarm (the system judges a defect but it is actually a normal texture or mark), missed alarm (the system fails to detect a defect that actually exists). For cases with deviations, further select the deviation type: if there is an offset between the defect position reported by the system and the actual position (such as the system reporting coordinates (120,80) but the actual position is (135,85)), then select spatial alignment deviation; if the system's assessment of the defect severity does not match the actual situation (such as the system judges a slight burr but it is actually a severe flash that affects assembly), then select attribute fusion deviation. The entered information is stored in the quality database in real time, including fields such as product serial number, detection timestamp, system judgment result, manual judgment result, deviation type, actual defect coordinates, actual defect size, etc.
[0057] Then, the results of manual re-inspection are compared with the quality inspection results to identify spatial alignment mode deviation and attribute fusion mode deviation. Historical inspection data packages for the product can be retrieved based on the product serial number, including original images, internal inspection data, parameters of the associated fusion strategy used (strategy ID, spatial alignment tolerance, weight), and intermediate calculation results (such as defect coordinates and confidence levels reported by the system). For spatial alignment deviation, the Euclidean distance between the three-dimensional coordinates of the defect reported by the system and the actual coordinates determined by manual re-inspection is calculated. For example, if the current tolerance is 0.1mm and the actual deviation is 0.25mm, then the recorded spatial alignment deviation is +0.15mm. For attribute fusion deviation, the fusion data on which the system's judgment is based is analyzed. If a defect is manually judged as a serious defect but the system misjudges it as a minor defect due to excessive surface weight, then the attribute fusion deviation is recorded as excessive surface weight.
[0058] Then, based on the spatial alignment mode deviation, the spatial alignment tolerance in the association fusion strategy is adjusted. The adjustment of the spatial alignment tolerance can employ an adaptive step-size algorithm: the system maintains a sliding window (e.g., the most recent N=10 products), calculates the average spatial alignment deviation within the window, and the formula for adjusting the spatial alignment tolerance is: In the formula, is the learning rate (usually taken as 0.5 to 1.0), is the adjusted spatial alignment tolerance, is the spatial alignment tolerance at the previous moment, and is the average value of the spatial alignment deviation. For example, if the average deviation of 10 consecutive products is 0.12mm, k is taken as 0.8, and the spatial alignment tolerance at the previous moment is 0.1, then the adjusted spatial alignment tolerance is 0.1 + 0.8 × 0.12 = 0.196mm.
[0059] Based on the attribute fusion mode deviation, the attribute fusion weights in the association fusion strategy are adjusted. The adjustment of attribute fusion weights is based on the gradient descent principle. The loss function L is defined as the cross-entropy loss between the system's decision confidence and the human decision result (1 for pass, 0 for fail), i.e. Where y is the manually assigned label and p is the system's output probability of passing. Calculate the partial derivative of L with respect to weight w, ∂L / ∂w, according to... Update weights, The learning rate (typically 0.01 to 0.05). The original weights, This is the updated weight. For example, if a case focuses excessively on surface texture (surface feature weights)... The internal feature weight is 0.6. If the error is 0.4 and internal welding defects are missed (human judgment is unacceptable y=0, system judgment is acceptable p=0.8), then ∂L / For positive, ∂L / Negative, after update Reduced to 0.55, Increased to 0.45.
[0060] Finally, the adjusted association fusion strategy is added to the association rule set. The adjusted strategy generates a new strategy record, assigns a new version number, and marks its applicable production parameter range (e.g., based on the current batch's product model, material batch number range B2024001-B2024050, and process parameter range: temperature 260±5℃, pressure 80±3MPa). This strategy is written to the association rule set database via an INSERT operation, setting the activation flag to TRUE. In subsequent production, when the system detects similar production parameters, it will prioritize matching this optimized strategy. The original strategy is marked as a historical version but retained for review during quality traceability.
[0061] Through the above technical solution, this embodiment enables continuous optimization and adaptive learning of the quality inspection system. By introducing manual re-inspection results as the "gold standard" feedback, this embodiment allows the system to identify and quantify the deviation between automated inspection results and human judgment. Consequently, the spatial alignment tolerance and attribute fusion weights in the association fusion strategy can be precisely adjusted, significantly improving the accuracy and reliability of automated inspection and reducing the risk of misjudgments and omissions. Furthermore, adding the adjusted association fusion strategy to the association rule set endows the system with self-learning and evolutionary capabilities, enabling it to better adapt to changes in the production environment and the emergence of new defects, thereby continuously improving the overall quality control level and reducing the workload and cost of manual re-inspection.
[0062] In some embodiments, after performing quality inspection based on defect judgment criteria and defect fusion data to generate quality inspection results, the method may further include, but is not limited to, the following steps: Step S501: Perform deviation analysis on the current production parameters and the candidate judgment criteria in the judgment criteria set to identify parameter deviations. The parameter deviations are used to reflect the deviations between the current production parameters and the candidate judgment criteria. Step S502: Perform offset analysis on the features of the first region to obtain the degree of offset; Step S503: Adjust the defect judgment criteria according to the parameter deviation and the degree of offset; Step S504: Add the adjusted defect judgment criteria to the judgment criteria set.
[0063] In some embodiments, as the production process continues, the process parameters of the injection molding machine may drift slightly. For example, aging of the hydraulic system may cause a slow decrease in holding pressure, or reduced heating coil efficiency may lead to fluctuations in melt temperature. Simultaneously, image acquisition equipment may experience changes in image quality due to mechanical vibration, temperature variations, or light source attenuation. These changes can shift the actual quality characteristic distribution of the plastic product. For instance, insufficient process pressure may lead to an increase in the number and size of bubble defects, and slight shifts in camera position may cause systematic overestimation or underestimation of defect size measurements. If the detection system consistently uses the initially set defect judgment criteria without considering these gradual changes, a gradual increase in missed detections or false alarms will occur.
[0064] To this end, a deviation analysis can be performed on the current production parameters and the candidate judgment criteria in the set of judgment criteria to identify parameter deviations. Parameter deviations reflect the discrepancies between the current production parameters and the candidate judgment criteria. Parameter deviation analysis is implemented using the Statistical Process Control (SPC) method. The system maintains a rolling data buffer, collects the actual process parameters for the most recent N=100 production cycles, and calculates the mean values of each key parameter (melt temperature T, holding pressure P, mold temperature M). Then, compare it with the benchmark parameters used when establishing the judgment criteria ( , The comparison is performed. The parameter deviation ΔP is calculated using a simplified relative deviation, such as... If ΔP exceeds the warning threshold (e.g., 1.5), it is determined that the current process state has significantly deviated from the state established when the standard was set, and the warning threshold can be calibrated. For example, if the reference melt temperature... =260℃, =2℃, while currently If the temperature is 255℃, then ΔP = 2.5, which exceeds the warning threshold, indicating that the material's fluidity is reduced and may lead to an increase in weld lines. At this point, the system triggers the judgment standard adjustment process.
[0065] Then, offset analysis is performed on the features of the first region to obtain the degree of offset, thereby detecting the stability of the image acquisition system. Based on the parameter deviation and the degree of offset, the defect judgment criteria are adjusted. The adjustment logic follows a preset process-quality mapping model, which is established through historical data regression analysis and records the threshold correction coefficients corresponding to different parameter deviation ranges. For example, the mapping table records: when the temperature deviation Δ∈[1.5,2.5] and the pressure deviation Δ∈[0.5,1.0], the bubble diameter threshold correction coefficient k=1.2 (relaxed by 20%); when the offset degree D∈[0.1,0.2], the dimensional defect threshold correction coefficient k=1.1 (compensating for the measurement system being too large). The system looks up the corresponding correction coefficients based on the current Δ, Δ, and D to adjust the defect judgment criteria. If the parameter deviation indicates that the process window is moving towards a defect-prone direction (e.g., a decrease in temperature leading to an increase in bubbles), or the offset degree indicates that the measurement system is systematically too large, then the threshold for dimensional defects is correspondingly relaxed; conversely, if the process condition is better than the baseline and the measurement system is stable, the criteria can be maintained or tightened.
[0066] The adjusted defect judgment criteria are then added to the judgment criteria set. A new standard record is generated for each adjusted defect judgment criterion, including the effective timestamp, applicable process parameter range (e.g., temperature range 255±3℃, pressure range 78±2MPa), reason for adjustment (parameter drift / equipment calibration), and a comparison of thresholds before and after adjustment (e.g., bubble threshold 0.2mm→0.24mm). This standard is written to the judgment criteria set via an INSERT operation, assigned a new standard ID, and the original standard is marked as updated but still retained as a historical record. In subsequent inspections, the system matches the latest effective standard based on real-time production parameters.
[0067] Through the above technical solution, this embodiment enables dynamic adaptive adjustment of defect judgment criteria, significantly improving the accuracy and robustness of plastic product quality inspection. By introducing parameter deviation analysis and feature offset analysis, this embodiment allows the system to promptly detect and quantify subtle changes in the production process, and accordingly refine the judgment criteria. This not only effectively avoids misjudgments and missed detections caused by production fluctuations or the evolution of defect characteristics, but also continuously optimizes the judgment criteria library by adding the adjusted criteria to the judgment criteria set, thereby enhancing the intelligence level and long-term stability of the entire quality inspection system.
[0068] In some embodiments, step S502 involves performing offset analysis on the features of the first region to obtain the degree of offset, which may include, but is not limited to, the following steps: Images of plastic products are acquired using adjacent image acquisition devices to obtain images for comparison. Defect region analysis is performed on the images to be compared to identify the second defect region; Feature extraction is performed on the second defect region to obtain the features of the second region; The features of the first region are compared with those of the second region to calculate the degree of offset.
[0069] In some embodiments, images of the plastic product can be acquired first using adjacent image acquisition devices to obtain images for comparison. Adjacent image acquisition devices refer to one of two cameras arranged at different angles at the same inspection station; the two cameras may include a main camera and an auxiliary verification camera. When the product passes through the inspection area, the two cameras synchronize via hardware triggering (sharing the same trigger signal to ensure an exposure time difference of less than one millisecond), capturing images separately within a very short time interval.
[0070] Then, defect region analysis is performed on the comparison image to identify the second defect region. Features are then extracted from the second defect region to obtain its features. Specifically, the image captured by the auxiliary verification camera (the comparison image) undergoes the same preprocessing steps as the main camera (grayscale conversion, local thresholding segmentation) to identify the second defect region in the corresponding field of view, and features of the second region are extracted (region area S2, bounding box center coordinates (x2, y2), edge intensity E2, etc.).
[0071] The features of the first region are then compared with those of the second region to calculate the degree of offset. The second region features can be transformed to the first camera coordinate system using a pre-defined camera calibration relationship (obtained through the rotation matrix and translation vector between the two cameras via pre-calibration using Zhang's calibration method, calculated from more than ten sets of checkerboard images with different poses), thus eliminating geometric distortion caused by viewpoint differences. The degree of offset D is calculated using normalized Euclidean distance. ,in, =(S1+S2) / 2, where W is the image width and H is the image height. This is the reference value for maximum edge strength. The area of the region with the first regional characteristic, ( , () represents the center coordinates of the bounding box of the first region feature. The edge intensity of the first region feature is represented by D. If D exceeds a preset offset threshold (e.g., 0.15), it indicates that the image acquisition system may have lens contamination, focus drift, or changes in light source intensity. The preset offset threshold can be calibrated.
[0072] Through the above technical solution, this embodiment can more comprehensively and accurately assess the offset of defect features in plastic products. By introducing multi-source image data for comparison, the influence of factors such as measurement errors from a single image acquisition device, changes in ambient lighting, or inconsistencies in product posture on the defect feature extraction results can be effectively eliminated or reduced, thus making the calculated offset more realistic and reliable. This precise offset level can provide more solid data support for subsequent adjustments to defect judgment criteria, ensuring that the adjusted judgment criteria can more accurately adapt to various changes in actual production, and improving the robustness and accuracy of quality inspection.
[0073] The beneficial effects of implementing the embodiments of the present invention include: First, the embodiments of this application acquire images of plastic products and internal inspection data. Then, defect area analysis is performed on the images of plastic products to identify a first defect area. Next, feature extraction is performed on the first defect area to obtain first area features. Finally, the internal inspection data, the first defect area, and the first area features are sent to the management center server. The management center server performs quality inspection based on the internal inspection data, the first defect area, and the first area features to generate quality inspection results. This enables the identification of defects and the generation of quality inspection results by combining internal inspection data and area features, thereby achieving quality inspection of plastic products and improving inspection accuracy and product quality.
[0074] like Figure 2 As shown, this embodiment of the invention also provides a visual inspection system for the quality of plastic products, comprising: The data acquisition module 601 is used to acquire images of plastic products and internal inspection data, including ultrasonic sensing data and X-ray detection data. The defect region analysis module 602 is used to perform defect region analysis on images of plastic products and identify the first defect region. The feature extraction module 603 is used to extract features from the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. The quality inspection module 604 is used to send internal inspection data, the first defect area, and the first area features to the management center server. The management center server is used to perform quality inspection based on the internal inspection data, the first defect area, and the first area features, and generate quality inspection results.
[0075] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0076] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
Claims
1. A method for visual inspection of the quality of a plastic product, characterized in that, Includes the following steps: Acquire images and internal inspection data of plastic products, wherein the internal inspection data includes ultrasonic sensing data and X-ray detection data; Defect region analysis is performed on the image of the plastic product to identify the first defect region; Feature extraction is performed on the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. The internal inspection data, the first defect area, and the first area features are sent to the management center server. The management center server is used to perform quality inspection based on the internal inspection data, the first defect area, and the first area features, and generate quality inspection results.
2. The method of claim 1, wherein, The step of analyzing the defect region of the plastic product image and identifying the first defect region includes: The image of the plastic product is converted to grayscale to obtain a grayscale image; Iterate through and select each pixel in the grayscale image, and perform the following steps: Use the currently selected pixel as the target pixel; Construct a local pixel region, which is centered on the target pixel and has a radius of a preset number of pixels; Calculate the average gray value of the local pixel region; If the target gray value corresponding to the target pixel is less than the average gray value of the local pixel region, then the target pixel is determined to be a defect point; After the traversal is completed, the first defect region is identified based on the multiple defect points.
3. The method of claim 1, wherein, The step of performing quality inspection based on the internal inspection data, the first defect area, and the features of the first area, and generating a quality inspection result, includes: Based on the features of the first region, a semantic segmentation network is used to perform surface defect analysis on the first defect region to identify surface defect information, including scratches, burrs and flow lines. Feature extraction is performed on the internal inspection data to identify non-defect structural features, including material batch features and process fluctuation features; Based on the surface defect information, the non-defect structural features, and the internal inspection data, quality inspection is performed, and the quality inspection result is generated.
4. The method of claim 3, wherein, The step of performing quality inspection based on the surface defect information, the non-defect structural features, and the internal inspection data, and generating the quality inspection result, includes: A three-dimensional spatial correlation analysis is performed on the surface defect information and the internal detection data to obtain the spatial correlation relationship; Based on the spatial correlation, the surface defect information is compared with the non-defect structural features to identify target defect information caused by the inherent properties of the material. The inherent properties of the material are used to represent the uneven stress distribution that exists after plastic injection molding. Based on the target defect information and the internal detection data, a quality inspection is performed, and the quality inspection result is generated.
5. The method of claim 4, wherein, The step of performing quality inspection based on the target defect information and the internal inspection data, and generating the quality inspection result, includes: Obtain the correlation fusion strategy and defect judgment criteria, wherein the correlation fusion strategy is used to reflect the spatial alignment mode and attribute fusion mode between the target defect information and the internal detection data; According to the association fusion strategy, the target defect information and the internal detection data are associated and fused to obtain defect fusion data; Based on the defect judgment criteria and the defect fusion data, quality inspection is performed to generate the quality inspection results.
6. The method of claim 5, wherein, The acquisition and fusion strategy and defect judgment criteria include: Obtain current production parameters, which include plastic product design parameters, material batch information, and production process parameters; Based on the current production parameters, the association fusion strategy is selected from the association rule set, which contains patterns for spatial alignment and attribute fusion between the target defect information and the internal detection data; Based on the current production parameters, the defect judgment criteria are selected from the judgment criteria set, which includes the priority of different types of defects, the judgment rules for defect combinations, and the product qualification threshold.
7. The method of claim 6, wherein, After performing quality inspection based on the defect judgment criteria and the defect fusion data, and generating the quality inspection result, the method further includes: Obtain the results of manual re-inspection of plastic products; The manual re-inspection results are compared with the quality inspection results to identify spatial alignment mode deviation and attribute fusion mode deviation. Based on the spatial alignment mode deviation, the spatial alignment tolerance in the correlation fusion strategy is adjusted; Based on the attribute fusion mode deviation, the attribute fusion weights in the association fusion strategy are adjusted; The adjusted association fusion strategy is added to the association rule set.
8. The method of claim 6, wherein, After performing quality inspection based on the defect judgment criteria and the defect fusion data, and generating the quality inspection result, the method further includes: A deviation analysis is performed between the current production parameters and the candidate judgment criteria in the set of judgment criteria to identify parameter deviations, which are used to reflect the deviation between the current production parameters and the candidate judgment criteria. Perform offset analysis on the features of the first region to obtain the degree of offset; The defect judgment criteria are adjusted based on the parameter deviation and the degree of offset. The adjusted defect judgment criteria are added to the set of judgment criteria.
9. The method according to claim 8, characterized in that, The offset analysis of the features in the first region to obtain the degree of offset includes: Images of plastic products are acquired using adjacent image acquisition devices to obtain images for comparison. Defect region analysis is performed on the image to be compared to identify the second defect region; Feature extraction is performed on the second defect region to obtain the second region features; The first region feature is compared with the second region feature to calculate the degree of offset.
10. A visual inspection system for the quality of plastic products, characterized in that, include: The data acquisition module is used to acquire images and internal inspection data of plastic products, including ultrasonic sensing data and X-ray detection data. The defect area analysis module is used to perform defect area analysis on the image of the plastic product and identify the first defect area; The feature extraction module is used to extract features from the first defect region to obtain the first region features, which include the region area, aspect ratio, bounding box coordinates, edge strength, maximum gray-level gradient magnitude, and average gray-level value of the first defect region. The quality inspection module is used to send the internal inspection data, the first defect area, and the first area features to the management center server. The management center server is used to perform quality inspection based on the internal inspection data, the first defect area, and the first area features, and generate quality inspection results.