An artificial intelligence-based plastic product quality detection method, device and medium

By decoupling polarized visible light and near-infrared frame image reflection and combining microtexture attention with structural attention encoding, the problem of the disconnect between structural semantics and instance inference in the quality inspection of plastic products is solved, achieving accurate detection and self-consistent inference, and improving cross-batch consistency and auditability of the inspection.

CN122289798APending Publication Date: 2026-06-26上海龙航包装材料有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
上海龙航包装材料有限公司
Filing Date
2026-04-24
Publication Date
2026-06-26

Smart Images

  • Figure CN122289798A_ABST
    Figure CN122289798A_ABST
Patent Text Reader

Abstract

This invention discloses an artificial intelligence-based method, equipment, and medium for quality inspection of plastic products, relating to the field of image recognition technology. The method includes: acquiring polarized visible light and near-infrared frame images; decoupling the polarized visible light and near-infrared frame images based on reflection to obtain a substrate appearance image and a micro-texture image; generating a unified feature map based on the substrate appearance image and micro-texture image through comparative learning, combining micro-texture attention and structural attention; establishing an initial prototype and label transduction map structure on the unified feature map; performing collaborative inference based on the initial prototype and label transduction map structure in the unified feature map to obtain an instance defect mask and updating the initial prototype; determining the main structural region based on the instance defect mask and outputting the quality conclusion and evidence image of the plastic product. By establishing an initial prototype and label transduction map structure on the unified feature map, intra-class aggregation and structural alignment are achieved, accurately characterizing subtle defects and functional semantics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method, equipment and medium for quality inspection of plastic products based on artificial intelligence. Background Technology

[0002] Online quality inspection of plastic products typically employs the conventional approach of machine vision and deep learning. Imaging calibration and data acquisition are completed within the production line cycle time. After image preprocessing and feature extraction, defect identification is modeled as target detection, semantic / instance segmentation, or feature-based anomaly detection. In the backend, combined with a process knowledge base, traceable inspection records and visualization results are generated. To adapt to multiple materials and complex appearances, the industry is also gradually introducing imaging methods such as multispectral, polarization, and near-infrared imaging, along with contrastive learning and attention mechanisms to improve the automatic identification and process monitoring capabilities of typical defects such as scratches, silver streaks, and periapical damage.

[0003] However, from an engineering application perspective, conventional solutions still face two challenges: the identification of decision-making links often relies on empirical rules or threshold integration, cross-batch consistency and auditability are limited, the semantic coupling between characterization and process structure is insufficient, and it is difficult to form a definite mapping between functional area, hole location and bonding wire information between instance-level inference and handling actions, making it difficult for the conclusions to directly serve release. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an artificial intelligence-based method for quality inspection of plastic products to solve the problem that the disconnect between structural semantics and instance inference makes it difficult to directly close the loop in release decisions.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for quality inspection of plastic products based on artificial intelligence, comprising, Polarized visible light and near-infrared frame images are acquired, and the polarized visible light and near-infrared frame images are decoupled by reflection to obtain the substrate appearance image and micro-texture image; Based on the base appearance map and microtexture map, through contrastive learning, combined with microtexture attention and structural attention, a unified feature map is generated, and an initial prototype and label transduction map structure are built on the unified feature map. Based on the initial prototype and label transduction graph structure, collaborative inference is performed in the unified feature map to obtain the instance defect mask and update the initial prototype; Based on the example defect mask, the main structural area is determined, and the quality conclusions and evidence diagrams of the plastic products are output.

[0007] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the specific steps for acquiring polarized visible light and near-infrared frame images are as follows: Using the conveyor line arrival signal as the trigger source, the coaxial white ring light is turned on to collect polarized visible light frame images of the same plastic product in a fixed sequence within the same cycle. The polarization angle is switched by the electrically controlled linear polarizer to collect polarized visible light frame images, and then switched to near-infrared ring light to collect near-infrared frame images.

[0008] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the specific steps for decoupling polarized visible light and near-infrared frame images to obtain a substrate appearance image and a micro-texture image are as follows: Radiation normalization and subpixel alignment are performed on the current plastic product. The normalized and aligned polarized visible light frame image, polarized visible light frame image and near-infrared frame image are decoupled by reflection to obtain the substrate appearance image and micro-texture image.

[0009] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the step of generating a unified feature map by encoding based on the substrate appearance map and micro-texture map through comparative learning, combined with micro-texture attention and structural attention, includes the following specific steps: The substrate appearance map and micro-texture map are used as channel image inputs for the current plastic product to generate positive sample pairs view A and view B; The micro-texture map is subjected to median filtering and normalized over the entire pixel range after being mapped by a monotonic concave function to obtain the micro-texture attention. In the tooling coordinate system, a set of structural regions is predefined. The structural regions are projected onto the pixel grid of the current plastic product substrate appearance image through the geometric mapping relationship between the tooling and the image. The structural regions are rasterized to generate masks for each structural region. The masks for each structural region are merged to form a structural region label. The structural region label contains a set of predefined structural region categories. The edges of the masks for each structural region are softened to obtain soft masks. The soft masks are then normalized to a structural attention weight field by pixel. The pixel-wise structural attention weight field is the structural attention. Semantic alignment and residual correction are performed by an encoder, and pixel-wise unitized features are output. The unitized features are then weighted and fused pixel-wise based on a structural attention weight field, and a unified feature map is generated through forward propagation.

[0010] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the specific steps for establishing an initial prototype and label transfer graph structure on a unified feature map are as follows: For each defect category, read the unitized feature vector pixel by pixel from the unified feature map position of the defect annotation pixel, sum the unitized feature vectors and normalize them to obtain the initial prototype and initial prototype vector of the defect category. The unified feature map is divided into patch nodes according to a fixed grid. Each patch node establishes an undirected connection with the adjacent patches above, below, left, and right, resulting in a label transduction graph structure.

[0011] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the step of obtaining an instance defect mask by performing collaborative inference based on the initial prototype and label transduction graph structure in a unified feature map includes the following steps: On the unified feature map, the cosine similarity between the unitized feature vector and the initial prototype vector of each defect category is calculated pixel by pixel. The cosine similarity of all categories within the pixel is then normalized by softmax to obtain the initial posterior distribution of the pixel with respect to all categories. The initial posterior distribution of the pixels covered by the patch node is then averaged equally according to the coverage of the patch node to form the initial label distribution. On the label transduction graph structure, a sparse weight matrix is ​​constructed using non-negative cosine similarity, and a degree matrix and a symmetric normalized Laplace are obtained. The symmetric normalized Laplace is used as a graph smoothing prior, and the initial label distribution is used as a data consistency term. By minimizing the smoothing term and the data consistency term, the problem of minimizing the collaborative inference energy of the label transduction graph structure is transformed into a system of linear equations without hyperparameters. The probability distribution of patch nodes belonging to each defect category is written back to the pixels according to their respective coverage areas to obtain the pixel-level posterior probability of each pixel. The category with the highest posterior probability for each pixel is taken as the pixel category. For each pixel category, the instance defect mask of the pixel category is obtained by connected component decomposition.

[0012] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the specific steps of updating the initial prototype are as follows: Using pixel-level posterior probabilities as continuous weights, the unitized feature vector of each pixel is weighted and summed according to the posterior probability of the defect category to obtain the direction vector of the defect category. The direction vector of the defect category is then unitized and used as the updated prototype of the defect category.

[0013] As a preferred embodiment of the artificial intelligence-based plastic product quality inspection method of the present invention, the steps of determining the main structural region based on the example defect mask and outputting the plastic product quality conclusion and evidence diagram are as follows: Each structural area category is checked sequentially according to the preset judgment order. It is determined whether there is an intersection between the instance defect mask and the pixel set of the structural area category in the structural area label. When the intersection is not empty, the current structural area category is recorded as the main structural area and the check is stopped. When there is no intersection between each structural area category, it is marked as an undefined structural area. Based on the main structural area and defect category of the instance defect mask, the comparison and treatment mapping takes the most stringent result as the final conclusion for the current plastic product, and generates a structural region overlay map and an instance defect mask overlay map.

[0014] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the artificial intelligence-based plastic product quality inspection method as described in the first aspect of the present invention.

[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the artificial intelligence-based plastic product quality inspection method as described in the first aspect of the present invention.

[0016] The beneficial effects of this invention are as follows: By combining contrastive learning with micro-texture attention and structural attention for encoding, an initial prototype and label transduction map structure are established on a unified feature map, achieving intra-class aggregation and structural alignment, accurately depicting minor defects and functional semantics, and performing collaborative inference based on the initial prototype and label transduction map structure to obtain instance defect masks and update the initial prototype, thereby achieving self-consistent inference from pixels to instances. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of an artificial intelligence-based method for quality inspection of plastic products.

[0019] Figure 2 This is a flowchart of reflection decoupling and image acquisition.

[0020] Figure 3 Flowcharts are created for feature encoding and prototyping.

[0021] Figure 4 This is a flowchart for collaborative inference and prototype update. Detailed Implementation

[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides a method for quality inspection of plastic products based on artificial intelligence, including the following steps: S1. Acquire polarized visible light and near-infrared frame images, and decouple the polarized visible light and near-infrared frame images by reflection to obtain the substrate appearance map and micro-texture map. A global shutter industrial camera, a fixed-focus lens, an electronically controlled linear polarizer, a coaxial white light ring light, an 850nm near-infrared ring light, and a hardware trigger are fixed at the workstation. The electronically controlled linear polarizer only switches between two settings: 0° and 90°. Using the conveyor line arrival signal as the trigger source, three frames are captured in a fixed sequence for the same plastic product within the same cycle. The coaxial white light ring light is turned on and the polarization angle is set to 0° to capture the 0° polarized visible light 0° frame image. The electrically controlled linear polarizer is switched to 90° to capture the 90° polarized visible light 90° frame image. The image is then switched to 850nm near-infrared ring light to capture the near-infrared frame image. Two types of miniature reference patches are fixed at the edge of the field of view of the tooling fixture and are included in the lens along with the part. A Lambertian gray reference film and a small high-reflectivity metal dot are used. After three frames of images—a 0° polarized visible light frame image, a 90° polarized visible light frame image, and a near-infrared frame image—arrive at the image receiving buffer of the vision industrial control computer (IPC), the grayscale and position of the two reference patch areas are automatically extracted, and the current plastic product is subjected to radiation normalization and subpixel alignment. Tooling fixtures refer to special carriers or trays used to fix and repeatedly position plastic products as they enter the shooting field of view. Tooling fixtures ensure that each product enters the shooting with the same posture and the same visible area at the same work station and under the same lens. By decoupling the normalized and aligned polarized visible light 0° frame image, polarized visible light 90° frame image, and near-infrared frame image through reflection, the substrate appearance map and microtexture map are obtained, expressed as follows: ; ; in, The base appearance map is shown in pixels. Strength at that location, Indicates the horizontal pixel index of the image. Indicates the pixel index in the vertical direction of the image. Indicates the near-infrared frame image in pixels Strength at that location, This indicates a 0° frame image of polarized visible light. The strength, This indicates a 90° frame image of polarized visible light. The strength, This represents a minimal positive stable term. Indicates microtexture map at the pixel level Strength at that location, Indicates the near-infrared frame image in pixels The two-dimensional discrete gradient vector at the given location; The substrate appearance image and micro-texture image generated from the plastic product are written into a circular buffer of shared memory with the same resolution, bit depth and image coordinate system as the input polarized visible light 0° frame image, polarized visible light 90° frame image and near-infrared frame image. At the same time, metadata such as batch number, unique identifier of plastic product, timestamp, work station number, calibration version number and other metadata are written into the circular buffer.

[0026] S2. Based on the base appearance map and micro-texture map, through comparative learning, combined with micro-texture attention and structural attention, a unified feature map is generated, and an initial prototype and label transduction map structure are established on the unified feature map. During the training phase, the base appearance map and micro-texture map are used as channel image inputs for the current plastic product, respectively. All operations do not change the geometric semantics, generating positive sample pairs, View A and View B. View A takes the center of the image as the anchor point, and cuts out the centered rectangular area at a fixed ratio. Bicubic interpolation is used to restore the cropped block to an H×W pixel grid. The two channels are processed synchronously without any photometric changes. View B only performs a fixed-amplitude brightness or contrast perturbation on the base appearance map channel, while leaving the micro-texture map channel unchanged. Similarly, it uses the image center as the anchor point, performs centered cropping at a fixed ratio, and then uses bicubic interpolation to restore it to an H×W pixel grid. Median filtering is applied to the micro-texture image to remove salt-and-pepper noise and preserve fine texture edges. After monotonic concave function mapping, normalization is performed on the entire pixel range of the image to obtain micro-texture attention. By estimating the homography matrix between the camera coordinates and the tooling coordinates using two types of miniature reference patches on the tooling fixture, after each plastic product enters the shooting position, the reference pixel position is automatically detected on the current substrate appearance image, and the homography matrix of the current plastic product is re-estimated using the currently detected reference points to obtain the unique pixel mapping relationship corresponding to the current plastic product. The optical surface, sealing surface, functional hole, weld line and non-appearance surface areas in the tooling coordinate system are projected from the tooling coordinates to the H×W pixel grid of the current plastic product substrate appearance image according to the homography matrix. The area masks of the same size and coordinate are generated by rasterization. The priority of optical surface, sealing surface, functional hole, weld line and non-appearance surface is decided pixel by pixel. All area masks are merged into structural area labels. The structural area labels contain a preset set of structural area categories. A slight Gaussian edge softening is applied to the mask of each structural region to obtain a smooth soft mask. The soft mask is then normalized to a structural attention weight field by pixel. The pixel-by-pixel structural attention weight field is the structural attention. Pixel alignment is achieved using a teacher-student dual encoder. The student encoder outputs pixel-by-pixel unitized features for view A, and the teacher encoder outputs pixel-by-pixel unitized features for view B. The unitized features are then weighted and fused pixel-by-pixel based on a structural attention weight field. During training, only the student parameters are backpropagated and the optimizer is updated. The teacher parameters are not involved in backpropagation during training and are obtained through the exponential moving average of the student parameters. Training automatically stops when a fixed number of iterations is reached, and the student encoder is frozen when training stops. During the online inference phase, for each plastic product, the substrate appearance map and micro-texture map are input into the frozen student encoder. A single forward propagation generates a unified feature map, expressed as: ; in, This represents the total value of the pixel-level weighted alignment loss. Indicates pixel coordinate index, This represents the set of pixel coordinates shared by the base appearance map and the microtexture map after normalization and alignment. Represents pixels Structural attention weights at the location, This indicates the student encoder in view A, in pixels. The normalized eigenvector at that location, The teacher encoder is shown in view B, in pixels. The normalized eigenvector at that location, Indicates cosine similarity; Student parameters refer to all trainable weights and biases in the student encoder (such as convolutional kernels, learnable affine terms of normalized layers, and attention or projection layer weights) and the corresponding model buffers (such as normalized running mean or variance). Teacher parameters refer to the isomorphic weights and biases corresponding to the teacher encoder; For each defect category, read the unitized feature vector pixel by pixel from the unified feature map position of the defect annotation pixel, sum the unitized feature vectors and normalize them to obtain the initial prototype and initial prototype vector of the defect category. Defect category refers to a discrete set of labels that define appearance quality problems of plastic products, including scratches, silver streaks, bubbles, short shots, burrs, burns, weld lines, contamination, indentations, shrinkage, voids, and normal or no defects, etc. Defect-marked pixels refer to the set of all pixels inside the defect mask after the defect mask is manually marked on the substrate appearance map, and a clear defect category is assigned to each defect mask; The unitized features are representation vectors extracted pixel-by-pixel by the encoder from the base appearance map and the microtexture map; The unified feature map is divided into patch nodes according to a fixed grid. The pixel features in each patch node are averaged by vector and then normalized, so that the representation of each patch node is a dimensionless unit vector. Each patch node establishes an undirected connection with the adjacent patches above, below, left and right. The edge weight between two patch nodes is the non-negative part of the cosine similarity of the normalized features, thus obtaining the label transduction graph structure.

[0027] S3. Based on the initial prototype and label transduction graph structure, perform collaborative inference in the unified feature map to obtain the instance defect mask and update the initial prototype; On the unified feature map, the cosine similarity between the unitized feature vector and the initial prototype vector of each defect category is calculated pixel by pixel. The cosine similarity of all categories within the pixel is then normalized by softmax to obtain the initial posterior distribution of the pixel with respect to all categories. The initial posterior distribution of the pixels covered by the patch node is then averaged equally according to the coverage of the patch node to form the initial label distribution. In the label transduction graph structure, a sparse weight matrix is ​​constructed using non-negative cosine similarity, resulting in a degree matrix and a symmetric normalized Laplace. The symmetric normalized Laplace is used as a graph smoothing prior, and the initial label distribution is used as a data consistency term. By minimizing the graph proximity consistency metric and the prior fitting metric, the problem of minimizing the collaborative inference energy of the label transduction graph structure is transformed into a system of linear equations without hyperparameters, expressed as: ; ; ; in, Indicates For the problem of minimizing the energy of variables, This represents a graph proximity consistency measure. This represents the prior fit metric. Describe the Frobenius norm. Denotes the posterior probability matrix. Represents the identity matrix. Represents the Laplacian matrix of a symmetric normalized graph. Represents a data item matrix, Represents a sparse weight matrix. Degree matrix; Write back the probability distribution of patch nodes belonging to each defect category to the pixels according to their respective coverage areas to obtain the pixel-level posterior probability of each pixel. Take the category with the largest posterior probability for each pixel as the pixel category. Perform connected component decomposition by pixel category. For each pixel category, perform connected component decomposition on the binary layer through 8 adjacencies to obtain the instance defect mask of the pixel category. The unified feature map is divided into small regions by a sliding window of fixed size, and each region is a patch node; The area of ​​pixels contained within a patch node is the coverage area of ​​the patch node. When there is no overlap, each pixel falls within only one patch node. When overlap is allowed, the same pixel may be covered by multiple patch nodes at the same time. In a binary layer of the same category, a pixel is adjacent to the pixels above, below, left, right, and four diagonally adjacent to it, i.e., 8-adjacency; Using pixel-level posterior probabilities as continuous weights, the unitized feature vector of each pixel is weighted and summed according to the posterior probability of the defect category to obtain the direction vector of the defect category. The direction vector of the defect category is then unitized and used as the updated prototype of the defect category. The updated prototype immediately replaces the old prototype and is used in the next round of collaborative inference and label transduction.

[0028] S4. Based on the example defect mask, determine the main structural area and output the quality conclusion and evidence diagram of the plastic product; For each instance defect mask, check the fixed priority in sequence: optical surface, sealing surface, functional hole, weld line and non-appearance surface. Under the priority, determine whether there is an intersection between the instance defect mask and the pixel set of the structural area category in the structural area label. If the intersection is not empty, the current structural area category is recorded as the main structural area. If each structural area category is empty, it is marked as an undefined structural area. When there are multiple candidate areas with the same priority, take the area with the most overlapping pixels with the instance defect mask. The structural area category refers to the surface functional semantic type assigned to each pixel after projecting the optical surface, sealing surface, functional hole, weld line and non-appearance surface areas in the tooling coordinate system from the tooling coordinate system into an H×W pixel grid of the current plastic product substrate appearance image. This includes optical surface, sealing surface, functional hole, weld line and non-appearance surface. The optical surface refers to the area with the highest requirements for appearance, transmission, and reflection. The sealing surface refers to the surface that performs the function of sealing or contact. A functional hole refers to the area including the orifice, the edge of the hole, and the inner wall of the hole projected onto the current view. The bonding line refers to the defined area of ​​the material flow confluence line and its adjacent region; Non-appearance surfaces refer to areas that have a minor impact on appearance and have general functional requirements. If the main structural area is an optical surface or a sealing surface, stop the current plastic product's subsequent processes and move it to the isolation area. At the same time, start parameter verification and cause analysis, and archive the images and judgment results simultaneously. If the main structural area contains functional holes or weld lines, temporarily suspend the current plastic products from entering the warehouse, arrange on-site verification of dimensions, fit, and sealing, and carry out local repairs. If the verification fails to meet the standards, transfer the products to isolation. If the main structural area is not an external surface, record the defect category information and maintain the normal flow of the current plastic product. If subsequent processes require it, local cleaning can be performed without changing the shape and function. If there are no instances of defect masks in the current plastic products, continue production as qualified parts and archive the images and judgment results; When multiple instance defect masks exist in a plastic product, each one is checked and the most stringent treatment item is used as the final conclusion for the current plastic product. Generate evidence maps, including structural region overlay maps and instance defect mask overlay maps; A structural region overlay diagram refers to displaying the outlines of each structural region labeled with different colors on a base appearance diagram; An instance defect mask overlay refers to an image overlaid with the boundaries of instance defect masks, with the main structural area of ​​each instance defect mask labeled.

[0029] This embodiment also provides a computer device applicable to the case of an artificial intelligence-based plastic product quality inspection method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the artificial intelligence-based plastic product quality inspection method proposed in the above embodiment.

[0030] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0031] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the artificial intelligence-based plastic product quality inspection method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0032] In summary, this invention achieves self-consistent inference from pixels to instances by: encoding through contrastive learning combined with micro-texture attention and structural attention; establishing an initial prototype and label transduction graph structure on a unified feature map; realizing intra-class aggregation and structural alignment; accurately characterizing minor defects and functional semantics; and performing collaborative inference based on the initial prototype and label transduction graph structure to obtain instance defect masks and update the initial prototype.

[0033] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for quality inspection of plastic products based on artificial intelligence, characterized in that: include, Polarized visible light and near-infrared frame images are acquired, and the polarized visible light and near-infrared frame images are decoupled by reflection to obtain the substrate appearance image and micro-texture image; Based on the base appearance map and microtexture map, through contrastive learning, combined with microtexture attention and structural attention, a unified feature map is generated, and an initial prototype and label transduction map structure are built on the unified feature map. Based on the initial prototype and label transduction graph structure, collaborative inference is performed in the unified feature map to obtain the instance defect mask and update the initial prototype; Based on the example defect mask, the main structural area is determined, and the quality conclusions and evidence diagrams of the plastic products are output.

2. The artificial intelligence-based plastic product quality inspection method as described in claim 1, characterized in that: The specific steps for acquiring polarized visible light and near-infrared frame images are as follows: Using the conveyor line arrival signal as the trigger source, the coaxial white ring light is turned on to collect polarized visible light frame images of the same plastic product in a fixed sequence within the same cycle. The polarization angle is switched by the electrically controlled linear polarizer to collect polarized visible light frame images, and then switched to near-infrared ring light to collect near-infrared frame images.

3. The artificial intelligence-based quality inspection method for plastic products as described in claim 2, characterized in that: The specific steps for decoupling polarized visible light and near-infrared frame images by reflection to obtain a substrate appearance map and a micro-texture map are as follows: Radiation normalization and subpixel alignment are performed on the current plastic product. The normalized and aligned polarized visible light frame image, polarized visible light frame image and near-infrared frame image are decoupled by reflection to obtain the substrate appearance image and micro-texture image.

4. The artificial intelligence-based quality inspection method for plastic products as described in claim 3, characterized in that: The process involves encoding a unified feature map based on the basal appearance map and micro-texture map through comparative learning, combining micro-texture attention and structural attention. The specific steps are as follows: The substrate appearance map and micro-texture map are used as channel image inputs for the current plastic product to generate positive sample pairs view A and view B; The micro-texture map is subjected to median filtering and normalized over the entire pixel range after being mapped by a monotonic concave function to obtain the micro-texture attention. In the tooling coordinate system, a set of structural regions is predefined. The structural regions are projected onto the pixel grid of the current plastic product substrate appearance image through the geometric mapping relationship between the tooling and the image. The structural regions are rasterized to generate masks for each structural region. The masks for each structural region are merged to form a structural region label. The structural region label contains a set of predefined structural region categories. The edges of the masks for each structural region are softened to obtain soft masks. The soft masks are then normalized to structural attention weight fields by pixels. Semantic alignment and residual correction are performed by an encoder, and pixel-wise unitized features are output. The unitized features are then weighted and fused pixel-wise based on a structural attention weight field, and a unified feature map is generated through forward propagation.

5. The artificial intelligence-based plastic product quality inspection method as described in claim 4, characterized in that: The specific steps for establishing the initial prototype and label transduction graph structure on the unified feature map are as follows: For each defect category, read the unitized feature vector pixel by pixel from the unified feature map position of the defect annotation pixel, sum the unitized feature vectors and normalize them to obtain the initial prototype and initial prototype vector of the defect category. The unified feature map is divided into patch nodes according to a fixed grid. Each patch node establishes an undirected connection with the adjacent patches above, below, left, and right, resulting in a label transduction graph structure.

6. The artificial intelligence-based quality inspection method for plastic products as described in claim 5, characterized in that: The specific steps for obtaining an instance defect mask by performing collaborative inference based on the initial prototype and label transduction graph structure in the unified feature map are as follows: On the unified feature map, the cosine similarity between the unitized feature vector and the initial prototype vector of each defect category is calculated pixel by pixel. The cosine similarity of all categories within the pixel is then normalized by softmax to obtain the initial posterior distribution of the pixel with respect to all categories. The initial posterior distribution of the pixels covered by the patch node is then averaged equally according to the coverage of the patch node to form the initial label distribution. On the label transduction graph structure, a sparse weight matrix is ​​constructed using non-negative cosine similarity, and a degree matrix and a symmetric normalized Laplace are obtained. The symmetric normalized Laplace is used as a graph smoothing prior, and the initial label distribution is used as a data consistency term. By minimizing the smoothing term and the data consistency term, the problem of minimizing the collaborative inference energy of the label transduction graph structure is transformed into a system of linear equations without hyperparameters. The probability distribution of patch nodes belonging to each defect category is written back to the pixels according to their respective coverage areas to obtain the pixel-level posterior probability of each pixel. The category with the highest posterior probability for each pixel is taken as the pixel category. For each pixel category, the instance defect mask of the pixel category is obtained by connected component decomposition.

7. The artificial intelligence-based plastic product quality inspection method as described in claim 6, characterized in that: The specific steps for updating the initial prototype are as follows: Using pixel-level posterior probabilities as continuous weights, the unitized feature vector of each pixel is weighted and summed according to the posterior probability of the defect category to obtain the direction vector of the defect category. The direction vector of the defect category is then unitized and used as the updated prototype of the defect category.

8. The artificial intelligence-based method for quality inspection of plastic products as described in claim 7, characterized in that: The steps for determining the main structural region based on the example defect mask and outputting the quality conclusion and evidence diagram of the plastic product are as follows: Each structural area category is checked sequentially according to the preset judgment order. It is determined whether there is an intersection between the instance defect mask and the pixel set of the structural area category in the structural area label. When the intersection is not empty, the current structural area category is recorded as the main structural area and the check is stopped. When there is no intersection between each structural area category, it is marked as an undefined structural area. Based on the main structural area and defect category of the instance defect mask, the comparison and treatment mapping takes the most stringent result as the final conclusion for the current plastic product, and generates a structural region overlay map and an instance defect mask overlay map.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the artificial intelligence-based plastic product quality inspection method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the artificial intelligence-based plastic product quality inspection method according to any one of claims 1 to 8.