A tracing method, device, equipment and medium integrating digital watermark
The random multiple digital signature and the fusion cross attention module generates digital watermark images, which solves the problem of low anti-counterfeiting ability of wine geographical indication products, realizes high-credit traceability, avoids counterfeiting and counterfeiting, and enhances product information Authenticity.
Patent Information
- Application Number
- CN202410721226.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-06-05
Smart Images

Figure CN118656809B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of anti-counterfeiting technology, and in particular relates to a traceability method, device, equipment and medium integrated with digital watermarks. Background Art
[0002] The unique economic and social value of geographical indications is increasingly recognized. The brand, reputation, and characteristics created by wine geographical indications, as well as the unique humanistic spirit embodied in the product, have extremely important economic significance or commercial value.
[0003] Therefore, strengthening the protection of wine geographical indications is particularly necessary. Traceability information for wine products with geographical indications includes not only textual information such as the manufacturer, vintage, and test reports, but also visual information such as the growing estate, production base, and storage cellar. This visual information is highly reproducible and can be easily exploited by unscrupulous operators to counterfeit origins and brands, thereby infringing on the legitimate rights and interests of consumers and disrupting market order.
[0004] The purpose of the present invention is to provide a traceability method to solve the problem of low anti-counterfeiting ability and low credibility of traceability identification products in the prior art. Summary of the Invention
[0005] In view of the above analysis, the embodiments of the present invention aim to provide a traceability method, device, equipment and medium integrated with digital watermarks to solve the problem of low anti-counterfeiting ability and low credibility of traceability identification products in the prior art.
[0006] The first embodiment of the present invention provides a method for tracing a digital watermark, comprising the following steps:
[0007] Acquire product information, use the product information as plain text, and encrypt the plain text using a random multiple digital signature technology to obtain a digital signature of the plain text;
[0008] Obtaining an original image, and inputting the original image and the digital signature into a diffusion generation model of a fused cross-attention module to form a digital watermark image, wherein the diffusion generation model of the fused cross-attention module is pre-trained;
[0009] Performing loss simulation based on the digital watermark image to form a loss image set;
[0010] Inputting the loss image set into a digital watermark decoder for training, and extracting the digital signature from the digital watermark image by the trained digital watermark decoder;
[0011] The digital signature is verified.
[0012] In some embodiments, the product information includes text information of product supply chain entities, and the original image includes image information of planting manors, production bases, and storage cellars.
[0013] In some embodiments, encrypting the plaintext through a random multiple digital signature technology includes:
[0014] S11. Generating a key pair based on the RSA algorithm:
[0015] Select p, q ∈ {prime numbers, p, q > 1 × 10 i-1 , p ≠ q}, and calculate: n = p·q·(p - 1)·(q - 1), m = p·q;
[0016] Randomly select an integer r ∈ {Z, 2 r <p, 2 r <q}, and calculate:
[0017]
[0018] Select an integer e ∈ {Z, 1 < e < α(n)}, and gcd(e, α(n)) = 1, where gcd is to find the greatest common divisor, that is, e and α(n) are relatively prime to each other, and calculate the private key d, satisfying:
[0019] e·d = 1 mod α(n), which means that the result of e multiplied by d modulo α(n) is always 1;
[0020] Select (e, n) as the public key and (d, m) as the private key;
[0021] S12. Generating a certificate corresponding to the signer based on the key pair, expressed as:
[0022] S a = H(ID i ) d mod n, S a represents the certificate of the signer U a , ID a represents the identity of the signer U a , H is a hash function, a = 1, 2,..., x;
[0023] S13. Randomly selecting one from all signers for signing, expressed as: U i = rand(U1, U2, U3...U x ), where rand is a random function, U i is the signer randomly selected for the i-th time;
[0024] S14. If i > 1, then obtain the signature (m i-1 , D i-1 of U i-1 and calculate:
[0025]
[0026]
[0027]
[0028]
[0029] [[ID= 81]]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038] [[ID= 103]]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054] [[ID= 142]]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061] Figure 1
[0062] Figure 2
[0063] Figure 3
[0064] Figure 4
[0065] Figure 5 <o000 295>
[0066] Figure 6
[0067] Figure 7
[0068]
[0069]
[0070] Figure 1 Figure 2
[0071]
[0072]
[0073] Figure 3
[0074]
[0075] [[ID=19 6]]
[0076]
[0077] i-1 ) and perform verification. If the verification passes, execute step S15; if i = 1, directly execute step S15;
[0025] S15. Based on the selected signer U i 's certificate S i and sign the plaintext, expressed as:
[0026]
[0027]
[0028] where H is a hash function, M is the plaintext, r i is the random number selected by U i during signing, and 1 < r i < n, and (m i , D i ) is used as the signature of U i .
[0029] S16. Repeat steps S13 - S15 until the final signature (m j , D j ) is generated, and j is a preset threshold.
[0030] In some embodiments, step S12 further includes:
[0031] The signer U a verifies the certificate S a based on the public key (e, n), and the verification method is expressed as:
[0032] If the equation holds, the verification passes; otherwise, the certificate S a is not accepted.
[0033] In some embodiments, in step S14, obtain the signature (m i-1 , D i-1 , D i-1 ) of U and perform verification, expressed as:
[0034] Calculate If m' i-1 = m i-1 , the verification passes.
[0035] In some embodiments, performing loss simulation on the digital watermark image to form a loss image set includes:
[0036] Performing one or a combination of more of compression, noise addition, or deformation on the digital watermark image, expressed as:
[0037] Let \(\mathcal{L}\) be the loss image set, \(G\) be a random function for randomly selecting one or more processing methods and randomly selecting parameters, \(S(\mu)\) be a compression function, \(\mu\) be the sampling range, \(T(\sigma)\) be a Gaussian noise function, \(\sigma\) be the standard deviation of the Gaussian noise, and \(W(a,b)\) be an image deformation function, where \(a\) and \(b\) represent the degree of deformation.
[0038] In some embodiments, the digital watermark decoder includes an encoding module, an attention support vector machine, and a fully connected neural network:
[0039] Inputting the loss image set into the digital watermark decoder for training includes:
[0040] Inputting the images \(x\) in the i \(\{0 < i \leq n\}\) into the encoding module to generate the encoding feature vector \(z\) corresponding to each digit of the digital signature in the image \(x\) i ; ij
[0041] Inputting the encoding feature vector \(z\) corresponding to each digit of the encoding into the attention support vector machine to generate a decision boundary and an attention weight vector, where the attention support vector machine includes an attention layer and a linear support vector machine, and the attention layer is expressed as: ij
[0042] where \(\beta\) ij represents the attention weight vector, conv represents a convolution operation, tanh represents an activation function, and \(N\) represents the total number of digits of the digital signature;
[0043] The linear support vector machine is expressed as:
[0044] \(f(x)=\text{sign}(\omega\) T \(\cdot x + b)\), where sign is the sign function, \(b\) is the bias term, \(\omega\) T is the weight of the vector machine, and \(\omega\) T \(\cdot x + b = 0\) represents the decision boundary of the linear support vector machine; [[ID=4l]]
[0045] The adversarial sample generation module adds different perturbations to the encoding feature vector corresponding to each digit based on the decision boundary and the attention weight vector to generate the corresponding adversarial encoding feature sample, and the generation of the adversarial encoding feature sample is expressed as:
[0046] where represents the adversarial encoding feature sample corresponding to \(z\) ij , \(\epsilon\) k > 0 represents the magnitude of the perturbation, \(k\) represents different perturbation exponents, the normal direction \(d\) of the decision boundary provides the generation direction of the adversarial encoding sample, and through the attention weight \(\beta\)ij You can get z ij The importance of different components across the decision boundary. k When it is large enough, the class label of the adversarial encoding feature sample will change from positive to negative;
[0047] The encoding feature vector and the corresponding adversarial encoding feature sample are input into a fully connected neural network to obtain a predicted code containing each digit of the digital signature. A loss value is constructed based on the difference between the predicted code and the digital signature. The loss value is expressed as:
[0048] Among them, f MSE is the mean square error, Describes the decoder, Represents the decoder for image x i The output of K represents the digital signature;
[0049] The decoder is trained based on the loss value.
[0050] The second embodiment of the present invention provides a traceability device integrating digital watermarks, including:
[0051] An encryption module is used to obtain product information, use the product information as plain text, and encrypt the plain text using a random multiple digital signature technology to obtain a digital signature of the plain text;
[0052] A generation module, configured to obtain an original image, and input the original image and the digital signature into a diffusion generation model of a fused cross-attention module to form a digital watermark image, wherein the diffusion generation model of the fused cross-attention module is pre-trained;
[0053] a loss simulation module, configured to perform loss simulation based on the digital watermark image to form a loss image set;
[0054] a decoding module, configured to input the loss image set into a digital watermark decoder for training, and extract the digital signature from the digital watermark image by the trained digital watermark decoder;
[0055] A verification module verifies the digital signature.
[0056] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for tracing the fused digital watermark as described in any of the above embodiments is implemented.
[0057] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for tracing the source of the fused digital watermark as described in any of the above embodiments is implemented.
[0058] The embodiments of the present invention have at least the following beneficial effects:
[0059] The embodiment of the present invention encrypts product information to generate a digital signature, then forms a digital watermark image based on the original image and the digital signature through a diffusion generation model that integrates a cross-attention module, then performs loss simulation on the generated image to expand the data, trains a decoder based on the expanded data to improve the decoder's ability to understand the digital signature, and then verifies the digital signature to achieve product traceability. At the same time, by generating a digital watermark image, counterfeiters are prevented from copying and counterfeiting product information, thereby improving credibility and greatly reducing the difficulty of counterfeiting. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0061] Figure 1 A schematic flow chart of a traceability method for integrating digital watermarks provided in accordance with an embodiment of the first aspect of the present invention;
[0062] Figure 2 It is a flowchart of a specific embodiment of the present invention;
[0063] Figure 3 A schematic diagram of a digital signature generation process according to an embodiment of the present invention;
[0064] Figure 4 This is a schematic diagram of the diffusion generation model structure that integrates the cross-attention module according to an embodiment of the present invention;
[0065] Figure 5 Schematic diagram of the decoder structure according to an embodiment of the present invention;
[0066] Figure 6 A schematic diagram of the architecture of a traceability device integrating digital watermarking provided in accordance with an embodiment of the second aspect of the present invention;
[0067] Figure 7 A schematic diagram of an electronic device architecture provided in an embodiment of the third aspect of the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments disclosed in this disclosure can be combined, separated, interchanged and / or rearranged with each other. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0069] The terms used herein are for the purpose of describing specific embodiments and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, the features, integral bodies, steps, operations, parts, assemblies and / or their groups stated are explained, but the presence or addition of one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups is not excluded. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or the values provided that will be recognized by those of ordinary skill in the art.
[0070] See also Figure 1 and Figure 2 The following describes a traceability method for integrating digital watermarks provided by the first aspect of the present invention through a specific embodiment. Specifically, a reliable traceability method for a wine geographical indication product is used as an example for description, and includes the following steps:
[0071] Step 1: Obtain product information, use the product information as plain text, and encrypt the plain text using a random multiple digital signature technology to obtain a digital signature of the plain text.
[0072] In some embodiments, the product information includes text information of the product supply chain entity, and the original image includes image information of a plantation, a production base, and a wine storage cellar.
[0073] In some embodiments, as Figure 3 As shown, the plaintext is encrypted using a random multiple digital signature technology, including:
[0074] S11. Generate a key pair based on the RSA algorithm:
[0075] Select p,q∈{prime number, p,q>1×10 199, where p ≠ q}, and calculate: n = p·q·(p - 1)·(q - 1), m = p·q;
[0076] Randomly select an integer r ∈ {Z, 2 r <p, 2 r <q}, and calculate:
[0077]
[0078] Select an integer e ∈ {Z, 1 < e < α(n)}, and gcd(e, α(n)) = 1, where gcd is to find the greatest common divisor, that is, e and α(n) are relatively prime to each other, and calculate the private key d, satisfying:
[0079] e·d = 1 mod α(n), which means that the result of e multiplied by d modulo α(n) is always 1; <000.com /
[0080] Select (e, n) as the public key and (d, m) as the private key;
[0081] S12. Generate a certificate corresponding to the signer based on the key pair, expressed as:
[0082] S a = H(ID i ) d mod n, S a represents the certificate of the signer U a . ID a represents the identity of the signer U a . H is a hash function, a = 1, 2,..., x; then distribute the certificate through a private secure channel to each signer U a , and each signer U a 3]] can use the formula to verify the certificate S a .
[0083] 0]]S13. Randomly select one from all the signers for signing, expressed as: U i = rand(U1, U2, U3...U x ), where rand is a random function, and U i And sign the plaintext, expressed as:
[0086]
[0087]
[0088] where H is a hash function, M is the plaintext, and r i is the random number selected during the signature of U i , and 1 < r i < n, and (m i , D i ) is used as the signature of U i ;
[0089] S16. Repeat steps S13 - S15 until the final signature (m j , D j ) is generated, and j is a preset threshold.
[0090] In some embodiments, step S12 further includes:
[0091] The signer U a verifies the certificate S a based on the public key (e, n), and the verification method is expressed as: [[ID=4�]]
[0092] If the equation holds, the verification passes; otherwise, the certificate S a is not accepted.
[0093] In some embodiments, in step S14, obtain the signature (m i-1 of U i-1 , D i-1 ) and verify it, expressed as:
[0094] Calculate If m' i-1 = m i-1 , the verification passes.
[0095] Step 2. Obtain the original image, and input the original image and the digital signature into the diffusion generation model of the fusion cross - attention module to form a digital watermark image. The diffusion generation model of the fusion cross - attention module is pre - trained.
[0096] Specifically, as Figure 4 shown, the image X i to be embedded with the watermark is fused with the digital signature K obtained in step S1, and used as the input of the diffusion generation model of the fusion cross - attention module to obtain a new image x iThe diffusion generation model with cross-attention module builds on the original diffusion model and divides the image generation process into the image feature extraction stage and the image reconstruction stage. The image feature extraction stage focuses on image feature extraction, while the image reconstruction stage follows the design of the Grid Transformer but introduces skip connections and a cross-attention block to filter out unimportant or non-semantic features, enabling more refined image generation.
[0097] The weight value of the cross attention in the feature extraction stage is expressed as:
[0098] q, k, v = W q I d , W k I d , W v I d
[0099]
[0100] Among them I d It is a high-level feature map obtained by convolutional neural network in the feature extraction stage. is the learnable weight, n e isI d Finally, the calculated weight values are passed to the grid transformer.
[0101] The Grid Transformer module is a transformer with grid self-attention. While traditional self-attention can capture global correspondences, its computational complexity increases rapidly with the input size. Grid self-attention divides the full-size feature map into N×M non-overlapping grids, first performing self-attention within the grid, and then connecting each grid. This preserves attention to local information while integrating global contextual information through cross-grid connections. The operation of the Grid Transformer is expressed as:
[0102]
[0103] Where i, j∈{Z, 0 <i≤N,0<j≤M},Q ij , K ij , V ij They represent the self-attention input feature embedding of grid ij respectively. Finally, the feature vector obtained by the grid transformer is passed to the image reconstruction stage.
[0104] The weight value of the cross attention in the image reconstruction stage is expressed as:
[0105] q, k, v = Wq I d , W k I d , W v I d
[0106] q′, k′, v′=W q ′f+q,W k ′f+k,W v ′f+v
[0107]
[0108] Among them I d It is the high-level feature map obtained by convolutional neural network in the image feature extraction stage, n e isI d Dimensions, is a learnable weight, and f represents the feature vector obtained in the feature extraction phase. The calculated weight value will be rescaled by the sigmoid activation function so that its value range is between 0 and 1. The resulting tensor is a filter that reduces the low-amplitude elements that represent noise or irrelevant areas. Finally, the result of the filtering operation is passed to the grid transformer:
[0109]
[0110] Where i, j∈{Z, 0 <i≤N,0<j≤M},Q ij , K ij , V ij They represent the self-attention input feature embedding of grid ij respectively. Finally, the encoded features obtained by the grid transformer are combined with the high-level feature map I d Fusion is performed and passed to the convolutional neural network to obtain the watermarked image x i .
[0111] Preferably, in order to fully preserve the content of the original image, the loss function of the diffusion generation model integrating the cross attention module is constructed:
[0112] L1=f Perceptual (X i , x i )
[0113] Among them, f PerceDtual Is the perceptual loss function, which measures the generated watermarked image x i With the original image X i The similarities between them.
[0114] Step three: performing loss simulation based on the digital watermark image to form a loss image set.
[0115] In some embodiments, loss simulation is performed based on the digital watermark image to form a loss image set, including:
[0116] Performing one or a combination of compression, noise addition, or distortion on the digital watermark image, expressed as:
[0117] is the loss image set, G is a random function for randomly selecting one or more processing methods and randomly selecting parameters, S(μ) is the compression function, μ is the sampling range, T(σ) is the Gaussian noise function, σ is the standard deviation of the Gaussian noise, W(a, b) is the image distortion function, and a, b represent the degree of distortion.
[0118] Step four: Input the loss image set into the digital watermark decoder for training, and extract the digital signature from the digital watermark image through the trained digital watermark decoder.
[0119] In some embodiments, the digital watermark decoder includes an encoding module, an attention support vector machine, and a fully connected neural network;
[0120] As Figure 5 shown, inputting the loss image set into the digital watermark decoder for training includes:
[0121] Inputting the image x in i {0 < i ≤ n} into the encoding module to generate the encoded feature vector z corresponding to each digit encoding of the digital signature in the image x i ; ij ;
[0122] Inputting the encoded feature vector z corresponding to each digit encoding ij into the attention support vector machine to generate a decision boundary and an attention weight vector, where the attention support vector machine includes an attention layer and a linear support vector machine, and the attention layer is expressed as:
[0123] where β ij represents the attention weight vector, conv represents the convolution operation, tanh represents the activation function, and N represents the total number of digits of the digital signature;
[0124] The linear support vector machine is expressed as:
[0125] f(x) = sign(ω T ·x + b), where sign is the sign function, b is the bias term, ω T is the vector machine weight, ω Tx + b = 0 represents the decision boundary of the linear support vector machine;
[0126] The adversarial sample generation module adds different perturbations to the encoding feature vector corresponding to each bit of encoding based on the decision boundary and the attention weight vector to generate corresponding adversarial encoding feature samples. The generation of adversarial encoding feature samples is expressed as:
[0127] in represents z ij The corresponding adversarial coding feature sample, ε k >0 indicates the size of the perturbation, k indicates different perturbation exponents, and the normal d of the decision boundary provides the generation direction of the adversarial coding sample. ij You can get z ij The importance of different components across the decision boundary. k When it is large enough, the class label of the adversarial encoding feature sample will change from positive to negative;
[0128] The encoding feature vector and the corresponding adversarial encoding feature sample are input into a fully connected neural network to obtain a predicted code containing each digit of the digital signature. A loss value is constructed based on the difference between the predicted code and the digital signature. The loss value is expressed as:
[0129] Among them, f MSE is the mean square error, Describes the decoder, Represents the decoder for image x i The output of K represents the digital signature;
[0130] The decoder is trained based on the loss value.
[0131] Preferably, in some embodiments, the loss function of the diffusion generation model fused with the cross attention module and the loss function of the digital watermark decoder are added together, and L2 regularization is introduced to optimize the loss function. Specifically expressed as:
[0132] Where ω1 and ω2 are the weight coefficients of L1 and L2, λ is the weight coefficient of the regularization term, and γ and δ are learnable weight parameters. This joint training strategy improves the accuracy of watermark extraction while promoting the performance of the generative model and effectively alleviating the overfitting problem, ultimately achieving end-to-end integration of watermark hiding and extraction.
[0133] Step 5: Verify the digital signature.
[0134] Verify random multi-signature (m j , D j) process is:
[0135]
[0136] If m′ j =m j , the signature passes verification.
[0137] The embodiment of the present invention encrypts product information to generate a digital signature, then forms a digital watermark image based on the original image and the digital signature through a diffusion generation model that integrates a cross-attention module, then performs loss simulation on the generated image to expand the data, trains a decoder based on the expanded data to improve the decoder's ability to understand the digital signature, and then verifies the digital signature to achieve product traceability. At the same time, by generating a digital watermark image, counterfeiters are prevented from copying and counterfeiting product information, thereby improving credibility and greatly reducing the difficulty of counterfeiting.
[0138] The second embodiment of the present invention provides a traceability device integrating digital watermarks, including:
[0139] An encryption module is used to obtain product information, use the product information as plain text, and encrypt the plain text using a random multiple digital signature technology to obtain a digital signature of the plain text;
[0140] A generation module, configured to obtain an original image, and input the original image and the digital signature into a diffusion generation model fused with a cross-attention module to form a digital watermark image;
[0141] a loss simulation module, configured to perform loss simulation based on the digital watermark image to form a loss image set;
[0142] a decoding module, configured to input the loss image set into a digital watermark decoder for training, and extract the digital signature from the digital watermark image by the trained digital watermark decoder;
[0143] A verification module verifies the digital signature.
[0144] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for tracing the fused digital watermark as described in any of the above embodiments is implemented.
[0145] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for tracing the source of the fused digital watermark as described in any of the above embodiments is implemented.
[0146] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0147] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0148] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0149] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A traceability method integrating digital watermarking, It is characterized in that The following steps are involved: Acquire product information, use the product information as plain text, and encrypt the plain text by using a random multiple digital signature technology to obtain a digital signature of the plain text; Acquire an original image, and input the original image and the digital signature into a diffusion generation model of a fusion cross-attention module to form a digital watermark image, wherein the diffusion generation model of the fusion cross-attention module is pre-trained; Performing loss simulation based on the digital watermark image to form a loss image set; Inputting the loss image set into a digital watermark decoder for training, and extracting the digital signature from the digital watermark image by the trained digital watermark decoder; Verifying the digital signature; The plaintext is encrypted by random multiple digital signature technology, including: S11. Generate a key pair based on the RSA algorithm: Select ,in , , and calculate: , ; Randomly pick an integer ,calculate: ; Select integer ,and ,in is to find the greatest common divisor, that is and Mutually prime numbers, calculate the private key ,satisfy: , which means that e multiplied by d is ; choose is the public key, is the private key; S12. Generate a certificate corresponding to the signer based on the key pair, expressed as: , Indicates the signer Certificate of Indicates the signer identity, is a hash function, a=1,2,…,x; S13. Randomly select one signer from all signatories to sign, expressed as: ,in is a random function, is the signer randomly selected for the i-th time; S14, if , then get Signature If the verification is successful, then execute step S15; Then directly execute step S15; S15. Based on the selected signer Certificate And sign the plaintext, expressed as: ; ; in is the hash function, M is the plain text, for The random number selected when signing, and ,by As signature; S16. Repeat steps S13-S15 until the final signature is generated , j is the preset threshold; The digital watermark decoder includes an encoding module, an attention support vector machine and a fully connected neural network; The loss image set is fed into the digital watermark decoder for training, including: The loss image set Images in Input encoding module to generate the image The encoding feature vector corresponding to each digit of the digital signature in ; The encoding feature vector corresponding to each digit is encoded Input the attention support vector machine to generate the decision boundary and attention weight vector, where the attention support vector machine includes the attention layer and the linear support vector machine. The attention layer is expressed as: ,in represents the attention weight vector, represents the convolution operation, represents the activation function, N represents the total number of bits of the digital signature; The linear support vector machine is expressed as: ,in is a sign function, is the bias term is the vector machine weight, represents the decision boundary of a linear support vector machine; The adversarial sample generation module adds different perturbations to the encoding feature vector corresponding to each digital encoding based on the decision boundary and the attention weight vector to generate corresponding adversarial encoding feature samples. The generation of adversarial encoding feature samples is expressed as: ,in express The corresponding adversarial coding feature samples, represents the size of the disturbance, k represents different disturbance indexes, and d represents the normal direction of the decision boundary; The encoding feature vector and the corresponding adversarial encoding feature sample are input into a fully connected neural network to obtain a predicted code containing each digit of the digital signature, and a loss value is constructed based on the difference between the predicted code and the digital signature. The loss value is expressed as: ,in, is the mean square error, Represents a decoder, Indicates the decoder for the image The output of K represents the digital signature; The decoder is trained based on the loss value.
2. According to the tracing method of fused digital watermarking described in claim 1, Features: The product information includes physical text information of the product supply chain, and the original image includes image information of a plantation, a production base, and a wine storage cellar.
3. The tracing method of fused digital watermark according to claim 1, Features: Step S12 also includes: Signer Public key based About Certificate Verification is performed, and the verification method is expressed as: If the equality holds, the verification is successful, otherwise the certificate is not accepted. .
4. The tracing method of fused digital watermark according to claim 1, Features: In step S14, obtain Signature And verify it, expressed as: calculate ,like , then the verification is passed.
5. The tracing method of fused digital watermark according to claim 1, Features: Performing loss simulation based on the digital watermark image to form a loss image set includes: The digital watermark image is subjected to one or more of the following combined processing: compression, noise addition or deformation, which is expressed as: , is the loss image set, is a random function used to randomly select one or more processing methods and randomly select parameters. is the compression function, is the sampling range, is the Gaussian noise function, is the standard deviation of the Gaussian noise, is the image deformation function, Indicates the degree of deformation.
6. A traceability device integrating digital watermarks, It is characterized in that The method for tracing the source of the fused digital watermark according to any one of claims 1 to 5 comprises: An encryption module is used to obtain product information, use the product information as plain text, and encrypt the plain text through a random multiple digital signature technology to obtain a digital signature of the plain text; A generation module, used for acquiring an original image, inputting the original image and the digital signature into a diffusion generation model of a fusion cross-attention module to form a digital watermark image, wherein the diffusion generation model of the fusion cross-attention module is pre-trained; A loss simulation module, used for performing loss simulation based on the digital watermark image to form a loss image set; A decoding module, used for inputting the loss image set into a digital watermark decoder for training, and extracting the digital signature from the digital watermark image by the trained digital watermark decoder; A verification module verifies the digital signature.
7. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for tracing the source of the fused digital watermark as described in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the tracing method for fused digital watermarking as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Digital signature identification method and device, electronic equipment and storage medium
CN112329599A
Text traceability detection method and system
CN113971266A
Energy big data query method and system
CN117235121A
Wine geographical indication product identification method and system
CN117351316A
