Information anti-counterfeiting method, verification method and server
By perturbing the QR code image to generate an adversarial image and using a classification model for verification, the problem of easy copying of QR codes is solved, and more efficient anti-counterfeiting verification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ROBERT BOSCH GMBH
- Filing Date
- 2020-07-27
- Publication Date
- 2026-04-17
AI Technical Summary
In existing digital anti-counterfeiting technologies, QR codes are easily copied and counterfeited, making it difficult to effectively verify the authenticity of goods.
By using a classification model to generate perturbation images to scramble QR codes, adversarial images are generated and then verified using a trained classification model, increasing the difficulty of copying.
Without affecting the readability of the QR code, the anti-counterfeiting features of the QR code have been improved, and the accuracy and difficulty of verification have been enhanced.
Smart Images

Figure CN114004244B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to digital anti-counterfeiting technology, and more particularly to a system for creating and verifying graphic codes. Background Technology
[0002] Counterfeiting is a global problem, and current technologies primarily employ physical or digital methods for product anti-counterfeiting. Physical anti-counterfeiting technologies, such as holograms and watermarks, may require additional equipment and manual verification, making them inconvenient for end users. Digital anti-counterfeiting technologies, such as QR codes and barcodes, can be verified using smartphones, facilitating operation by relevant links in the supply chain and end users; however, the drawback is that digital anti-counterfeiting labels themselves are easily copied and counterfeited. Summary of the Invention
[0003] To address the problems existing in the prior art, this application provides an improved digital anti-counterfeiting technology that can increase the difficulty of accurately copying digital anti-counterfeiting labels such as QR codes, thereby making it easier to verify counterfeit goods.
[0004] According to one aspect of the present invention, an information anti-counterfeiting method is provided, comprising: processing an original image using a classification model to generate a classification estimate of the original image; calculating a loss of a standard training image corresponding to the classification estimate relative to the original image; generating a perturbation image based on the loss; superimposing the perturbation image onto the original image to generate an adversarial image; learning the adversarial image using the classification model to generate an updated classification estimate; and storing the updated classification estimate for verification of the adversarial image.
[0005] According to another aspect of the present invention, a verification method is provided, comprising: receiving a scanned image of a target to be verified; processing the scanned image using a trained classification model to generate a predicted classification estimate of the target to be verified; comparing the predicted classification estimate with a pre-stored original classification estimate of a prototype target of the target to be verified; and determining, based on the comparison result, whether the target to be verified has passed verification.
[0006] According to another aspect of the present invention, a verification server is provided, comprising: a receiving / transmitting module for receiving a verification request from a remote terminal, wherein the verification request includes an image to be verified; a memory for storing a pre-trained image classification model and the received image to be verified; and a processing module for: processing the image to be verified using the trained classification model to generate a predicted classification estimate of the image to be verified; comparing the predicted classification estimate with a pre-stored original classification estimate of a prototype target of the target to be verified; and determining, based on the comparison result, whether the verification of the target to be verified has passed. Attached Figure Description
[0007] Figure 1 This diagram illustrates a classification model for processing QR codes, as shown in one example.
[0008] Figure 2 A flowchart of QR code anti-counterfeiting processing according to an example of the present invention is shown;
[0009] Figure 3 This diagram illustrates the scrambling of a QR code.
[0010] Figure 4 A block diagram of a QR code anti-counterfeiting processing device according to an example of the present invention is shown;
[0011] Figure 5 A flowchart for verifying a product QR code is shown according to an embodiment of the present invention;
[0012] Figure 6 A block diagram of a verification server for verifying product QR codes is shown according to an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only for illustrative purposes and are not restrictive. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. In the following description of the embodiments, QR codes, in particular, are used as examples to illustrate the present invention.
[0014] In the manufacturing process of some goods, QR codes are sometimes printed on product packaging for customers to query product information, such as verifying authenticity. When printing QR codes on product packaging, due to their graphic characteristics, they have a high error correction rate. Therefore, even if the QR code on the product is copied or scanned multiple times, the encoded information in the copied or scanned QR code can still be accurately read. Thus, simply relying on the encoded information is insufficient to verify the authenticity of the product. However, according to embodiments of the present invention, by using, for example, a neural network to generate a perturbation image, the original QR code is scrambled, thereby enriching the pixel level of the printed QR code image. Any subsequent copying or scanning of the QR code on the product is highly likely to lose pixel information, leading to incorrect classification results when using a neural network to classify the copied or scanned QR code. Therefore, product verification can be achieved.
[0015] Figure 1This diagram illustrates a method for processing a QR code image using a classification model, as shown in one example. The QR code is, for example, a raw QR code generated by a manufacturer for a product, encoding information related to the product. Before generating the QR code for printing the product, the QR code is input as a raw image (hereinafter denoted as org_QR) into a trained image classification model (ICM). The ICM is pre-trained to perform classification estimation on the input image to identify the category to which the input image belongs. According to one embodiment of the invention, the ICM can be a neural network model for predicting any image, even one completely unrelated to the QR code. As an example, it is assumed that the ICM used is a neural network model trained to identify flower names, with multiple outputs, as shown in (1), (2), (3)...(m), each indicating the corresponding flower name, for example, classification result (1) indicates Epiphyllum oxypetalum, classification result (2) indicates Osmanthus fragrans, classification result (3) indicates Gazania latifolia... classification result (m) indicates Nelumbo nucifera. Following this example, the flower classification model ICM processes the input QR code image and outputs m classification results. It is easy to understand that since the QR code is completely unrelated to the flowers, the confidence of the classification results is very low. For example, the confidence P for predicting it as Epiphyllum is 0.2, the confidence P for Osmanthus is 0.4, the confidence P for Gazania is 0.1, and the confidence P for Lotus is 0.3.
[0016] In one example, the classification result with the highest confidence is used as the classification estimate for the QR code, for example in... Figure 1 In the example, the second classification result with the highest confidence of 0.4 (indicating osmanthus) is designated as the recognition result of the original image org_QR. The loss LOSS between the standard osmanthus image represented by this classification estimate and the image org_QR can be calculated. Based on this loss LOSS, a perturbation image PertImg between the standard osmanthus image and the image org_QR is calculated. This perturbation image PertImg is superimposed on the original image org_QR to generate an adversarial image adv_QR, which can be used as an updated QR code. According to this embodiment of the invention, the updated QR code superimposed with the perturbation image PertImg is printed out as the final product QR code.
[0017] In another example, a classification result with arbitrary confidence can be used as a classification estimate for the original image org_QR, for example in... Figure 1In the example, the third classification result—the medal flower—with a minimum confidence of 0.1 is specified as the QR code recognition result. From this, the loss LOSS between the standard medal image represented by this classification estimate and the original image org_QR can be calculated, and based on this loss LOSS, a perturbation image PertImg is calculated between the standard medal image and the original image org_QR. Similarly, the perturbation image PertImg based on the medal flower is superimposed on the original image org_QR to generate an adversarial image adv_QR, which serves as the updated QR code. Then, the updated QR code superimposed with the perturbation image PertImg is printed out as the final product QR code.
[0018] According to an embodiment of the present invention, the classification estimate of the adversarial image adv_QR by the classification model ICM can be used as the verification basis for the final product QR code. For example, it can be designed to still specify the first category indicating epiphyllum, or the third category indicating asterias, or any other output as the classification estimate of the adversarial image adv_QR. The verification data here includes not only the specific category estimated, but also the confidence level of the estimate. Figure 2 A flowchart illustrating a QR code anti-counterfeiting process according to an example of the present invention is shown.
[0019] In the above embodiment, a flower classification model was used to estimate the QR code, where the flower classification model was trained using various flower images completely unrelated to the QR code. However, according to another embodiment, the image classification model ICM can also be trained using a mixture of QR code images and training images. For example, during training, multiple original QR code images and / or printed or photographed images of the original images are added as a separate class to another N classes of training image samples, resulting in N+1 classes of training samples used to train the neural network model. Here, the N classes of training images represent, for example, N types of flowers. However, it should be noted that after training the image classification model ICM using the N+1 classes of training samples, when using ICM to estimate the original image as org_QR, a class can still be randomly selected from m classification estimates as the classification result, thereby generating a perturbation image, which is then superimposed onto the original image.
[0020] like Figure 2 As shown, in step 201, a raw QR code generated for the product is received. This raw QR code can be either an electronic description file format of the QR code or a scanned image generated by scanning the raw QR code. In the following description, both types of QR codes will be referred to as raw QR codes.
[0021] Subsequently, in step 203, the original QR code is submitted to a pre-trained classification model ICM, such as the flower classification model in the example above. The flower classification model ICM predicts the input original QR code to generate m classification results. According to the present invention, the ICM here can be a model trained for any type of image, such as a classification model trained for flowers in this example, or a model trained for animals, or a face recognition model, or a classification model for other special images such as curtains and floor mats. In a preferred example, the classification model ICM is a neural network model trained based on deep learning, suitable for representing the texture and other detailed features of images. It can adopt any neural network architecture in the prior art, such as the AlexNet network model based on convolutional neural networks (CNNs), the GoogleNet network model, etc. The convolutional neural network (CNN) model can fully analyze the detailed information contained in the image texture, effectively obtaining texture features in shallow networks and extracting structural shape features in deep networks. Moreover, network models such as AlexNet can generate a distribution covering up to 1000 class labels, thus providing great freedom for QR code classification estimation and selection of classification results.
[0022] As mentioned earlier, the classification model used in this invention was trained on flowers, and the flower images used for training may have different image sizes than those used in the QR code. Figure 1 As shown, the QR code image size is a*a, for example, 513*513, while the flower image size is b*b, for example, 300*300. Therefore, before processing the QR code image org_QR using the classification model ICM, in one implementation, the image org_QR is first preprocessed, including scaling. Since the QR code image is larger than the flower image, its size can be reduced to 300*300. Obviously, if the QR code image size a is smaller than the training image size b, the image org_QR needs to be enlarged. It should be understood that, depending on the actual needs, preprocessing of the QR code image may not be required before inputting it into the classification model ICM; this application does not impose specific limitations on this.
[0023] After processing the original image org_QR using the flower classification model ICM in step 203, in step 205, the classification estimate for the original image org_QR is confirmed from multiple predicted classification results of the flower classification model ICM. For example, when the flower classification model ICM is trained using the AlexNet network model architecture, the osmanthus with the highest confidence can be selected as the final classification estimate from up to 1000 classification results. Of course, as mentioned above, any classification result can also be used as the final classification estimate. Here, due to the significant difference between the original image org_QR and the flower, this invention can select the classification estimate for the original image org_QR using any designed classification determination principle.
[0024] In step 207, the classification estimate of the flower classification model ICM is calculated relative to the original image org_QR, representing the difference between the classification result and the original image org_QR. In this embodiment of the invention, since the classification model ICM is implemented using a convolutional neural network (CNN), any known loss function can be used to calculate the estimated loss LOSS, such as the cross-entropy loss function. That is, LOSS = J(f(θ,x),y), where x represents the input image, i.e., the original QR code image org_QR, y represents the ground truth (i.e., the class label or tag value), f(θ,x) represents the neural network classification model ICM, which performs classification estimation on the input image org_QR, such as osmanthus in this example, where θ represents the internal parameters of the classification model ICM trained by the neural network. J() represents the loss function, such as cross-entropy; therefore, J(f(θ,x),y) represents the loss LOSS calculated between the output of the neural network classification model ICM and y.
[0025] In step 209, backpropagation is performed using the loss calculated in step 207 to generate the perturbation image PerImg. A network architecture known in the prior art can be used to generate the perturbation image. As an example, the existing FGSM (Fast Gradient Sign Method) method can be used to generate the perturbation image. The following equation shows the functional representation of the FGSM method:
[0026]
[0027] Here, η represents the perturbation image, and ε is a user-defined hyperparameter that represents the degree of perturbation, such as 0.1, 0.2, etc. This represents the derivative of LOSS(=J(f(θ,x),y)) with respect to the input layer x of the neural network (i.e., the image org_QR). Sign() is the activation function. It's important to note that for the class label y, the flower classification model used in this example was not trained using QR codes. Therefore, the class label of the most similar category obtained after processing the QR code image org_QR using the flower classification model (e.g., osmanthus in this example) can be defined as 1. Then, a function such as cross-entropy is used to calculate the loss LOSS of the input image org_QR for class label 1, i.e., osmanthus. It's important to note that since the flower classification model ICM was not trained using QR code images, although the ICM classifies osmanthus as class label 1, the probability that the QR code image org_QR belongs to class label 1 is still very low, for example, only 40%. However, 40% is still the highest confidence score given by ICM for the QR code image org_QR. Using the FGSM method, the perturbation obtained by taking the derivative of the loss (LOSS) with respect to the input image x is superimposed on the input image, resulting in a higher classification probability than the existing probability, such as 50%. Of course, the extent of the improvement is determined by the hyperparameter ε. Taking the derivative of this loss with respect to the input image org_QR, only positive derivatives are obtained. Multiplying this derivative by the hyperparameter ε, which represents the desired perturbation magnitude, yields the final perturbed image PerImg.
[0028] Furthermore, it should be noted that, according to this invention, the final result of the classification estimation can be chosen independently. For example, if the classification model ICM gives a class label of 1, but we randomly select any class label, such as 5, for loss calculation, we expect the superimposed adversarial image to appear more like class 5 to ICM. This method of randomly selecting the classification result also applies to cases where the training set includes QR codes to train the classification model ICM. In this case, the classification model will obviously classify the QR code image org_QR into the class to which the QR code belongs, for example, defined as the p-th output of class label 1. Obviously, calculating the classification loss for class label 1 is meaningless at this point, because no matter how the loss is calculated and superimposed, it will only make the QR code appear more like class label 1 in the image classification model. Therefore, according to an embodiment of this invention, any class other than the QR code's class label 1, such as 5, is designated as the class label y, and the derivative with respect to the input is calculated. Then, a perturbation image is superimposed to obtain an adversarial image. The resulting adversarial image, after being predicted by the classification model ICM, looks more like class label 5, rather than class label 1.
[0029] In step 211, the perturbation image PerImg is fused with the original image org_QR to generate an adversarial image adv_QR, which serves as the updated 2D QR code. It's important to note that, as mentioned earlier, the classification model ICM is trained on flowers, therefore the size of the perturbation image PerImg needs to be adjusted to fit the original QR code. For example, if the flower image size is 300*300, the perturbation image PerImg needs to be padded first, for example, by upsampling, so that the size of the padded perturbation image PerImg matches the size of the original QR code image org_QR. Figure 3 The fusion process of the perturbation image PerImg generated according to step 211 is shown.
[0030] like Figure 3 As shown, the perturbation image PerImg represents the perturbation image generated based on loss backpropagation. After fusing PerImg with the original image org_QR, an adversarial image adv_QR containing the perturbation is generated, which can be used to update the original QR code. It is important to note that when fusing the perturbation image PerImg with the original image org_QR, a weighting process can be performed on PerImg to limit the magnitude of the perturbation, such as... Figure 3 As shown, PerImg is schematically weighted by 0.2. Due to the construction characteristics of QR codes, the encoded information contained in the updated adversarial image adv_QR is the same as that of the original QR code, which does not affect the correct reading of the code.
[0031] In step 213, the updated adversarial image adv_QR is input again into the classification model ICM to achieve an updated classification estimate for the adversarial image adv_QR. It is important to note that although the perturbation image PerImg is generated based on the original QR code and the initial classification estimate (e.g., osmanthus), due to the structural design of the neural network model ICM, the updated classification estimate for the adversarial image adv_QR may not necessarily be osmanthus, but could be an estimate of other flowers with higher confidence, such as the (i)th output chrysanthemum with the highest confidence of 0.45. Therefore, the (i)th classification estimate chrysanthemum and its confidence of 0.45 generated in step (i) are stored for subsequent QR code verification. It is important to note that for ease of verification, the classification result with the highest confidence can be simply used as the updated classification estimate for the adversarial image adv_QR. However, in another embodiment, the j-th output with any confidence can be specified as the updated classification estimate; therefore, the j-th classification estimate generated in step 213 and its confidence can be stored as verification data for subsequent QR code verification. Therefore, according to the embodiments of the present invention, anti-counterfeiting technology is added to the printed QR code, which increases the difficulty of copying without compromising the readability of the original QR code, thus enhancing its anti-counterfeiting properties.
[0032] The above combination Figure 2 The anti-counterfeiting methods for QR codes are described. Figure 4 An apparatus for implementing a QR code anti-counterfeiting method according to an embodiment of the present invention is shown, in which the flower classification model ICM is still used as an example. As shown in the figure, the apparatus 400 includes: a classification module 401, a loss calculation module 402, an interference generation module 403, and a fusion module 404.
[0033] The classification module 401 receives the original image org_QR of the original QR code generated for the product and submits the original image org_QR to a pre-trained flower classification model ICM, such as an AlexNet network model based on a convolutional neural network (CNN). The flower classification model ICM predicts the input original QR code to produce m classification results. In one example, since the flower classification model is trained on flowers, and the image size of the flower image used for training may differ from that of the QR code, the classification module 401 further scales the original image org_QR to match the input image requirements of the flower classification model ICM.
[0034] The loss calculation module 402 can select the classification estimate of the original image org_QR from multiple predicted classification results of the flower classification model ICM based on a pre-defined classification determination principle. For example, it can select the osmanthus with the highest confidence as the final classification estimate from multiple classification results of the flower classification model ICM. Then, the loss calculation module 402 calculates the estimated loss LOSS of the standard osmanthus image relative to the original image org_QR. When the classification model ICM is implemented using a convolutional neural network (CNN), any known loss function can be used to calculate the estimated loss LOSS, such as the cross-entropy loss function.
[0035] The disturbance generation module 403 uses the loss LOSS determined by the loss calculation module 402 to generate a perturbation image PerImg. Here, a network architecture known in the prior art can be used to generate the perturbation image, such as the FGSM (Fast Gradient Sign Method).
[0036] The fusion module 404 performs a fusion process on the perturbation image PerImg and the original image org_QR to generate an adversarial image adv_QR as an updated two-dimensional QR code. As an example, during the fusion process, the fusion module 404 needs to adjust the size of the perturbation image PerImg to fit the original QR code. The fusion module 404 then provides the updated adversarial image adv_QR to the classification module 401. The classification module 401 inputs the updated adversarial image adv_QR back into the classification model ICM to achieve an updated classification estimate for the adversarial image adv_QR. The classification module 401 can select the classification result with the highest confidence from the updated classification results of the classification model ICM as the updated classification estimate for the adversarial image adv_QR, and store the updated classification estimate for subsequent validation, for example, storing the (i)th classification estimate with the highest confidence of 0.45 and its confidence of 0.45. In another embodiment, the classification module 401 may also specify and store the j-th output with arbitrary confidence as an updated classification estimate for subsequent QR code verification.
[0037] In another embodiment, to adjust the perturbation magnitude of the perturbation image PerImg, the fusion module 404 can further assign weights ε to the perturbation image PerImg and superimpose the weighted perturbation image onto the original image to generate an adversarial image, i.e., adv_QR = org_QR + ε * PerImg. Thus, during the fusion process, the fusion module 404 can further verify whether the encoded content contained in the adversarial image adv_QR is the same as the encoded content of the original image org_QR. If they are different, the fusion module 404 redetermines the weights ε to adjust the impact of the perturbation on the adversarial image.
[0038] In another embodiment of the present invention, different classification models (ICMs) can be matched for the QR codes of different products. Therefore, after receiving the original image org_QR, the classification module 401 first reads the encoded information in the QR code represented by the original image org_QR, and then selects a classification model from a plurality of pre-trained classification models that matches the read encoded information, thereby performing the anti-counterfeiting processing as discussed above.
[0039] Figure 5 A flowchart illustrating a method for verifying a product's QR code according to an embodiment of the present invention is shown. This verification can be performed by a backend verification server. In step 501, the backend server receives a QR code on the product for sale, captured by a scanner or camera, to obtain the QR code image, hereinafter referred to as Sale_QR. For example, the camera can be located on a terminal such as a mobile phone. In this embodiment, the backend server can be either a remote server connected to the mobile phone via a wireless network or an application residing within the mobile phone, such as a WeChat mini-program.
[0040] In step 503, the backend server invokes a predefined classification model ICM (e.g., a flower classification model used in generating adversarial QR codes) to process the received image Sale_QR and generate m classification results. In this example, the classification model ICM can be located within the backend server or separate from it.
[0041] In step 505, according to the pre-designed classification determination principle, a classification estimate for the image Sale_QR is selected from the m classification results generated by the classification model ICM, for example, the k-th classification result with the highest confidence is selected. Then, in step 507, it is further determined whether the k-th classification result confirmed in step 505 matches the verification data for the QR code of the product pre-stored in the server. It is assumed that the verification data for the QR code of the product pre-stored in the server is the (i)-th classification estimate and the confidence level is 0.45.
[0042] If in step 507 it is determined that k is not equal to i, for example, for the image Sale_QR, its classification estimate with the highest confidence is a lotus, then it obviously does not match the pre-stored verification classification estimate (chrysanthemum), thus confirming that the QR code of the currently scanned image Sale_QR is illegally copied or damaged and cannot be verified. If k equals i, it indicates that the classification of the image Sale_QR is basically correct, so proceed to step 509. In step 509, it is further determined whether the confidence level corresponding to the k-th classification result is within the deviation range of the confidence level of the (i)-th verification classification estimate, for example, within ±20%. If it is within the deviation range, it indicates that the current QR code is the QR code of a genuine product; otherwise, the QR code on the current product may be illegally copied.
[0043] Figure 6 A block diagram of a verification server for verifying product QR codes is shown according to an embodiment of the present invention. The verification server 600 includes a receiving / transmitting module 601, a processing module 602, and a memory 603. The verification server 600 can communicate with a remote terminal, such as a mobile phone, via a wired or wireless network.
[0044] The receiving / transmitting module 601 receives a verification request from a remote terminal, wherein the verification request contains, for example, a QR code image (Sale_QR) of a product for sale captured by a camera in the remote terminal. The receiving / transmitting module 601 then forwards the received verification request to the processing module 602. Upon receiving the verification request, the processing module 602 caches the QR code image (Sale_QR) in a memory 603, which also stores a pre-trained image classification model (ICM).
[0045] In response to the verification request, processing module 602 retrieves the classification model ICM from memory 603 to process the received image Sale_QR and generates m classification results. Then, according to a pre-defined classification determination principle, processing module 602 selects a classification estimate for the image Sale_QR from the m classification results, for example, selecting the k-th classification result with the highest confidence. Subsequently, processing module 602 determines whether the selected k-th classification result matches the pre-stored classification estimate for verifying the QR code of the product (e.g., the i-th classification result with a confidence level of 0.45). If k is not equal to i, processing module 602 sends a warning message to the remote terminal via receiving / transmitting module 601, indicating that the current product is not genuine or the QR code is damaged and cannot be verified. If k equals i, then the processing module 602 further determines whether the confidence level corresponding to the k-th classification result is within the deviation range of the confidence level estimated by the (i)-th verification classification, for example, within ±20%. If it is within the deviation range, it indicates that the current QR code is the QR code of a genuine product; otherwise, the QR code on the current product may be illegally copied. Accordingly, the processing module 602 instructs the receiving / transmitting module 601 to send the corresponding verification pass information or non-genuine product information to the remote terminal.
[0046] In the above embodiments, QR codes are used as an example to describe the possibility of image encryption to prevent tampering and copying according to the present invention. However, it is not difficult to see that the solution and principle of the present invention can be applied to any other image. Furthermore, it should be noted that although the present invention has been described in conjunction with the above preferred embodiments, it is obvious that the present invention is not limited thereto. Figure 4 , 6 The modules may include processors, electronic devices, hardware devices, electronic components, logic circuits, memory, software code, firmware code, etc., or any combination thereof. Those skilled in the art will also recognize that the various illustrative logic blocks, units, and method steps described in conjunction with this disclosure can be implemented as electronic hardware, computer software, or a combination of both. Taking software implementation as an example, a device in a logical sense is formed by a computing device executing computer program instructions. Another embodiment of the invention provides a machine-readable medium storing machine-readable instructions that, when executed by a computing device, cause the computing device to perform any of the methods disclosed herein.
[0047] It should be noted that not all steps or modules in the above process and device diagrams are mandatory; certain steps or modules can be omitted or combined according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above embodiments can be a physical structure or a logical structure; that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.
[0048] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments above, and these embodiments are also within the protection scope of the present invention.
Claims
1. An information anti-counterfeiting method, comprising: A classification model is used to process an original image to generate an initial classification estimate of the original image, wherein the classification estimate is selected from multiple classification results generated by the classification model processing the original image based on a pre-defined classification determination principle, and the original image includes a QR code, wherein the original image is content-independent from the training images used to train the classification model. Calculate the loss of the standard training image corresponding to the classification estimate relative to the original image; A perturbation image is generated based on the loss; The perturbation image is superimposed on the original image to generate an adversarial image, wherein the encoded content of the QR code represented by the adversarial image is the same as the encoded content of the original image; The classification model is used to learn the adversarial image to produce an updated classification estimate, wherein the updated classification estimate is selected from multiple classification results generated by the classification model processing the adversarial image and can have arbitrary confidence levels; The updated classification estimate and the confidence level are stored for verification of the adversarial image.
2. The method of claim 1, wherein the classification model processes the original image to generate multiple classification results with different confidence levels. The classification estimate is the classification result with the highest confidence among the plurality of classification results; or the classification estimate is a classification result with any confidence randomly selected from the plurality of classification results, wherein the stored classification estimate includes classification confidence.
3. The method of claim 2, wherein superimposing the perturbation image onto the original image to generate an adversarial image comprises: The perturbation image is scaled according to the ratio of the training image to the original image, and the scaled perturbation image is superimposed onto the original image.
4. The method as described in any one of claims 1-3, wherein the original image and the perturbation image are in electronic file format, and the adversarial image is output in the form of a printed carrier.
5. The method of claim 1, wherein superimposing the perturbation image onto the original image to generate an adversarial image further comprises: Assign weights to the perturbed image; The weighted perturbation image is superimposed onto the original image to generate the adversarial image; Verify whether the encoded content of the QR code represented by the adversarial image is the same as the encoded content of the original image; if they are different, adjust the weight assigned to the perturbation image.
6. The method of any one of claims 1-3, wherein the classification model is a trained convolutional neural network model.
7. A verification method, comprising: Receive a scanned image of a target to be verified, wherein the scanned image includes an original image superimposed with a perturbation image, the original image includes a QR code, wherein the encoded content of the QR code in the scanned image is the same as the encoded content of the original image. The scanned image is processed using a trained classification model to generate a predicted classification estimate and its confidence level for the target to be verified, wherein the predicted classification estimate is selected from multiple classification results generated by the classification model processing the scanned image based on a pre-defined classification determination principle, and the original image is content-independent from the training images used to train the classification model. The predicted classification estimate and its confidence level are compared with the original classification estimate and confidence level of the prototype target of the target to be verified, which are stored in advance; Based on the comparison results, it is determined whether the verification of the target to be verified has been passed.
8. The method of claim 7, wherein comparing the predicted classification estimate with the pre-stored original classification estimate comprises: Determine whether the predicted classification estimate and the original classification estimate have the same category indication; as well as Determine whether the confidence level of the predicted classification estimate is within a predetermined error range of the confidence level of the original classification estimate.
9. The method of claim 7 or 8, wherein the classification model processes the scanned image to produce multiple classification results with different confidence levels. The predicted classification estimate is the classification result with the highest confidence selected from the plurality of classification results based on a predetermined classification determination principle, or the classification result selected from the plurality of classification results according to a predetermined design, wherein the stored classification estimate includes classification confidence.
10. The method of claim 8 or 7, wherein the classification model is a trained convolutional neural network model.
11. A verification server, comprising: A receiving / sending module is used to receive a verification request from a remote terminal, wherein the verification request contains an image to be verified, wherein the image to be verified includes an original image superimposed with a perturbation image, the original image includes a QR code, and wherein the encoded content of the QR code in the verification image is the same as the encoded content of the original image. The memory is used to store the pre-trained image classification model and the received images to be verified. Processing module, used for: The image to be verified is processed using a trained classification model to generate a predicted classification estimate and its confidence level for the image to be verified. The predicted classification estimate is selected from multiple classification results generated by the classification model processing the image to be verified based on a pre-defined classification determination principle. The original image is content-independent from the training images used to train the classification model. The predicted classification estimate and its confidence score are compared with the original classification estimate and confidence score of the prototype image of the image to be verified, which are stored in advance. Based on the comparison results, it is determined whether the image to be verified passes the verification.
12. The verification server of claim 11, wherein the processing module further: determines whether the category indication of the predicted classification estimate is the same as that of the original classification estimate; and Determine whether the confidence level of the predicted classification estimate is within a predetermined error range of the confidence level of the original classification estimate.
13. The verification server as described in claim 12 or 11, wherein the classification model processes the image to be verified to generate multiple classification results with different confidence levels. The processing module selects the classification result with the highest confidence from the plurality of classification results based on a predetermined classification determination principle, or selects the classification result from the plurality of classification results according to a predetermined design, as the predicted classification estimate, wherein the stored classification estimate includes classification confidence.
14. The verification server of claim 12 or 11, wherein the classification model is a trained convolutional neural network model.
15. A device for implementing information anti-counterfeiting, comprising: A classification module is configured to process an original image using a classification model to generate an initial classification estimate of the original image, wherein the initial classification estimate is selected from multiple classification results generated by the classification model processing the original image based on a pre-defined classification determination principle, the original image including a QR code, wherein the original image is content-independent from the training images used to train the classification model. The loss calculation module is configured to calculate the loss of the standard training image corresponding to the classification estimate relative to the original image; The interference generation module is configured to generate a perturbation image based on the loss; The fusion module is configured to overlay the perturbation image onto the original image to generate an adversarial image, wherein the encoded content of the QR code represented by the adversarial image is the same as the encoded content of the original image; The classification module is further configured to learn the adversarial image using the classification model to generate an updated classification estimate, wherein the updated classification estimate is selected from multiple classification results generated by the classification model processing the adversarial image and may have arbitrary confidence levels, and the updated classification estimate and confidence levels are stored for verification of the adversarial image.
16. The device of claim 15, wherein the classification module processes the original image using the classification model to generate multiple classification results with different confidence levels. The classification estimate is the classification result with the highest confidence among the plurality of classification results; or the classification estimate is a classification result with any confidence randomly selected from the plurality of classification results, wherein the stored classification estimate includes classification confidence.
17. The device of claim 16, wherein the fusion module is further configured to: The perturbation image is scaled according to the ratio of the training image to the original image, and the scaled perturbation image is superimposed onto the original image.
18. The device of any one of claims 15-17, wherein the fusion module is further configured to: assign weights to the perturbed image; The weighted perturbation image is superimposed onto the original image to generate the adversarial image; Verify whether the encoded content of the product QR code represented by the adversarial image is the same as the encoded content of the original image. If they are different, adjust the weight assigned to the perturbation image.
Citation Information
Patent Citations
Artificial intelligence prediction evaluation method and device, storage medium and electronic equipment
CN110826908A