DCT (Discrete Cosine Transform) frequency domain watermark embedding optimization method and system based on potential space
By embedding DCT frequency domain watermarks in the latent space and optimizing image quality, the problem of watermark indelibility and extractability under AI generation model attacks in existing technologies is solved, achieving efficient copyright protection and reliable traceability in the AIGC environment.
Patent Information
- Application Number
- CN202511181510.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-28
AI Technical Summary
Existing image watermarking technologies struggle to maintain image quality and stably preserve watermark information when facing attacks from AI-generated models, and lack the ability to semantically ablate deep generative models, thus threatening copyright protection and trusted traceability mechanisms.
A latent space-based DCT frequency domain watermarking embedding method is adopted. The latent space representation of the image is obtained through a pre-trained inverse denoising diffusion model. The watermark is embedded in the frequency domain using a weighted voting mechanism. The watermark embedding is optimized through a multi-objective joint loss function. The image quality is ensured by combining SSIM and LPIPS loss functions to generate an optimized image.
It enhances the survivability of watermarks under AI generation model attacks, improves the extraction accuracy and robustness of watermarks, maintains image quality, and is suitable for copyright protection and trusted traceability of AIGC content.
Smart Images

Figure CN121032772A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of digital image processing, information security and artificial intelligence security, and particularly relates to a DCT frequency domain watermark embedding optimization method and system based on a latent space. BACKGROUND
[0002] With the wide application of AIGC (artificial intelligence generated content) technology, especially the continuous development of image generation models represented by diffusion models and GANs, traditional image watermarking technology is facing unprecedented challenges. These AI models have strong image "reconstruction" and "redrawing" capabilities, which can significantly remove watermark information in the original image without significantly changing the visual content, resulting in the failure of existing watermarking schemes to extract when facing AI re-generation attacks (such as image style migration, image-to-image translation, and text-guided editing), which seriously threatens the copyright protection and traceability mechanism of digital content. On the other hand, most current mainstream watermarking methods are based on pixel domain or shallow feature space embedding, lacking targeted design for deep generative model semantic ablation capability, making it difficult to adapt to the security needs in the AIGC ecosystem.
[0003] Therefore, there is an urgent need to design a watermark embedding method that is robust to AI attacks, which not only has good image quality preservation ability, but also can stably retain and accurately extract watermark information in the latent image regeneration scenario. SUMMARY
[0004] The purpose of the present application is to solve the problems existing in the prior art and provide a DCT frequency domain watermark embedding optimization method based on a latent space. This method combines the latent space representation of diffusion models and frequency domain analysis mechanisms to improve the non-erasability and extractability of watermarks in the face of deep generation attacks such as AI redrawing, style migration, and content translation, and is suitable for AIGC content copyright identification and traceability scenarios.
[0005] To achieve the above-mentioned application purposes, the present application specifically adopts the following technical solutions: In a first aspect, the present application provides a DCT frequency domain watermark embedding optimization method based on a latent space, which includes the following steps: S1. Given an input original image, obtain the original latent space representation corresponding to the original image through a pre-trained inverse denoising diffusion implicit model; S2. divide the original latent space representation into several non-overlapping small blocks, and perform a two-dimensional discrete cosine transform on each small block to obtain an original frequency domain representation corresponding to each small block, and embed a single-bit watermark in the original frequency domain representation of each small block based on a weighted voting mechanism, restore the frequency domain representation after adding the watermark to the corresponding watermarked image block through inverse discrete cosine transform, combine all watermarked image blocks to obtain a watermarked latent space representation, and input the watermarked latent space representation into the parameter-fixed stable diffusion model to generate a watermarked image; S3. optimize the watermarked latent space representation based on the original latent space representation, use a multi-objective joint loss function as the optimization objective, and repeatedly perform S2, and when the multi-objective joint loss function is minimized, the finally optimized watermarked latent space representation is taken as the final representation after embedding the watermark; S4. input the final representation after embedding the watermark into the parameter-fixed stable diffusion model to form an optimized watermarked image and take it as the watermarked image, linearly mix the watermarked image with the original image to form an optimized image, automatically adjust the coefficient used in linear mixing through binary search, so that the optimized image satisfies the preset image quality optimization objective, and take the optimized image satisfying the objective as the final image, and complete the latent space-based DCT frequency domain watermark embedding optimization.
[0006] On the basis of the above scheme, each step can be implemented in the following preferred specific manner.
[0007] As a preferred embodiment of the above first aspect, the specific process of embedding a watermark for an original frequency domain representation in step S2 is as follows: first, select a plurality of pairs of mid-frequency DCT coefficients in the original frequency domain representation, and each pair of mid-frequency DCT coefficients has a pre-statistically obtained robustness weight; second, calculate the coefficient difference of each pair of mid-frequency DCT coefficients, and quantize the coefficient difference to a binary result through a sign function, and multiply the binary result by the robustness weight of the pair of mid-frequency DCT coefficients to obtain the voting score of the pair of mid-frequency DCT coefficients; finally, add the voting scores of all pairs of mid-frequency DCT coefficients as the weighted voting score result of the original frequency domain representation, and generate a bit embedding value for the original frequency domain representation based on the weighted voting score result, and judge whether the bit embedding value is equal to the target bit, and embed a watermark for the original frequency domain representation according to the judgment result.
[0008] As a preferred embodiment of the above first aspect, the robustness weight of each pair of mid-frequency DCT coefficients is positively correlated with the sign preservation probability of the coefficient difference before and after the attack.
[0009] As a preferred embodiment of the first aspect, in step S2, the specific process of generating the bit embedding value based on the weighted voting score result is as follows: when the weighted voting score result is greater than 0, the bit embedding value is 1; otherwise, the bit embedding value is 0.
[0010] As a preferred embodiment of the first aspect, in step S2, when the bit embedding value is equal to the target bit, the target bit is embedded into the original frequency domain representation; when the bit embedding value is not equal to the target bit, a minimum disturbance strategy is performed, the medium frequency DCT coefficient pairs with high robustness weight are preferentially selected, the frequency domain values in the original frequency domain representation are fine-tuned to form a fine-tuned frequency domain representation, the weighted voting score result is recalculated, a new bit embedding value is generated to be consistent with the target bit, and the target bit is embedded into the fine-tuned frequency domain representation.
[0011] As a preferred embodiment of the first aspect, in step S3, the multi-target joint loss function is a weighted sum of four loss functions, the first one is a watermark extraction loss formed by the mean square error between the actual extracted watermark and the embedded watermark, the second one is an attack robustness loss formed by the mean square error between the extracted watermark after adding an attack and the embedded watermark, the third one is a frequency energy disturbance loss quantifying the distortion degree introduced by the original frequency domain representation after adding the watermark, and the fourth one is an image fidelity loss maintaining the perceptual consistency between the watermarked image and the original image; wherein the actual extracted watermark is the watermark extracted from the watermarked image; the embedded watermark is the watermark embedded in the watermarked image; the extracted watermark after adding an attack is the watermark extracted from the watermarked image after adding an attack.
[0012] As a preferred embodiment of the first aspect, the specific calculation process of the frequency energy disturbance loss is as follows: the L2 norm square between each original frequency domain representation and the corresponding frequency domain representation after adding the watermark is calculated to obtain the distortion of each small block, the distortions of all small blocks are accumulated to obtain the total distortion, and the energy of all small block original frequency domain representations is summed to obtain the total energy, and the ratio of the total distortion to the total energy is taken as the frequency energy disturbance loss.
[0013] As a preferred embodiment of the first aspect, the image fidelity loss is a weighted sum of an SSIM part and an LPIPS part, the SSIM part is a structural similarity loss between the watermarked image and the original image, and the LPIPS part is a perceptual loss between the watermarked image and the original image.
[0014] As a preferred embodiment of the first aspect, the image quality optimization target is to optimize the structural similarity index of the image to satisfy a preset structural similarity threshold.
[0015] As a preferred embodiment of the first aspect, the structural similarity threshold is set to 0.92.
[0016] In a second aspect, the present application provides a latent space-based DCT frequency domain watermark embedding optimization system, comprising: An original image input module for obtaining an original image to be optimized; An final image output module for processing the original image to be optimized according to the latent space-based DCT frequency domain watermark embedding optimization method of any one of the above first aspect, to generate a final image.
[0017] Compared with the prior art, the present application has the following beneficial effects: 1) Robustness design for AI attacks: The present application is based on latent space and frequency domain coupling embedding, which enhances the survival ability of the watermark under the reconstruction attack of the image generation model (such as diffusion model, graph-to-graph model), effectively resisting semantic-level erasure methods such as regeneration and de-stylization.
[0018] 2) Weighted voting multi-point redundancy embedding strategy: The present application proposes a weighted voting mechanism for multiple pairs of intermediate frequency DCT coefficients, each bit is determined by multiple places, which improves the extraction accuracy under the destruction conditions such as compression, cropping and adding noise.
[0019] 3) Triple frequency domain robust loss function guidance: The present application constructs a differentiable comprehensive loss function, which jointly optimizes the extractability, attack robustness and frequency domain disturbance energy constraint of the watermark, while maintaining the image quality and ensuring the embedding effect.
[0020] 4) Perception-driven adaptive post-processing mechanism: The present application uses structural similarity (SSIM) and perceptual feature distance (such as LPIPS) to guide the linear fusion strategy, to ensure the optimal balance between subjective visual quality and watermark effectiveness of the embedded image.
[0021] 5) No need to modify the parameters of the generation model, flexible deployment: The method of the present application completes embedding by optimizing the latent space input vector, does not depend on model fine-tuning, and has good cross-platform adaptability and practical engineering deployment friendliness. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 The step flowchart of the method of the present application; Figure 2 The flowchart of the method of the present application for optimizing the latent space representation with watermark; Figure 3 The original image schematic diagram provided by the present embodiment; Figure 4 The watermark-embedded image schematic diagram obtained by performing watermark embedding on the original image provided by the present embodiment; Figure 5 The final image schematic diagram provided by the present embodiment. DETAILED DESCRIPTION
[0023] In order to make the above objectives, characteristics and advantages of the present application more apparent, concrete embodiments of the present application will be described in detail below with reference to the accompanying drawings. In the following description, a large number of specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many different ways than those described herein, and those skilled in the art can make similar improvements without departing from the spirit of the present application, so the present application is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present application can be combined accordingly without conflict, provided that there is no conflict.
[0024] In the description of the present application, it should be understood that the terms "first", "second" are only used for distinguishing description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features.
[0025] As shown in Figure 1 , in a preferred implementation of the present application, the above-mentioned DCT frequency domain watermark embedding optimization method based on latent space includes the following S1~S4 steps. The specific implementation process will be described respectively below.
[0026] S1. Given the input original image, obtain the original latent space representation corresponding to the original image through the pre-trained reverse denoising diffusion implicit model (Reverse Denoising Diffusion Implicit Models) . Wherein, respectively represent the channel number, height and width of the original image.
[0027] It should be noted that in step S1 of the present application, all watermark embedding and perturbation optimization operations are completed in the latent space, avoiding direct intervention in the pixel domain, and improving the invisibility and model compatibility of embedding.
[0028] S2. Divide the original latent space representation into several non-overlapping blocks, and perform a two-dimensional discrete cosine transform (DCT) on each block to obtain the original frequency domain representation corresponding to each block. Based on a weighted voting mechanism, embed a single-bit watermark into the original frequency domain representation of each block. Use an inverse discrete cosine transform (IDCT) to restore the watermarked frequency domain representation to the corresponding watermarked image block. Merge all watermarked image blocks to obtain the watermarked latent space representation. Then, input the watermarked latent space representation into a stable diffusion model with fixed parameters to generate a watermarked image.
[0029] It should be noted that, in step S2 of this invention, the specific process of embedding a watermark for an original frequency domain representation is as follows: First, multiple intermediate frequency (IF) DCT coefficient pairs are selected in the original frequency domain representation, and each IF DCT coefficient pair has a pre-statistically obtained robustness weight; second, the coefficient difference of each IF DCT coefficient pair is calculated, and the coefficient difference is quantized into a binary result through a sign function, and the binary result is multiplied by the robustness weight of the IF DCT coefficient pair to obtain the voting score of the IF DCT coefficient pair; finally, the voting scores of all IF DCT coefficient pairs are added together to obtain the weighted voting score result of the original frequency domain representation, and the bit embedding value of the original frequency domain representation is generated based on the weighted voting score result. It is then determined whether the bit embedding value and the obtained target bit are equal, and the watermark is embedded in the original frequency domain representation according to the determination result.
[0030] In this embodiment, as Figure 2 As shown, the DCT transform is used to convert small blocks of the original latent spatial representation from the time domain (or spatial domain) to the frequency domain, generating a set of DCT coefficients. These coefficients are arranged from low to high frequency and can be divided into: 1) Low-frequency DCT coefficients, located in the low-frequency part of the frequency domain (the upper left corner of the original frequency domain representation matrix), which typically contain the main energy and structural information of the signal, used to reflect the smooth areas and overall brightness of the image; 2) High-frequency DCT coefficients, located in the high-frequency part of the frequency domain (the lower right corner of the original frequency domain representation matrix), which typically contain the details and noise of the signal, used to reflect the edge and texture information of the image; 3) Mid-frequency coefficients, located between the low and high frequencies (the middle area of the original frequency domain representation matrix), which contain the mid-frequency information of the signal. Their specific range can be determined experimentally or empirically. The reason for choosing mid-frequency DCT coefficients here is that they possess both a certain degree of robustness (i.e., they are not easily erased during compression or reconstruction) and low perceptual sensitivity (i.e., they cause little visual interference to the human eye).
[0031] It should be noted that in the present application, the robustness weight of each pair of mid-frequency DCT coefficients is positively correlated with the sign preservation probability of the coefficient difference of the pair of mid-frequency DCT coefficients before and after the attack.
[0032] In the present embodiment, an attack (such as JPEG compression, noise, etc.) is applied to the original image, and the image after the attack is input into the pre-trained inverse denoising diffusion implicit model to generate a new latent space representation. The new latent space representation is divided into a plurality of non-overlapping small blocks, and the number of divided small blocks is equal to the number of small blocks divided in the latent space representation. A two-dimensional DCT transformation is performed on each small block corresponding to the new latent space representation, thereby generating a new frequency domain representation. A pair of mid-frequency DCT coefficients is selected from the new frequency domain representation, and the sign preservation probability of the coefficient difference of each pair of mid-frequency DCT coefficients before and after the attack is counted. The higher the sign preservation probability, the more stable the pair of mid-frequency DCT coefficients under the attack, and therefore a higher robustness weight is assigned to the pair of mid-frequency DCT coefficients.
[0033] In the present embodiment, the calculation of the weighted voting score result of the first original frequency domain representation is as follows: wherein, is the pair of mid-frequency DCT coefficients of the first original frequency domain representation; denotes a sign function; denotes the number of pairs of mid-frequency DCT coefficients; denotes the weighted voting result; denotes the robustness weight of the pair of mid-frequency DCT coefficients.
[0034] It should be noted that in the present application, the specific process of generating a bit embedding value based on the weighted voting score result is as follows: when the weighted voting score result is greater than 0, the bit embedding value is 1, otherwise the bit embedding value is 0.
[0035] In the present embodiment, when the weighted voting score result is calculated, the bit embedding value of each original frequency domain representation is determined by the result: It should be noted that when the bit embedding value and the obtained target bit are equal, the target bit is embedded into the original frequency domain representation; when the bit embedding value and the obtained target bit are not equal, a minimum disturbance strategy is executed, a medium frequency DCT coefficient pair with a high robustness weight is preferentially selected, and the frequency domain value in the original frequency domain representation is fine-tuned to form a fine-tuned frequency domain representation, the weighted voting score result is recalculated, a new bit embedding value is generated to be consistent with the target bit, and the target bit is embedded into the fine-tuned frequency domain representation.
[0036] In the embodiment, when the bit embedding value and the target bit defined in advance are not equal, a minimum disturbance strategy is executed: a medium frequency DCT coefficient pair with a high robustness weight is preferentially selected, and the corresponding frequency domain value is fine-tuned so that the calculated bit embedding value is consistent with the target bit. By limiting the disturbance amplitude of each modification, the frequency domain energy balance is ensured.
[0037] S3. The watermark-embedded latent space representation is optimized based on the original latent space representation, a multi-objective joint loss function is used as an optimization target, S2 is repeatedly executed, and when the multi-objective joint loss function is minimized, the finally optimized watermark-embedded latent space representation is taken as the final representation after embedding the watermark.
[0038] It should be noted that in step S3 of the present application, the multi-objective joint loss function is obtained by weighted summation of four loss functions, the first term is a watermark extraction loss formed by the mean square error between the actual extracted watermark and the embedded watermark, the second term is an attack robustness loss formed by the mean square error between the extracted watermark after adding an attack and the embedded watermark, the third term is a frequency domain energy disturbance loss representing the distortion degree introduced by the original frequency domain representation after adding the watermark, and the fourth term is an image fidelity loss for maintaining the perceptual consistency between the watermark image and the original image; wherein the actual extracted watermark is the watermark extracted from the watermark image; the embedded watermark is the watermark embedded in the watermark image; and the extracted watermark after adding the attack is the watermark extracted from the watermark image after adding the attack.
[0039] Further, the specific calculation process of the frequency domain energy disturbance loss is as follows: the L2 norm square between each original frequency domain representation and the corresponding frequency domain representation after adding the watermark is calculated to obtain the distortion of each small block, all the distortions of the small blocks are accumulated to obtain the total distortion, and the energy of all the small block original frequency domain representations is summed to obtain the total energy, and the ratio of the total distortion to the total energy is taken as the frequency domain energy disturbance loss.
[0040] Furthermore, the image fidelity loss is a weighted sum of the SSIM and LPIPS components. The SSIM component calculates the structural similarity loss (SSIM) between the watermarked image and the original image, while the LPIPS component calculates the perceptual loss between the watermarked image and the original image.
[0041] In this embodiment, a multi-objective optimization framework integrating watermark robustness and image perceptual quality is designed, consisting of a joint multi-objective loss function composed of four loss functions. Each loss function is described below.
[0042] 1) Watermark extraction loss This is used to measure the mean square error between the actual extracted watermark and the embedded watermark: in, For the first The actual watermark is extracted; For the first Embedded watermark; This represents the total number of bits in the watermark.
[0043] 2) Loss of attack robustness This method is used to extract the watermark and calculate the mean squared error loss after applying typical attacks (such as JPEG compression and noise) to a watermarked image. in, To add the first After the first attack Extracting watermarks from positions, This represents the total number of attack categories.
[0044] 3) Frequency domain energy perturbation loss This is used to limit the energy difference in the frequency domain representation of the latent space before and after embedding: in, For the first The original frequency domain representation corresponding to each small block; To The frequency domain representation formed after adding a watermark; Represents the square of the L2 norm; This represents total distortion; This represents the total energy.
[0045] 4) Image fidelity loss Used to preserve watermarked images With the original image Consistency in perception between them: in, The SSIM part is used to ensure structural similarity. The closer the value is to 1, the closer the structures are. Therefore, the loss is 1-SSIM. This refers to the LPIPS (Learned Perceptual Image Patch Similarity) part, which extracts features through deep networks (such as VGG, AlexNet, or SqueezeNet) to measure perceptual differences; weights Weights are used to adjust the importance of the LPIPS component in image fidelity loss. Used to adjust the importance of the SSIM component in image fidelity loss.
[0046] Therefore, the multi-objective joint loss function proposed in this invention can be expressed as: in, All are weighting coefficients.
[0047] The watermarked latent space representation is iteratively optimized through backpropagation to finally obtain the watermarked final representation.
[0048] S4. Input the final representation after watermarking into a stable diffusion model with fixed parameters to form an optimized watermarked image, and use this optimized watermarked image as the watermarked image. With the original image Linear blending is performed to form an optimized image, and the coefficients used in the linear blending are automatically adjusted through binary search. This process ensures that the optimized image meets the preset image quality optimization target. The optimized image that meets the target is then used as the final image, thus completing the DCT frequency domain watermark embedding optimization based on the latent space.
[0049] It should be noted that in step S4 of this embodiment, the image is optimized. It can be represented as: It should be noted that in step S4 of this embodiment, the image quality optimization objective is to optimize the structural similarity index (SSIM) of the image to meet a preset structural similarity threshold. This stage can further introduce LPIPS or VGG sensing distance as an optimization objective to ensure optimal visual quality. Furthermore, the structural similarity threshold can be selected by those skilled in the art according to actual needs; in this embodiment, the threshold is set to 0.92.
[0050] Furthermore, after the final image is generated, watermark extraction and detection can be performed on it. In this stage, the final image is used as the input image to be detected, and the watermark string is recovered through the same latent space mapping, DCT block division and weighted voting mechanism. Then, comprehensive evaluation indicators such as watermark extraction accuracy (BER), stability under attack, and embedded image quality can be output to evaluate the optimization effect.
[0051] To demonstrate the effectiveness of the method of the present invention, this embodiment provides an example of an optimized image result. For example... Figure 3 The image shown is an example of an original image provided in an embodiment of the present invention. The image formed after adding a watermark to this image is as follows. Figure 4 As shown, the final image generated using the method of this invention is as follows. Figure 5 As shown.
[0052] In summary, to address the problems of traditional watermarking algorithms being vulnerable to "semantic reconstruction" attacks by AI generative models, and the difficulty in balancing watermark embedding strength, image quality, and robustness (higher watermark embedding strength leads to lower image quality, and lower watermark embedding strength leads to lower robustness), as well as the shortcomings of existing generative watermarking methods (generative watermarking refers to images generated by image generation models already containing watermarks, eliminating the need for manual embedding via watermarking algorithms) such as: 1) excessive modifications to the latent space can severely impact the quality of generated images, even altering the generated content; 2) low flexibility and versatility, with a finely tuned model typically generating only one type of watermark, usually tied to a specific model version. Changing the model or watermark information requires retraining, resulting in high costs. Therefore, this invention proposes a DCT frequency domain watermark embedding optimization method based on latent space. Its core advantage lies in: (1) High robustness against “semantic reconstruction” attacks by AI generative models. Unlike traditional pixel domain embedding, this method moves the watermarking operation to the latent space of the diffusion model. The latent space is the intermediate representation layer in which the generative model truly “understands” the semantics of the image, and has stronger semantic consistency and structural stability. Embedding the watermark in this space is equivalent to implanting the identifier at the “idea level” rather than the “appearance level”, making it more difficult to be erased by the subsequent generation process.
[0053] (2) Minimal modification to the latent space: Because the perturbation is distributed to multiple locations and the adjustment is small each time, this ensures that the "intrusiveness" of the watermark embedding process to the original semantic information is minimized, and the main structure and semantics of the image are not distorted.
[0054] (3) High robustness: Each watermark bit is determined by multiple pairs of coefficients. Even if some coefficients are compressed, noiseed, or truncated, the information can still be accurately recovered through "voting". Priority is given to embedding on coefficient pairs with "high weight", hiding the watermark in a position that is least likely to be attacked and erased and is difficult for the human eye to detect.
[0055] It is understood that the latent space-based DCT frequency domain watermarking embedding optimization method described in S1-S4 above can essentially be implemented by a computer program or module. Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a latent space-based DCT frequency domain watermarking embedding optimization system corresponding to the latent space-based DCT frequency domain watermarking embedding optimization method provided in the above embodiments, comprising: The raw image input module is used to acquire the raw image to be optimized; The final image output module is used to process the original image to be optimized according to the latent space-based DCT frequency domain watermark embedding optimization method described in the above embodiments, and generate the final image.
[0056] It should also be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the embodiments provided in this application, the division of steps or modules in the system and method is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules or steps may be combined or integrated together, and a module or step may also be split.
[0057] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. A DCT frequency domain watermark embedding optimization method based on latent space, characterized in that, Includes the following steps: S1. Given the original input image, obtain the original latent space representation of the original image through a pre-trained inverse denoising diffusion implicit model; S2. Divide the original latent space representation into several non-overlapping blocks and perform a two-dimensional discrete cosine transform on each block to obtain the original frequency domain representation corresponding to each block. Based on a weighted voting mechanism, embed a single-bit watermark into the original frequency domain representation of each block. Use the inverse discrete cosine transform to restore the frequency domain representation after adding the watermark to the corresponding watermarked image block. Merge all watermarked image blocks to obtain the watermarked latent space representation. Then, input the watermarked latent space representation into a stable diffusion model with fixed parameters to generate a watermarked image. S3. Optimize the watermarked latent space representation based on the original latent space representation. Use a multi-objective joint loss function as the optimization objective and repeat S2. When the multi-objective joint loss function is minimized, use the final optimized watermarked latent space representation as the final representation after embedding the watermark. S4. Input the final representation after watermarking into a stable diffusion model with fixed parameters to form an optimized watermarked image and use it as the watermarked image. Linearly blend the watermarked image with the original image to form an optimized image. Automatically adjust the coefficients used in the linear blending through binary search so that the optimized image meets the preset image quality optimization target. Use the optimized image that meets the target as the final image to complete the DCT frequency domain watermark embedding optimization based on latent space.
2. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 1, characterized in that, In step S2, the specific process of embedding a watermark for an original frequency domain representation is as follows: First, select multiple intermediate frequency DCT coefficient pairs in the original frequency domain representation, and each intermediate frequency DCT coefficient pair has a pre-statistically obtained robustness weight. Secondly, the coefficient difference of each intermediate frequency (IF) DCT coefficient pair is calculated, and the coefficient difference is quantized into a binary result using a sign function. The binary result is then multiplied by the robustness weight of the IF DCT coefficient pair to obtain the voting score of the IF DCT coefficient pair. Finally, the voting scores of all IF DCT coefficient pairs are summed to obtain the weighted voting score of the original frequency domain representation. Based on the weighted voting score, the bit embedding value of the original frequency domain representation is generated. It is then determined whether the bit embedding value is equal to the obtained target bit. Based on the determination result, a watermark is embedded in the original frequency domain representation.
3. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 2, characterized in that, In step S2, the robustness weight of each intermediate frequency DCT coefficient pair is positively correlated with the sign preservation probability of its coefficient difference before and after the attack.
4. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 2, characterized in that, In step S2, the specific process of generating bit embedding values based on weighted voting scores is as follows: when the weighted voting score is greater than 0, the bit embedding value is 1; otherwise, the bit embedding value is 0.
5. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 2, characterized in that, In step S2, when the bit embedding value is equal to the obtained target bit, the target bit is embedded into the original frequency domain representation; when the bit embedding value is not equal to the obtained target bit, the minimum perturbation strategy is executed, the intermediate frequency DCT coefficient pair with high robustness weight is selected first, and the frequency domain value in the original frequency domain representation is fine-tuned to form the fine-tuned frequency domain representation. Then, the weighted voting score is recalculated to generate a new bit embedding value that is consistent with the target bit, and the target bit is embedded into the fine-tuned frequency domain representation.
6. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 1, characterized in that, In step S3, the multi-objective joint loss function is formed by a weighted sum of four loss functions. The first term is the watermark extraction loss, which is formed by the mean square error between the actual extracted watermark and the embedded watermark. The second term is the attack robustness loss, which is formed by the mean square error between the extracted watermark and the embedded watermark after the attack. The third term is the frequency domain energy perturbation loss, which quantifies the degree of distortion introduced after the watermark is added to the original frequency domain representation. The fourth term is the image fidelity loss, which maintains the perceptual consistency between the watermarked image and the original image. Here, the actual extracted watermark is the watermark extracted from the watermarked image; the embedded watermark is the watermark embedded in the watermarked image; and the extracted watermark after the attack is the watermark extracted from the watermarked image after the attack.
7. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 6, characterized in that, The specific calculation process of the frequency domain energy perturbation loss is as follows: calculate the L2 norm square between each original frequency domain representation and its corresponding watermarked frequency domain representation to obtain the distortion of each small block, then sum the distortions of all small blocks to obtain the total distortion, and sum the energy of all small block original frequency domain representations to obtain the total energy. The ratio of the total distortion to the total energy is used as the frequency domain energy perturbation loss.
8. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 6, characterized in that, The image fidelity loss is calculated by weighted summation of the SSIM and LPIPS components. The SSIM component calculates the structural similarity loss between the watermarked image and the original image, while the LPIPS component calculates the perceptual loss between the watermarked image and the original image.
9. The DCT frequency domain watermark embedding optimization method based on latent space as described in claim 1, characterized in that, The goal of image quality optimization is to optimize the structural similarity index of the image to meet the preset structural similarity threshold.
10. A DCT frequency domain watermark embedding optimization system based on latent space, characterized in that, include: The raw image input module is used to acquire the raw image to be optimized; The final image output module is used to process the original image to be optimized according to the latent space-based DCT frequency domain watermark embedding optimization method as described in any one of claims 1 to 9, and generate the final image.
Citation Information
Cited By
Spatial self-adaptive plug-and-play watermarking method and device for image editing traceability
CN121544448A
Diffusion model watermark removing method and device
CN121810471A