Image watermarking method based on diffusion model with phase spectrum redundancy

By constructing a ring-shaped hollow binary mask and embedding the watermark key into the phase spectrum of the diffusion model image using a random sampling method, and combining it with a multi-channel phase consistency rotation correction algorithm, the problems of limited watermark key capacity and susceptibility to image quality are solved, achieving high-capacity and robust watermark detection.

CN123118337APending Publication Date: 2026-11-17GUIZHOU NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611580847.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-13
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing diffusion model image watermarking methods suffer from limited watermark key capacity, easily affected image quality, and insufficient robustness, making it difficult to balance multi-key recognition and cross-model compatibility.

Method used

By constructing a ring-shaped hollow binary mask, randomly sampling to determine the phase value of the watermark embedding region, embedding the watermark key into the channel tensor phase spectrum of the initial latent noise, and combining it with a multi-channel phase consistency rotation correction algorithm for detection, the image quality is maintained and robustness is improved.

Benefits of technology

It increases the capacity of the watermark key set, reduces the risk of display structure artifacts, maintains the quality of image generation, and enhances robustness to image attacks and cross-model compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118337A_ABST
    Figure CN123118337A_ABST
Patent Text Reader

Abstract

This invention discloses an image watermarking method based on a diffusion model with phase spectrum redundancy, belonging to the field of image processing technology. The method includes constructing a ring-shaped hollow binary mask, determining the watermark embedding region, collecting phase values ​​of the watermark embedding region through random sampling, and determining the watermark key set. A two-dimensional discrete Fourier transform is performed on the initial latent noise in the diffusion model, embedding each watermark key into the phase spectrum of its corresponding channel. The initial amplitude spectrum and the watermark phase spectrum corresponding to each channel are recombined. Inverse discrete Fourier transforms are then performed on multiple watermark frequency domain representations to obtain the initial latent noise. The initial latent noise and text information are iteratively processed using the diffusion model to obtain the watermarked image. This method can increase the capacity of the watermark key set and reduce the risk of display structure artifacts, thereby reducing the impact of watermark key embedding in the image on the image generation quality and improving the quality of the generated watermarked image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and specifically to an image watermarking method based on a diffusion model with phase spectrum redundancy. Background Technology

[0002] As the realism and application scope of images generated by diffusion models continue to improve, these images may be used for unauthorized dissemination, copyright infringement, or the creation of fake content. Since ordinary images typically do not contain clear source information, it is difficult to determine whether they were generated by a specific diffusion model, and it is also difficult to trace the corresponding generating user. Therefore, it is necessary to embed imperceptible identifiers into the generated images using watermarking technology for model source verification, copyright protection, and user tracking.

[0003] Diffusion-based watermarking methods can be categorized into three types in terms of implementation:

[0004] (1) Generate post-processing watermark: Modify the generated image in the pixel domain or transform domain. It is easy to integrate but may reduce image quality and imperceptibility.

[0005] (2) Model fine-tuning watermark: By adjusting the parameters of the generation model, the generated image has extractable features and is highly imperceptible, but the training cost is high and the cross-model compatibility is limited.

[0006] (3) Latent space semantic watermarking: directly modify the initial latent noise used to generate images by the diffusion model, so that the watermark information is hidden in the semantics of the generated image as the diffusion process proceeds, which has good robustness to image processing and maintains good visual quality.

[0007] However, in watermarking methods of related technologies, the frequency domain embedding region is usually divided into multiple concentric rings, and all frequency positions within the same ring use the same discrete value. Each ring can only choose one of two preset values, representing either 0 or 1 of a binary bit. Therefore, a ring can only carry 1 bit of information. At most one independent ring can form Watermarking keys are used to expand the watermarking key space. This typically requires increasing the number of rings and enlarging the embedding region, thereby enhancing the regular ring structure of the watermark pattern and potentially affecting the visual quality of the generated image. Furthermore, the Fourier phase of the initial latent noise approximately follows... Because of their uniform distribution, artificially structured patterns are more likely to expose structures when their statistical characteristics are inconsistent with those of the background noise, which in turn leads to a decrease in the quality of the generated image. Summary of the Invention

[0008] The purpose of this invention is to provide an image watermarking method based on a diffusion model with phase spectrum redundancy, in order to solve the technical problems existing in related technologies.

[0009] To achieve the above objectives, this invention provides an image watermarking method based on a diffusion model with phase spectral redundancy, comprising:

[0010] Receive an image generation instruction, wherein the image generation instruction includes text information and user identity information for generating an image;

[0011] A circular hollow binary mask is constructed. A watermark embedding region is determined in the circular hollow binary mask based on a preset frequency range. The phase value of the watermark embedding region is collected by a random sampling method. A watermark key set is determined based on the phase value. The phase value is used to represent user identity information. The watermark key set includes multiple watermark keys, and the multiple watermark keys are set to correspond to the channel tensor in the initial latent noise.

[0012] A two-dimensional discrete Fourier transform is performed on the initial latent noise in the diffusion model to obtain the initial amplitude spectrum and the initial phase spectrum;

[0013] Determine the channel tensor corresponding to each watermark key in the initial latent noise, and embed each watermark key into the phase spectrum of its corresponding channel to obtain the watermark phase spectrum;

[0014] The initial amplitude spectrum and the watermark phase spectrum corresponding to each channel are recombined to obtain multiple watermark frequency domain representations. Inverse discrete Fourier transform is performed on each of the multiple watermark frequency domain representations, and the results are combined to obtain the initial latent noise of the watermark.

[0015] The watermarked image is obtained by iteratively processing the initial latent noise of the watermark and the text information in the image generation instructions using a diffusion model.

[0016] Optionally, determining the watermark embedding region in the annular hollow binary mask based on a preset frequency range includes:

[0017] In a ring-shaped hollow binary mask, local polar coordinates are constructed with the center of the zero-frequency spectrum as the reference point, and the inner and outer radii are determined according to the preset frequency range.

[0018] Calculate the straight-line distance between the spectral coordinates of each position in the annular hollow binary mask and the spectral center. The region corresponding to the position where the straight-line distance is between the inner radius and the outer radius is determined as the watermark embedding region.

[0019] Optionally, the step of acquiring the phase value of the watermark embedding region through a random sampling method and determining the watermark key set based on the phase value includes:

[0020] The watermark embedding area is divided into a first half-region and a second half-region with the center of the spectrum as the symmetrical point.

[0021] The phase value at each position in the first half-region is randomly sampled based on the uniformly distributed phase angle. After sampling at all positions in the first half-region, the first watermark half-region is obtained.

[0022] With the center of the spectrum as the symmetrical position, the phase value of each position in the second half is set to the opposite value of the phase value at the corresponding position in the first half, thus obtaining the second watermark half region;

[0023] The first and second watermark halves are determined as sub-watermark keys, and the sub-watermark keys are rotated around the center of the spectrum at multiple preset angles to obtain multiple watermark keys.

[0024] Multiple watermark keys are identified as a watermark key set.

[0025] Optionally, the step of embedding each watermark key into the phase spectrum of its corresponding channel tensor to obtain the watermark phase spectrum includes:

[0026] Determine the phase spectrum of the region belonging to the watermark embedding area in the phase spectrum of the channel tensor;

[0027] The watermark phase spectrum is obtained by replacing the regional phase spectrum with the phase spectrum in the corresponding watermark key.

[0028] Optionally, the method further includes:

[0029] The watermark image is subjected to image attack processing to obtain the image to be inspected, wherein the attack processing is at least one of rotation, cropping, compression, blurring, noise addition and brightness adjustment processing;

[0030] The image to be inspected is rotated and corrected using a multi-channel phase consistency rotation correction algorithm to obtain the latent noise to be inspected. The latent noise to be inspected is then restored using multi-channel restoration and circular mean fusion to obtain the target watermark.

[0031] The target watermark is detected, and the detection results are obtained.

[0032] Optionally, the step of performing rotation correction on the image to be inspected using a multi-channel phase consistency rotation correction algorithm to obtain the latent noise to be inspected includes:

[0033] The image to be tested is mapped to the latent space by the diffusion model to obtain the image latent variables. The image latent variables are then inverted by DDIM to obtain the approximate initial latent noise.

[0034] The target rotation angle of the approximate initial latent noise is calculated by a multi-channel phase consistency rotation correction algorithm. The approximate initial latent noise is then rotated in the opposite direction by the target rotation angle to obtain the latent noise to be detected.

[0035] Optionally, the step of calculating the target rotation angle of the approximate initial latent noise using a multi-channel phase-consistent rotation correction algorithm includes:

[0036] Multiple candidate rotation angles are determined within a preset angle range. For each candidate rotation angle, the following processing is performed: the approximate initial latent noise is rotated in the opposite direction according to the candidate rotation angle to obtain the candidate corrected latent noise. The candidate corrected latent noise is subjected to Fourier transform to obtain the candidate phase spectrum corresponding to each channel tensor in the candidate corrected latent noise. After all candidate rotation angles are processed, multiple candidate phase spectra are obtained for each channel tensor.

[0037] For each candidate phase spectrum corresponding to each channel tensor, obtain the watermark key of the channel tensor, and calculate the average element distance between the candidate phase spectrum and the watermark key corresponding to the channel tensor. After all candidate phase spectra are calculated, multiple average element distances are obtained for each channel tensor.

[0038] In each channel tensor, the candidate rotation angle corresponding to the smallest average element distance among multiple average element distances is determined as the sub-target rotation angle of the channel tensor, thus obtaining multiple sub-target rotation angles for candidate correction of latent noise;

[0039] Extract multiple average element distances corresponding to the rotation angle of each sub-target, and add the multiple average element distances to obtain multiple total average element distances. The sub-target rotation angle corresponding to the minimum total average element distance among the multiple total average element distances is determined as the target rotation angle.

[0040] Optionally, the step of performing multi-channel restoration and circular mean fusion processing on the latent noise to be detected to obtain the target watermark includes:

[0041] Perform Discrete Fourier Transform on the latent noise to be detected to obtain the phase spectrum of each channel, and restore the phase spectrum to obtain the restored watermark phase of each channel.

[0042] The target watermark is obtained by processing multiple restored watermark phases using the circular mean fusion method.

[0043] Optionally, the step of detecting the target watermark and obtaining the detection result includes:

[0044] The circumferential distance between the extracted watermark and the spectral coordinates of each position of each watermark key in the watermark key set is calculated by phase circumferential distance, resulting in multiple circumferential distances.

[0045] Calculate the average circumferential distance of multiple circumferential distances. When the average circumferential distance is less than or equal to a preset distance threshold, the detection result is that the target watermark matches the watermark key set.

[0046] Optionally, the step of detecting the target watermark and obtaining the detection result includes:

[0047] Calculate the circumferential distance between the target watermark and each user watermark key in the user watermark key set to obtain multiple circumferential distances. The user watermark key set consists of the user watermark keys corresponding to different users.

[0048] Determine the user watermark key corresponding to the smallest circumferential distance among multiple circumferential distances, and determine the identity information corresponding to the user watermark key as the user identity information of the target watermark.

[0049] The user's identity information for the target watermark is used as the detection result.

[0050] By using the above technical solution, a ring-shaped hollow binary mask is constructed. The watermark embedding area is determined in the ring-shaped hollow binary mask based on a preset frequency range. The phase value of the watermark embedding area is collected by a random sampling method, and the watermark key set is determined based on the phase value. This can improve the capacity of the watermark key set and reduce the risk of display structure artifacts. A two-dimensional discrete Fourier transform is performed on the initial latent noise in the diffusion model to obtain the initial amplitude spectrum and the initial phase spectrum. The channel tensor corresponding to each watermark key in the initial latent noise is determined, and each watermark key is embedded into the phase spectrum of its corresponding channel tensor to obtain the watermark phase spectrum. This avoids the formation of fixed, regular, and perceptible structural patterns in the generated image. The initial amplitude spectrum and the watermark phase spectrum corresponding to each channel are recombined to obtain multiple watermark frequency domain representations. Inverse discrete Fourier transforms are performed on multiple watermark frequency domain representations, and the results are combined to obtain the initial watermark latent noise. This maintains the original energy distribution of the initial latent noise and reduces the impact of embedding the watermark key into the image on the image generation quality. The initial watermark latent noise and the text information in the image generation instructions are iteratively processed by the diffusion model to obtain the watermarked image, which improves the quality of the generated watermarked image.

[0051] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0052] Figure 1 This is a schematic diagram illustrating an image watermarking method based on a diffusion model with phase spectrum redundancy according to an exemplary embodiment of the present invention.

[0053] Figure 2 This is an exemplary embodiment of the present invention illustrating the overall framework of a diffusion model image watermarking method based on phase spectrum redundancy.

[0054] Figure 3 This is a schematic diagram illustrating the generation of a watermark key set according to an exemplary embodiment of the present invention.

[0055] Figure 4This is a schematic diagram illustrating the application process of an image watermarking method based on a diffusion model with phase spectrum redundancy according to an exemplary embodiment of the present invention. Detailed Implementation

[0056] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, so as to provide a better understanding of the concept of the present invention, the technical problem solved, the technical features constituting the technical solution, and the technical effects brought about.

[0057] Latent diffusion models are a class of generative models that progressively generate images from random noise. Their generation process starts with random noise and gradually recovers the image's structure, semantics, and details through multiple iterations of denoising. Latent diffusion models do not perform denoising directly in the image's pixel space, but rather complete the process in a lower-dimensional compressed latent space, thus reducing computational overhead. In text-to-image generation, the model samples the initial latent noise. and in text conditions Next iteration for denoising. The simplified DDIM denoising process is as follows:

[0058] ;

[0059] through After denoising, the result is Then, the image is generated by the image decoder. Conversely, for a given image... First, it is obtained through the pre-trained encoder E. Then use DDIM inversion operation Stepwise mapping back to the initial latent noise:

[0060] ;

[0061] DDIM sampling is deterministic, so even if the original text prompt is unknown during the extraction stage, the initial latent noise can still be approximately recovered by inversion using empty prompts, providing a basis for latent space semantic watermark extraction.

[0062] In related technologies, latent semantic watermarking is mainly performed using the following three methods:

[0063] (1) The tree ring pattern is embedded into the Fourier domain of the initial latent noise to achieve watermark detection in the generated image. However, this method destroys the Fourier conjugate symmetry during the embedding process, which causes the statistical distribution of the latent noise to shift, and the statistical features generated by different watermark keys are quite similar, which limits the multi-key recognition capability;

[0064] (2) Based on the above, the introduction of conjugate symmetry preservation, numerical discretization and spatial translation mechanisms improves the performance of multi-key recognition. However, it still uses discrete rings as the main carriers of watermark information, and the key capacity is limited by the number of embedded rings. As the number of rings increases, the embedding area expands, which may introduce ring artifacts in the generated image. At the same time, its robustness to geometric attacks such as cropping and scaling is still insufficient.

[0065] (3) Different initial latent noises are registered as identities, and the source identification of generated images is achieved through group retrieval, which expands the identifiable range while maintaining image quality. However, this method requires saving and retrieving the initial noise records corresponding to the generated images, and the retrieval scale increases with the number of generated images. The deployment method is different from the identification method based on a pre-defined user watermark key. Overall, existing latent space semantic watermarking methods still struggle to simultaneously achieve image quality, geometric attack robustness, key capacity, and cross-model compatibility.

[0066] In summary, the related technologies have the following problems: Because structured ring patterns only use ring-level values ​​to represent information, the number of keys is limited by the number of rings; when increasing the number of rings to expand the key space, the embedding region expands, potentially producing visible ring artifacts. Furthermore, the Fourier phase of the initial latent noise approximately follows... Because of their uniform distribution, structures are more easily exposed when the statistical characteristics of artificially structured patterns are inconsistent with those of background noise.

[0067] In view of this, the present invention provides a diffusion model image watermarking method based on phase spectrum redundancy to solve the technical problems existing in the above-mentioned related technologies.

[0068] like Figure 1 As shown, Figure 1 This is a schematic diagram illustrating an image watermarking method based on a diffusion model with phase spectrum redundancy according to an exemplary embodiment of the present invention. (Refer to...) Figure 1 The method includes:

[0069] S101: Receive an image generation instruction, wherein the image generation instruction includes text information and user identity information for generating an image;

[0070] S102: Construct a ring-shaped hollow binary mask, determine the watermark embedding region in the ring-shaped hollow binary mask based on a preset frequency range, collect the phase value of the watermark embedding region through a random sampling method, and determine the watermark key set based on the phase value. The phase value is used to represent user identity information, and the watermark key set includes multiple watermark keys, and the multiple watermark keys are set to correspond to the channel tensor in the initial latent noise.

[0071] S103: Perform a two-dimensional discrete Fourier transform on the initial latent noise in the diffusion model to obtain the initial amplitude spectrum and the initial phase spectrum;

[0072] S104: Determine the channel tensor corresponding to each watermark key in the initial latent noise, embed each watermark key into the phase spectrum of its corresponding channel, and obtain the watermark phase spectrum;

[0073] S105: Reassemble the initial amplitude spectrum and the watermark phase spectrum corresponding to each channel to obtain multiple watermark frequency domain representations. Perform inverse discrete Fourier transform processing on the multiple watermark frequency domain representations respectively, and combine the processing results to obtain the initial latent noise of the watermark.

[0074] S106: The watermark image is obtained by iteratively processing the initial latent noise of the watermark and the text information in the image generation instruction through a diffusion model.

[0075] By using the above technical solution, a ring-shaped hollow binary mask is constructed. The watermark embedding area is determined in the ring-shaped hollow binary mask based on a preset frequency range. The phase value of the watermark embedding area is collected by a random sampling method, and the watermark key set is determined based on the phase value. This can improve the capacity of the watermark key set and reduce the risk of display structure artifacts. A two-dimensional discrete Fourier transform is performed on the initial latent noise in the diffusion model to obtain the initial amplitude spectrum and the initial phase spectrum. The channel tensor corresponding to each watermark key in the initial latent noise is determined, and each watermark key is embedded into the phase spectrum of its corresponding channel tensor to obtain the watermark phase spectrum. This avoids the formation of fixed, regular, and perceptible structural patterns in the generated image. The initial amplitude spectrum and the watermark phase spectrum corresponding to each channel are recombined to obtain multiple watermark frequency domain representations. Inverse discrete Fourier transforms are performed on multiple watermark frequency domain representations, and the results are combined to obtain the initial watermark latent noise. This maintains the original energy distribution of the initial latent noise and reduces the impact of embedding the watermark key into the image on the image generation quality. The initial watermark latent noise and the text information in the image generation instructions are iteratively processed by the diffusion model to obtain the watermarked image, which improves the quality of the generated watermarked image.

[0076] To enable those skilled in the art to better understand the diffusion model image watermarking method based on phase spectrum redundancy provided by this invention, the above steps are illustrated in detail below.

[0077] For example, the watermarking method in this embodiment of the invention can be applied to a diffusion image generation platform, without specific limitations. When applied to a diffusion image generation platform, the user can input an image generation command through the platform. This image generation command can include text information and user identity information. The text information can be used to represent the image the user wants to generate, and the user identity information can be relevant information when the user logs into the diffusion image generation platform, which can include user fingerprint information, name information, etc.

[0078] For example, when embedding a watermark in the phase spectrum of the initial latent noise, the frequency position occupied by the watermark needs to be determined in advance. The initial latent noise can be a latent variable at the start of the generation process, typically randomly sampled from a Gaussian distribution and used to generate the image after progressive denoising. Embedding the watermark across the entire phase spectrum of the initial latent noise can easily cause significant changes to the original frequency domain characteristics of the latent noise; conversely, if the embedding area is too small, it may lead to insufficient watermark information and decreased detection stability. Therefore, a circular hollow binary mask can be constructed to define the positions of allowed replacement phases in each latent noise channel. This circular hollow binary mask can serve as a tool for selecting the watermark embedding region, providing a unified positional constraint for the subsequent generation and embedding of random phase watermarks.

[0079] After that, as Figure 2 As shown, the phase value of the watermark embedding region can be collected using a random sampling method. Based on the phase value, a watermark key set is determined. This watermark key set includes multiple watermark keys, each corresponding to a channel tensor in the initial latent noise. Therefore, the number of watermark keys and the number of channel tensors in the initial latent noise are the same and perfectly matched. Simultaneously, the phase value can be used to represent user identity information, and thus the watermark key set can be used to represent identity information. Figure 2 middle, To represent the initial latent noise at time... The corresponding initial amplitude spectrum; This represents the initial phase spectrum corresponding to the initial latent noise; This represents the phase spectrum of the watermark after embedding the watermark key; This represents the frequency domain representation of the watermark obtained by reconstructing the initial amplitude spectrum and the watermark phase spectrum. Indicates from the first The watermark phase is recovered and restored to a unified direction in each channel. FFT (Fast Fourier Transform) is used to transform latent noise from the spatial domain to the frequency domain, and IFFT (Inverse Fast Fourier Transform) is used to transform the reconstructed frequency domain representation back to the latent space. DDIM (Denoising Diffusion Implicit Models) is used for the diffusion generation of the watermark image and the inversion process in the detection stage.

[0080] In one possible manner, determining the watermark embedding region in the annular hollow binary mask based on a preset frequency range includes:

[0081] In a ring-shaped hollow binary mask, local polar coordinates are constructed with the center of the zero-frequency spectrum as the reference point, and the inner and outer radii are determined according to the preset frequency range.

[0082] Calculate the straight-line distance between the spectral coordinates of each position in the annular hollow binary mask and the spectral center. The region corresponding to the position where the straight-line distance is between the inner radius and the outer radius is determined as the watermark embedding region.

[0083] It should be understood that, in this embodiment of the invention, the annular hollow binary mask can be constructed in local polar coordinates with the center of the zero-frequency spectrum as the reference point. Let the coordinate point of the spectrum center be... Arbitrary frequency domain coordinates straight-line distance to the center of the spectrum for:

[0084] ;

[0085] Then, the inner and outer radii are determined based on a preset frequency range. The preset frequency range can be the frequency range within the annular hollow binary mask located between the low-frequency and high-frequency regions. When the straight-line distance from the frequency domain coordinates to the center of the spectrum lies between the inner and outer radii, the corresponding annular hollow binary mask value is set to 1; otherwise, the corresponding mask value is set to 0.

[0086] ;

[0087] in, The positions constitute the watermark embedding area, and random phase watermarks are subsequently generated and embedded in these positions; The position of the watermark does not participate in the watermark embedding, and its original phase value will remain unchanged. The inner radius of the watermark embedding area is 1. The outer radius of the watermark embedding area.

[0088] Different locations in the frequency domain have varying impacts on the quality of the generated image and the robustness of the watermark. Low-frequency regions generally exhibit strong stability, but significant modifications to them may affect the quality of the generated image. High-frequency regions have a relatively smaller impact on the quality of the generated image, but are more susceptible to degradation by compression, noise, and blurring. Therefore, in this embodiment of the invention, an annular region located between the low-frequency and high-frequency regions is selected as the watermark embedding location within the annular hollow binary mask to balance watermark detection robustness and the quality of the generated image.

[0089] In one possible manner, the step of acquiring the phase value of the watermark embedding region through a random sampling method and determining the watermark key set based on the phase value includes:

[0090] The watermark embedding area is divided into a first half-region and a second half-region with the center of the spectrum as the symmetrical point.

[0091] The phase value at each position in the first half-region is randomly sampled based on the uniformly distributed phase angle. After sampling at all positions in the first half-region, the first watermark half-region is obtained.

[0092] With the center of the spectrum as the symmetrical position, the phase value of each position in the second half is set to the opposite value of the phase value at the corresponding position in the first half, thus obtaining the second watermark half region;

[0093] The first and second watermark halves are determined as sub-watermark keys, and the sub-watermark keys are rotated around the center of the spectrum at multiple preset angles to obtain multiple watermark keys.

[0094] Multiple watermark keys are identified as a watermark key set.

[0095] It should be understood that, such as Figure 3 As shown, the watermark embedding region is divided about the center point of the spectrum according to the frequency position. Symmetrical first half Second half , Figure 3 The mask in the image is a hollow annular binary mask. Due to initial latent noise... It typically follows a Gaussian distribution, and its Fourier phase approximately follows the phase angle. The phase of the generated watermark is uniformly distributed across the surface. Therefore, to ensure that the phase of the generated watermark is statistically consistent with the phase of the initial latent noise, a uniform distribution is achieved in the first half-region. The first watermark half-region is generated by randomly sampling phase values ​​according to the following formula. :

[0096] ;

[0097] To construct the watermark key based on the first watermark half-region and ensure it satisfies the Fourier conjugate symmetry constraint of the real-valued signal, the spectral center is used as the reference point. Centered on symmetry, position The central symmetric position is denoted as and in the second half of the zone The phase value at the corresponding position is set to the first half-zone. The inverse of the phase value. The conjugate pair is called the symmetry property satisfied by the Fourier spectrum of the real-valued signal, that is, the spectral values ​​at the centrally symmetric frequency positions are complex conjugates of each other, with equal amplitudes and phases in the modulus. They are opposites in the same sense. The watermark key can be expressed by the following formula:

[0098] ;

[0099] Different random sampling results can generate different sub-watermark keys. Different sub-watermark keys can be used as identity keys for different users or generation models. To improve the robustness of the watermark under geometric perturbations such as cropping, the sub-watermark keys... Rotating around the center of the spectrum at a predetermined angle, which may include multiple preset angles, in this embodiment of the invention, the initial latent noise channel tensor is set to four, that is, the channel dimension is 4. Therefore, the multiple preset angles are set to four, namely... , , and Four watermark keys were obtained:

[0100] ;

[0101] in, This represents a watermark rotation operation centered on the frequency spectrum. Due to initial latent noise... It contains four channels, therefore the sub-watermark key Rotate separately , , and Four watermark keys were obtained. , , and The four watermark keys together constitute the watermark key set. :

[0102] ;

[0103] Subsequently, the watermark key set The four watermark keys contained are embedded in the initial latent noise. In different channels, watermarks with different orientations but the same identity information are stored in different channels.

[0104] For example, a diffusion model can be a generative model that learns the data distribution through a forward noise-adding process and a reverse noise-de-noising process, while progressively generating data such as images from random noise. Let the initial latent noise be... Where 4 indicates that the initial latent noise contains 4 channels. and Let these represent the height and width of each channel in the latent space, respectively. Perform a two-dimensional discrete Fourier transform on each channel in the initial latent noise, and shift the zero-frequency component to the center of the spectrum to obtain the frequency domain representation. Among them, the Discrete Fourier Transform (DFT) is a mathematical transformation that converts discrete signals from the spatial domain to the frequency domain. The initial amplitude spectrum and initial phase spectrum of each channel are denoted as follows: and The initial amplitude spectrum can represent the intensity of each frequency component, and the initial phase spectrum can represent the phase angle of each frequency component.

[0105] For example, after obtaining the initial amplitude spectrum and the initial phase spectrum, the watermark key can be embedded into the corresponding phase spectrum for each channel without changing the initial amplitude spectrum, thus obtaining the watermark phase spectrum.

[0106] In one possible manner, embedding each watermark key into the phase spectrum of its corresponding channel to obtain the watermark phase spectrum includes:

[0107] Determine the phase spectrum of the region belonging to the watermark embedding area in the phase spectrum of the channel;

[0108] The watermark phase spectrum is obtained by replacing the regional phase spectrum with the phase spectrum in the corresponding watermark key.

[0109] It should be understood that the watermark key is used to... Embedded into the initial latent noise Taking one channel as an example, in the phase spectrum of the channel, determine the phase spectrum of the region corresponding to the watermark embedding area, and then insert the watermark key. The phase spectrum of the replacement region is used to retain the original phase outside the watermark embedding region, resulting in the watermark phase spectrum. The watermark phase spectrum is expressed by the following formula:

[0110] ;

[0111] in, , Indicates the first The phase spectrum after watermarking is embedded in each channel.

[0112] All channels are processed in the manner described above, and each channel stores a watermark phase spectrum with different directions but the same identity information.

[0113] For example, after obtaining the watermark phase spectrum, for each channel, the watermark phase spectrum and the initial amplitude spectrum corresponding to that channel can be recombined to obtain multiple watermark frequency domain representations. Then, the multiple watermark frequency domain representations can be processed by the inverse discrete Fourier transform method to obtain the initial latent noise of the watermark.

[0114] Specifically, the entire watermark embedding process does not change the initial amplitude spectrum of the initial latent noise. The initial amplitude spectrum... Phase spectrum with watermark Recombined, we get the first The watermark frequency domain representation for each channel:

[0115] ;

[0116] in, The imaginary unit is represented. Inverse Discrete Fourier Transforms are performed on the frequency domain representations of the watermark for each of the four channels, and the results are combined to obtain the initial latent noise of the watermark. .

[0117] Because the embedding process only replaces the phase values ​​within the latent noise mask region and completely preserves the initial amplitude spectrum, it can maintain the original energy distribution and frequency domain characteristics of the initial latent noise as much as possible. Finally, the initial latent noise is watermarked. A diffusion model with unchanged structure and parameters is directly input, and iterative denoising is performed under the guidance of user-inputted text information to obtain the final latent variables. Then, a watermarked image is generated using an image decoder. The image is delivered to the user for use, where the latent variables can be multi-channel tensor representations of the image in the compressed latent space.

[0118] In some possible ways, the method further includes:

[0119] The watermark image is subjected to image attack processing to obtain the image to be inspected, wherein the attack processing is at least one of rotation, cropping, compression, blurring, noise addition and brightness adjustment processing;

[0120] The image to be inspected is rotated and corrected using a multi-channel phase consistency rotation correction algorithm to obtain the latent noise to be inspected. The latent noise to be inspected is then restored using multi-channel restoration and circular mean fusion to obtain the target watermark.

[0121] The target watermark is detected, and the detection results are obtained.

[0122] It should be understood that in watermarking methods of related technologies, when verifying the watermark on the generated image, image rotation operations cause the latent representation to rotate synchronously, and image cropping and noise may also damage individual channels. Therefore, unaligned single-channel extraction is prone to producing large matching distances. Furthermore, post-processing embedding directly modifies the generated image, which may reduce image quality; model-based fine-tuning methods require changes to model parameters, resulting in high computational costs and limited cross-model compatibility.

[0123] Therefore, in this embodiment of the invention, after obtaining the watermark image, the attacked watermark image can be verified to determine the quality of the generated watermark image. Specifically, the watermark image can first be subjected to attack processing, which can be at least one of the following: rotation, cropping, compression, blurring, noise addition, and brightness adjustment, to obtain the image to be inspected.

[0124] Then, the image to be inspected can be rotated and corrected using a multi-channel phase consistency rotation correction algorithm to obtain the latent noise to be inspected. The latent noise to be inspected is then restored using multi-channel and fused with circular mean to obtain the target watermark, which is then verified and detected.

[0125] In one possible manner, the step of performing rotation correction on the image to be inspected using a multi-channel phase-consistency rotation correction algorithm to obtain the latent noise to be inspected includes:

[0126] The image to be tested is mapped to the latent space by the diffusion model to obtain the image latent variables. The image latent variables are then inverted by DDIM to obtain the approximate initial latent noise.

[0127] The target rotation angle of the approximate initial latent noise is calculated by a multi-channel phase consistency rotation correction algorithm. The approximate initial latent noise is then rotated in the opposite direction by the target rotation angle to obtain the latent noise to be detected.

[0128] It should be understood that, in the specific implementation process, the pre-trained encoder of the diffusion model is first utilized. The image to be examined is mapped to the latent space to obtain the image latent variables. :

[0129] ;

[0130] Subsequently, using empty text information as text conditions, for Perform DDIM inversion, gradually recovering the latent noise in the opposite direction to image generation, and finally obtain an approximate initial latent noise. , The image to be inspected.

[0131] When a watermarked image is subjected to a rotation attack, the approximate initial latent noise obtained through DDIM inversion will also undergo a corresponding spatial rotation, causing a misalignment between the watermark phase and the watermark in the watermark key. Therefore, a multi-channel phase consistency rotation correction algorithm can be used to estimate the rotation angle of the image under inspection and to perform a reverse rotation on the inverted latent noise, thereby restoring the spatial alignment between the watermark and the target watermark.

[0132] In one possible manner, calculating the target rotation angle of the approximate initial latent noise using a multi-channel phase-consistent rotation correction algorithm includes:

[0133] Multiple candidate rotation angles are determined within a preset angle range. For each candidate rotation angle, the following processing is performed: the approximate initial latent noise is rotated in the opposite direction according to the candidate rotation angle to obtain the candidate corrected latent noise. The candidate corrected latent noise is subjected to Fourier transform to obtain the candidate phase spectrum corresponding to each channel tensor in the candidate corrected latent noise. After all candidate rotation angles are processed, multiple candidate phase spectra are obtained for each channel tensor.

[0134] For each candidate phase spectrum corresponding to each channel tensor, obtain the watermark key of the channel tensor, and calculate the average element distance between the candidate phase spectrum and the watermark key corresponding to the channel tensor. After all candidate phase spectra are calculated, multiple average element distances are obtained for each channel tensor.

[0135] In each channel tensor, the candidate rotation angle corresponding to the smallest average element distance among multiple average element distances is determined as the sub-target rotation angle of the channel tensor, thus obtaining multiple sub-target rotation angles for candidate correction of latent noise;

[0136] Extract multiple average element distances corresponding to the rotation angle of each sub-target, and add the multiple average element distances to obtain multiple total average element distances. The sub-target rotation angle corresponding to the minimum total average element distance among the multiple total average element distances is determined as the target rotation angle.

[0137] It should be understood that, in the specific processing, the approximate initial latent noise obtained through rotation correction and inversion is... Watermark key set Mask and angle consistency threshold For input, the specific process is as follows:

[0138] Candidate rotation angles are selected sequentially within a preset angle range. The preset angle range is to and approximate the initial latent noise Reverse rotation Candidate latent noise for correction is obtained. Subsequently, Fourier transform is performed on each channel of the candidate latent noise to extract the corresponding candidate phase spectrum.

[0139] For the One channel, in the mask Internally, calculate the candidate phase spectrum and the corresponding watermark key. Average element distance between:

[0140] ;

[0141] in, This indicates the number of positions in the mask where the value is 1. The smaller the value, the higher the value of the candidate rotation angle. Each channel and watermark key The better the match.

[0142] For each channel Select to make The smallest candidate rotation angle is taken as the sub-target rotation angle of that channel. In another possible approach, individual channels may be severely damaged by disturbances such as pruning and noise. The channel with the largest minimum matching distance is removed to reduce the impact of abnormal channels on angle estimation.

[0143] A consistency check is performed on the sub-target rotation angle results for the remaining channels. Among multiple sub-target rotation angles, the difference between any two sub-target rotation angles is calculated, resulting in multiple difference rotation angles. If a preset number of difference rotation angles exceed the angle consistency threshold, a check is performed. If the angle estimation is unreliable, rotation correction will not be performed, and the sub-target rotation angle will be set to... .

[0144] Otherwise, for any sub-target rotation angle, extract the average element-wise distance of that sub-target rotation angle across all reserved channels, and sum these average element-wise distances to obtain the total average element-wise distance corresponding to that candidate angle. After comparing the average element-wise distances of all sub-target rotation angles, select the sub-target rotation angle with the smallest total average element-wise distance as the target rotation angle. Subsequently, the approximate initial latent noise is... Rotation The rotation-corrected latent noise to be detected is obtained, providing input for subsequent watermark detection.

[0145] In one possible manner, the process of performing multi-channel restoration and circular mean fusion on the latent noise to be detected to obtain the target watermark includes:

[0146] Perform Discrete Fourier Transform on the latent noise to be detected to obtain the phase spectrum of each channel, and restore the phase spectrum to obtain the restored watermark phase of each channel.

[0147] The target watermark is obtained by processing multiple restored watermark phases using the circular mean fusion method.

[0148] It should be understood that performing a DFT (Discrete Fourier Transform) on the latent noise to be detected yields the phase spectrum of each channel. Because of the embedding time The channel uses the target rotation angle The watermark key is extracted by reversing the rotation angle as follows:

[0149] ;

[0150] Different channels may exhibit varying degrees of distortion due to disturbances such as noise and cropping. The phases of each channel, restored to a common direction, are then fused using circular mean averaging to obtain the target watermark. The position at M(u,v)=1 is calculated as follows:

[0151] ;

[0152] in, Represents a complex argument. Represents the imaginary unit. The initial number of channels for latent noise. Circular averaging avoids phase distortion by averaging the cosine and sine components of the phase of each channel on a unit circle and then taking the argument of the resulting complex number. and A linear average error is generated at the boundary, ultimately yielding the target watermark. .

[0153] In possible ways, the detection of the target watermark to obtain the detection result includes:

[0154] The circumferential distance between the extracted watermark and the spectral coordinates of each position of each watermark key in the watermark key set is calculated by phase circumferential distance, resulting in multiple circumferential distances.

[0155] Calculate the average circumferential distance of multiple circumferential distances. When the average circumferential distance is less than or equal to a preset distance threshold, the detection result is that the target watermark matches the watermark key set.

[0156] It should be understood that obtaining the target watermark Next, it needs to be compared with the watermark keys in the watermark key set to determine whether the image to be inspected contains a watermark key from the watermark key set, or to determine its corresponding user identity. Since watermarks are represented by periodic phase values, ordinary absolute difference cannot accurately reflect the actual proximity between two phases. Therefore, phase circumferential distance is used to measure the difference between the target watermark and the watermark key. Let two phase values... and The circumferential distance is:

[0157] ;

[0158] Let N be the number of positions in the mask where M(u,v)=1, and let the target watermark be... With watermark key The matching distance is:

[0159] ;

[0160] In watermark verification tasks, the watermark key This is a preset, fixed watermark pattern. If... Then it is determined that the target watermark in the image to be inspected matches the watermark key. This is a preset watermark matching distance threshold, used to determine the matching relationship between the target watermark and the watermark key.

[0161] In possible ways, the detection of the target watermark to obtain the detection result includes:

[0162] Calculate the circumferential distance between the target watermark and each user watermark key in the user watermark key set to obtain multiple circumferential distances. The user watermark key set consists of the user watermark keys corresponding to different users.

[0163] Determine the user watermark key corresponding to the smallest circumferential distance among multiple circumferential distances, and determine the identity information corresponding to the user watermark key as the user identity information of the target watermark.

[0164] The user's identity information for the target watermark is used as the detection result.

[0165] It should be understood that in the user identification task, a unique user watermark key is pre-assigned to each authorized user, and all user watermark keys are combined into a user watermark key set. .in, Indicates the number of authorized users. Indicates the first Each user has a corresponding watermark key. The goal of user identification is to target the watermark. The watermark is compared one by one with all user watermark keys in the user watermark key set, and the user watermark key with the smallest circumferential distance is selected. The user watermark key associated with this key is then linked to the user watermark key. As the user who generates the image, specifically:

[0166] ;

[0167] In the specific implementation process, such as Figure 4 As shown, taking image source verification and user identity tracking in the diffusion image generation platform as an example, the upper part of the figure shows the process of watermark generation, embedding and image generation, and the lower part shows the process of image inversion, watermark extraction and detection result output.

[0168] When a user submits an image generation command to the diffusion image generation platform, the platform generates a watermark embedding region based on a preset frequency range and generates or retrieves a unique watermark key based on the user's identity, further constructing a corresponding multi-channel watermark key set. Subsequently, the watermark key is embedded into each channel of the initial latent noise of the diffusion model, and the initial latent noise containing the watermark key is input into the diffusion model with unchanged structure and parameters. The diffusion model performs iterative denoising and image decoding based on the user's input text information, generating a watermarked image with the user's identity. The watermark information is injected into the phase spectrum of the initial latent noise and propagates into the generated image during the diffusion denoising process, without affecting the user's normal use and dissemination of the generated image.

[0169] During network propagation, storage, or reprocessing, generated images may undergo operations such as rotation, cropping, compression, blurring, noise addition, or brightness adjustment. When a diffusion image generation platform needs to determine whether an image to be inspected was generated by the platform itself, or needs to track its corresponding generating user, it inputs the image to be inspected into the watermark detection module. The detection module first uses the diffusion model inversion method to recover the initial latent noise corresponding to the image to be inspected, and then sequentially performs rotation correction, multi-channel watermark restoration, and multi-channel fusion to obtain the target watermark.

[0170] In watermark verification scenarios, the target watermark is compared with a set of watermark keys, and the phase circumferential distance between the two is used to determine whether the image under inspection contains a watermark key from the watermark key set, thereby verifying whether it originated from a designated diffusion image generation platform. In user identification scenarios, the target watermark is compared one by one with the user watermark keys corresponding to each user in the user watermark key set, and the user associated with the user watermark key with the smallest matching distance is identified as the user who generated the image. Finally, the diffusion image generation platform outputs either the watermark verification result or the user identification result, realizing the confirmation of the source and the tracking of responsibility for the diffusion-generated image.

[0171] The above technical solutions improve watermark key capacity and reduce structural artifacts: Since the watermark identity is determined by multiple random phase values ​​within the watermark embedding region, rather than relying on a limited number of rings or discrete values, a larger watermark key space can be formed. Simultaneously, the random phase watermark and the original phase of the initial latent noise have similar statistical distributions, making it less likely to form fixed, regular, and perceptible structural patterns in the generated image. This helps maintain the quality of the generated image: Because the initial amplitude spectrum of the initial latent noise is preserved during watermark embedding, and only the phase values ​​within the watermark embedding region are replaced, the original energy distribution of the latent noise can be well maintained. At the same time, the watermark phase satisfies Fourier conjugate symmetry constraints, which helps ensure the real-valued nature and reconstruction stability of the latent noise after inverse Fourier transform, thereby reducing the impact of watermark embedding on the image generation quality. Furthermore, it enhances robustness against geometric attacks such as rotation and cropping: Since the same watermark is embedded in multiple latent noise channels with different rotation directions, each channel can form a complementary watermark key. When some channels are subjected to cropping, noise, or other perturbations, the watermark information retained in the remaining channels can still be used for recovery. Meanwhile, the multi-channel phase consistency rotation correction algorithm can estimate and correct watermark misalignment caused by image rotation, and then improve the stability of watermark extraction through multi-channel restoration and circular mean fusion; it supports large-scale user identification: since unstructured random phase watermarks have a large distinguishable space, different users can be assigned watermark keys that are significantly different from each other. During detection, by calculating the phase circumferential distance between the target watermark and each watermark key in the watermark key set, identity matching between multiple candidate users can be completed without changing the size of the embedding region, thus supporting user-level tracking of diffusion-generated images; it requires no model modification and is easy to deploy across models: since the watermark only embeds initial latent noise before image generation, it is not necessary to modify the denoising network, decoder structure or model parameters of the diffusion model, nor is it necessary to retrain the original generation model. Therefore, this invention can be integrated into existing diffusion image generation processes with independent pre-embedding and post-detection modules, and can be adapted to different models based on their latent space size and channel settings; it also improves resistance to active watermark removal and regeneration processing: because the watermark uses a high-dimensional unstructured random phase pattern and does not have an easily estimable regular circular template, attackers find it difficult to accurately infer the complete watermark structure and perform targeted removal using a small number of samples. Even if the image has undergone regeneration, compression, or other processing, as long as some watermark phase information is still retained in its latent space, watermark detection can still be completed through diffusion inversion, multi-channel redundancy recovery, and distance matching.

[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image watermarking method based on a diffusion model with phase spectral redundancy, characterized in that, include: Receive an image generation instruction, wherein the image generation instruction includes text information and user identity information for generating an image; A circular hollow binary mask is constructed. A watermark embedding region is determined in the circular hollow binary mask based on a preset frequency range. The phase value of the watermark embedding region is collected by a random sampling method. A watermark key set is determined based on the phase value. The phase value is used to represent user identity information. The watermark key set includes multiple watermark keys, and the multiple watermark keys are set to correspond to the channel tensor in the initial latent noise. A two-dimensional discrete Fourier transform is performed on the initial latent noise in the diffusion model to obtain the initial amplitude spectrum and the initial phase spectrum; Determine the channel tensor corresponding to each watermark key in the initial latent noise, and embed each watermark key into the phase spectrum of its corresponding channel to obtain the watermark phase spectrum; The initial amplitude spectrum and the watermark phase spectrum corresponding to each channel are recombined to obtain multiple watermark frequency domain representations. Inverse discrete Fourier transform is performed on each of the multiple watermark frequency domain representations, and the results are combined to obtain the initial latent noise of the watermark. The watermarked image is obtained by iteratively processing the initial latent noise of the watermark and the text information in the image generation instructions using a diffusion model.

2. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 1, characterized in that, The determination of the watermark embedding region in the annular hollow binary mask based on a preset frequency range includes: In a ring-shaped hollow binary mask, local polar coordinates are constructed with the center of the zero-frequency spectrum as the reference point, and the inner and outer radii are determined according to the preset frequency range. Calculate the straight-line distance between the spectral coordinates of each position in the annular hollow binary mask and the spectral center. The region corresponding to the position where the straight-line distance is between the inner radius and the outer radius is determined as the watermark embedding region.

3. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 1, characterized in that, The step of acquiring the phase value of the watermark embedding region through a random sampling method and determining the watermark key set based on the phase value includes: The watermark embedding area is divided into a first half-region and a second half-region with the center of the spectrum as the symmetrical point. The phase value at each position in the first half of the region is randomly sampled based on the uniformly distributed phase angle. After sampling at all positions in the first half of the region, the first watermark half of the region is obtained. With the center of the spectrum as the symmetrical position, the phase value of each position in the second half is set to the opposite value of the phase value at the corresponding position in the first half, thus obtaining the second watermark half region; The first and second watermark halves are determined as sub-watermark keys, and the sub-watermark keys are rotated around the center of the spectrum at multiple preset angles to obtain multiple watermark keys. Multiple watermark keys are identified as a watermark key set.

4. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 1, characterized in that, The step of embedding each watermark key into the phase spectrum of its corresponding channel to obtain the watermark phase spectrum includes: Determine the phase spectrum of the region belonging to the watermark embedding area in the phase spectrum of the channel; The watermark phase spectrum is obtained by replacing the regional phase spectrum with the phase spectrum in the corresponding watermark key.

5. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 1, characterized in that, The method further includes: The watermark image is subjected to image attack processing to obtain the image to be inspected, wherein the attack processing is at least one of rotation, cropping, compression, blurring, noise addition and brightness adjustment processing; The image to be inspected is rotated and corrected using a multi-channel phase consistency rotation correction algorithm to obtain the latent noise to be inspected. The latent noise to be inspected is then restored using multi-channel restoration and circular mean fusion to obtain the target watermark. The target watermark is detected, and the detection results are obtained.

6. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 5, characterized in that, The step of performing rotation correction on the image to be inspected using a multi-channel phase consistency rotation correction algorithm to obtain the latent noise to be inspected includes: The image to be tested is mapped to the latent space by the diffusion model to obtain the image latent variables. The image latent variables are then inverted by DDIM to obtain the approximate initial latent noise. The target rotation angle of the approximate initial latent noise is calculated by a multi-channel phase consistency rotation correction algorithm. The approximate initial latent noise is then rotated in the opposite direction by the target rotation angle to obtain the latent noise to be detected.

7. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 6, characterized in that, The calculation of the target rotation angle of the approximate initial latent noise using a multi-channel phase-consistent rotation correction algorithm includes: Multiple candidate rotation angles are determined within a preset angle range. For each candidate rotation angle, the following processing is performed: the approximate initial latent noise is rotated in the opposite direction according to the candidate rotation angle to obtain the candidate corrected latent noise. The candidate corrected latent noise is subjected to Fourier transform to obtain the candidate phase spectrum corresponding to each channel tensor in the candidate corrected latent noise. After all candidate rotation angles are processed, multiple candidate phase spectra are obtained for each channel tensor. For each candidate phase spectrum corresponding to each channel tensor, obtain the watermark key of the channel tensor, and calculate the average element distance between the candidate phase spectrum and the watermark key corresponding to the channel tensor. After all candidate phase spectra are calculated, multiple average element distances are obtained for each channel tensor. In each channel tensor, the candidate rotation angle corresponding to the smallest average element distance among multiple average element distances is determined as the sub-target rotation angle of the channel tensor, thus obtaining multiple sub-target rotation angles for candidate correction of latent noise; Extract multiple average element distances corresponding to the rotation angle of each sub-target, and add the multiple average element distances to obtain multiple total average element distances. The sub-target rotation angle corresponding to the minimum total average element distance among the multiple total average element distances is determined as the target rotation angle.

8. The image watermarking method based on a diffusion model with phase spectral redundancy according to claim 7, characterized in that, The process of performing multi-channel restoration and circular mean fusion on the latent noise to be detected to obtain the target watermark includes: Perform Discrete Fourier Transform on the latent noise to be detected to obtain the phase spectrum of each channel, and restore the phase spectrum to obtain the restored watermark phase of each channel. The target watermark is obtained by processing multiple restored watermark phases using the circular mean fusion method.

9. The diffusion model image watermarking method based on phase spectrum redundancy according to any one of claims 5-8, characterized in that, The detection of the target watermark, and the resulting detection results, include: The circumferential distance between the extracted watermark and the spectral coordinates of each position of each watermark key in the watermark key set is calculated by phase circumferential distance, resulting in multiple circumferential distances. Calculate the average circumferential distance of multiple circumferential distances. When the average circumferential distance is less than or equal to a preset distance threshold, the detection result is that the target watermark matches the watermark key set.

10. The diffusion model image watermarking method based on phase spectrum redundancy according to any one of claims 5-8, characterized in that, The detection of the target watermark, and the resulting detection results, include: Calculate the circumferential distance between the target watermark and each user watermark key in the user watermark key set to obtain multiple circumferential distances, where the user watermark key set consists of the user watermark keys corresponding to different users; Determine the user watermark key corresponding to the smallest circumferential distance among multiple circumferential distances, and determine the identity information corresponding to the user watermark key as the user identity information of the target watermark. The user's identity information for the target watermark is used as the detection result.