An automatic detection method for packaging patterns based on artificial intelligence

Through the automatic packaging pattern detection method based on artificial intelligence, high-dimensional matrix is ​​constructed using pixel tracking matrix and mask matrix to calculate packaging similarity, solving the problems of inefficient and insufficient accuracy of traditional manual detection methods, and achieving efficient and accurate packaging pattern detection.

CN119131030BActive Publication Date: 2025-03-21山东银广印务科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411606730.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-21
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

Traditional manual testing methods are difficult to efficiently and accurately detect pattern defects in environmentally friendly packaging materials, such as color aberration, printing blur, cracks and deformation, especially in large-scale production lines, which are difficult to meet the needs.

Method used

Automatic detection method of packaging pattern based on artificial intelligence is adopted, and by obtaining normal and real-time packaging patterns, using pixel tracking matrix and mask matrix to build a high-dimensional matrix, calculate the packaging similarity, and judge whether the pattern is qualified.

Benefits of technology

It realizes efficient and accurate automatic detection of packaging patterns, reduces manual intervention, improves detection efficiency, is suitable for various types of packaging patterns, and has high versatility and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131030B_ABST
    Figure CN119131030B_ABST
Patent Text Reader

Abstract

The invention discloses an automatic detection method for packaging patterns based on artificial intelligence, which belongs to the field of image processing technology and includes the following steps: S1, obtaining a normal packaging pattern and photographing a real-time packaging pattern; S2, using a pixel tracking matrix of the real-time packaging pattern and a corresponding mask matrix to construct a high-dimensional matrix for the real-time packaging pattern; S3, using the high-dimensional matrix of the real-time packaging pattern to generate packaging similarity between the normal packaging pattern and the real-time packaging pattern, and determining whether the real-time packaging pattern is qualified. The invention realizes automatic matching and comparison of patterns through image processing technology, does not require manual intervention, greatly improves detection efficiency, is applicable to various types of packaging patterns, and has high versatility and flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing, and in particular relates to an automatic detection method for packaging patterns based on artificial intelligence. Background Art

[0002] With the enhancement of environmental awareness, environmentally friendly packaging materials are increasingly used in the market. However, due to factors such as material properties and production processes, environmentally friendly packaging is prone to various pattern defects such as color difference, blurred printing, cracks and deformation during the production process. These defects not only affect the aesthetics of the product, but may also pose a potential threat to the quality and safety of the product. Traditional manual detection methods have problems such as low efficiency and high missed detection rate, which are difficult to meet the needs of large-scale production lines. Therefore, it is particularly important to develop an efficient and accurate automatic detection method for environmentally friendly packaging patterns. Summary of the invention

[0003] In order to solve the above problems, the present invention proposes an automatic detection method for packaging patterns based on artificial intelligence.

[0004] The technical solution of the present invention is: an automatic detection method for packaging patterns based on artificial intelligence comprises the following steps:

[0005] S1. Obtain a normal packaging pattern and shoot a real-time packaging pattern;

[0006] S2, constructing a high-dimensional matrix for the real-time packaging pattern using a pixel tracking matrix of the real-time packaging pattern and a corresponding mask matrix;

[0007] S3. Using the high-dimensional matrix of the real-time packaging pattern, generate packaging similarity between the normal packaging pattern and the real-time packaging pattern, and determine whether the real-time packaging pattern is qualified.

[0008] Furthermore, S2 includes the following sub-steps:

[0009] S21, performing convolution processing on the real-time packaging pattern using a mean filter to obtain a smooth packaging pattern;

[0010] S22, filling the pixel values ​​of the pixel points in the smooth packaging pattern into the pixel tracking matrix;

[0011] S23, determining the mask value corresponding to each element in the pixel tracking matrix, and filling the mask value into the mask matrix;

[0012] S24, extracting the number of non-zero values ​​in each row of the mask matrix as the update weight of each row;

[0013] S25, using the update weight of each row of the mask matrix and the pixel tracking matrix to obtain a high-dimensional matrix of the real-time packaging pattern.

[0014] The beneficial effect of the above further scheme is that: in the present invention, the number of rows and columns of the pixel tracking matrix and the mask matrix are the same as the number of pixel rows and columns of the real-time packaging pattern. The pixel values ​​processed by the filter are filled into the pixel tracking matrix, and the image can be smoothed and noise can be removed. The mask matrix corresponding to the pixel tracking matrix can be used for image enhancement and image masking tasks. By specifying the binary value of each pixel point, a high-dimensional matrix of the real-time packaging pattern is obtained, which reflects the global pixel of the packaging pattern.

[0015] Further, in S21, the pixel value y of the pixel point in the smoothing packaging pattern is * The calculation formula is: ; Where y represents the pixel value of the pixel at the same position in the real-time packaging pattern, represents the mean pixel value of the four neighboring pixels corresponding to the pixel at the same position in the real-time packaging pattern, tanh(·) represents the hyperbolic tangent function, w represents the weight of the convolution kernel corresponding to the mean filter, and b represents the bias of the convolution kernel corresponding to the mean filter.

[0016] Further, in S23, the mask value r corresponding to the element in the hth row and the kth column in the pixel tracking matrix h,k The calculation formula is: ; In the formula, x h,k represents the element in the hth row and kth column of the pixel tracking matrix, x h-1,k-1 represents the element in the h-1th row and k-1th column of the pixel tracking matrix, x h+1,k-1 represents the element in the h+1th row and k-1th column of the pixel tracking matrix, x h-1,k+1 represents the element in the h-1th row and k+1th column of the pixel tracking matrix, x h+1,k+1 Represents the element in the h+1th row and k+1th column in the pixel tracking matrix.

[0017] Furthermore, in S24, the expression of the high-dimensional matrix is: ; where Y represents the pixel tracking matrix, α1 represents the update weight of the first row in the mask matrix, and α m represents the update weight of the mth row in the mask matrix, α M represents the update weight of the Mth row in the mask matrix, R 11 Represents the element in row 1 and column 1 of the mask matrix, R 1n Represents the element in row 1 and column n in the mask matrix, R 1N Represents the element in row 1 and column N in the mask matrix, R m1 Represents the element in the mth row and first column of the mask matrix, R mn Represents the element in the mth row and nth column of the mask matrix, R mN Represents the element in the mth row and Nth column of the mask matrix, R M1Represents the element in the Mth row and the first column of the mask matrix, R Mn Represents the element in the Mth row and nth column of the mask matrix, R MN Represents the element in the Mth row and Nth column of the mask matrix.

[0018] Furthermore, S3 includes the following sub-steps:

[0019] S31, extracting the L1 norm of the high-dimensional matrix;

[0020] S32, extracting the maximum value of each row in the high-dimensional matrix as the similarity coefficient corresponding to each row in the real-time packaging pattern;

[0021] S33, calculating the similarity between the pixel points of the real-time packaging pattern and the corresponding pixel points in the normal packaging pattern according to the L1 norm of the high-dimensional matrix and the similarity coefficient of each row in the real-time packaging pattern;

[0022] S34. Generate packaging similarity between the normal packaging pattern and the real-time packaging pattern according to the similarity between each pixel point of the real-time packaging pattern and each corresponding pixel point in the normal packaging pattern, and determine whether the real-time packaging pattern is qualified.

[0023] The beneficial effect of the above further scheme is that in the present invention, the size of the normal packaging pattern and the real-time packaging pattern can be revised so that the two patterns have the same size. The high-dimensional matrix is ​​generated through filtering and masking operations, and the Manhattan distance of each pixel point in the two images is corrected by the characteristic parameters of the high-dimensional matrix to obtain the similarity between the patterns, and the qualified pattern detection is completed by the threshold that can be set manually.

[0024] Furthermore, in S33, the calculation formula of the similarity S between the pixel points of the real-time packaging pattern and the corresponding pixel points in the normal packaging pattern is: ; Where s represents the similarity coefficient of the row where the pixel of the real-time packaging pattern is located, L1 represents the L1 norm of the high-dimensional matrix, rand(0,1) represents a random number generated between 0 and 1, p1 represents the pixel value of the pixel of the real-time packaging pattern, p2 represents the pixel value of the corresponding pixel in the normal packaging pattern, and D(·) represents the Manhattan distance function.

[0025] Furthermore, in S34, the mean of all similarities is calculated as the packaging similarity between the normal packaging pattern and the real-time packaging pattern. If the packaging similarity is greater than or equal to the threshold, the real-time packaging pattern is qualified, otherwise the real-time packaging pattern is unqualified.

[0026] The beneficial effects of the present invention are as follows: the present invention utilizes the characteristic matrix of the real-time packaging pattern to calculate the similarity between the real-time packaging pattern and the preset normal packaging pattern, and determines whether the real-time packaging pattern is qualified, and the determination process combines the similarity of specific pixel points; the present invention realizes automatic matching and comparison of patterns through image processing technology, without manual intervention, greatly improving the detection efficiency, being applicable to various types of packaging patterns, and having high versatility and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 The flowchart of the automatic detection method of packaging patterns based on artificial intelligence. DETAILED DESCRIPTION

[0028] The embodiments of the present invention will be further described below in conjunction with the accompanying drawings.

[0029] like Figure 1 As shown, the present invention provides an automatic detection method for packaging patterns based on artificial intelligence, comprising the following steps:

[0030] S1. Obtain a normal packaging pattern and shoot a real-time packaging pattern;

[0031] S2, constructing a high-dimensional matrix for the real-time packaging pattern using a pixel tracking matrix of the real-time packaging pattern and a corresponding mask matrix;

[0032] S3. Using the high-dimensional matrix of the real-time packaging pattern, generate packaging similarity between the normal packaging pattern and the real-time packaging pattern, and determine whether the real-time packaging pattern is qualified.

[0033] In this embodiment of the present invention, S2 includes the following sub-steps:

[0034] S21, performing convolution processing on the real-time packaging pattern using a mean filter to obtain a smooth packaging pattern;

[0035] S22, filling the pixel values ​​of the pixel points in the smooth packaging pattern into the pixel tracking matrix;

[0036] S23, determining the mask value corresponding to each element in the pixel tracking matrix, and filling the mask value into the mask matrix;

[0037] S24, extracting the number of non-zero values ​​in each row of the mask matrix as the update weight of each row;

[0038] S25, using the update weight of each row of the mask matrix and the pixel tracking matrix to obtain a high-dimensional matrix of the real-time packaging pattern.

[0039] In the present invention, the number of rows and columns of the pixel tracking matrix and the mask matrix are the same as the number of pixel rows and columns of the real-time packaging pattern. The pixel values ​​processed by the filter are filled into the pixel tracking matrix, and the image can be smoothed and noise can be removed. The mask matrix corresponding to the pixel tracking matrix can be used for image enhancement and image masking tasks. By specifying the binary value of each pixel point, a high-dimensional matrix of the real-time packaging pattern is obtained, which reflects the global pixels of the packaging pattern.

[0040] In the embodiment of the present invention, in S21, the pixel value y of the pixel point in the smoothing packaging pattern is * The calculation formula is: ; Where y represents the pixel value of the pixel at the same position in the real-time packaging pattern, represents the mean pixel value of the four neighboring pixels corresponding to the pixel at the same position in the real-time packaging pattern, tanh(·) represents the hyperbolic tangent function, w represents the weight of the convolution kernel corresponding to the mean filter, and b represents the bias of the convolution kernel corresponding to the mean filter.

[0041] In the embodiment of the present invention, in S23, the mask value r corresponding to the element in the hth row and the kth column in the pixel tracking matrix h,k The calculation formula is: ; In the formula, x h,k represents the element in the hth row and kth column of the pixel tracking matrix, x h-1,k-1 represents the element in the h-1th row and k-1th column of the pixel tracking matrix, x h+1,k-1 represents the element in the h+1th row and k-1th column of the pixel tracking matrix, x h-1,k+1 represents the element in the h-1th row and k+1th column of the pixel tracking matrix, x h+1,k+1 Represents the element in the h+1th row and k+1th column in the pixel tracking matrix.

[0042] In the embodiment of the present invention, in S24, the expression of the high-dimensional matrix is: ; where Y represents the pixel tracking matrix, α1 represents the update weight of the first row in the mask matrix, and α m represents the update weight of the mth row in the mask matrix, α M represents the update weight of the Mth row in the mask matrix, R 11 Represents the element in row 1 and column 1 of the mask matrix, R 1n Represents the element in row 1 and column n in the mask matrix, R 1N Represents the element in row 1 and column N in the mask matrix, R m1 Represents the element in the mth row and first column of the mask matrix, R mn Represents the element in the mth row and nth column of the mask matrix, R mN Represents the element in the mth row and Nth column of the mask matrix, R M1Represents the element in the Mth row and the first column of the mask matrix, R Mn Represents the element in the Mth row and nth column of the mask matrix, R MN Represents the element in the Mth row and Nth column of the mask matrix.

[0043] In this embodiment of the present invention, S3 includes the following sub-steps:

[0044] S31, extracting the L1 norm of the high-dimensional matrix;

[0045] S32, extracting the maximum value of each row in the high-dimensional matrix as the similarity coefficient corresponding to each row in the real-time packaging pattern;

[0046] S33, calculating the similarity between the pixel points of the real-time packaging pattern and the corresponding pixel points in the normal packaging pattern according to the L1 norm of the high-dimensional matrix and the similarity coefficient of each row in the real-time packaging pattern;

[0047] S34. Generate packaging similarity between the normal packaging pattern and the real-time packaging pattern according to the similarity between each pixel point of the real-time packaging pattern and each corresponding pixel point in the normal packaging pattern, and determine whether the real-time packaging pattern is qualified.

[0048] In the present invention, the size of the normal packaging pattern and the real-time packaging pattern can be revised so that the two patterns have the same size. The high-dimensional matrix is ​​generated through filtering and masking operations. The Manhattan distance of each pixel in the two images is corrected by the characteristic parameters of the high-dimensional matrix to obtain the similarity between the patterns, and the qualified pattern detection is completed by the threshold that can be set manually.

[0049] In the embodiment of the present invention, in S33, the calculation formula of the similarity S between the pixel points of the real-time packaging pattern and the corresponding pixel points in the normal packaging pattern is: ; Where s represents the similarity coefficient of the row where the pixel of the real-time packaging pattern is located, L1 represents the L1 norm of the high-dimensional matrix, rand(0,1) represents a random number generated between 0 and 1, p1 represents the pixel value of the pixel of the real-time packaging pattern, p2 represents the pixel value of the corresponding pixel in the normal packaging pattern, and D(·) represents the Manhattan distance function.

[0050] In the embodiment of the present invention, in S34, the mean of all similarities is calculated as the packaging similarity between the normal packaging pattern and the real-time packaging pattern. If the packaging similarity is greater than or equal to the threshold, the real-time packaging pattern is qualified, otherwise the real-time packaging pattern is unqualified.

[0051] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. An automatic detection method for packaging patterns based on artificial intelligence, characterized in that: The following steps are involved: S1. Obtain a normal packaging pattern and shoot a real-time packaging pattern; S2, constructing a high-dimensional matrix for the real-time packaging pattern using a pixel tracking matrix of the real-time packaging pattern and a corresponding mask matrix; S3, using the high-dimensional matrix of the real-time packaging pattern, generating packaging similarity between the normal packaging pattern and the real-time packaging pattern, and determining whether the real-time packaging pattern is qualified; The S2 comprises the following sub-steps: S21, performing convolution processing on the real-time packaging pattern using a mean filter to obtain a smooth packaging pattern; S22, filling the pixel values ​​of the pixel points in the smooth packaging pattern into the pixel tracking matrix; S23, determining the mask value corresponding to each element in the pixel tracking matrix, and filling the mask value into the mask matrix; S24, extracting the number of non-zero values ​​in each row of the mask matrix as the update weight of each row; S25, using the update weight of each row of the mask matrix and the pixel tracking matrix to obtain a high-dimensional matrix of the real-time packaging pattern; In S21, the pixel value y of the pixel point in the smoothing packaging pattern is * The calculation formula is: ; Where y represents the pixel value of the pixel at the same position in the real-time packaging pattern, represents the mean pixel value of the four neighboring pixels corresponding to the pixel at the same position in the real-time packaging pattern, tanh(·) represents the hyperbolic tangent function, w represents the weight of the convolution kernel corresponding to the mean filter, and b represents the bias of the convolution kernel corresponding to the mean filter; In S23, the mask value r corresponding to the element in the hth row and the kth column in the pixel tracking matrix h,k The calculation formula is: ; In the formula, x h,k represents the element in the hth row and kth column of the pixel tracking matrix, x h-1,k-1 represents the element in the h-1th row and k-1th column of the pixel tracking matrix, x h+1,k-1 represents the element in the h+1th row and k-1th column of the pixel tracking matrix, x h-1,k+1 represents the element in the h-1th row and k+1th column of the pixel tracking matrix, x h+1,k+1 Represents the element in the h+1th row and k+1th column in the pixel tracking matrix; In S24, the expression of the high-dimensional matrix is: ; where Y represents the pixel tracking matrix, α1 represents the update weight of the first row in the mask matrix, and α m represents the update weight of the mth row in the mask matrix, α M represents the update weight of the Mth row in the mask matrix, R 11 Represents the element in row 1 and column 1 of the mask matrix, R 1n Represents the element in row 1 and column n in the mask matrix, R 1N Represents the element in row 1 and column N in the mask matrix, R m1 Represents the element in the mth row and first column of the mask matrix, R mn Represents the element in the mth row and nth column of the mask matrix, R mN Represents the element in the mth row and Nth column of the mask matrix, R M1 Represents the element in the Mth row and the first column of the mask matrix, R Mn Represents the element in the Mth row and nth column of the mask matrix, R MN Represents the element in the Mth row and Nth column of the mask matrix.

2. The method for automatic detection of packaging patterns based on artificial intelligence according to claim 1, characterized in that: The S3 comprises the following sub-steps: S31, extracting the L1 norm of the high-dimensional matrix; S32, extracting the maximum value of each row in the high-dimensional matrix as the similarity coefficient corresponding to each row in the real-time packaging pattern; S33, calculating the similarity between the pixel points of the real-time packaging pattern and the corresponding pixel points in the normal packaging pattern according to the L1 norm of the high-dimensional matrix and the similarity coefficient of each row in the real-time packaging pattern; S34. Generate packaging similarity between the normal packaging pattern and the real-time packaging pattern according to the similarity between each pixel point of the real-time packaging pattern and each corresponding pixel point in the normal packaging pattern, and determine whether the real-time packaging pattern is qualified.

3. The method for automatic detection of packaging patterns based on artificial intelligence according to claim 2, characterized in that: In S33, the calculation formula of the similarity S between the pixel points of the real-time packaging pattern and the corresponding pixel points in the normal packaging pattern is: ; Where s represents the similarity coefficient of the row where the pixel of the real-time packaging pattern is located, L1 represents the L1 norm of the high-dimensional matrix, rand(0,1) represents a random number generated between 0 and 1, p1 represents the pixel value of the pixel of the real-time packaging pattern, p2 represents the pixel value of the corresponding pixel in the normal packaging pattern, and D(·) represents the Manhattan distance function.

4. The method for automatic detection of packaging patterns based on artificial intelligence according to claim 2, characterized in that: In S34, the average of all similarities is calculated as the packaging similarity between the normal packaging pattern and the real-time packaging pattern. If the packaging similarity is greater than or equal to the threshold, the real-time packaging pattern is qualified, otherwise the real-time packaging pattern is unqualified.

Citation Information

Patent Citations

  • Intelligent control method and system for quality inspection of printing ink presswork

    CN117576101A

  • Carbon nanotube image processing method based on neural network algorithm

    CN117788843A