Two-dimensional code watermark commodity anti-counterfeiting method and system

Through the improved WGAN algorithm, graphic watermarks are embedded in the QR code anti-counterfeiting technology, and the attention mechanism is used to fusion of features, solving the problems of unstable watermark embedding effect and insufficient extraction robustness, achieving high-quality watermark embedding and accurate extraction, and improving the anti-counterfeiting ability of the product.

CN120012810APending Publication Date: 2025-05-16INST OF ADVANCED TECH UNIV OF SCI & TECH OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411889811.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the existing QR code anti-counterfeiting technology, the watermark embedding effect is unstable, the extraction robustness is insufficient, and the QR code is easily forged.

Method used

The improved WGAN algorithm is used to embed the graphic watermark into the QR code, and feature fusion is performed in the generator by introducing an attention mechanism, combining the discriminator to evaluate the embedding effect, improving the robustness of the watermark embedding and the accuracy of extraction.

Benefits of technology

It significantly improves the image quality of watermark embedding, enhances the robustness and extraction accuracy of watermarks, prevents QR codes from being forged, and improves the anti-counterfeiting ability of products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012810A_ABST
    Figure CN120012810A_ABST
Patent Text Reader

Abstract

The invention discloses a two-dimensional code watermark commodity anti-counterfeiting method and system. The method comprises the following steps: collecting commodity production information; converting the commodity production information into a character string format, and generating a key by using a digest algorithm; generating a two-dimensional code according to the generated key; generating watermark information according to the commodity information, encoding the watermark information into binary data, and generating a graphic watermark by using a graphic processing library; an improved WGAN algorithm is applied to embed the graph watermark into the two-dimensional code, and a fused image is obtained; and extracting a graphic watermark from the fused image, if the graphic watermark cannot be extracted, determining that the product is a counterfeit and shoddy product, if the graphic watermark can be extracted, decoding a key in the two-dimensional code and commodity information contained in the watermark through a deep learning decoder network, comparing with information in a database, and if the comparison fails, determining that the product is a counterfeit and shoddy product. And if the comparison is successful, obtaining the production information of the product, and marking the scanning times and the scanning place, thereby effectively preventing the circulation of counterfeit and shoddy commodities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of commodity anti-counterfeiting, and in particular to a method and system for commodity anti-counterfeiting with a two-dimensional code watermark. Background Art

[0002] With the rapid development of information technology and the globalization of commodity circulation, commodity anti-counterfeiting technology has become particularly important in economic activities. Currently, the widely used commodity anti-counterfeiting technologies include laser anti-counterfeiting labels, invisible ink, barcodes, etc. However, these traditional anti-counterfeiting methods have problems such as high production costs, low replication technology thresholds, and expensive identification equipment.

[0003] Two-dimensional code technology has gradually become a popular means of commodity anti-counterfeiting due to its advantages such as high information capacity, easy generation and reading. However, most traditional two-dimensional code anti-counterfeiting methods directly embed anti-counterfeiting information into the content of the two-dimensional code, which lacks additional security guarantees and is easy to be copied and tampered with. At the same time, in order to further improve the security of two-dimensional code anti-counterfeiting technology, methods of embedding watermarks into two-dimensional code images have gradually emerged in recent years, but these methods usually rely on complex image processing technology and cannot effectively resist tampering or noise interference. In addition, watermark embedding and extraction algorithms designed based on traditional rules have obvious limitations in terms of robustness and adaptability.

[0004] With the rapid development of deep learning technology, it has shown excellent performance in the fields of image generation, embedding and extraction. The generative adversarial network (GAN) based on neural network is particularly suitable for processing image information embedding and extraction problems, providing a new solution for QR code anti-counterfeiting. By using deep learning technology to model the process of embedding and extracting watermarks in QR codes, the robustness of watermark embedding and the accuracy of extraction can be significantly improved, while maintaining the readability of the QR code.

[0005] The invention patent with patent publication number CN114493972A discloses an adversarial generative network copyright protection method. In this patent, the trigger set and the training task image are sent to the adversarial generative network for training to obtain a network model with a watermark. However, the generator in WGAN generally uses a convolutional neural network, which is a local operation and cannot capture the overall structural information of the QR code image. Summary of the invention

[0006] The technical problem to be solved by the present invention is to solve the problem of low image quality of the current generator network watermark embedded in the QR code.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] A two-dimensional code watermark commodity anti-counterfeiting method, comprising:

[0009] Production stage:

[0010] Collect commodity production information;

[0011] Convert product production information into string format and use digest algorithm to generate key;

[0012] Generate a QR code based on the generated key;

[0013] Generate watermark information according to product information, encode the watermark information into binary data, and use a graphics processing library to generate a graphic watermark;

[0014] The improved WGAN algorithm is applied to embed the graphic watermark into the QR code to obtain the fused image;

[0015] Market launch phase:

[0016] The graphic watermark is extracted from the fused image. If the graphic watermark cannot be extracted, it is a counterfeit product. If the graphic watermark can be extracted, the key in the QR code and the product information contained in the watermark are decoded by the deep learning decoder network at the same time, and compared with the information in the database. If the comparison fails, it is a counterfeit product. If the comparison is successful, the production information of the product is obtained, and the number of scans and the scanning location are marked.

[0017] In one embodiment of the present invention, a network framework of an improved WGAN algorithm includes a generator and a discriminator; wherein the generator introduces an attention mechanism to fuse features of a graphic watermark and a two-dimensional code, and the discriminator is used to evaluate the embedding effect.

[0018] In one embodiment of the present invention, the network framework of the generator includes: a first convolutional network, a second convolutional network, a concatenation network, a self-attention network, and a transposed convolutional network;

[0019] The QR code is input into the first convolutional network for feature extraction to obtain the image feature F Q ; The graphic watermark is input into the second convolutional network for feature extraction to obtain the image feature F W ;

[0020] Image feature F Q and image features F W After merging through the splicing network, the splicing feature F is obtained in ;

[0021] The splicing feature F in Input into the self-attention network, perform global feature fusion, and obtain the fusion feature F out ;

[0022] The fusion feature F out The size is gradually restored through the transposed convolutional network, and the fused image Q is outputW .

[0023] In one embodiment of the present invention, the fusion feature F out Obtained by the following formula:

[0024]

[0025] Q=W Q F in ,K=W K F in ,V=W V F in ;

[0026] In the formula, Softmax is represented as the activation function, Q, K, and V are the query, key, and value of the attention mechanism, and d k Denoted as the dimension of the key vector, W Q , W K , W V They represent the learnable weight parameters corresponding to query, key, and value respectively, and T represents transpose.

[0027] In one embodiment of the present invention, the discriminator estimates the upper and lower bounds of the Wasserstein distance in the WGAN algorithm, and the optimization objectives are as follows:

[0028]

[0029] Where, L D It is represented as the optimization goal of estimating the upper and lower bounds of the Wasserstein distance, D(x) is represented as the score of the discriminator on the original two-dimensional code image, and D(G(z)) is represented as the score of the discriminator on the fused image. Expressed as probability distribution P r expectations, Expressed as probability distribution P z expectations.

[0030] In one embodiment of the present invention, a gradient penalty is used as a constraint condition of the discriminator; wherein the constraint condition L GP for:

[0031]

[0032] In the formula, Represented as the weighted original QR code image, ∥·∥ 2 Expressed as the 2-norm, It is represented as the gradient operation, α is represented as the weight coefficient, Represented as a weighted sample The corresponding probability distribution P r expectations.

[0033] In one embodiment of the present invention, the loss function Loss of the discriminator G , expressed by the following formula: Loss G =L D +L GP .

[0034] In one embodiment of the present invention, in the generator, the L2 norm is used to measure the fusion image Q W Compared with the original QR code image Q 0 Pixel-level difference, training loss function Loss C , the formula is as follows: In the formula, Expressed in L2 form.

[0035] In one embodiment of the present invention, at the market launch stage, an extractor network consisting of several convolutional layers is applied to extract the graphic watermark from the fused image; and the L2 paradigm is used to measure the extracted graphic watermark W m With the original graphic watermark W 0 The pixel-level difference between the training loss function Loss s The formula is as follows:

[0036] The present invention also provides a two-dimensional code watermark commodity anti-counterfeiting system, which uses the above-mentioned two-dimensional code watermark commodity anti-counterfeiting method, comprising:

[0037] Information collection module, used to collect commodity production information;

[0038] The key generation module is used to convert the product production information into a string format and use a digest algorithm to generate a key;

[0039] A QR code generation module, used to generate a QR code according to the generated key;

[0040] A watermark generation module is used to generate watermark information according to product information, encode the watermark information into binary data, and generate a graphic watermark using a graphic processing library;

[0041] The watermark embedding module is used to apply the improved WGAN algorithm to embed the graphic watermark into the QR code and obtain the fused image;

[0042] The QR code recognition module is used to extract the graphic watermark from the fused image. If the graphic watermark cannot be extracted, it is a counterfeit product. If the graphic watermark can be extracted, the key in the QR code and the product information contained in the watermark are decoded through the deep learning decoder network at the same time, and compared with the information in the database. If the comparison fails, it is a counterfeit product. If the comparison is successful, the production information of the product is obtained, and the number of scans and the scanning location are marked.

[0043] Compared with the prior art, the beneficial effects of the present invention are as follows: the generator in the traditional WGAN uses a convolutional neural network, which is a local operation and cannot capture the overall structural information of the two-dimensional code image. Therefore, the present invention introduces attention in the network of the generator G and focuses on the overall structure of the image, thereby improving the image quality of the two-dimensional code embedded with the watermark.

[0044] In order to visually ensure that the watermarked QR code Q generated by the watermark embedding model w With the original QR code Q 0 There is a high degree of similarity. This method uses the L2 paradigm to measure Q w With Q 0 The pixel-level difference between

[0045] The present invention provides an anti-counterfeiting solution with high security, multiple verifications, strong robustness and good compatibility through the full process design of key generation, watermark generation, QR code generation, watermark embedding and recognition. The method uses an improved WGAN network to achieve hidden embedding of watermarks and accurate extraction of information. Compared with the traditional GAN ​​network, it is more stable during the training process and can generate higher quality images. At the same time, combined with database comparison and QR code marking mechanism, it effectively prevents the circulation of counterfeit and shoddy goods, the abuse of QR codes and other problems, significantly improves the credibility of goods and brand competitiveness, and promotes the upgrading and application of anti-counterfeiting technology.

[0046] The present invention solves the problems of unstable watermark embedding effect, insufficient extraction robustness and easy forgery of QR codes in the existing QR code anti-counterfeiting technology, and proposes a QR code watermark product anti-counterfeiting method based on improved WGAN, thereby improving the anti-counterfeiting ability of products, protecting the rights and interests of consumers, and safeguarding the legitimate rights and interests of enterprises. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 The present invention is a flowchart of a method for anti-counterfeiting of a product using a two-dimensional code watermark.

[0048] Figure 2 Schematic diagram of an improved WGAN network architecture according to an embodiment of the present invention.

[0049] Figure 3 Schematic diagram of the generator network architecture of an embodiment of the present invention.

[0050] Figure 4 Schematic diagram of a watermark extraction network architecture according to an embodiment of the present invention.

[0051] Figure 5 The present invention is a block diagram of a two-dimensional code watermark commodity anti-counterfeiting system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to facilitate those skilled in the art to understand the technical solution of the present invention, the technical solution of the present invention is further described in conjunction with the accompanying drawings of the specification.

[0053] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0054] See also Figure 1 As shown, the present invention provides a two-dimensional code watermark commodity anti-counterfeiting method, comprising:

[0055] During the production phase:

[0056] S10, collecting commodity production information.

[0057] In one embodiment of the present invention, key information of the product, including the production location, production date and batch number, is collected and combined into a standardized string format as production information. This information is subsequently used for key generation, watermark generation, etc. to ensure the consistency and traceability of product information.

[0058] S20, converting the product production information into a string format, and using a digest algorithm to generate a key.

[0059] In one embodiment of the present invention, an irreversible hash calculation is performed on the collected commodity production information through a digest algorithm to generate a unique key and save it in a database. Specifically, the commodity production information string is processed by the digest algorithm SHA-25 to generate a hash value of a fixed length, which is used as the commodity key. The generated key is then associated with the commodity production information and saved in the database for comparison and verification by the QR code recognition module. The irreversibility of the key ensures its security, ensures that the generated key cannot be restored through reverse engineering, and prevents the information from being maliciously tampered with.

[0060] S30, generating a QR code according to the generated key.

[0061] In one embodiment of the present invention, a two-dimensional code Q is generated based on a key. 0 , ensuring that the QR code can be embedded with watermarks and can be read by ordinary devices. Specifically, the key is first converted into a QR code image using a standard QR code generation algorithm. By adjusting the QR code generation parameters, such as error correction level and encoding mode, redundant space is reserved for watermark embedding to ensure that the readability of the QR code is not significantly affected after the watermark is embedded.

[0062] S40, generating watermark information according to the product information, encoding the watermark information into binary data, and generating a graphic watermark using a graphic processing library.

[0063] In one embodiment of the present invention, a graphic watermark is generated based on the production information of the product. Specifically, the production information is first encoded into binary data to ensure that it can be directly represented in digital form, and then a graphic processing library such as OpenCV is used to generate a graphic watermark based on the binary data. The watermark is in the form of a black and white pixel map with a size of N×N to improve compatibility with QR code embedding.

[0064] S50, applying the improved WGAN algorithm, embedding the graphic watermark into the QR code, and obtaining a fused image.

[0065] In one embodiment of the present invention, the generated watermark is embedded into the QR code to ensure that the watermark is invisible after embedding and the QR code still has high readability. 0 Embedded into the original QR code Q 0 In the example above, a watermarked QR code is generated, i.e., the fused image Q w .

[0066] In one embodiment of the present invention, the network framework of the improved WGAN algorithm includes a generator G and a discriminator D. The generator introduces an attention mechanism to fuse the features of the graphic watermark and the QR code, and the discriminator is used to evaluate the embedding effect.

[0067] In one embodiment of the present invention, the specific training steps are as follows: Figure 2 As shown,

[0068] 1) Generator G converts the original QR code Q 0 and graphic watermark W 0 Perform feature fusion to obtain the fused image Q w The formula is as follows: Q w =G(Q 0 ,w 0 ).

[0069] 2) Use the discriminator D to evaluate the embedding effect.

[0070] Compared with GAN (Generative Adversarial Nets, GAN), WGAN (Wasserstein Generative Adversarial Nets, WGAN) significantly improves the stability and generation quality of GAN by introducing Wasserstein distance as a new loss function. Specifically, the basic principles of the WGAN algorithm and the settings of the training function are as follows:

[0071]

[0072] Among them, P r Expressed as the probability distribution of the original QR code image, P g Expressed as the probability distribution of the graphic watermark, W(P r ,P g ) is expressed as a probability distribution P r , P g , which is the lower bound of the norm mean of the difference between two random variables x and y of the same dimension. Π(P r ,P g ) indicates P r and P g All possible joint probability distributions. Where: γ represents Π(P r ,P g ) also represents all possible paths to move x to y, E (x,y)~γ Expressed as the expectation of the joint probability distribution, It is expressed as L2 normal form and inf is the infimum.

[0073] In one embodiment of the present invention, the generator in the traditional WGAN uses a convolutional neural network. This network is a local operation and cannot capture the overall structural information of the two-dimensional code image. Therefore, the present invention introduces attention in the network of the generator G to focus on the overall structure of the image, thereby improving the image quality of the two-dimensional code embedded with the watermark. Specifically, the network structure of the generator G of the improved WGAN is as follows: Figure 3 As shown, first convert the original QR code image Q 0 and the original graphic watermark W 0 The input is fed to two different convolutional networks (CNN) for feature extraction:

[0074] F Q =Conv(Q 0 ), F W =Conv(W 0 );

[0075] In the formula, Conv() is a multi-layer convolution operation, F Q and F W Q 0 and W 0 The image features are extracted after the convolutional network. Then the image features F Q and image features F W After merging through the splicing network, the splicing feature F is obtained in :

[0076] F in =Concat(F Q ,F W);

[0077] In the formula, Concat is represented as the concatenation function. The concatenation feature F in Input into the self-attention network, perform global feature fusion, and obtain the fusion feature F out :

[0078]

[0079] Q=W Q F in ,K=W K F in ,V=W V F in ;

[0080] In the formula, Softmax is represented as the activation function, Q, K, and V are the query, key, and value of the attention mechanism, and d k Denoted as the dimension of the key vector, W Q , W K , W V They represent the learnable weight parameters corresponding to query, key, and value respectively, and T represents transpose.

[0081] Finally, after the transposed convolution network, i.e. the deconvolution layer, the size is gradually restored and the fused image Q is output. W .

[0082] Q W =Deconv(F out );

[0083] Where Deconv() represents a multi-layer transposed convolution operation.

[0084] In one embodiment of the present invention, in order to visually ensure that the fused image Q W Compared with the original QR code image Q 0 There is a high degree of similarity. This method uses the L2 paradigm to measure Q w With Q 0 The pixel-level difference between the training loss function Loss C , the formula is as follows:

[0085]

[0086] In the formula, in the formula, Expressed in L2 form.

[0087] In WGAN, the discriminator is used to estimate the upper and lower bounds of the Wasserstein distance, and the optimization objective is as follows:

[0088]

[0089] Where, L D It is represented as the optimization goal of estimating the upper and lower bounds of the Wasserstein distance, D(x) is represented as the score of the discriminator on the original two-dimensional code image, and D(G(z)) is represented as the score of the discriminator on the fused image. Expressed as probability distribution P r expectations, Expressed as probability distribution P z In order to make the estimation of Wasserstein distance valid, it is necessary to ensure that the discriminator D satisfies the K-Lipschitz condition. Here, the gradient penalty is used as the constraint condition L GP The formula is as follows:

[0090]

[0091] In the formula, Represented as the weighted original QR code image, ∥·∥ 2 Expressed as the 2-norm, It is represented as the gradient operation, α is represented as the weight coefficient, Represented as a weighted sample The corresponding probability distribution P r expectations.

[0092] The loss function of the final discriminator D is Loss G It can be expressed as: Loss G =L D +L GP .

[0093] And, the total training loss function of the improved WGAN algorithm is as follows: yotal =Loss C +Loss G .

[0094] See also Figures 1 to 4 As shown, in one embodiment of the present invention, during the market launch phase:

[0095] S100, extract the graphic watermark from the fused image. If the graphic watermark cannot be extracted, it is a counterfeit product. If the graphic watermark can be extracted, the key in the QR code and the product information contained in the watermark are decoded through the deep learning decoder network at the same time, and compared with the information in the database. If the comparison fails, it is a counterfeit product. If the comparison is successful, the production information of the product is obtained, and the scanning number and scanning location are marked to prevent the QR code from being excessively abused.

[0096] In this embodiment, an extractor network E composed of several convolutional layers is used to extract the graphic watermark from the fused image. The specific formula is as follows:m =E(Q w ). Where W m Represented as the extracted graphic watermark.

[0097] And use L2 paradigm to measure the extracted graphic watermark W m With the original graphic watermark W 0 The pixel-level difference between the training loss function Loss s , the formula is as follows:

[0098] See also Figures 1 to 5 As shown, the present invention also provides a two-dimensional code watermark commodity anti-counterfeiting system, which applies the above-mentioned two-dimensional code watermark commodity anti-counterfeiting method, including:

[0099] The information collection module is used to collect commodity production information.

[0100] The key generation module is used to convert the product production information into a string format and use a digest algorithm to generate a key.

[0101] The QR code generation module is used to generate a QR code according to the generated key.

[0102] The watermark generation module is used to generate watermark information according to the product information, encode the watermark information into binary data, and generate a graphic watermark using a graphic processing library.

[0103] The watermark embedding module is used to apply the improved WGAN algorithm to embed the graphic watermark into the QR code and obtain the fused image.

[0104] The QR code recognition module is used to extract the graphic watermark from the fused image. If the graphic watermark cannot be extracted, it is a counterfeit product. If the graphic watermark can be extracted, the key in the QR code and the product information contained in the watermark are decoded through the deep learning decoder network at the same time, and compared with the information in the database. If the comparison fails, it is a counterfeit product. If the comparison is successful, the production information of the product is obtained, and the number of scans and the scanning location are marked.

[0105] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be regarded as exemplary and non-limiting from any point of view, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.

[0106] The above-described embodiments merely represent implementation methods of the invention. The protection scope of the present invention is not limited to the above-described embodiments. For those skilled in the art, several modifications and improvements may be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A two-dimensional code watermark commodity anti-counterfeiting method, characterized in that: include: Production stage: Collect commodity production information; Convert product production information into string format and use digest algorithm to generate key; Generate a QR code based on the generated key; Generate watermark information according to product information, encode the watermark information into binary data, and use a graphics processing library to generate a graphic watermark; The improved WGAN algorithm is applied to embed the graphic watermark into the QR code to obtain the fused image; Market launch phase: The graphic watermark is extracted from the fused image. If the graphic watermark cannot be extracted, it is a counterfeit product. If the graphic watermark can be extracted, the key in the QR code and the product information contained in the watermark are decoded by the deep learning decoder network at the same time, and compared with the information in the database. If the comparison fails, it is a counterfeit product. If the comparison is successful, the production information of the product is obtained, and the number of scans and the scanning location are marked.

2. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 1, characterized in that: The network framework of the improved WGAN algorithm includes a generator and a discriminator. The generator introduces an attention mechanism to fuse the features of the graphic watermark and the QR code, and the discriminator is used to evaluate the embedding effect.

3. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 2, characterized in that: The network framework of the generator includes: the first convolutional network, the second convolutional network, the splicing network, the self-attention network and the transposed convolutional network; The QR code is input into the first convolutional network for feature extraction to obtain the image feature F Q ; The graphic watermark is input into the second convolutional network for feature extraction to obtain the image feature F W ; Image feature F Q and image features F W After merging through the splicing network, the splicing feature F is obtained in ; The splicing feature F in Input into the self-attention network, perform global feature fusion, and obtain the fusion feature F out ; The fusion feature F out The size is gradually restored through the transposed convolutional network, and the fused image Q is output W .

4. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 2, characterized in that: Fusion feature F out Obtained by the following formula: Q=W Q F in ,K=W K F in ,V=W V F in ; In the formula, Softmax is represented as the activation function, Q, K, and V are the query, key, and value of the attention mechanism, and d k Denoted as the dimension of the key vector, W Q , W K , W V They represent the learnable weight parameters corresponding to query, key, and value respectively, and T represents transpose.

5. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 2, characterized in that: The discriminator estimates the upper and lower bounds of the Wasserstein distance in the WGAN algorithm, and the optimization objectives are as follows: Where, L D Denotes the optimization objective for estimating the upper and lower bounds of the Wasserstein distance, D(x) denotes the score of the discriminator for the original QR code image, and D(G(z)) denotes the score of the discriminator for the fused image. Expressed as probability distribution P r expectations, Expressed as probability distribution P z expectations.

6. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 5, characterized in that: Gradient penalty is used as the constraint condition of the discriminator; among them, the constraint condition L GP for: In the formula, is represented as the weighted original QR code image, ∥·∥2 is represented as the 2-norm, It is represented as the gradient operation, α is represented as the weight coefficient, Represented as a weighted sample The corresponding probability distribution P r expectations.

7. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 6, characterized in that: Loss function of the discriminator G , expressed by the following formula: Loss G =L D +L GP .

8. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 3, characterized in that: In the generator, the L2 paradigm is used to measure the fusion image Q W The pixel-level difference from the original QR code image Q0, training loss function Loss C , the formula is as follows: In the formula, Expressed in L2 form.

9. The two-dimensional code watermark commodity anti-counterfeiting method according to claim 1, characterized in that: In the market launch phase, an extractor network consisting of several convolutional layers is applied to extract the graphic watermark from the fused image; and the L2 paradigm is used to measure the extracted graphic watermark W m The pixel-level difference between the original graphic watermark W0 and the training loss function Loss s The formula is as follows:

10. A QR code watermark commodity anti-counterfeiting system, characterized in that: The method for anti-counterfeiting a product using a two-dimensional code watermark as claimed in any one of claims 1 to 9 comprises: Information collection module, used to collect commodity production information; The key generation module is used to convert the product production information into a string format and use a digest algorithm to generate a key; A QR code generation module, used to generate a QR code according to the generated key; A watermark generation module is used to generate watermark information according to product information, encode the watermark information into binary data, and generate a graphic watermark using a graphic processing library; The watermark embedding module is used to apply the improved WGAN algorithm to embed the graphic watermark into the QR code and obtain the fused image; The QR code recognition module is used to extract the graphic watermark from the fused image. If the graphic watermark cannot be extracted, it is a counterfeit product. If the graphic watermark can be extracted, the key in the QR code and the product information contained in the watermark are decoded through the deep learning decoder network at the same time, and compared with the information in the database. If the comparison fails, it is a counterfeit product. If the comparison is successful, the production information of the product is obtained, and the number of scans and the scanning location are marked.

Citation Information

Patent Citations

  • Copyright protection method for adversarial generative network

    CN114493972A