Image generation method, image detection method, device and electronic equipment

By adjusting the noisy image using a mask image of a polygonal space-filling graphic during the image generation process, and combining it with a diffusion model to achieve progressive injection of traceability identifiers, the problem of traceability identifiers being easily destroyed and high computational overhead in existing technologies is solved, thereby improving the anti-attack capability and efficiency of image generation.

CN122390941APending Publication Date: 2026-07-14BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2026-03-10
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing image generation models have weak anti-attack capabilities for source identification embedding algorithms, which are easily destroyed by operations such as cropping, scaling, and compression. Furthermore, existing methods have high computational overhead and high latency, making them difficult to adapt to real-time generation scenarios.

Method used

The first noisy image is adjusted by using a mask image with a polygonal space-filling shape. The source identification is progressively injected and fused simultaneously during the image generation process using a diffusion model, avoiding additional watermark embedding post-processing operations and model retraining.

Benefits of technology

It significantly improves the resistance of traceability identifiers to attacks such as cropping, scaling, and compression, reduces computational overhead and latency, and ensures the traceability and robustness of generated images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122390941A_ABST
    Figure CN122390941A_ABST
Patent Text Reader

Abstract

The present disclosure provides an image generation method, an image detection method, a device and an electronic device, and relates to the technical fields of image processing, artificial intelligence, large models and the like. The method comprises: obtaining a mask image; wherein the mask image is used for image tracing, and the mask image comprises a space-filling graph in the form of a broken line; obtaining a first noise image, wherein the first noise image is used for an image generation model to perform a generation process of a target image; adjusting the first noise image according to the mask image to obtain a second noise image; and generating a traceable target image based on the image generation model and the second noise image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical fields of image processing, artificial intelligence, and large models, and in particular to an image generation method, an image detection method, an apparatus, and an electronic device. Background Technology

[0002] With the development of Artificial Intelligence Generated Content (AIGC) technology, high-performance image generation models have become capable of generating ultra-high-resolution images. To achieve copyright management and source tracing for AI-generated images, these models typically embed source identifiers into the generated images using identifier embedding algorithms.

[0003] However, based on existing identifier embedding algorithms, in actual dissemination and use, users can easily erase traces of source identification in images through image processing operations such as cropping, scaling, compression, or Gaussian blurring, resulting in weak anti-attack capabilities of existing identifier embedding algorithms. Summary of the Invention

[0004] This disclosure provides an image generation method, an image detection method, an apparatus, and an electronic device.

[0005] According to one aspect of this disclosure, an image generation method is provided, the method comprising: acquiring a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic; acquiring a first noise image, wherein the first noise image is used by an image generation model to perform a target image generation process; adjusting the first noise image according to the mask image to obtain a second noise image; and generating a traceable target image based on the image generation model and the second noise image.

[0006] According to another aspect of this disclosure, an image detection method is provided, the method comprising: acquiring an image to be detected and a mask image; wherein the mask image is used for image source tracing, and the mask image includes a polyline-type space-filled pattern; the mask image is further used to adjust a first noise image to obtain a second noise image, the first noise image being used by an image generation model to perform a target image generation process; the second noise image and the image generation model being used to generate a traceable target image; using the image generation model to perform noise reconstruction on the image to be detected to obtain a reconstructed noise image, and performing source tracing detection on the image to be detected based on the reconstructed noise image and the mask image.

[0007] According to another aspect of this disclosure, an image generation apparatus is provided, the apparatus comprising: a first acquisition module for acquiring a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic; a second acquisition module for acquiring a first noise image, wherein the first noise image is used by an image generation model to perform a target image generation process; an adjustment module for adjusting the first noise image according to the mask image to obtain a second noise image; and a generation module for generating a traceable target image based on the image generation model and the second noise image.

[0008] According to another aspect of this disclosure, an image detection apparatus is provided, the apparatus comprising: an acquisition module for acquiring an image to be detected and a mask image; wherein the mask image is used for image source tracing, and the mask image includes a polyline-shaped space-filled pattern; the mask image is further used to adjust a first noise image to obtain a second noise image, the first noise image being used by an image generation model to perform a target image generation process; the second noise image and the image generation model are used to generate a traceable target image; and a detection module for using the image generation model to perform noise reconstruction on the image to be detected to obtain a reconstructed noise image, and for performing source tracing detection on the image to be detected based on the reconstructed noise image and the mask image.

[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the image generation method or image detection method proposed above in this disclosure.

[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the image generation method or image detection method proposed in this disclosure above.

[0011] According to another aspect of this disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the image generation method or image detection method proposed above in this disclosure.

[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0013] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0014] Figure 1 This is a schematic flowchart of an image generation method provided in an embodiment of the present disclosure; Figure 2 A schematic flowchart illustrating another image generation method provided in this embodiment of the present disclosure; Figure 3 This is a schematic flowchart of an image detection method provided in an embodiment of the present disclosure; Figure 4 This is a schematic diagram of the structure of an image generation apparatus provided in an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the structure of an image detection device provided in an embodiment of the present disclosure; Figure 6 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0015] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0016] In related technologies, existing identifier embedding methods have the following problems: 1. Frequency domain embedding methods, which rely on frequency domain processing techniques such as discrete cosine transform and discrete wavelet transform, convert the image to a specified color space and divide it into blocks. They then embed identifiers by modifying intermediate frequency coefficients and finally restore the image through an inverse transform. However, these methods depend on the global geometric structure of the image, making the embedded identifiers susceptible to damage from cropping, scaling, and filtering, thus exhibiting weak resistance to geometric attacks.

[0017] 2. Most existing identifier embedding methods are "post-processing" methods, which involve generating an image and then performing a complex frequency domain transformation and adding noise. This results in a high latency cost for identifier embedding, making it difficult to adapt to real-time generation scenarios.

[0018] 3. The method of embedding identifiers by fine-tuning the image generation model structure and implicitly injecting the identifier information into the model weights, and then jointly training with the identifier extraction network, improves the stability of watermarks to a certain extent. However, it requires retraining and fine-tuning of a large model, resulting in high computational and deployment costs. Furthermore, this method performs poorly against combined attacks such as cropping and scaling.

[0019] To address the aforementioned issues, this disclosure provides an image generation method, image detection method, apparatus, and electronic device. It includes adjusting a first noisy image using a mask image with a polygonal spatial filling pattern. This allows for the simultaneous, progressive injection and fusion of traceability identifiers during the iterative denoising process of the image generation model to generate the target image. This eliminates the need for additional post-processing operations such as watermark embedding after image generation, reducing computational overhead and latency. Furthermore, it avoids the significant computational cost associated with model retraining. Simultaneously, the polygonal spatial filling pattern possesses characteristics such as uniform spatial coverage, regular structure, and ease of extraction and recognition. Adjusting the first noisy image using this pattern ensures a uniform distribution of traceability identifiers and deep coupling with image features, significantly enhancing the traceability identifiers' resistance to attacks such as cropping, scaling, and compression, thus guaranteeing the traceability and robustness of the generated image.

[0020] The image generation method, image detection method, apparatus, and electronic device of this disclosure are described below with reference to the accompanying drawings.

[0021] Figure 1 This is a schematic flowchart of an image generation method provided in an embodiment of the present disclosure.

[0022] like Figure 1 As shown, the image generation method may include the following steps: Step S101: Obtain a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic.

[0023] It should be noted that the executing entity of the image generation method in this disclosure embodiment can be a hardware device with image generation capabilities and / or the necessary software to drive the hardware device. Optionally, the executing entity may include a server, a user terminal, and other smart devices. Optionally, the user terminal includes, but is not limited to, mobile phones, computers, smart voice interaction devices, etc. Optionally, the server includes, but is not limited to, a network server, an application server, or a server of a distributed system, or a server combined with blockchain, etc. This disclosure embodiment does not impose specific limitations.

[0024] The mask image can be pre-generated, for example, retrieved from a designated storage location upon receiving an image generation request from the user; alternatively, it can be generated in real-time, responding to the user's image generation request. It should be noted that the image generation request is used to request the generation of the target image, and the size of the mask image is the same as the size of the target image to be generated.

[0025] The space-filling pattern in a masked image is a fractal structure that can continuously and uninterruptedly traverse a specified region without intersection or repetition, and it also possesses self-similarity. It should be noted that the space-filling pattern in a masked image can be called a source identifier or a watermark.

[0026] As an example, space-filling graphics can refer to Peano curves, Z-sequence curves, and other polyline curves.

[0027] Linear spatial filling patterns are almost impossible to exist naturally in the spectrum of natural images. Therefore, compared with embedding circular watermarks, using linear spatial filling patterns as traceability identifiers can reduce the false alarm rate of traceability identifier detection.

[0028] Step S102: Obtain a first noise image, wherein the first noise image is used by the image generation model to perform the process of generating the target image.

[0029] The first noise image can be a preset noise image or a random Gaussian noise image generated by an image generation model.

[0030] The image generation model is used to denoise the first noisy image in order to generate the target image.

[0031] In some embodiments, the image generation model may be a diffusion model.

[0032] The diffusion model generates images through multi-step iterations and layer-by-layer denoising. This progressive denoising characteristic allows the diffusion model to accurately capture the image's detailed textures, edge contours, and global structure, effectively avoiding problems such as image blurring, texture breaks, and severe artifacts. Furthermore, the diffusion model's progressive denoising generation feature enables the simultaneous and progressive injection of source identification during the denoising process, eliminating the need for additional denoising or watermarking post-processing steps after image generation.

[0033] Step S103: Adjust the first noise image according to the mask image to obtain the second noise image.

[0034] The second noisy image refers to a noisy image incorporating the source identification mark into the first noisy image. By adjusting the first noisy image based on the mask image, the source identification mark can be integrated into the second noisy image, achieving a deep integration of the source identification mark and the image content.

[0035] Step S104: Generate a traceable target image based on the image generation model and the second noisy image.

[0036] The image generation model can perform a denoising process based on the second noisy image to generate a target image with embedded traceability identifiers.

[0037] The image generation method provided in this disclosure adjusts a first noisy image using a mask image containing a polygonal space-filling pattern. This allows for the simultaneous, progressive injection and fusion of traceability identifiers during the iterative denoising process of the image generation model to generate the target image. This eliminates the need for additional post-processing operations such as watermark embedding after image generation, reducing computational overhead and latency. Furthermore, it avoids the significant computational cost associated with model retraining. Simultaneously, the polygonal space-filling pattern features uniform spatial coverage, regular structure, and ease of extraction and recognition. Adjusting the first noisy image using this pattern ensures a uniform distribution of traceability identifiers and deep coupling with image features, significantly enhancing the traceability identifiers' resistance to attacks such as cropping, scaling, and compression, thus guaranteeing the traceability and robustness of the generated image.

[0038] Figure 2 This is a schematic flowchart of another image generation method provided in an embodiment of the present disclosure.

[0039] like Figure 2 As shown, the image generation method may include the following steps: Step S201: Obtain mask generation instruction information.

[0040] The mask generation instruction information includes relevant data for mask image generation.

[0041] In some embodiments, the mask generation indication information may include graphic indication information, wherein the graphic indication information is used to indicate at least one of the graphic identifier of the space-filling graphic and the graphic generation method.

[0042] Step S202: If the mask generation instruction information includes graphic fill density instruction information, generate a space-filled graphic based on the graphic fill density instruction information.

[0043] The graphic fill density indication information can be used to indicate the fill density of the space-filling graphic in the mask image.

[0044] As an example, the graphic fill density indication information may include the fractal order of the space-filled graphic. For example, the fractal order may be 3 or 4.

[0045] Based on the graphic fill density indication information, space-filling graphics are generated, which can flexibly control the graphic fill density and coverage intensity in the mask image, thereby adapting to the different requirements of source tracing strength, concealment and image generation effect in different scenarios, and achieving a dynamic balance between source tracing effect and generated image quality.

[0046] Step S203: If the mask generation instruction information includes graphic fill position instruction information, a space fill graphic is generated in the graphic fill area indicated by the graphic fill position instruction information.

[0047] The graphic fill position indication information can be used to indicate the fill position of the space-filling graphic in the mask image.

[0048] Based on the graphic fill position indication information, a space-filling graphic is generated within a specified area, which can accurately limit the embedding position of the traceability information and avoid interference with key areas, sensitive areas or high visual attention areas of the image. While ensuring the traceability function, the visual quality of the target image is guaranteed.

[0049] As an example, graphic fill location indication information may include the location information of the graphic fill area.

[0050] As another example, graphic fill location indication information may include the minimum and maximum distances of the graphic fill area relative to the image center point in the image width and height directions.

[0051] The mid-to-low frequency band of an image carries core features such as the global outline and main structure of the image. These features are almost not lost under attacks such as strong compression, Gaussian blur, cropping, and scaling. In order to improve the attack resistance capability of this application, the watermark can be injected into the mid-to-low frequency region. For example, the minimum distance can be 18 and the maximum distance can be 85.

[0052] It should be noted that when the mask generation instruction information includes both graphic fill density instruction information and graphic fill position instruction information, a space-filled graphic can be generated in the graphic fill area indicated by the graphic fill position instruction information based on the graphic fill density instruction information.

[0053] Step S204: Obtain the mask image based on the space-filling graphic.

[0054] In some embodiments, the space-filling graphic is a centrally symmetric Hilbert curve graphic.

[0055] Hilbert curves are characterized by strong spatial filling continuity, uniform traversal, and high consistency between local and global structures. They enable traceability markers to be evenly distributed in images and have stronger resistance to cropping and local tampering, thereby improving the robustness and anti-attack capabilities of image traceability.

[0056] In some embodiments, the mask value corresponding to any point in the space-filled graphic can be set to a preset value to obtain a mask image.

[0057] In some embodiments, for any point on any line segment in the space-filled graphic, the mask value corresponding to the point is determined based on the distance between the point and the center point of the corresponding line segment; wherein, the mask value is used to indicate the degree of adjustment of the pixel position matching the point in the first noise image; and a mask image is obtained based on the mask value corresponding to any point on the space-filled graphic.

[0058] There is a negative correlation between distance and mask value; that is, the greater the distance, the smaller the mask value corresponding to the corresponding location point, and the smaller the distance, the greater the mask value corresponding to the corresponding location point.

[0059] As an example, the mask value corresponding to any location point can be determined according to the following formula:

[0060] in, Represents the mask value. This represents the maximum value of the mask. This indicates the distance between the location point and the center point of the corresponding line segment. This represents the attenuation control parameter. For example, It can be either the standard deviation of the distance or a preset value.

[0061] To ensure the clarity of the generated image and the sharpness of the embedded lines in the frequency domain, you can set... =0.5, =0.15.

[0062] The mask value is dynamically determined based on the distance between the position point on the space-filled graphic and the center point of the corresponding line segment. This allows the mask value to exhibit a gradual and smooth transition distribution along the line segment, avoiding sudden changes in the mask value that could cause severe disturbances to the noisy image. This makes the noisy image adjustment process smoother and more natural, effectively reducing the interference of the source identification embedding on the image generation process, thereby improving the quality of the generated image.

[0063] It should be noted that when the space-filling graphic is a Hilbert curve graphic, since the Hilbert curve graphic is centrally symmetric, the mask image obtained based on the Hilbert curve graphic is also centrally symmetric, to ensure that the noise components in the adjusted second noise image remain real numbers.

[0064] Step S205: Obtain the first noisy image.

[0065] The explanation of step S205 can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.

[0066] Step S206: Perform frequency domain transformation on the first noise image to obtain the corresponding complex matrix; for any complex number in the complex matrix, adjust at least the real part of the complex number according to the set adjustment coefficient and the mask value that matches the complex number in the mask image to obtain the adjusted complex number; perform inverse frequency domain transformation on the adjusted complex number corresponding to any complex number in the complex matrix to obtain the second noise image.

[0067] Among them, frequency domain transformation can refer to Fourier transform, and inverse frequency domain transformation can refer to inverse Fourier transform.

[0068] The complex matrix includes a complex number corresponding to the noise signal value at any pixel location in the first noisy image. For any complex number in the complex matrix, the pixel location of the mask value that matches the complex number in the mask image matches the pixel location of the complex number in the first noisy image.

[0069] One method involves adjusting the real part of a complex number based on a set adjustment coefficient and a mask value in a mask image that matches the complex number, to obtain an adjusted complex number. Alternatively, both the real and imaginary parts of a complex number can be adjusted simultaneously based on a set adjustment coefficient and a mask value in a mask image that matches the complex number, to obtain an adjusted complex number.

[0070] When adjusting the real part of a complex number, the adjusted real part is obtained. Based on the adjusted real part and the imaginary part of the complex number before adjustment, the adjusted complex number can be obtained. For example, the adjusted real part can be obtained according to the following formula:

[0071] in, Indicates the adjusted real part. M represents the real part of the complex number before adjustment, M represents the mask value in the mask image that matches the complex number, C represents the set adjustment coefficient, and C is a preset constant.

[0072] By adjusting the first noisy image in the frequency domain, the traceability identifier can be implicitly embedded in the image generation process in the frequency domain without significantly changing the spatial visual features of the image. This ensures the stability and detectability of the traceability identifier while avoiding problems such as image distortion and obvious embedding traces caused by direct modification in the spatial domain.

[0073] Step S207: Generate a traceable target image based on the image generation model and the second noisy image.

[0074] The explanation of step S207 can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.

[0075] The image generation method provided in this disclosure generates a space-filled graphic by using graphic fill density indication information or graphic fill position indication information in the mask generation indication information, thereby obtaining a mask image. This method can flexibly and accurately control the distribution density and embedding area of ​​the tracing mask, meeting the image tracing requirements of different intensities and locations while avoiding unnecessary interference to the image generation process. By adjusting the first noisy image in the frequency domain, fine-grained and smooth control of the noise signal can be achieved at the frequency domain level. This ensures that the tracing information presents clear and sharp features in the frequency domain, while maintaining high transparency and naturalness of the noisy image in the spatial domain, reducing the impact of the tracing mask embedding on the quality of the generated image.

[0076] Figure 3 This is a schematic flowchart of an image detection method provided in an embodiment of the present disclosure.

[0077] like Figure 3 As shown, this image detection method may include the following steps: Step S301: Obtain the image to be detected and the mask image; wherein, the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filling pattern; the mask image is also used to adjust the first noise image to obtain the second noise image, the first noise image is used by the image generation model to perform the target image generation process; the second noise image and the image generation model are used to generate a traceable target image.

[0078] It should be noted that the execution entity of the image detection method in this disclosure embodiment can be a hardware device with image detection capabilities and / or the necessary software to drive the hardware device. Optionally, the execution entity may include a server, a user terminal, and other smart devices. Optionally, the user terminal includes, but is not limited to, mobile phones, computers, smart voice interaction devices, etc. Optionally, the server includes, but is not limited to, a network server, an application server, or a server of a distributed system, or a server combined with blockchain, etc. This disclosure embodiment does not impose specific limitations.

[0079] The image to be detected can be any image to be used for source tracing detection. The image to be detected may be generated based on a mask image, or it may be an image obtained by adjusting an image generated based on a mask image, or it may not be an image generated based on a mask image. For example, image adjustments include rotation, cropping, compression, color dithering, etc.

[0080] The process of generating the target image can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.

[0081] Step S302: Using an image generation model, noise reconstruction is performed on the image to be detected to obtain a reconstructed noise image. Based on the reconstructed noise image and the mask image, source tracing detection is performed on the image to be detected.

[0082] The image generation model can be a diffusion model. The image to be detected can be input into the diffusion model, and the diffusion model can run the Ordinary Differential Equation (ODE) equation in reverse along the time step to obtain the reconstructed noisy image.

[0083] Among them, source tracing detection of the image to be detected refers to detecting whether the image to be detected was generated by the image generation model based on the mask image.

[0084] In some embodiments, frequency domain transformations can be performed on the reconstructed noisy image and the mask image respectively to obtain corresponding frequency domain matrices; thereby, source tracing detection of the image to be detected can be performed based on the difference between the frequency domain matrix corresponding to the reconstructed noisy image and the frequency domain matrix corresponding to the mask image.

[0085] In some embodiments, a first image region in the image to be detected is obtained based on a mask image; wherein the first image region is the region covered by the space-filling graphic in the image to be detected; the reconstructed noisy image is subjected to frequency domain transformation processing to obtain a corresponding frequency domain matrix, and an amplitude matrix is ​​obtained based on the frequency domain matrix; a first amplitude corresponding to any pixel position in the first image region is obtained based on the amplitude matrix, and source tracing detection is performed on the image to be detected based on the first amplitude.

[0086] In this context, frequency domain transformation can refer to Fourier transform; the amplitude matrix can also be called the amplitude spectrum. Specifically, the amplitude spectrum can be obtained by performing spectral analysis on the reconstructed noisy image. This involves performing a Fourier transform on the reconstructed noisy image and taking its magnitude (also called amplitude) to obtain the energy distribution of the reconstructed noisy image in the frequency domain, i.e., obtaining the amplitude spectrum.

[0087] The first image region refers to the area in the image to be detected that is covered by the space-filling pattern in the mask image. Image matching between the mask image and the image to be detected can be performed to obtain the first image region. It should be noted that if the image to be detected and the mask image have different dimensions, the image to be detected can be resized first to make its dimensions correspond to those of the mask image; then image matching can be performed to obtain the first image region.

[0088] As an example, a first amplitude calculation can be performed on any pixel location in the first image region to obtain a first calculation result; a set adjustment coefficient can be obtained, wherein the adjustment coefficient is used to adjust the first noisy image in conjunction with the mask image; a first difference between the first calculation result and the adjustment coefficient can be obtained; if the first difference is less than or equal to a first difference threshold, it can be determined that the image to be detected is generated based on the mask image; if the first difference is greater than the first difference threshold, it can be determined that the image to be detected is not generated based on the mask image. Here, the adjustment coefficient refers to C in the aforementioned embodiment.

[0089] By identifying the first image region covered by the space-filling pattern using a mask image, the core distribution area of ​​the traceability marker can be accurately located, avoiding interference from irrelevant image regions on the traceability detection results. Performing a frequency domain transformation on the reconstructed noisy image to obtain a frequency domain matrix and extracting the amplitude matrix, converting the reconstructed noise from the spatial domain to the frequency domain for analysis, highlights the characteristic traces of the space-filling pattern in the mask image in the frequency domain, improving the recognition and extraction accuracy of the traceability marker, thereby enhancing the precision and reliability of traceability detection.

[0090] In some embodiments, a second image region in the image to be detected is obtained; wherein, the second image region is an image region in the image to be detected other than the first image region; based on the amplitude matrix, a second amplitude corresponding to any pixel position in the second image region is obtained; based on the first amplitude and the second amplitude, source tracing detection is performed on the image to be detected.

[0091] The second image region refers to the area in the image to be detected that is not covered by the space-filling pattern in the mask image.

[0092] As an example, a first amplitude is set and processed for any pixel position in the first image region to obtain a first calculation result, and a second amplitude is set and processed for any pixel position in the second image region to obtain a second calculation result; if the second difference between the first calculation result and the second calculation result is greater than or equal to a second difference threshold, it is determined that the image to be detected is generated based on a mask image; if the second difference between the first calculation result and the second calculation result is less than the second difference threshold, it is determined that the image to be detected is not generated based on a mask image.

[0093] Since the mask image only adjusts the noise corresponding to the first image region during the image generation process, the first amplitude of the first image region and the second amplitude of the second image region will show obvious differences. Therefore, the amplitude comparison mechanism of "source identification embedding region - non-source identification embedding region" constructed based on the first amplitude and the second amplitude can accurately capture the amplitude difference brought about by the mask embedding, further improve the anti-interference ability of source detection, and ensure the accuracy and stability of the detection results.

[0094] In some embodiments, a set adjustment coefficient is obtained, wherein the adjustment coefficient is used to adjust the first noisy image in combination with the mask image; a set operation is performed on the first amplitude corresponding to any pixel position in the first image region to obtain a first operation result, and a set operation is performed on the second amplitude corresponding to any pixel position in the second image region to obtain a second operation result; based on the first difference between the first operation result and the adjustment coefficient, and the second difference between the first operation result and the second operation result, source tracing detection is performed on the image to be detected.

[0095] Here, the set operation processing can refer to the mean operation processing; the first difference can refer to the absolute value of the difference between the first operation result and the adjustment coefficient; the second difference can refer to the absolute value of the difference between the first operation result and the second operation result.

[0096] By setting and calculating the first and second amplitudes respectively, the corresponding calculation results are obtained. Then, the first and second differences are combined for comprehensive judgment. This can verify whether the noise adjustment traces of the image to be detected are consistent with the adjustment logic in the generation stage, and can also verify whether there is a significant amplitude difference between the source identification embedded region (first image region) and the non-source identification embedded region (second image region) in the image to be detected. This further improves the interpretability and credibility of source detection.

[0097] In some embodiments, if the first difference is less than or equal to a first difference threshold and the second difference is greater than or equal to a second difference threshold, it is determined that the image to be detected is generated based on a mask image.

[0098] Specifically, if the first difference is greater than the first difference threshold, or the second difference is less than the second difference threshold, it is determined that the image to be detected is not generated based on the mask image.

[0099] The first difference threshold is less than the second difference threshold.

[0100] By setting a first difference threshold and a second difference threshold, the determination process of source tracing detection is quantified and standardized, and the determination condition of "the image to be detected is generated based on the mask image" is clarified, thereby realizing the automated execution of source tracing detection and improving the efficiency of source tracing detection.

[0101] The image detection method provided in this disclosure acquires the image to be detected and a mask image containing a polyline-shaped space-filled pattern. It can fully utilize the source embedding characteristics of the mask image in the image generation stage, providing a unified and reliable detection basis for subsequent source tracing detection. The image generation model is used to reconstruct noise from the image to be detected to obtain a reconstructed noise image. Source tracing detection of the image to be detected is then achieved based on the reconstructed noise image and the mask image. It can complete source tracing determination in the noise domain by combining the mask image, and has the characteristics of high detection accuracy, strong robustness, and resistance to tampering and destruction.

[0102] Figure 4 This is a schematic diagram of the structure of an image generation apparatus provided in an embodiment of the present disclosure.

[0103] like Figure 4 As shown, the image generation apparatus 400 of this embodiment includes a first acquisition module 401, a second acquisition module 402, an adjustment module 403, and a generation module 404.

[0104] The first acquisition module 401 is used to acquire a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic; The second acquisition module 402 is used to acquire a first noise image, wherein the first noise image is used by the image generation model to perform the process of generating the target image; The adjustment module 403 is used to adjust the first noise image according to the mask image to obtain a second noise image; The generation module 404 is used to generate a traceable target image based on the image generation model and the second noise image.

[0105] In one embodiment of this disclosure, the first acquisition module 401 is specifically used for: acquiring mask generation indication information; generating the space-filling graphic according to the graphic fill density indication information when the mask generation indication information includes graphic fill density indication information; and obtaining the mask image based on the space-filling graphic.

[0106] In one embodiment of this disclosure, the first acquisition module 401 is specifically used for: acquiring mask generation indication information; when the mask generation indication information includes graphic fill position indication information, generating the space fill graphic in the graphic fill area indicated by the graphic fill position indication information; and obtaining the mask image based on the space fill graphic.

[0107] In one embodiment of this disclosure, the first acquisition module 401 is specifically used to: for any position point on any line segment in the space-filling graphic, determine the mask value corresponding to the position point based on the distance between the position point and the center point of the corresponding line segment; wherein, the mask value is used to indicate the degree of adjustment of the pixel position in the first noise image that matches the position point; and obtain the mask image based on the mask value corresponding to any position point on the space-filling graphic.

[0108] In one embodiment of this disclosure, the space-filling graphic is a centrally symmetrical Hilbert curve graphic.

[0109] In one embodiment of this disclosure, the adjustment module 403 is specifically configured to: perform frequency domain transformation processing on the first noise image to obtain a corresponding complex matrix; for any complex number in the complex matrix, adjust at least the real part of the complex number according to a set adjustment coefficient and a mask value in the mask image that matches the complex number to obtain an adjusted complex number; and perform inverse frequency domain transformation processing based on the adjusted complex number corresponding to any complex number in the complex matrix to obtain the second noise image.

[0110] In one embodiment of this disclosure, the image generation model is a diffusion model.

[0111] The image generation apparatus provided in this disclosure adjusts a first noisy image using a mask image containing a polygonal space-filling pattern. This allows for the simultaneous progressive injection and fusion of traceability identifiers during the iterative denoising process of the image generation model to generate the target image. This eliminates the need for additional post-processing operations such as watermark embedding after image generation, reducing computational overhead and latency. Furthermore, it avoids the significant computational cost associated with model retraining. Simultaneously, the polygonal space-filling pattern features uniform spatial coverage, regular structure, and ease of extraction and recognition. Adjusting the first noisy image using this pattern ensures a uniform distribution of traceability identifiers and deep coupling with image features, significantly enhancing the traceability identifiers' resistance to attacks such as cropping, scaling, and compression, thus guaranteeing the traceability and robustness of the generated image.

[0112] Figure 5 This is a schematic diagram of the structure of an image detection device provided in an embodiment of this disclosure.

[0113] like Figure 5 As shown, the image detection device 500 of this embodiment includes an acquisition module 501 and a detection module 502.

[0114] The acquisition module 501 is used to acquire the image to be detected and the mask image; wherein, the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic; the mask image is also used to adjust the first noise image to obtain a second noise image, the first noise image is used by the image generation model to perform the target image generation process; the second noise image and the image generation model are used to generate a traceable target image; The detection module 502 is used to reconstruct noise from the image to be detected using the image generation model to obtain a reconstructed noise image, and to perform source tracing detection on the image to be detected based on the reconstructed noise image and the mask image.

[0115] In one embodiment of this disclosure, the detection module 502 is specifically configured to: obtain a first image region in the image to be detected based on the mask image; wherein the first image region is the region covered by the space-filling graphic in the image to be detected; perform frequency domain transformation processing on the reconstructed noise image to obtain a corresponding frequency domain matrix, and obtain an amplitude matrix based on the frequency domain matrix; obtain a first amplitude corresponding to any pixel position in the first image region based on the amplitude matrix, and perform source tracing detection on the image to be detected based on the first amplitude.

[0116] In one embodiment of this disclosure, the detection module 502 is specifically configured to: acquire a second image region in the image to be detected; wherein the second image region is an image region in the image to be detected other than the first image region; acquire a second amplitude corresponding to any pixel position in the second image region based on the amplitude matrix; and perform source tracing detection on the image to be detected based on the first amplitude and the second amplitude.

[0117] In one embodiment of this disclosure, the detection module 502 is specifically configured to: obtain a set adjustment coefficient, wherein the adjustment coefficient is used to adjust the first noise image in conjunction with the mask image; perform a set operation on a first amplitude corresponding to any pixel position in the first image region to obtain a first operation result, and perform a set operation on a second amplitude corresponding to any pixel position in the second image region to obtain a second operation result; and perform source tracing detection on the image to be detected based on a first difference between the first operation result and the adjustment coefficient, and a second difference between the first operation result and the second operation result.

[0118] In one embodiment of this disclosure, the detection module 502 is specifically configured to: determine that the image to be detected is generated based on the mask image when the first difference is less than or equal to a first difference threshold and the second difference is greater than or equal to a second difference threshold.

[0119] The image detection apparatus provided in this disclosure acquires the image to be detected and a mask image containing a polyline-shaped space-filled pattern. It can fully utilize the source embedding characteristics of the mask image in the image generation stage, providing a unified and reliable detection basis for subsequent source tracing detection. The image generation model is used to reconstruct noise from the image to be detected to obtain a reconstructed noise image. Source tracing detection of the image to be detected is then achieved based on the reconstructed noise image and the mask image. It can complete source tracing determination in the noise domain by combining the mask image, and has the characteristics of high detection accuracy, strong robustness, and resistance to tampering and destruction.

[0120] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0121] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0122] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0123] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on computer programs / instructions stored in read-only memory (ROM) 602 or loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0124] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606 such as keyboard, mouse, etc.; output unit 607 such as various types of monitors, speakers, etc.; storage unit 608 such as disk, optical disk, etc.; and communication unit 609 such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0125] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as image generation methods or image detection methods. For example, in some embodiments, the image generation method or image detection method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program / instructions may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program / instructions are loaded into RAM 603 and executed by the computing unit 601, one or more steps of the image generation method or image detection method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform an image generation method or an image detection method by any other suitable means (e.g., by means of firmware).

[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs / instructions that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0127] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0128] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0129] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0130] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.

[0131] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. The client-server relationship is created by computer programs / instructions running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0132] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in the disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this document does not impose any restrictions.

[0133] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An image generation method, the method comprising: Obtain a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic; A first noisy image is obtained, wherein the first noisy image is used by the image generation model to perform the process of generating the target image; Based on the mask image, the first noise image is adjusted to obtain the second noise image; Based on the image generation model and the second noisy image, a traceable target image is generated.

2. The method according to claim 1, wherein, The process of obtaining the mask image includes: Obtain mask generation instruction information; If the mask generation instruction information includes graphic fill density instruction information, the space fill graphic is generated according to the graphic fill density instruction information; The mask image is obtained based on the space-filling pattern.

3. The method according to claim 1, wherein, The process of obtaining the mask image includes: Obtain mask generation instruction information; When the mask generation instruction information includes graphic fill position instruction information, the space fill graphic is generated in the graphic fill area indicated by the graphic fill position instruction information; The mask image is obtained based on the space-filling pattern.

4. The method according to claim 2 or 3, wherein, The process of obtaining the mask image based on the space-filling pattern includes: For any point on any line segment in the space-filling graphic, a mask value corresponding to the point is determined based on the distance between the point and the center point of the corresponding line segment; wherein, the mask value is used to indicate the degree of adjustment of the pixel position in the first noise image that matches the point. The mask image is obtained based on the mask value corresponding to any point on the space-filled graphic.

5. The method according to any one of claims 1-3, wherein, The space-filling graphic is a centrally symmetrical Hilbert curve.

6. The method according to claim 1, wherein, The step of adjusting the first noise image based on the mask image to obtain the second noise image includes: The first noise image is subjected to frequency domain transformation to obtain the corresponding complex matrix; For any complex number in the complex matrix, at least the real part of the complex number is adjusted according to the set adjustment coefficient and the mask value in the mask image that matches the complex number, to obtain the adjusted complex number; Based on the adjusted complex number corresponding to any complex number in the complex matrix, inverse frequency domain transformation is performed to obtain the second noise image.

7. The method according to claim 1, wherein, The image generation model is a diffusion model.

8. An image detection method, the method comprising: The process involves acquiring an image to be detected and a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled pattern; the mask image is also used to adjust a first noise image to obtain a second noise image, the first noise image being used by an image generation model to perform the target image generation process; the second noise image and the image generation model are used to generate a traceable target image; The image generation model is used to reconstruct noise from the image to be detected, resulting in a reconstructed noise image. Based on the reconstructed noise image and the mask image, source tracing detection is performed on the image to be detected.

9. The method according to claim 8, wherein, The step of performing source tracing detection on the image to be detected based on the reconstructed noisy image and the mask image includes: Based on the mask image, a first image region in the image to be detected is obtained; wherein, the first image region is the area covered by the space-filling graphic in the image to be detected; The reconstructed noisy image is subjected to frequency domain transformation to obtain the corresponding frequency domain matrix, and the amplitude matrix is ​​obtained based on the frequency domain matrix; Based on the amplitude matrix, a first amplitude corresponding to any pixel position in the first image region is obtained, and based on the first amplitude, source tracing detection is performed on the image to be detected.

10. The method according to claim 9, wherein, The step of performing source tracing detection on the image to be detected based on the first amplitude includes: Obtain a second image region in the image to be detected; wherein, the second image region is an image region in the image to be detected other than the first image region; Based on the amplitude matrix, obtain the second amplitude corresponding to any pixel position in the second image region; Based on the first amplitude and the second amplitude, source tracing detection is performed on the image to be detected.

11. The method according to claim 10, wherein, The step of performing source tracing detection on the image to be detected based on the first amplitude and the second amplitude includes: Obtain a set adjustment coefficient, wherein the adjustment coefficient is used to adjust the first noise image in conjunction with the mask image; A first amplitude corresponding to any pixel position in the first image region is set and processed to obtain a first calculation result; and a second amplitude corresponding to any pixel position in the second image region is set and processed to obtain a second calculation result. Based on the first difference between the first calculation result and the adjustment coefficient, and the second difference between the first calculation result and the second calculation result, source tracing detection is performed on the image to be detected.

12. The method according to claim 11, wherein, The step of performing source tracing detection on the image to be detected based on the first difference between the first calculation result and the adjustment coefficient, and the second difference between the first calculation result and the second calculation result, includes: If the first difference is less than or equal to the first difference threshold and the second difference is greater than or equal to the second difference threshold, it is determined that the image to be detected was generated based on the mask image.

13. An image generation apparatus, the apparatus comprising: The first acquisition module is used to acquire a mask image; wherein the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled graphic; The second acquisition module is used to acquire a first noise image, wherein the first noise image is used by the image generation model to perform the process of generating the target image; An adjustment module is used to adjust the first noise image according to the mask image to obtain a second noise image; The generation module is used to generate a traceable target image based on the image generation model and the second noisy image.

14. An image detection apparatus, the apparatus comprising: An acquisition module is used to acquire an image to be detected and a mask image; wherein, the mask image is used for image tracing, and the mask image includes a polyline-shaped space-filled pattern; the mask image is also used to adjust a first noise image to obtain a second noise image, the first noise image is used by an image generation model to perform the target image generation process; the second noise image and the image generation model are used to generate a traceable target image; The detection module is used to reconstruct noise from the image to be detected using the image generation model to obtain a reconstructed noise image, and to perform source tracing detection on the image to be detected based on the reconstructed noise image and the mask image.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-7 or 8-12.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method as described in any one of claims 1-7 or 8-12.

17. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1-7 or 8-12.