Deep Learning-Based Transaction Anti-Counterfeiting Identification Method
By using diffusion model, attention Unet model and lora model to process low-dimensional vector representation in deep learning-based steganography methods, the problems of difficulty in convergence and poor adaptability of prompt word optimization are solved, and the anti-counterfeiting identification marks are effectively hidden and extracted, which improves the anti-interference ability and robustness.
Patent Information
- Application Number
- CN202510457478.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-04-14
AI Technical Summary
In the steganography method based on deep learning, the optimization and convergence of prompt words is difficult, and the adaptability is poor, making it difficult to effectively hide and extract anti-counterfeiting identification marks.
The initial transaction identification vector is processed by the variational autoencoder of the pre-trained diffusion model, and the low-dimensional vector characterization is obtained, and the attention-based Unet model is used for reverse denoising. The anti-counterfeiting identification mark is added to the low-frequency region of the frequency domain characterized by low-dimensional vectors. The learnable Lora model is configured for denoising to hide and extract the anti-counterfeiting identification mark.
It improves training efficiency, enhances the anti-interference ability and robustness of the anti-counterfeiting identification mark, ensures the effective hiding and extraction of the mark, and realizes the privacy and reliability of the anti-counterfeiting identification.
Smart Images

Figure CN119992303B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transaction anti-counterfeiting identification, and particularly to a transaction anti-counterfeiting identification method based on deep learning. Background Art
[0002] Steganography is an anti-counterfeiting identification technology that embeds specific information into an information carrier to achieve anti-counterfeiting and identification. For example, image steganography means hiding secret information in an image without changing the visual quality and representation of the image.
[0003] The steganographic embedding method can be through modifying pixel values, frequency domain transformation (such as DCT, DFT), or a deep learning-based steganography method. When identification is required, the embedded information is extracted from the image through a specific algorithm to verify its authenticity. In the deep learning-based steganography method, the diffusion model steganography technology based on prompts is a new type of steganography method. Utilizing the generation ability of the diffusion model and the randomness and diversity of the images generated by the diffusion model, the secret information is hidden in the noise or details of the image. By adjusting the noise distribution or sampling strategy in the generation process, the embedding and extraction of information are realized. Its process requires designing effective prompts to achieve steganography, which requires high technology and experience. The optimization and convergence of the prompts are very difficult, and the adaptability is very poor.
[0004] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0005] To solve the above technical problems or at least partially solve the above technical problems, the present invention provides a transaction anti-counterfeiting identification method based on deep learning.
[0006] The present invention provides a transaction anti-counterfeiting identification method based on deep learning, including:
[0007] Processing an initial transaction identification vector through a variational autoencoder of a pre-trained diffusion model to obtain a low-dimensional vector representation of the initial transaction identification vector ;
[0008] Processing the low-dimensional vector representation through the attention-based Unet model of the diffusion model according to the inverse denoising process to obtain a low-dimensional vector representation that follows a Gaussian distribution ; wherein, the low-dimensional vector representation is generated by the Nth step of inverse denoising implemented by the attention-based Unet model;
[0009] Adding an anti-counterfeiting identification mark to the low-dimensional vector representation in the low-frequency region of the frequency domain;
[0010] Configure a learnable LoRA model for the attention-based Unet model. The trained LoRA model cooperates with the attention-based Unet model to perform a denoising process on the low-dimensional vector representation of the added anti-counterfeiting identification mark, so as to hide the anti-counterfeiting identification mark through the denoising process implemented by the LoRA model cooperating with the attention-based Unet model, and obtain the reduced result of the low-dimensional vector representation of the low-dimensional vector representation , and the variational autoencoder of the diffusion model can be based on to obtain a transaction identification vector ;
[0011] During the identification process, the variational autoencoder of the diffusion model processes the transaction identification vector , and then the LoRA model cooperates with the attention-based Unet model to restore the low-dimensional vector representation of the added anti-counterfeiting identification mark through an inverse denoising process, extract the anti-counterfeiting identification mark from it, and compare whether the similarity between the extracted anti-counterfeiting identification mark and the constructed anti-counterfeiting identification mark exceeds a set threshold to achieve anti-counterfeiting identification.
[0012] Furthermore, the diffusion model includes: a variational autoencoder, an attention-based Unet model, and a variational auto-decoder; among them, the attention-based Unet model includes: an input encoding unit composed of a residual module, a multi-head self-attention module, and a downsampling module, multiple input encoding units are cascaded, the last input encoding unit is connected to the intermediate encoding unit, the intermediate encoding unit is composed of a residual module, a multi-head self-attention module, and a residual module, multiple intermediate encoding units are cascaded, the last intermediate encoding unit is connected to the output decoding unit, the output decoding unit is composed of a residual module, a multi-head self-attention module, and an upsampling module, the output decoding unit receives the concatenated result of the output of the same-level input decoding unit and the output of the previous-level output decoding unit or intermediate encoding unit for decoding, and the last output decoding unit is connected to the output layer.
[0013] Furthermore, in the inverse denoising process implemented by the attention-based Unet model, the attention-based Unet model predicts the Gaussian noise according to the low-dimensional vector representation at the nth time step in the denoising process and the Gaussian noise predicted at the nth time step, and the predicted Gaussian noise is added to the low-dimensional vector representation obtained from the inverse denoising process at the (n - 1)th time step for inverse denoising. The inverse denoising process implemented by the attention-based Unet model gradually spreads the low-dimensional vector representation into a low-dimensional vector representation that follows a Gaussian distribution .
[0014] Furthermore, adding the anti-counterfeiting identification mark to the low-dimensional vector representation in the frequency domain includes:
[0015] For the low-dimensional vector representation Perform a two-dimensional Fourier transform and move the low-frequency components to the center position of the frequency domain through the fftshift operation;
[0016] Construct an anti-counterfeiting identification mark and refer to the low-dimensional vector representation Encode the anti-counterfeiting identification mark according to the specifications of the frequency domain, and add the encoded anti-counterfeiting identification mark to the low-frequency part in the frequency domain of the low-dimensional vector representation The low-frequency part in the frequency domain;
[0017] Convert the frequency domain result with the added anti-counterfeiting identification mark to the spatial domain through the inverse two-dimensional Fourier transform to obtain the low-dimensional vector representation with the added anti-counterfeiting identification mark.
[0018] Furthermore, configure LoRA parameters in the convolutional layer and output layer of the residual module of the attention-based Unet model to form a LoRA model.
[0019] Furthermore, regarding the denoising process of the low-dimensional vector representation with the added anti-counterfeiting identification mark and the inverse denoising process of the low-dimensional vector representation of the transaction identification vector of the transaction identification vector Train a learnable LoRA model. During the training, the processes participated by the diffusion model and the LoRA model are as follows: The LoRA model cooperates with the attention-based Unet model to iteratively denoise the low-dimensional vector representation with the added anti-counterfeiting identification mark, and sequentially obtain the denoising intermediate states of the low-dimensional vector representation with the added anti-counterfeiting identification mark …… and the restoration results during the training process , where the variational autoencoder of the diffusion model can obtain the transaction identification vector during the training process based on the restoration results during the training process ; After obtaining the transaction identification vector during the training process , the transaction identification vector during the training process is processed through a variational autoencoder to obtain the low-dimensional vector representation of the transaction identification vector of the transaction identification vector , and the LoRA model cooperates with the attention-based Unet model to iteratively perform inverse denoising on the low-dimensional vector representation and sequentially obtain …… , .
[0020] Furthermore, during the process of training the learnable LoRA model, the parameters of the attention-based Unet model remain unchanged, only the parameters of the LoRA model are adjusted, and the loss function that constrains the sampling training process is:
[0021] The restoration result of the denoising process implemented by the LoRA model in cooperation with the attention-based Unet model and the low-dimensional vector representation The distance between them. The variational autoencoder generates a transaction authentication vector based on the restoration result and the distance between the initial transaction authentication vector The LoRA model in cooperation with the attention-based Unet model calculates the KL divergence sum between the distribution of the low-dimensional vector representation of the transaction authentication vector obtained by the inverse denoising process of the low-dimensional vector representation of the transaction authentication vector and the distribution of the low-dimensional vector representation with anti-counterfeiting authentication marks added.
[0022] Furthermore, during the training process, after generating the transaction authentication vector, interference operations are performed on the transaction authentication vector, and then the recognizability of the anti-counterfeiting authentication mark is verified. Among them, the interference operations adopt any one or a combination of the following operations: compression interference, Gaussian noise addition interference, Gaussian blur interference, scaling interference, partial cropping interference, rotation interference, adding a constant interference to each element of the transaction authentication vector, and multiplying a constant coefficient interference to each element of the transaction authentication vector.
[0023] Furthermore, during the authentication process, the product party uses the variational autoencoder of the diffusion model to process the transaction authentication vector to obtain its low-dimensional vector representation , and then the private LoRA model in cooperation with the attention-based Unet model restores the low-dimensional vector representation with anti-counterfeiting authentication marks added through the inverse denoising process, performs a two-dimensional Fourier transform on the low-dimensional vector representation with anti-counterfeiting authentication marks added to obtain a frequency domain result, extracts the anti-counterfeiting authentication mark from the frequency domain result, and compares whether the similarity between the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark exceeds a set threshold to achieve anti-counterfeiting authentication.
[0024] Furthermore, the similarity between the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark is as follows:
[0025] ;
[0026] where are the means of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark respectively, are the variances of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark respectively, is the covariance of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark, is a constant for stabilizing the similarity.
[0027] The above technical solution provided by the embodiment of the present invention has the following advantages compared with the prior art:
[0028] This application uses the attention-based Unet model of the diffusion model to represent the low-dimensional vector according to the inverse denoising process. Processing is performed to obtain a low-dimensional vector representation that obeys the Gaussian distribution ; Low-dimensional vector representation of the inverse denoising process following Gaussian distribution Add anti-counterfeiting identification marks to the diffusion process instead of the low-dimensional vector representation that follows the Gaussian distribution. An anti-counterfeiting identification mark is added. Since the noise predicted by the attention-based Unet model is added, it is easier to converge in the subsequent training process of the lora model with the attention-based Unet model, thereby improving the training efficiency.
[0029] This application adds anti-counterfeiting identification marks to low-dimensional vector representation In the low-frequency area of the frequency domain; the visible representation is mainly related to the high frequency. The present application adds the anti-counterfeiting identification mark coding to the low-frequency part. When the high-frequency part that determines the visible representation changes, the anti-counterfeiting identification mark coding information of the low-frequency part will not be lost.
[0030] The attention-based Unet model is configured with a learnable lora model. The trained lora model cooperates with the attention-based Unet model to perform a denoising process on the low-dimensional vector representation with the anti-counterfeiting identification mark added, so as to hide the anti-counterfeiting identification mark through the denoising process realized by the lora model in cooperation with the attention-based Unet model, and obtain a low-dimensional vector representation. The restoration result , the variational self-decoder of the diffusion model can be based on Get the transaction identification vector The original variational autoencoder, variational autodecoder, lora model and attention-based Unet model in this application actually form a new diffusion model, which can use its generation ability to hide anti-counterfeiting identification marks in the denoising process and obtain a low-dimensional vector representation. The restoration result , the variational self-decoder can be based on Get the transaction identification vector , the generated transaction identification vector The representation of the initial transaction identification vector is retained. This method can retain the original representation of the carrier image in image-based steganography. During the identification process, the variational autoencoder of the diffusion model processes the transaction identification vector , then the LoRA model cooperates with the attention-based Unet model to restore the low-dimensional vector representation with the anti-counterfeiting identification mark added through the inverse denoising process, extract the anti-counterfeiting identification mark from it, and compare whether the similarity between the extracted anti-counterfeiting identification mark and the constructed anti-counterfeiting identification mark exceeds the set threshold to achieve anti-counterfeiting identification. Since the product side retains the LoRA model and the constructed anti-counterfeiting identification mark, even if the diffusion model is an existing model, the privacy of identification can still be achieved and it is not easily cracked. Using the LoRA model to participate in the denoising and inverse denoising processes makes full use of the robustness of the model, improves the robustness of the anti-counterfeiting identification mark encoding and decoding processes, and enhances the anti-interference ability of the anti-counterfeiting identification mark. LoRA directly fine-tunes the parameters of the attention-based Unet model through low-rank matrix factorization, can more precisely control the generation result, and has stronger adaptability to the anti-counterfeiting identification mark compared to the existing prompt word optimization processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0033] Figure 1 It is a flowchart of a method for anti-counterfeiting identification of transactions based on deep learning provided by an open embodiment of the present invention.
[0034] Figure 2 It is a schematic diagram of the overall architecture of a method for anti-counterfeiting identification of transactions based on deep learning provided by an open embodiment of the present invention.
[0035] Figure 3 It is a schematic diagram of the attention-based Unet model provided by an open embodiment of the present invention.
[0036] Figure 4 It is for adding an anti-counterfeiting identification mark to the low-dimensional vector representation in the frequency domain.
[0037] Figure 5 It is a flowchart of the process participated by the model during the training of the LoRA model provided by an open embodiment of the present invention.
[0038] Figure 6 It is a schematic diagram of a device for anti-counterfeiting identification of transactions based on deep learning provided by an open embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] To make the objectives, 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 with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0040] It should be noted that in this text, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such a process, method, article, or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the element.
[0041] Embodiment 1
[0042] Referring to Figure 1 and Figure 2 as shown, an anti-counterfeiting identification method for transactions based on deep learning provided by an embodiment of the present invention includes:
[0043] S100, processing an initial transaction identification vector through a variational autoencoder of a pre-trained diffusion model to obtain a low-dimensional vector representation of the initial transaction identification vector ; the initial transaction identification vector is a high-dimensional vector, and its parameter distribution has a set meaning, such as representing the identification of a transaction product.
[0044] The pre-trained diffusion model includes: a variational autoencoder, an attention-based Unet model, and a variational auto-decoder. The variational autoencoder maps the initial transaction identification vector to a low-dimensional space for processing, reducing the computational complexity of the processing process and the hardware configuration requirements. The attention-based Unet model supports subsequent inverse denoising and denoising processes in the low-dimensional space. The variational auto-decoder restores the initial transaction identification vector according to the output result of the attention-based Unet model in the denoising process.
[0045] As Figure 2 shown, in the diffusion process of the diffusion model, Gaussian noise is iteratively added to the low-dimensional vector representation of the initial transaction identification vector to successively obtain low-dimensional vector representations …… , , where the low-dimensional vector representation follows a Gaussian distribution. During the denoising process, the attention-based Unet model predicts the noise based on the time step encoding and the current low-dimensional vector representation. The predicted noise corresponds to the noise added at the corresponding step of the diffusion process. The denoising is performed by modeling the predicted noise through the attention-based Unet model to obtain the low-dimensional vector representation through iterative denoising. ... , . Among them, is the restoration result of the low-dimensional vector representation . The variational autoencoder restores the initial transaction authentication vector according to the restoration result of the low-dimensional vector representation . The time step encoding is a conventional technique involved in the diffusion model. The prediction of the attention-based Unet model is related to the time step, so the time step encoding is introduced to control the prediction. .
[0046] In the specific implementation process, as Figure 3 shown, the attention-based Unet model includes: an input encoding unit composed of a residual module, a multi-head self-attention module, and a downsampling module. Multiple input encoding units are cascaded, and the last input encoding unit is connected to the intermediate encoding unit. The intermediate encoding unit is composed of a residual module, a multi-head self-attention module, and a residual module. Multiple intermediate encoding units are cascaded, and the last intermediate encoding unit is connected to the output decoding unit. The output decoding unit is composed of a residual module, a multi-head self-attention module, and an upsampling module. The output decoding unit receives the concatenation result of the output of the same-level input decoding unit and the output of the previous-level output decoding unit or intermediate encoding unit for decoding, and the last output decoding unit is connected to the output layer. In the specific implementation process, the multi-head self-attention module can be optimized into other types of attention modules according to requirements, such as cross-attention and linear attention.
[0047] In this application, in S200, the low-dimensional vector representation is processed by the attention-based Unet model according to the inverse denoising process to obtain a low-dimensional vector representation that follows a Gaussian distribution; among them, the low-dimensional vector representation Generated by the Nth step of inverse denoising implemented by the attention-based Unet model. During the inverse denoising process implemented by the attention-based Unet model, the attention-based Unet model predicts Gaussian noise based on the low-dimensional vector representation at the nth time step and the predicted Gaussian noise at the nth time step during the denoising process. The predicted Gaussian noise is added to the low-dimensional vector representation obtained from the inverse denoising process at the (n - 1)th time step. The inverse denoising process implemented by the attention-based Unet model gradually transforms the low-dimensional vector representation into a low-dimensional vector representation that follows a Gaussian distribution .
[0048] S300, add the anti-counterfeiting identification mark to the low-dimensional vector representation in the low-frequency region of the frequency domain. In the specific implementation process, the product side will construct an anti-counterfeiting identification mark and retain the constructed anti-counterfeiting identification mark for subsequent identification.
[0049] In the specific implementation process, as Figure 4 shown, the above process includes:
[0050] Perform a two-dimensional Fourier transform on the low-dimensional vector representation and move the low-frequency components to the center position of the frequency domain through the fftshift operation;
[0051] Construct an anti-counterfeiting identification mark and encode the anti-counterfeiting identification mark with reference to the specifications of the low-dimensional vector representation in the frequency domain, and add the encoded anti-counterfeiting identification mark to the low-frequency part of the low-dimensional vector representation in the frequency domain; the visible representation is mainly related to the high frequency. In this application, the anti-counterfeiting identification mark encoding is added to the low-frequency part, so that when the high-frequency part that determines the visible representation changes, the anti-counterfeiting identification mark encoding in the low-frequency part will not be lost.
[0052] Convert the frequency domain result with the added anti-counterfeiting identification mark to the spatial domain through the inverse two-dimensional Fourier transform to obtain the low-dimensional vector representation with the added anti-counterfeiting identification mark.
[0053] Since the anti-counterfeiting identification mark is added to the low-dimensional vector representation with the added anti-counterfeiting identification mark, the original low-dimensional vector representation cannot be obtained through the denoising process of the low-dimensional vector representation with the added anti-counterfeiting identification mark by the attention-based Unet model. Correspondingly, the variational autoencoder of the diffusion model cannot generate the initial transaction identification vector The restoration result. The purpose of this application is to enable the diffusion model to obtain a transaction authentication vector based on the low-dimensional vector representation of the added anti-counterfeiting authentication mark, and the transaction authentication vector is consistent with the visible representation of the initial transaction authentication vector, so that while the transaction authentication vector retains the meaning of the initial transaction authentication vector, the anti-counterfeiting authentication mark is hidden. In this way, the product provider can use the "decoding key" retained in hand to restore the low-dimensional vector representation of the added anti-counterfeiting authentication mark from the transaction authentication vector, and then extract the anti-counterfeiting authentication mark for anti-counterfeiting authentication.
[0054] To achieve the above object, this application performs the following operations:
[0055] S400, as Figure 2 shown, configure a learnable LoRA model for the attention-based Unet model. The LoRA model does not affect the parameters of the attention-based Unet model, and the parameters of the LoRA model exist independently of the attention-based Unet model. In the specific implementation process, LoRA parameters are configured in the convolutional layer and output layer of the residual module of the attention-based Unet model to form a LoRA model.
[0056] The trained LoRA model cooperates with the attention-based Unet model to perform a denoising process on the low-dimensional vector representation of the added anti-counterfeiting authentication mark; to hide the anti-counterfeiting authentication mark through the denoising process implemented by the LoRA model cooperating with the attention-based Unet model, and obtain the restoration result of the low-dimensional vector representation of , and is consistent. The variational autoencoder of the diffusion model can obtain a transaction authentication vector based on and the obtained transaction authentication vector is consistent with the visible representation of the initial transaction authentication vector.
[0057] To achieve the above object, it is necessary to train the learnable LoRA model for the denoising process of the low-dimensional vector representation of the added anti-counterfeiting authentication mark, and the inverse denoising process of the low-dimensional vector representation of the transaction authentication vector of . As Figure 2 and Figure 5 shown, during training, the processes participated by the diffusion model and the LoRA model are as follows: the LoRA model cooperates with the attention-based Unet model to iteratively perform denoising processing on the low-dimensional vector representation of the added anti-counterfeiting authentication mark, and successively obtain the denoising intermediate states of the low-dimensional vector representation of the added anti-counterfeiting authentication mark …… and the restoration results during the training process , where the variational autoencoder of the diffusion model can be based on the restoration results during the training process Obtain the transaction authentication vector during the training process ; Obtain the transaction authentication vector during the training process After that, the transaction authentication vector during the training process is processed by the variational autoencoder of the diffusion model to obtain the low-dimensional vector representation of the transaction authentication vector during the training process ; The LoRA model cooperates with the attention-based UNet model to iteratively perform inverse denoising processing on the low-dimensional vector representation and sequentially obtain …… and the low-dimensional vector representation with anti-counterfeiting authentication marks added during the training process .
[0058] During training, the parameters of the attention-based UNet model remain unchanged, only the parameters of the LoRA model are adjusted, and the loss function that constrains the sampling training process is the restoration result of the denoising process implemented by the LoRA model cooperating with the attention-based UNet model and the low-dimensional vector representation The distance between them, the variational auto-decoder generates the transaction authentication vector based on the restoration result and the distance between the initial transaction authentication vector The LoRA model cooperates with the attention-based UNet model to perform the inverse denoising process on the low-dimensional vector representation of the transaction authentication vector The KL divergence between the obtained low-dimensional vector representation and the distribution of the low-dimensional vector representation with anti-counterfeiting authentication marks added is summed. With the aim of minimizing the loss function, the parameters of the LoRA model are adjusted. Through the above training process, the LoRA model cooperating with the attention-based UNet model realizes hiding anti-counterfeiting authentication marks during the denoising process. This hiding can be decoded by the LoRA model and the attention-based UNet model, which can be used as the "decoding key" during the inverse denoising process. And during the process of hiding anti-counterfeiting authentication marks, the loss function constrains the distance between the restoration result and the low-dimensional vector representation , constrains the distance between the transaction authentication vector generated by the variational auto-decoder based on the restoration result and the initial transaction authentication vector , ensuring that the generated transaction authentication vector is basically consistent with the initial transaction authentication vector .
[0059] During the specific training process, after generating the transaction authentication vector, interference operations are performed on the transaction authentication vector, and then the recognizability of the anti-counterfeiting authentication mark is verified to verify the authentication effect after the generated transaction authentication vector in this application is interfered. The interference operations adopt any one or several of the following operation combinations:
[0060] Compression interference, adding Gaussian noise interference, Gaussian blur interference, scaling interference, partial cropping interference, rotation interference, adding a constant interference to each element of the transaction authentication vector, multiplying each element of the transaction authentication vector by a constant coefficient interference. Through verification, ensure that the parameters of the LoRA model can be robust to the interfered transaction authentication vector.
[0061] After generating the transaction authentication vector, during the transaction process, it is transmitted to the buyer together with the product. In the specific implementation process, after the buyer in the transaction obtains the product, the corresponding transaction authentication vector is provided to the product side, and the product side uses the diffusion model and the LoRA model in hand to extract the anti-counterfeiting authentication mark to achieve authentication.
[0062] During the authentication process, the product side uses the variational autoencoder of the diffusion model to process the transaction authentication vector to obtain its low-dimensional vector representation , and then the private LoRA model cooperates with the attention-based Unet model to restore the low-dimensional vector representation with the added anti-counterfeiting authentication mark through the inverse denoising process. Perform a two-dimensional Fourier transform on the low-dimensional vector representation with the added anti-counterfeiting authentication mark to obtain the frequency domain result, extract the anti-counterfeiting authentication mark from the frequency domain result, and compare whether the similarity between the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark exceeds the set threshold to achieve anti-counterfeiting authentication.
[0063] An example of similarity is as follows:
[0064] ;
[0065] wherein, are the means of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark respectively, are the variances of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark respectively, is the covariance of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark, is a constant for stabilizing the similarity.
[0066] Of course, it also supports directly comparing the coding similarity of the extracted anti-counterfeiting authentication mark and the constructed anti-counterfeiting authentication mark, omitting the decoding process of the anti-counterfeiting authentication mark.
[0067] Example 2
[0068] Refer to Figure 6As shown in the figure, the present invention provides a transaction anti-counterfeiting identification device based on deep learning, including: a sending end and a receiving end. Both the sending end and the receiving end include a processing unit, a storage unit, and a communication unit interconnected via a bus. The communication units of the sending end and the receiving end are connected. Among them, the storage unit stores a computer program. When the processing unit reads and executes the computer program, the transaction anti-counterfeiting identification method based on deep learning is implemented.
[0069] In the specific implementation process, the sending end is in the hands of the buyer. The buyer sends the transaction identification vector of the product to the receiving end through the sending end. The receiving end is in the hands of the product party. After receiving the transaction identification vector, the product party processes the transaction identification vector using the variational autoencoder of the diffusion model. Obtain its low-dimensional vector representation , and then the private LoRA model cooperates with the attention-based Unet model to restore the low-dimensional vector representation with anti-counterfeiting identification marks added through the inverse denoising process. Perform a two-dimensional Fourier transform on the low-dimensional vector representation with anti-counterfeiting identification marks added to obtain a frequency-domain result. Extract the anti-counterfeiting identification mark from the frequency-domain result, and compare whether the similarity between the extracted anti-counterfeiting identification mark and the constructed anti-counterfeiting identification mark exceeds a set threshold.
[0070] Of course, the computer program stored in the storage unit of a transaction anti-counterfeiting identification device based on deep learning provided by the embodiments of the present invention is not limited to the method operations described above, and can also execute related operations in a transaction anti-counterfeiting identification method provided by any embodiment of the present invention.
[0071] Embodiment 3
[0072] The embodiments of the present invention provide a computer-readable storage medium. The computer-readable storage medium stores computer instructions. When the computer instructions are executed by a processor, the transaction anti-counterfeiting identification method based on deep learning is implemented, including:
[0073] Process the initial transaction identification vector through the variational autoencoder of the pre-trained diffusion model , obtain the low-dimensional vector representation of the initial transaction identification vector ;
[0074] Process the low-dimensional vector representation through the attention-based Unet model of the diffusion model according to the inverse denoising process , obtain a low-dimensional vector representation that follows a Gaussian distribution ; Among them, the low-dimensional vector representation is generated by the Nth step of inverse denoising implemented by the attention-based Unet model;
[0075] Add the anti-counterfeiting identification mark to the low-dimensional vector representation in the low-frequency region of the frequency domain;
[0076] Configure a learnable LoRA model for the attention-based Unet model. After training, the LoRA model cooperates with the attention-based Unet model to perform a denoising process on the low-dimensional vector representation of the added anti-counterfeiting identification mark, so as to hide the anti-counterfeiting identification mark through the denoising process implemented by the LoRA model cooperating with the attention-based Unet model, and obtain the reduced result of the low-dimensional vector representation ; , the variational autoencoder of the diffusion model can be based on to obtain a transaction identification vector ;
[0077] During the identification process, the variational autoencoder of the diffusion model processes the transaction identification vector , and then the LoRA model cooperates with the attention-based Unet model to restore the low-dimensional vector representation of the added anti-counterfeiting identification mark through an inverse denoising process, extract the anti-counterfeiting identification mark from it, and compare whether the similarity between the extracted anti-counterfeiting identification mark and the constructed anti-counterfeiting identification mark exceeds a set threshold to achieve anti-counterfeiting identification.
[0078] Of course, for a computer-readable storage medium provided by an embodiment of the present invention, the computer program stored therein is not limited to the method operations described above, and can also execute related operations in a method for transaction anti-counterfeiting identification based on deep learning provided by any embodiment of the present invention.
[0079] In the embodiments provided by the present invention, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the structural embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of structures or units can be in electrical, mechanical or other forms.
[0080] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, in each embodiment of the present invention, each functional unit may be integrated into one processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0082] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather will conform to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A transaction anti-counterfeiting identification method based on deep learning, characterized in that: include: Processing the initial transaction identification vector through a variational autoencoder of a pre-trained diffusion model , and obtain the low-dimensional vector representation of the initial transaction identification vector ; The low-dimensional vector representation is performed by the attention-based Unet model of the diffusion model according to the inverse denoising process. Processing is performed to obtain a low-dimensional vector representation that obeys the Gaussian distribution ; Among them, the low-dimensional vector representation The Nth step inverse denoising is achieved by the attention-based Unet model; Adding anti-counterfeiting identification marks to low-dimensional vector representation In the low frequency region of the frequency domain; The attention-based Unet model is configured with a learnable lora model. The trained lora model cooperates with the attention-based Unet model to perform a denoising process on the low-dimensional vector representation with the anti-counterfeiting identification mark added, so as to hide the anti-counterfeiting identification mark through the denoising process realized by the lora model in cooperation with the attention-based Unet model, and obtain a low-dimensional vector representation. The restoration result , the variational self-decoder of the diffusion model can be based on Get the transaction identification vector ; During the identification process, the variational autoencoder of the diffusion model processes the transaction identification vector Then, the lora model cooperates with the attention-based Unet model to restore the low-dimensional vector representation of the added anti-counterfeiting identification mark through the inverse denoising process, extract the anti-counterfeiting identification mark from it, and compare whether the similarity between the extracted anti-counterfeiting identification mark and the constructed anti-counterfeiting identification mark exceeds the set threshold to achieve anti-counterfeiting identification.
2. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: The diffusion model includes: a variational autoencoder, an attention-based Unet model and a variational self-decoder; wherein the attention-based Unet model includes: an input encoding unit consisting of a residual module, a multi-head self-attention module and a downsampling module, a cascade of multiple levels of input encoding units, a last-level input encoding unit connected to an intermediate encoding unit, an intermediate encoding unit consisting of a residual module, a multi-head self-attention module and a residual module, a cascade of multiple levels of intermediate encoding units, a last-level intermediate encoding unit connected to an output decoding unit, an output decoding unit consisting of a residual module, a multi-head self-attention module and an upsampling module, an output decoding unit receiving a concatenation of the output of an input decoding unit at the same level and the output of an output decoding unit or an intermediate encoding unit at the previous level for decoding, and a last-level output decoding unit connected to an output layer.
3. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: In the inverse denoising process implemented by the attention-based Unet model, the attention-based Unet model predicts Gaussian noise based on the low-dimensional vector representation of the nth time step in the denoising process and the nth time step. The predicted Gaussian noise is added to the low-dimensional vector representation obtained by the inverse denoising process at the n-1th time step. The inverse denoising process implemented by the attention-based Unet model gradually converts the low-dimensional vector representation into Diffusion into a low-dimensional vector representation that follows a Gaussian distribution .
4. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: The anti-counterfeiting identification mark is added to the low-dimensional vector representation The frequency domain includes: Representation of low-dimensional vectors Perform a two-dimensional Fourier transform and move the low-frequency component to the center of the frequency domain through the fftshift operation; Construct anti-counterfeiting identification marks and refer to low-dimensional vector representation The anti-counterfeiting identification mark is encoded using the frequency domain specification, and the encoded anti-counterfeiting identification mark is added to the low-dimensional vector representation. The low frequency part in the frequency domain; The frequency domain result of adding the anti-counterfeiting identification mark is converted into the spatial domain through two-dimensional inverse Fourier transform to obtain a low-dimensional vector representation of the added anti-counterfeiting identification mark.
5. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: The convolutional layer and output layer in the residual module of the attention-based UNet model are configured with LoRa parameters to form a LoRa model.
6. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: The denoising process of the low-dimensional vector representation of the added anti-counterfeiting identification mark and the transaction identification vector A low-dimensional vector representation of The inverse denoising process is used to train the learnable lora model. During the training, the diffusion model and the lora model participate in the following process: the lora model cooperates with the attention-based Unet model to iteratively denoise the low-dimensional vector representation of the added anti-counterfeiting identification mark, and obtains the denoised intermediate state of the low-dimensional vector representation of the added anti-counterfeiting identification mark in turn. … And the restoration results during training , where the variational self-decoder of the diffusion model can be based on the restoration results during training Get the transaction identification vector during the training process; Get the transaction identification vector during the training process After that, the transaction identification vector The transaction identification vector is obtained through variational autoencoder processing A low-dimensional vector representation of , lora model cooperates with attention-based Unet model to represent low-dimensional vectors Iteratively perform inverse denoising and obtain … , .
7. The transaction anti-counterfeiting identification method based on deep learning according to claim 6 is characterized in that: In the process of training the learnable lora model, the parameters of the attention-based Unet model remain unchanged, and only the parameters of the lora model are adjusted. The loss function of the constrained sampling training process is: The restoration result of the denoising process achieved by the LoRa model in conjunction with the attention-based UNet model and low-dimensional vector representation The distance between them, the variational self-decoder is based on the restoration result Generated transaction identification vector and the initial transaction identification vector The lora model cooperates with the attention-based Unet model to identify the transaction vector A low-dimensional vector representation of The low-dimensional vector representation obtained by the inverse denoising process The KL divergence sum is calculated between the distribution of and the distribution of the low-dimensional vector representation of the anti-counterfeiting identification mark.
8. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: After the transaction identification vector is generated during the training process, an interference operation is performed on the transaction identification vector, and then the recognizability of the anti-counterfeiting identification mark is verified, wherein the interference operation adopts any one or a combination of the following operations: compression interference, adding Gaussian noise interference, Gaussian blur interference, scaling interference, partial cropping interference, rotation interference, adding a constant interference to each element of the transaction identification vector, and multiplying each element of the transaction identification vector by a constant coefficient interference.
9. The transaction anti-counterfeiting identification method based on deep learning according to claim 1 is characterized in that: During the identification process, the product side uses the variational autoencoder of the diffusion model to process the transaction identification vector Get its low-dimensional vector representation Then, the private lora model cooperates with the attention-based Unet model to restore the low-dimensional vector representation of the added anti-counterfeiting identification mark through the inverse denoising process, and performs a two-dimensional Fourier transform on the low-dimensional vector representation of the added anti-counterfeiting identification mark to obtain the frequency domain result, and extracts the anti-counterfeiting identification mark from the frequency domain result. The similarity between the extracted anti-counterfeiting identification mark and the constructed anti-counterfeiting identification mark is compared to see whether it exceeds the set threshold, so as to realize anti-counterfeiting identification.
10. The transaction anti-counterfeiting identification method based on deep learning according to claim 1, characterized in that: The similarity between extracting anti-counterfeiting identification marks and constructing anti-counterfeiting identification marks is as follows: ; in, are the mean values of extracting anti-counterfeiting identification marks and constructing anti-counterfeiting identification marks, respectively. are the variances of extracting anti-counterfeiting identification marks and constructing anti-counterfeiting identification marks, respectively. In order to extract the anti-counterfeiting identification mark and construct the covariance of the anti-counterfeiting identification mark, is a constant that stabilizes the similarity.
Citation Information
Patent Citations
Generative steganography method for anti-counterfeiting of electronic certificate
CN117376484A
Trademark identification method and system based on anti-counterfeiting codes
CN119129620A