A method of quality control of die cut products
Patent Information
- Application Number
- CN202611194188.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-10-30
AI Technical Summary
[0014]本发明要解决的技术问题是:提供一种模切产品的品控方法,解决现有模切产品生产中缺陷成因追溯依赖人工经验导致的不稳定与低效率、大数据分析数据量庞大且需额外标记产品、以及传统RAG技术依赖高质量知识库且难以处理多重原因缺陷等技术问题
[0040]本发明的有益效果是,解决了背景技术中存在的缺陷,
Smart Images

Figure CN123015456A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, and in particular to a quality control method for die-cut products that uses multi-stage defect distribution map alignment to locate the defect-causing process, and combines hybrid expert models and RAG technology for root cause analysis and quality control strategy output. Background Technology
[0002] Die-cut products refer to products with uniform shapes that are cut from long film materials. Their production process typically includes multiple steps such as film transfer, coating, lamination, pressing, segmentation, and die-cutting. These steps may be performed multiple times, and the order of execution may vary. In the production of multi-step die-cut products, tracing the causes of defects is a key technical challenge. The same final defect may originate from any of the multiple steps. Quickly and accurately locating the stage at which the defect occurred is crucial for narrowing down the scope of root cause analysis and developing effective quality control strategies.
[0003] In existing technologies, there are three main approaches to tracing the causes of defects in die-cut products:
[0004] (a) Human experience scheme
[0005] After defects are detected, quality department personnel observe the actual product and analyze it based on experience to determine which processes or abnormalities might have caused the defects, and then investigate them one by one. This approach has obvious flaws: different personnel have different experience and skills, resulting in inconsistent analysis results; even the same person can be influenced by various subjective factors, leading to unstable judgments; and it is costly and inefficient.
[0006] (II) Big Data Analysis Solution
[0007] The solution involves establishing a Manufacturing Execution System (MES) to collect various monitoring data during the production process and using data mining to predict the causes of defects. However, this approach analyzes all monitoring data from the entire production process, resulting in a massive and complex dataset. Furthermore, the MES system requires marking each product corresponding to a defect when storing data, and the marking itself may cause secondary damage to the product.
[0008] (III) Solutions based on RAG technology
[0009] Theoretical knowledge and the experience of relevant personnel are compiled into a knowledge base, and a question-answering system based on RAG (Retrieval Enhanced Generation) technology is built using a large language model to identify the causes of defects. However, traditional RAG technology is highly dependent on the quality of the knowledge base, and building a high-quality professional domain knowledge base is extremely difficult; moreover, when a defect may be caused by multiple reasons, it is difficult to investigate and locate the cause.
[0010] Furthermore, Chinese patent CN106458495B discloses a production method and cutting system for cut products, which involves a technique for generating a defect distribution map based on blank defect information and segmenting the defect distribution map along the cutting line. The defect distribution map in this patent is generated based on the xy coordinates of the defect relative to a reference point. However, this solution only involves the generation and segmentation of a single defect distribution map, and does not address the alignment of defect distribution maps across multiple processes or the process location of defect causes.
[0011] Chinese patent CN116664633B discloses a method for image registration of printed materials based on a convolutional cross-attention mechanism; another document discloses a method for fabric image registration using a multi-size window Transformer network based on cross-attention. However, the above solutions all use cross-attention for general image registration tasks, without addressing its application to similarity judgment and defect pairing of small defect images of die-cut products.
[0012] Mixture of Experts (MoE) models have been applied in image classification. However, existing technologies lack a scheme that combines the MoE architecture with iterative training mechanisms for automatic selection of expert networks in image similarity calculation, and even more so, its application in matching small defect images of die-cut products.
[0013] In summary, the existing technology lacks a complete quality control solution that can automatically, efficiently, and accurately locate the root causes of defects in multiple processes of die-cut products, perform root cause analysis, and output quality control strategies. Summary of the Invention
[0014] The technical problem to be solved by this invention is to provide a quality control method for die-cut products, which solves the problems of instability and inefficiency caused by relying on manual experience for tracing the causes of defects in existing die-cut product production, the large amount of data required for big data analysis and the need for additional product labeling, and the difficulty of handling defects with multiple causes due to reliance on high-quality knowledge bases in traditional RAG technology.
[0015] The technical solution adopted by this invention to solve its technical problem is: a quality control method for die-cut products, comprising the following steps:
[0016] Construct a defect distribution map for each production stage: perform defect detection on the film material imaging of each production stage of the die-cut product, extract the coordinate points of each defect and stitch them together to form a defect point set distribution map corresponding to each production stage, and select the defect distribution map of the initial production process stage as the defect distribution benchmark map.
[0017] Global positioning and alignment: Extract shape features from the defect distribution map at each stage, and match it with the defect distribution baseline map by template matching that supports rotation, translation and scaling. Fit the global affine transformation matrix from the defect distribution map at each stage to the baseline map to complete the global coarse alignment of the defect distribution map at each stage.
[0018] Local fine positioning and alignment: According to the production process sequence, the defect distribution map of the later stage in two adjacent stages is divided into blocks and clustered. The defect small map similarity matching and template matching are performed between each block and the corresponding area of the previous stage to obtain the affine transformation parameters of the local blocks and complete the local fine alignment of each block.
[0019] Defect formation stage determination: Tracing back along the production process to the corresponding position of each defect in the previous stage, the production stage in which the defect first appears is determined as the formation stage of the defect.
[0020] Defect Root Cause Analysis and Quality Control Output: Combining production monitoring data and defect attributes at the defect formation stage, the root causes of defects and corresponding quality control strategies are generated through a knowledge base and a large language model.
[0021] Furthermore, the construction of defect distribution maps for each production stage as described in this invention specifically includes:
[0022] Extract the centroid coordinates of each connected region of the defect, or the center coordinates of the defect detection rectangle; establish a coordinate system with the film material conveying direction as the x-axis and the width direction as the y-axis, and stitch the defect coordinates of the segmented imaging into a continuous defect point set distribution map; select the defect distribution map of the first process stage in the production process as the defect distribution reference map.
[0023] Furthermore, the shape feature extraction step in the global positioning and alignment described in this invention specifically includes:
[0024] A sliding window of a preset size is used to traverse and slide across the defect distribution map, retaining windows with more than a preset threshold number of defect points; local non-maximum suppression is performed on overlapping retained windows, retaining the window with the most defect points; when there are multiple windows with the same number of points, the window located in the middle of all windows is selected; all defect points in the retained window are connected to form a polygon, which is used as the shape feature of the window.
[0025] Furthermore, the fitting step of the global affine transformation matrix described in this invention specifically includes:
[0026] The polygon shape features extracted at each stage are template matched on the defect distribution baseline map to obtain multiple sets of candidate affine transformation matrices. Coordinate points are randomly generated in the two-dimensional space of the baseline map. After transformation by each set of candidate matrices, a two-dimensional normal distribution is fitted, and the variance and expectation are calculated. The matrices corresponding to points whose surrounding distance is more than twice the variance are removed. The mean of the translation components of the remaining candidate matrices is taken, and the rotation components are decomposed and recombined to obtain the final global affine transformation matrix.
[0027] Furthermore, the defect clustering and pairing steps in the local fine-localization alignment described in this invention specifically include:
[0028] Defect distribution maps of adjacent preceding and following stages are taken according to the production process sequence. Defect clustering is performed on the defect distribution map of the following stage: the defects in the selected window are taken as the central defects, and the KNN clustering method is used to assign the defects in the unselected window to the nearest central defects, forming multiple defect blocks.
[0029] For each defect block, the corresponding area of the defect distribution map in the previous stage is expanded outward by a preset number of pixels to form the search area. The defect small image corresponding to the central defect of the defect block is compared with the defect small images in the search area one by one to calculate the image similarity and complete the defect pairing.
[0030] Furthermore, the image similarity described in this invention is calculated using a cross-attention similarity network, which includes a convolutional encoder, a cross-attention layer, and an output layer.
[0031] The convolutional encoder contains a first-level convolution and a third-level separable convolution, which encodes the input defect small image into a multi-channel feature map and unfolds it into a two-dimensional feature vector group.
[0032] The cross-attention layer is a two-layer multi-head structure that performs cross-attention feature interaction on the feature vector groups of the two input images;
[0033] The output layer sequentially goes through global average pooling, concatenation of difference and product features, and multiple fully connected layers, and finally outputs the similarity score after sigmoid activation.
[0034] Furthermore, the cross-attention similarity network described in this invention adopts a hybrid expert MoE architecture, which includes n_s similarity calculation sub-networks and a MoE classification module; through iterative training, a dedicated sample set is assigned to each similarity calculation sub-network, and the MoE classification module automatically matches the optimal similarity calculation sub-network based on the input image.
[0035] Furthermore, after the defect pairing is completed, the present invention automatically selects the optimal matching algorithm from a variety of preset template matching algorithms through the template matching MoE module; based on the defect small image of the previous stage of pairing, template matching is performed on the defect small image of the next stage to obtain the local affine transformation parameters of the defect block, thereby completing the local fine alignment of the block.
[0036] Furthermore, the defect cause determination stage described in this invention specifically includes:
[0037] After aligning the defect distribution maps for all production stages, trace the corresponding position of the target defect back from the final production stage along the process flow, stage by stage. If the corresponding position of a certain preceding stage does not exist, it is determined that the defect was formed in the production stage following the preceding stage.
[0038] Furthermore, the defect root cause analysis and quality control output described in this invention specifically include:
[0039] After determining the defect formation stage, the production process monitoring data of that stage is extracted. Combined with the defect's category, shape, and severity attributes, the data is input into a RAG-based causal knowledge base and a large language model to deduce the root cause of the defect. Then, the root cause of the defect is input into a quality control strategy knowledge base and a large language model to generate the corresponding quality control optimization strategy.
[0040] The beneficial effect of this invention is that it solves the defects existing in the prior art.
[0041] 1. Compared with solutions that rely on human experience, the entire process of this invention is fully automated and requires no human intervention. This eliminates the instability in judgment caused by human factors, greatly improves analysis efficiency, and saves labor costs.
[0042] 2. Compared to big data analysis solutions, this invention uses a method of image alignment at different stages and defect distribution comparison to determine the production stage at which defects form. Alignment is performed using the defects themselves as markers, eliminating the need for additional product marking and fundamentally avoiding potential secondary damage caused by such marking. Simultaneously, by narrowing the analysis scope from all MES data to local data at the defect formation stage, the amount of data processing is significantly reduced.
[0043] 3. Compared to traditional RAG solutions, this invention first determines the formation stage of a defect through image alignment and defect stage tracing, narrowing the scope of defect cause investigation from all processes to a single process stage. This allows the RAG system to search only the process knowledge of that stage, significantly reducing the size and complexity of the cause knowledge base and the difficulty of its construction. Furthermore, because the investigation scope is precisely defined, even for defects that may be caused by multiple factors, effective investigation and localization can be achieved by focusing on MES data and process knowledge of a single stage.
[0044] 4. The image similarity calculation scheme based on the hybrid expert model proposed in this invention, through iterative training of multiple expert networks and automatic selection of the most suitable expert network using the MoE module, can adaptively select the optimal similarity calculation strategy for different types and forms of defects. Compared with a single similarity calculation network, it has higher pairing accuracy and stronger generalization ability.
[0045] 5. This invention introduces a cross-attention network into image similarity calculation, which enables the features of two defect images to fully interact at a deeper level, thereby more accurately capturing the morphological correspondence between defects in the preceding and following processes and improving the accuracy of defect pairing.
[0046] 6. This invention uses the template matching MoE module to automatically select the optimal template matching algorithm (NCC, contour matching, SURF matching, or frequency domain matching) based on the input image, avoiding the problem of insufficient adaptability of a single template matching algorithm in different scenarios and improving the alignment accuracy of local fine localization. Attached Figure Description
[0047] Figure 1 This is the overall flowchart of the present invention.
[0048] Figure 2 This is a flowchart of the image similarity calculation steps of the present invention.
[0049] Figure 3 This is a schematic diagram of the overall structure of the similarity network of the present invention.
[0050] Figure 4 This is a flowchart illustrating the overall alignment and positioning process of the present invention. Detailed Implementation
[0051] The present invention will now be described in further detail with reference to the accompanying drawings and preferred embodiments. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0052] Product and manufacturing process description:
[0053] Die-cut products refer to products that are cut from a long, large sheet of film into many identical shapes; the general production process is as follows:
[0054] Membrane transport, similar to a belt conveyor, transports a very long membrane.
[0055] Coating, applying a layer of material onto the film;
[0056] Applying a film involves attaching a layer of film onto the existing film.
[0057] Pressing: pressing several layers of film together into one film;
[0058] Cut into segments; cut the membrane into segments.
[0059] Die-cutting: cutting the film into a fixed shape;
[0060] Note: The above steps may be performed multiple times, and the list only includes some possible steps. In a real production environment, the execution order may vary. Also, please note that root cause analysis is performed after the detection task.
[0061] A quality control method for die-cut products, the overall steps are as follows: Figure 1 As shown:
[0062] I. Constructing a Defect Distribution Map
[0063] 1. Defect distribution baseline map
[0064] In the initial process stage (i.e. before it is cut into segments, when the image is the longest), the coordinates of the detected defects are extracted. The centroid coordinates of each connected region in all defect areas are calculated (region calculation is a mature algorithm; if the detected image is not a region but a rectangle, the center of the rectangle can be used instead of the centroid). These coordinate points are then stitched together. The coordinate system is with the conveying direction as the x-axis and the width direction as the y-axis (usually, a line scan camera continuously images the membrane that is being transported like a conveyor belt. Due to image format and storage limitations, the entire membrane cannot be imaged in one image, as that would be too long; it needs to be segmented, and these segments can be stitched together, which is a mature technology). This set of points with a large span in the x-axis direction is called the defect distribution reference map. That is, the defect distribution map of one stage (the method of making the defect distribution map has been explained above) is selected as the fixed map, and the defect distribution maps of other stages are aligned with this defect distribution map. In this invention, the defect distribution map of the initial stage, i.e., the first stage, is selected as the reference map.
[0065] 2. Defect distribution map
[0066] Similar point set extraction and stitching operations are performed on the maps of other stages to form defect distribution maps for each stage.
[0067] II. Global Positioning
[0068] 1. Feature Extraction
[0069] Taking the defect distribution baseline map as an example:
[0070] The window is slid across the stitched image (in practice, only the point coordinates are used; the image is virtual. This is efficient, and when the defect distribution is sparse, using a real image would consume too much storage space). The window size depends on the specific situation. In this invention, the line scan resolution is 4K, the window size is 512*512, and windows with more than 5 points are retained. During the sliding process, local non-maximum suppression is performed, that is, when the retained windows overlap, the window with the most points is retained. There are two cases in this case:
[0071] (1) If there is only one window with the most retained points, then select that window;
[0072] (2) When there are multiple windows with the same number of retention points, and all of them are windows with the most retention points, select the window with the most retention points that is in the middle of all windows (including the window with the most retention points and other windows with other retention points);
[0073] The points within the selected window are used as vertices and connected to form polygons, which are used as feature shapes for the next step of feature matching.
[0074] There are many ways to construct shape features by connecting points within a window into polygons; the methods that have been invented and used are as follows:
[0075] (1) Find the coordinates of the center point of all points;
[0076] (2) Select the point farthest from the center point as the starting point;
[0077] (3) Starting from the starting point, connect all the remaining points counterclockwise to form a polygon;
[0078] For the defect distribution maps of other stages, feature extraction is also performed using the defect distribution baseline map as an example.
[0079] 2. Feature matching
[0080] For each stage of polygon shape features, a matching window is found in the shape features on the defect distribution reference map using a template matching algorithm with rotation, translation, and scaling (this template matching algorithm is mature, and the one used in this invention is a contour-based template matching algorithm). The matching threshold in this invention is 0.9. Matches without this threshold are considered unsuccessful. If there are multiple matching pairs with scores higher than this threshold, the one with the highest score is selected. For a successfully matched defect point set, the affine transformation matrix that transforms the coordinates of the defect point set to the matching position on the defect distribution reference map is calculated.
[0081] 3. Global positioning
[0082] (1) Fitting the affine transformation matrix
[0083] Taking the affine transformation matrix (multiple) corresponding to a set of matching points (multiple clusters of matching feature points) at a certain stage as an example:
[0084] 1) Randomly generate one coordinate point, with the coordinate range within the 2D space of the defect distribution baseline map. Assume there are n_h affine transformation matrices. Perform affine transformations on the generated coordinate point using these n_h matrices to obtain n_h affine transformation two-dimensional coordinate points. Fit a two-dimensional normal distribution using these two-dimensional coordinate points, calculate the variance and expectation, and remove the matrices corresponding to points whose surrounding distance is more than twice the variance. The remaining matrices are used for subsequent calculations. Assume there are a total of n_h2 matrices used for subsequent calculations.
[0085] 2) Let T be a radial transformation matrix, then the translation part t (2*1) and the rotation part A (2*2) are included;
[0086] , ( , Both are numbers, representing the offsets in the x and y directions respectively. The final translation is: ;
[0087] Perform polar decomposition on the rotating part (the polar decomposition process has a fixed formula): Where x represents matrix multiplication, R is an orthogonal matrix (i.e., the rotation part), and S is a symmetric positive definite matrix (i.e., the scaling part). Both R and S are 2*2 matrices.
[0088] The specific formula for polar decomposition is as follows:
[0089] ;
[0090] , where x represents matrix multiplication;
[0091] Find the rotation angle: ;
[0092] ;
[0093] ;
[0094] ;
[0095] The final linear portion is obtained by recombination: ;
[0096] The final affine transformation matrix is obtained by recombination: ;
[0097] The above steps yield the global affine transformation matrix from the defect distribution map to the defect distribution baseline map corresponding to the current process. If higher accuracy is desired, more points can be randomly generated, more affine transformation matrices can be calculated, and then the above steps can be iterated again. The purpose of this step in this invention is coarse positioning, so no further iteration is performed.
[0098] The defect distribution maps of other stages are also obtained by the above method to obtain the corresponding global affine transformation matrix. Except for the defect distribution baseline map, the defect distribution maps of all other stages are affine transformed through their global affine transformation matrix to achieve global positioning, that is, preliminary alignment.
[0099] III. Local Precision Positioning
[0100] Taking adjacent bright phases as an example, let phase a be the previous phase of phase b:
[0101] At this point, the defect distribution maps for each stage have been aligned with the defect distribution baseline map.
[0102] 1. Defect Clustering
[0103] Cluster the defects in the defect distribution map of stage b. The clustering method is as follows:
[0104] (1) Divide the defects on the defect distribution map into two parts: the selected window part and the unselected part;
[0105] (2) Use the KNN clustering method, that is, each unselected defect is clustered with the window part closest to it. Suppose that the current stage is clustered into n_k classes, that is, the current defect distribution map is divided into n_k blocks, and the selected window part defect in each block is called the central defect.
[0106] 2. Defect pairing
[0107] Perform the following operation on each block in stage b:
[0108] Find the portion of the defect distribution map of stage a corresponding to the area of this block (which has already been globally aligned), and expand this portion of the area outward (in this invention, it is expanded by 50 pixels, which is achieved by region dilation). The area on the defect distribution map of stage a after expansion is called the search area.
[0109] The defect image corresponding to the central defect in the current block (called stage b image) is compared with the defect images in the search area (called stage a image) by calculating image similarity, and the stage a image that best matches the stage b image is obtained.
[0110] The steps for image similarity calculation are as follows: Figure 2 As shown:
[0111] The similarity MoE module modifies the output of ResNet-18 into an n_s classification header, where n_s is the number of similarity networks; in this invention, n_s = 5.
[0112] The overall structure of the similarity network is as follows: Figure 3 As shown;
[0113] (1) Convolutional encoder
[0114] Assuming the input image has 3 channels (single-channel images are also first converted to 3 channels), with a width of W and a height of H, the structure of the convolutional encoder is as follows:
[0115] 1) Convolution
[0116] The convolutional kernel size is 3*3, the stride is 2, followed by a BN layer, and the activation function is ReLU.
[0117] Input: 3*W*H, Output: 32*W / 2*H / 2;
[0118] 2) Separable convolution
[0119] The convolution kernel size is 3x3, and the stride is 2.
[0120] Input: 32*W / 2*H / 2; Output: 64*W / 4*H / 4; Activation function: ReLU;
[0121] 3) Separable convolution
[0122] The convolution kernel size is 3x3, and the stride is 2.
[0123] Input: 64*W / 4*H / 4, Output: 128*W / 8*H / 8, Activation function is ReLU;
[0124] 4) Separable convolution
[0125] The convolution kernel size is 3x3, and the stride is 2.
[0126] Input: 128*W / 8*H / 8, Output: 256*W / 16*H / 16, Activation function: ReLU;
[0127] The image Image (3*W*H) is input into the convolutional encoder to obtain a feature map of 256*W / 16*H / 16 (3D). The channels of the feature map are flattened to obtain a feature vector group of 256*N (where N=(W*H) / (16*16)) (2D).
[0128] In the above sections, the activation function in the final output is ReLU.
[0129] (2) Cross-attention network
[0130] The input consists of two images, which are fed into a convolutional encoder to obtain features (2*256*N). The output is 2*256*N dimensional features. There are two heads, and two such cross-attention layers are used (which are very common in neural networks). The final output is 2*256*N.
[0131] (3) Output layer
[0132] 1) Global average pooling
[0133] The input is 2*256*N, and the output is 2*256;
[0134] 2) Relationship Modeling
[0135] Let gA and gB be two 256-dimensional vectors respectively;
[0136] Then the relation features
[0137] This represents the absolute value of the difference between the numerical values of corresponding dimensions of a vector. The first operation represents the multiplication of the corresponding dimensions of the vectors. Each of the two operations results in a 256-dimensional vector. The second operation represents the concatenation operation, resulting in a 512-dimensional vector.
[0138] 3) Output
[0139] Fully connected layer: Input: 512 dimensions, Output: 64 dimensions, Activation function: ReLU;
[0140] Fully connected layer: Input: 64-dimensional, Output: 16-dimensional, Activation function: ReLU;
[0141] Fully connected layer: Input: 16-dimensional, Output: 1-dimensional, Activation function: sigmoid;
[0142] The above describes the network structure, the method for calculating image similarity, and the network's reasoning process.
[0143] The above networks only need to be trained once during construction, and once trained, they can be used in various scenarios. The following is the training process of the network:
[0144] 1) First, collect small images of defects at different stages of die-cut products in various scenarios. Then, group the imaging effects of the same defect at different stages into a positive sample group and group the imaging effect images of different defects into a positive sample group, thereby obtaining multiple positive and negative samples from the data.
[0145] 2) Train an image similarity calculation network;
[0146] 3) After training for a certain number of rounds (50 rounds in this invention), all sample data are then input into the similarity calculation network for prediction. Positive samples with similarity scores above the threshold t_s (t_s = 0.95 in this invention) are used as the network's exclusive samples.
[0147] 4) These dedicated samples will be used to train the MoE module, and the label will be the class of the network corresponding to the dedicated sample (such as network 0, network 1, etc.).
[0148] 5) Initialize another similarity calculation network, and use the remaining samples as in the previous steps to obtain the exclusive samples for the current similarity calculation network. Then train the MoE module using the exclusive samples of the current network.
[0149] 6) Iterate through the above steps until you get n_s similarity calculation networks. Note: When training the last similarity calculation network, all the remaining samples are exclusive to this network and no longer need to be selected using a threshold.
[0150] 7) Once the MoE module and the similarity calculation network are trained, defective small images can be paired by measuring the similarity between images.
[0151] 3. Template matching
[0152] like Figure 4 As shown:
[0153] 1) The image of the current block is called the template (e.g., when aligning the image of the second stage to the image of the first stage, a local image block on the image of the second stage is called the template image. Using the template, a matching image block is found on the image of the first stage, thereby obtaining the positioning, translation, rotation, and scaling parameters required for aligning the image of the second stage to the image of the first stage); input the template matching MoE module to obtain a suitable template matching method (including NCC, contour-based matching, SURF feature-based matching, and frequency domain-based matching, a total of 3 methods);
[0154] 2) Using the obtained appropriate template matching algorithm, perform template matching on the small image of stage b around the small image of stage a to obtain the matching affine transformation matrix. Then, parse the affine transformation of the current block according to the affine transformation sentence to achieve the alignment of the block region from stage b to stage a.
[0155] Following the above method, each block of stage b is aligned with stage a, thereby achieving precise positioning and alignment of the defect area from stage b to stage a.
[0156] In addition, except for the defect distribution baseline map, which is the initial stage, all other stages are aligned with the previous stages in the same way as described above.
[0157] The template matching MoE module and the similarity calculation MoE module have the same structure, except that the output header is changed to 3 categories.
[0158] Training method for the template matching MoE module (which only needs to be trained once and can be reused after training):
[0159] 1) Collect defect imaging images at each stage in various application scenarios. Each defect imaging image at the current stage and the corresponding imaging image at the previous stage constitute a sample.
[0160] 2) Using NCC, based on contour matching, SURF feature matching, and frequency domain matching, the collected samples are template matched. The template matching algorithm with the highest matching accuracy is selected as the label for each sample. The defect map of the current stage is used as the data to form a sample for training the template matching MoE module.
[0161] 3) Following the above method, obtain multiple training templates that match the MoE module, and then use them to train the MoE module. The end standard for training in this invention is that the accuracy reaches 99% or higher.
[0162] IV. Defect Cause Stage Analysis
[0163] After the alignment process, each defect can be located in the previous stage. When a defect needs to be analyzed, we can trace back from the current stage until a previous stage does not have a defect at that location (called the defect disappearance stage). Then the defect was formed in the stage after the defect disappearance stage.
[0164] By following the above methods, the formation stage of the defect can be determined.
[0165] V. Root Cause Analysis of Defects
[0166] After determining the formation stage of the defect, the MES monitoring data for that stage is analyzed. The defect category, shape, severity, and other information, along with the MES monitoring data, are used as input to the RAG system. Relevant defect cause analysis knowledge is retrieved from the cause knowledge base and sent to the large language model for processing, thereby summarizing the root cause of the defect (RAG technology is a mature technology).
[0167] VI. Output Quality Control Strategy
[0168] The root cause is input into the RAG system, which retrieves targeted solutions from the quality control strategy knowledge base. These solutions are then input into the large language model, which summarizes suggested solutions, thus obtaining a quality control strategy for the current defect.
[0169] The above description is merely a specific embodiment of the present invention. Various examples and illustrations do not constitute a limitation on the substantive content of the present invention. Those skilled in the art can make modifications or variations to the specific embodiments described above after reading the specification, without departing from the essence and scope of the invention.
Claims
1. A quality control method for die-cut products, characterized in that: Includes the following steps: Construct a defect distribution map for each production stage: perform defect detection on the film material imaging of each production stage of the die-cut product, extract the coordinate points of each defect and stitch them together to form a defect point set distribution map corresponding to each production stage, and select the defect distribution map of the initial production process stage as the defect distribution benchmark map. Global positioning and alignment: Extract shape features from the defect distribution map at each stage, and match it with the defect distribution baseline map by template matching that supports rotation, translation and scaling. Fit the global affine transformation matrix from the defect distribution map at each stage to the baseline map to complete the global coarse alignment of the defect distribution map at each stage. Local fine positioning and alignment: According to the production process sequence, the defect distribution map of the later stage in two adjacent stages is divided into blocks and clustered. The defect small map similarity matching and template matching are performed between each block and the corresponding area of the previous stage to obtain the affine transformation parameters of the local blocks and complete the local fine alignment of each block. Defect formation stage determination: Tracing back along the production process to the corresponding position of each defect in the previous stage, the production stage in which the defect first appears is determined as the formation stage of the defect. Defect Root Cause Analysis and Quality Control Output: Combining production monitoring data and defect attributes at the defect formation stage, the root causes of defects and corresponding quality control strategies are generated through a knowledge base and a large language model.
2. The quality control method for die-cut products as described in claim 1, characterized in that: The construction of defect distribution maps for each production stage specifically includes: Extract the centroid coordinates of each connected region of the defect, or the center coordinates of the defect detection rectangle; establish a coordinate system with the film material conveying direction as the x-axis and the width direction as the y-axis, and stitch the defect coordinates of the segmented imaging into a continuous defect point set distribution map; select the defect distribution map of the first process stage in the production process as the defect distribution reference map.
3. The quality control method for die-cut products as described in claim 1, characterized in that: The shape feature extraction step in the global positioning and alignment specifically includes: A sliding window of a preset size is used to traverse and slide across the defect distribution map, retaining windows with more than a preset threshold number of defect points; local non-maximum suppression is performed on overlapping retained windows, retaining the window with the most defect points; when there are multiple windows with the same number of points, the window located in the middle of all windows is selected; all defect points in the retained window are connected to form a polygon, which is used as the shape feature of the window.
4. The quality control method for die-cut products as described in claim 3, characterized in that: The fitting steps for the global affine transformation matrix specifically include: The polygon shape features extracted at each stage are template matched on the defect distribution baseline map to obtain multiple sets of candidate affine transformation matrices. Coordinate points are randomly generated in the two-dimensional space of the baseline map. After transformation by each set of candidate matrices, a two-dimensional normal distribution is fitted, and the variance and expectation are calculated. The matrices corresponding to points whose surrounding distance is more than twice the variance are removed. The mean of the translation components of the remaining candidate matrices is taken, and the rotation components are decomposed and recombined to obtain the final global affine transformation matrix.
5. The quality control method for die-cut products as described in claim 1, characterized in that: The defect clustering and pairing steps in the local fine-positioning alignment specifically include: Defect distribution maps of adjacent preceding and following stages are taken according to the production process sequence. Defect clustering is performed on the defect distribution map of the following stage: the defects in the selected window are taken as the central defects, and the KNN clustering method is used to assign the defects in the unselected window to the nearest central defects, forming multiple defect blocks. For each defect block, the corresponding area of the defect distribution map in the previous stage is expanded outward by a preset number of pixels to form the search area. The defect small image corresponding to the central defect of the defect block is compared with the defect small images in the search area one by one to calculate the image similarity and complete the defect pairing.
6. The quality control method for die-cut products as described in claim 5, characterized in that: The image similarity is calculated using a cross-attention similarity network, which includes a convolutional encoder, a cross-attention layer, and an output layer. The convolutional encoder contains a first-level convolution and a third-level separable convolution, which encodes the input defect small map into a multi-channel feature map and unfolds it into a two-dimensional feature vector group. The cross-attention layer is a two-layer multi-head structure that performs cross-attention feature interaction on the feature vector groups of the two input images; The output layer sequentially goes through global average pooling, concatenation of difference and product features, and multiple fully connected layers, and finally outputs the similarity score after sigmoid activation.
7. The quality control method for die-cut products as described in claim 6, characterized in that: The cross-attention similarity network adopts a hybrid expert MoE architecture, which includes n_s similarity calculation subnetworks and a MoE classification module. Through iterative training, a dedicated sample set is assigned to each similarity calculation subnetwork, and the MoE classification module automatically matches the optimal similarity calculation subnetwork based on the input image.
8. The quality control method for die-cut products as described in claim 5, characterized in that: After defect pairing is completed, the template matching (MoE) module automatically selects the optimal matching algorithm from a variety of preset template matching algorithms. Based on the defect image of the previous stage, template matching is performed on the defect image of the next stage to obtain the local affine transformation parameters of the defect block, thus completing the local fine alignment of the block.
9. The quality control method for die-cut products as described in claim 1, characterized in that: The determination of the defect cause stage specifically includes: After aligning the defect distribution maps for all production stages, trace the corresponding position of the target defect back from the final production stage along the process flow, stage by stage. If the corresponding position of a certain preceding stage does not exist, it is determined that the defect was formed in the production stage following the preceding stage.
10. The quality control method for die-cut products as described in claim 1, characterized in that: The defect root cause analysis and quality control output specifically include: After determining the defect formation stage, the production process monitoring data of that stage is extracted. Combined with the defect's category, shape, and severity attributes, the data is input into a RAG-based causal knowledge base and a large language model to deduce the root cause of the defect. Then, the root cause of the defect is input into a quality control strategy knowledge base and a large language model to generate the corresponding quality control optimization strategy.
Citation Information
Patent Citations
Cutting product production method and cutting system
CN106458495B
Printed matter image registration method based on convolution cross attention mechanism
CN116664633B
