Watermark generation and detection method and system for image generation model

By pre-embedding an invisible watermark in the image generation model and using PCET coefficients and the DDIM algorithm to detect the watermark, the imperceptibility and robustness issues of the diffusion model are solved, the reliability of the image generation model and the protection of user privacy are achieved, and the fairness of AI content governance is improved.

CN121767155APending Publication Date: 2026-03-31NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Diffusion models cannot simultaneously address the issues of imperceptibility, robustness, and low training cost in the image generation process, leading to malicious misuse and copyright disputes.

Method used

An invisible watermark mechanism is pre-embedded in the image generation model. The watermark bits are embedded into the noise signal moments of the diffusion model through PCET coefficient mapping and embedding function E to generate an invisible watermark image. The DDIM reverse diffusion algorithm is then used to detect and determine the generation source of the image generation model.

Benefits of technology

This enables the identification of the source of image generation models while ensuring content security and user privacy, thereby improving the fairness and acceptability of AI content governance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767155A_ABST
    Figure CN121767155A_ABST
Patent Text Reader

Abstract

The invention discloses an image generation model-oriented watermark generation and detection method and system, and the method comprises the steps: a model provider pre-embeds an invisible watermark in a diffusion model, and provides a high-quality non-perception image generation service for a legal user; when a malicious user generates and propagates illegal or harmful images by using an API, a detection request can be provided to a model party through a supervision party, and a model provider performs watermark detection on suspicious images; and the model provider extracts watermark information from the suspicious image, judges whether the watermark information is generated by the model or not, and submits a detection result to the supervisor to judge whether the watermark information is legal or not. According to the method, a watermarking mechanism which is only used for'detection 'instead of'traceability' is designed, the speech freedom and privacy of legal users are protected while the identifiability requirement of supervision on AI generation content is met, direct tracking of user identities is avoided, and therefore effective balance between content safety guarantee and user right maintenance is achieved, and user experience is improved. And the fairness and acceptability of AI content governance are obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of detection of images generated by diffusion models, specifically involving image watermark tracing and verification technology, and is a watermark generation and detection method and system for image generation models. Background Technology

[0002] In recent years, diffusion models have become a new paradigm in image generation due to their ability to generate high-quality images. Commercial models such as Stable Diffusion and Wenxin Yige have significantly lowered the barrier to entry for professional-level image generation, allowing ordinary users to generate realistic photos or artistic images without specialized knowledge. However, when this technology is maliciously abused, it can lead to serious social risks, such as the spread of misinformation and the widespread dissemination of forged images on social media, causing public confusion and a crisis of social trust. Furthermore, AI face-swapping technology can be used to commit new types of illegal activities such as fraud. It can also impact the copyright system, as model training data may contain implicit copyright disputes; for example, unauthorized use of "Miyazaki Hayao style" to generate commercial images could lead to copyright disputes. Summary of the Invention

[0003] Purpose of the invention: The present invention aims to provide a watermark generation and detection method and system for image generation models, in order to solve the problems of diffusion models in application that cannot simultaneously achieve imperceptibility, robustness and low training cost.

[0004] Technical solution: A watermark generation and detection method for image generation models, comprising the following steps:

[0005] S1. The model provider pre-embeds an invisible watermark mechanism in the image generation model, so that the model automatically generates an image containing a watermark when responding to a user request. The watermark is only used to verify whether the image was generated by this model and does not contain user identity or request content information.

[0006] The watermark is generated by taking the initial noise signal from the diffusion model generation process. Mapped to a circular harmonic space in polar coordinates, a set of moments is obtained by calculating its PCET coefficients. ,in For order, For the number of repetitions, , To meet and set of integer pairs The maximum order is preset.

[0007] Define a binary watermark sequence Its length is equal to the specified embedding region. The number of moments in, where For any selection within the first and second quadrants of the circular harmonic space, satisfying The set of moments, and ;

[0008] Use the embedding function E to embed the watermark bits. Embedded into the corresponding PCET matrix In the process, the moments to be embedded with the watermark replace the corresponding moments in the original set of moments, forming a new set of moments with embedded watermarks. To maintain the conjugate symmetry of the circular harmonic space, the moments in the third and fourth quadrants are modified accordingly to ensure the moment set for embedding the watermark. It satisfies symmetry constraints throughout the entire space;

[0009] The set of rectangles with embedded watermarks By mapping back to the spatial domain through inverse circular harmonic transform, the initial noise signal containing the watermark is reconstructed and used in the subsequent diffusion model generation process.

[0010] S2. Submit a text prompt by calling the model API to obtain a watermarked image generated by the model, and you can freely use or distribute the image;

[0011] S3. When the regulator discovers a suspicious illegal or harmful image, it initiates a watermark detection request to the model provider and provides the suspicious image as the detection target.

[0012] S4. After receiving the detection request, the model provider performs watermark extraction and verification operations on the suspicious image to determine whether it was generated by the model. The model provider then returns the watermark detection results to the regulator. The detection process does not trace the identity of the specific user.

[0013] Furthermore, step S4 specifically includes:

[0014] The model provider receives images to be detected submitted by the regulator. The image was then processed using the DDIM backdiffusion algorithm to estimate its corresponding initial noise signal. ;

[0015] The model provider will estimate the initial noise signal. By mapping to a circular harmonic space in polar coordinates and calculating the PCET coefficients, a set of moments to be detected is obtained. ;

[0016] The model provider in the set of moments to be detected Extract the region located in the specified embedding area. internal moment;

[0017] The model provider uses a pre-defined embedded watermark. and preset amplitude parameters and Calculate the moment to be detected With embedded watermark Distance between final distance For all The average value;

[0018] Furthermore, the PCET coefficient is calculated as follows:

[0019] ,

[0020] ,

[0021] ,

[0022] in, Describes the basis functions The complex conjugate, This represents the radial distance (radius) of the image in polar coordinates. Represents the angle in polar coordinates. This represents the orthogonal basis functions used to calculate the PCET coefficients. Describing basis functions radial component, Represents the imaginary unit (i.e.) ).

[0023] The above method uses the embedding function E to embed the watermark bits. Embedded into the corresponding PCET matrix The specific operation is as follows:

[0024] when At that time, The amplitude was modified to And maintain its phase constant;

[0025] when At that time, The amplitude was modified to And maintain its phase Unchanged, among which and Given two unequal nonnegative real numbers, we obtain the rectangle containing the embedded watermark. ;

[0026] The calculation formula is as follows:

[0027] .

[0028] Symmetric constraints are expressed as:

[0029] ;

[0030] in, Represents watermark rectangle .

[0031] Furthermore, the reconstruction process of the initial noise:

[0032] .

[0033] Furthermore, the target moment With embedded watermark Distance between The calculation method is as follows:

[0034] ,

[0035] Final distance .

[0036] This invention also provides a watermarking system for image generation models, which can implement the aforementioned watermark generation and detection method for image generation models. The system includes:

[0037] The watermark generation module is used to perform step S1, in which the model provider generates an invisible watermark without the identity or requested content based on the watermark generation module.

[0038] The watermark detection module, upon receiving a watermark detection request from the regulator, performs watermark detection according to step S4 to determine whether the watermark was generated by the watermark generation module.

[0039] Beneficial effects: By designing a watermarking mechanism that is only used for "detection" rather than "source tracing", this invention meets the regulatory requirements for the identifiability of AI-generated content while protecting the freedom of speech and privacy of legitimate users and avoiding direct tracking of user identities. This achieves an effective balance between ensuring content security and protecting user rights, and significantly improves the fairness and acceptability of AI content governance. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the solution process of the present invention;

[0041] Figure 2 This is a schematic diagram of the watermark embedding principle of the present invention;

[0042] Figure 3 This is a visual effect diagram of the present invention. Detailed Implementation

[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. To make the above-mentioned objectives, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] like Figure 1 As shown, this invention is a watermark generation and detection method for image generation models, comprising the following steps:

[0045] Step 1: The model provider pre-embeds an invisible watermark mechanism in the image generation model, so that the model automatically generates an image containing a watermark when responding to a user request. The watermark is only used to verify whether the image was generated by this model and does not contain user identity or request content information.

[0046] Step 2: Legitimate or malicious users submit text prompts by calling the model API to obtain the watermarked image generated by the model, and can freely use or distribute the image;

[0047] Step 3: When the regulator discovers a suspicious illegal or harmful image, it initiates a watermark detection request to the model provider and provides the suspicious image as the detection target.

[0048] Step 4: After receiving the detection request, the model provider performs watermark extraction and verification operations on the suspicious image to determine whether it was generated by this model.

[0049] Step 5: The model provider returns the watermark detection results to the regulator to assist in evidence collection and behavior identification, without tracing the specific user's identity.

[0050] like Figure 2 As shown, the detailed steps of step 1) are as follows:

[0051] First, the model provider will amplify the initial noise signal generated during the model generation process. Mapping to a circular harmonic space in polar coordinates, a set of moments is obtained by calculating its Polar Complex Exponential Transform (PCET) coefficients. ,in For order, For the number of repetitions, , To meet and set of integer pairs The maximum order is preset, and the specific calculation method is as follows:

[0052] ,

[0053] ,

[0054] ,

[0055] At the same time, the model provider defines a binary watermark sequence. Its length is equal to the specified embedding region. The number of moments in, where For any selection within the first and second quadrants of the circular harmonic space, satisfying The set of moments, and ;

[0056] Next, the model provider uses the embedding function E to embed the watermark bits. Embedded into the corresponding PCET matrix In the middle, the specific method is: when At that time, The amplitude was modified to And maintain its phase Unchanged; when At that time, The amplitude was modified to And maintain its phase Unchanged, among which and Given two unequal nonnegative real numbers, we obtain the rectangle containing the embedded watermark. The specific calculation formula is as follows:

[0057] ;

[0058] After the basic watermark embedding is completed, the moments in the original moment set of the model provider are replaced by the moments embedded with the watermark, forming a new set of watermark-embedded moments. :

[0059] ;

[0060] Since embedding was previously performed only in the first and second quadrants, the model provider made corresponding modifications to the moments in the third and fourth quadrants to maintain the conjugate symmetry of the circular harmonic space, thus ensuring the moment set for watermark embedding. The symmetry constraint is satisfied throughout the entire space:

[0061] .

[0062] Finally, the model provider embeds the watermark in a set of moments. By mapping back to the spatial domain using inverse circular harmonic transform, the initial noise signal containing the watermark is reconstructed and used in the subsequent diffusion model generation process. The resulting image is shown below. Figure 3 :

[0063] .

[0064] The detailed steps for step 4 are as follows:

[0065] First, the model provider receives the images to be detected submitted by the regulator. The image was then processed using the DDIM backdiffusion algorithm to estimate its corresponding initial noise signal. ;

[0066] Next, the model provider will estimate the initial noise signal. The circular harmonic space mapped to polar coordinates is the watermark embedding space. By calculating the PCET coefficients, a set of moments to be detected is obtained.

[0067] :

[0068] In the set of moments to be detected Next, it is necessary to extract the watermark located in the specified embedding area based on the pre-defined watermark embedding area. internal moment;

[0069] Finally, the model provider embeds the watermark according to the preset settings. and preset amplitude parameters and Calculate the moment to be detected With embedded watermark Distance between The specific calculation method is as follows:

[0070]

[0071] Final distance For all The average value, that is:

[0072] .

[0073] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for watermark generation and detection for image-oriented generative models, characterized in that, Comprise: S1, the model provider pre-embeds an invisible watermark mechanism in the image generation model, so that the model automatically generates an image containing a watermark in response to a user request, the watermark is only used to verify whether the image is generated by the model, does not contain user identity or request content information; The watermark is generated by taking the initial noise signal from the diffusion model generation process. Mapped to a circular harmonic space in polar coordinates, a set of moments is obtained by calculating its PCET coefficients. ,in This represents the radial distance of the image in polar coordinates. Represents the angle in polar coordinates. For order, For the number of repetitions, , To meet and set of integer pairs The maximum order is preset. Defining a binary watermark sequence of length equal to the number of moments in the specified embedding region , for a circular harmonic space, any chosen set of moments in the first and second quadrants satisfying , and ; using an embedding function E to embed the watermark bits into corresponding PCET moments The moments to be embedded with watermark replace the moments in the original moment set at the corresponding positions to form a new moment set embedded with watermark To maintain the conjugate symmetry of the circular harmonic space, the moments in the third and fourth quadrants are modified accordingly to form the moment set embedded with watermark The symmetry constraint is satisfied in the entire space Set of matrices embedding a watermark The initial noise signal containing the watermark is reconstructed by mapping back to the spatial domain through inverse circular harmonic transform, for subsequent diffusion model generation process; S2, by calling the model API to submit a text prompt, get the image containing watermark generated by the model, and can freely use or spread the image; S3, when the supervisor finds suspicious illegal or harmful images, initiates a watermark detection request to the model provider, and provides the suspicious image as the detection object; S4, the model provider receives the detection request, performs watermark extraction and verification operation on the suspicious image, judges whether it is generated by the model, and the model provider returns the watermark detection result to the supervisor, and the detection process does not trace the specific user identity.

2. The image-oriented generative model watermark generation and detection method according to claim 1, characterized in that, Step S4 specifically comprises: The model provider receives an image to be detected submitted by the supervisor And uses the DDIM inverse diffusion algorithm to process the image, estimates the corresponding initial noise signal ; The model provider maps the estimated initial noise signal to a circular harmonic space in a polar coordinate system, and obtains a set of to-be-detected matrices by calculating PCET coefficients ; The model provider extracts a rectangle located in a specified embedding region from among the to-be-detected rectangle set from among the to-be-detected rectangle set The model provider uses a pre-defined embedded watermark. and preset amplitude parameters and Calculate the moment to be detected With embedded watermark Distance between final distance For all The average value.

3. The image-oriented generative model watermark generation and detection method according to claim 1, characterized in that, The calculation of PCET coefficient is as follows: , , , wherein denotes the complex conjugate of the basis function denotes the radial distance of the image in polar coordinate system, denotes the angle in polar coordinate system, denotes the orthogonal basis function used for the calculation of the PCET coefficients, denotes the radial component of the basis function denotes the imaginary unit.​​ 4. The image-oriented generative model watermark generation and detection method according to claim 1, characterized in that, The watermark bits are embedded using an embedding function E The specific operation is as follows: The specific operation is as follows: When the amplitude of is modified to and its phase is kept unchanged; When , the amplitude of is modified to and its phase is kept unchanged, where and are two unequal non-negative real numbers, so as to obtain the matrix embedded with the watermark; the calculation formula is as follows: 。 5. The image-oriented generative model watermark generation and detection method according to claim 1, characterized in that, The symmetry constraint is expressed as: ; wherein represents the complex conjugate of the watermark matrix .

6. The image-oriented generative model watermark generation and detection method according to claim 1, characterized in that, The reconstruction process of the initial noise is represented as .

7. The image-oriented generative model watermark generation and detection method according to claim 1, characterized in that, The to-be-detected matrix The distance between the embedded watermark The distance between the embedded watermark The distance between the embedded watermark , Final distance .

8. An image generation model oriented watermark system, which can implement the image generation model oriented watermark generation and detection method according to any one of claims 1-7, the system comprises: A watermark generation module for executing step S1, the model provider generates an invisible watermark containing no user identity or request content based on the watermark generation module; A watermark detection module, when receiving a watermark detection request from the supervisor, performs watermark detection according to step S4 to judge whether it is generated by the watermark generation module.