Generated picture blind box detection method and system based on diffusion model
By constructing an integral pipeline for ordinary differential equations and extracting features using a dual ResNet-50 model, the problem of difficulty in identifying images generated by diffusion models is solved, achieving accurate blind box detection, and is applicable to various generation algorithms and models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-04
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies struggle to effectively identify images generated by diffusion models, leading to increased security risks.
By constructing an integral pipeline of ordinary differential equations, a probability flow trajectory is generated and converted into a discriminative curvature field. Features are extracted by combining a dual ResNet-50 model, and a multilayer perceptron is used to determine whether the image is generated by a diffusion model.
It achieves accurate identification of images generated by diffusion models, is applicable to various algorithms and models, improves detection accuracy and robustness, reduces manual intervention, and enhances the scalability and maintainability of the method.
Smart Images

Figure CN121767765A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security detection technology, specifically a method and system for generating image blind boxes based on a diffusion model. Background Technology
[0002] With the development of generative artificial intelligence technologies such as Generative Adversarial Networks (GANs), diffusion models, and flow matching, AI-generated images have been widely used in smart cities, smart healthcare, and smart retail. By modeling the distribution of the original data, AI generative models can automatically generate image content with similar features to the original samples. For example, in smart city scenarios, they can generate schematic diagrams of future urban planning, more clearly showing urban changes.
[0003] However, with the continuous improvement in the performance of AI image generation models and their open-source dissemination, the realism of the generated images has approached that of real images, making it difficult for the human eye to accurately distinguish between genuine and fake images. At the same time, uncontrolled model misuse could be used to generate malicious deepfake content, causing security risks such as misleading public opinion and identity fraud. Although existing methods can effectively identify images generated by Generative Adversarial Networks (GANs), they are insufficient to effectively deal with images generated by diffusion models.
[0004] Based on this, a method and system for generating image blind boxes based on a diffusion model is provided, which can eliminate the drawbacks of existing technical solutions. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for detecting blind boxes generated images based on a diffusion model, so as to solve the problem that existing methods in the background art are difficult to effectively identify images generated by diffusion models.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for generating blind boxes using a diffusion model, comprising the following steps:
[0008] Step S1: Using the pre-trained diffusion model as the baseline model, construct an ordinary differential equation integral pipeline to generate a denoising velocity field for the image to be detected from the time t=0 of the data distribution to the time t=1 of the Gaussian noise distribution, which constitutes a probability flow trajectory.
[0009] Step S2: Convert the denoised velocity field at T time points into T-1 curvature fields using the approximate curvature calculation formula, and then compress it using a pseudo-Gaussian compression strategy to obtain a discriminative curvature field.
[0010] Step S3: Using first-order discrete wavelet transform, based on bior1.3 basis functions and symmetric boundary extension, the image to be detected is converted into the frequency domain and diagonal high-frequency wavelet components are obtained;
[0011] Step S4: Use the dual ResNet-50 model to extract the second-order features of the discriminative curvature field and the zero-order features of the diagonal high-frequency wavelet components respectively. The last projection layer of the dual ResNet-50 model shares weights, projects the corresponding features to the shared subspace, and forms complementary discriminative information.
[0012] Step S5: Concatenate the second-order features with the zero-order features to form a joint representation, input it into the multilayer perceptron, and determine whether the image to be detected is generated by the diffusion model based on the output of the multilayer perceptron.
[0013] The image to be detected is generated by a variety of different generation models, including image modal information but not text modal information.
[0014] Further, step S1 specifically includes:
[0015] The parameters of the diffusion model are frozen, and an ordinary differential equation integral pipeline is constructed from time t=0 to t=1. The ordinary differential equation integral pipeline uses the one-to-one mapping relationship between the data distribution and the Gaussian noise distribution constructed by the pre-trained diffusion model to deterministically add noise to the image to be detected.
[0016] Starting at time t=0 and ending at time t=1, the time interval from 0 to 1 is divided into T uniform intervals. The images to be detected are input into the ordinary differential equation integration pipeline one by one. The integration starts from the first interval and continues to the last interval. The denoising velocity field corresponding to T times for each image is obtained one by one, thus forming a probability flow trajectory that transforms the data distribution into a Gaussian noise distribution.
[0017] Further, step S2 specifically includes:
[0018] The approximate curvature calculation formula is to perform second-order Taylor truncation on the midpoint image of the probability flow trajectory, and then perform approximate difference calculation on the obtained second-order terms to obtain T-1 curvature fields.
[0019] The pseudo-Gaussian compression strategy selects the maximum and minimum values on the time scale for each pixel's T-1 curvature fields, and multiplies the maximum and minimum values for each pixel to obtain a discriminative curvature field.
[0020] Furthermore, step S3 specifically includes:
[0021] The images to be detected are subjected to a first-order discrete wavelet transform based on the bior1.3 basis function to obtain a frequency domain image. The frequency domain image includes an approximate low-frequency component, a horizontal detail sub-band, a vertical detail sub-band, and a diagonal detail sub-band. The parts other than the diagonal detail sub-band are discarded, and upsampling is performed by bilinear interpolation to align with the original spatial resolution to obtain the diagonal high-frequency wavelet component of the original resolution.
[0022] Furthermore, the dual ResNet-50 model in step S4 includes a first ResNet-50 model and a second ResNet-50 model. The discriminative curvature field is input into the neural network of the first ResNet-50 model to extract the features of the probabilistic flow curvature, and the diagonal high-frequency wavelet components are input into the neural network of the second ResNet-50 model to extract the frequency domain features of the image to be detected. Both dual ResNet-50 models adopt the ResNet-50 network structure, and the final projection layer of the dual ResNet-50 models shares the same weight parameters.
[0023] Further, step S4 specifically includes:
[0024] When the discriminative curvature field is input into the first ResNet-50 model neural network to extract the features of the probability flow curvature, the last projection layer of the first ResNet-50 model neural network and the last projection layer of the second ResNet-50 model neural network share weights, projecting the second-order features and the zero-order features into the shared subspace, so that the second-order features and the zero-order features form complementary discriminative information.
[0025] When the diagonal high-frequency wavelet components are input into the second ResNet-50 model neural network to extract the frequency domain features of the image to be detected, the last projection layer of the second ResNet-50 model neural network shares weights with the last projection layer of the first ResNet-50 model neural network, projecting the 0th-order features and 2nd-order features into the shared subspace, so that the 0th-order features and 2nd-order features form complementary discriminative information.
[0026] Furthermore, in step S5, the second-order features and the zero-order features are concatenated to form a joint representation, specifically including:
[0027] The probability flow curvature feature output by the first ResNet-50 model and the frequency domain feature output by the second ResNet-50 model are concatenated along one dimension of the feature vector with a length of 1 to form a joint representation. The length of this dimension remains unchanged after concatenation, while the length of the other concatenated dimension is twice the total length of this dimension before concatenation.
[0028] Furthermore, step S5 also includes: processing the probabilistic flow curvature features and frequency domain features based on a dual-pipeline training strategy to train a multilayer perceptron, wherein the dual-pipeline includes a first pipeline and a second pipeline, the first pipeline corresponds to a first ResNet-50 model, and the second pipeline corresponds to a second ResNet-50 model.
[0029] Furthermore, the dual-pipeline training specifically includes:
[0030] The first ResNet-50 model was trained using second-order features, the second ResNet-50 model was trained using 0th-order features, and the multilayer perceptron was trained using joint representations.
[0031] The output of the multilayer perceptron and the true labels of the samples are used to calculate the loss function and train the multilayer perceptron, the first ResNet-50 model and the second ResNet-50 model.
[0032] The learning rates of the multilayer perceptron, the first ResNet-50 model, and the second ResNet-50 model are decoupled, and the learning rates are dynamically planned based on the output of the loss function.
[0033] The output of the multilayer perceptron after training is used as the basis for the final determination of whether the image to be detected was generated by the diffusion model.
[0034] A generated image blind box detection system based on a diffusion model, applied to a generated image blind box detection method based on a diffusion model, includes:
[0035] The conversion module uses a pre-trained diffusion model to generate a denoised velocity field of probability flow trajectory for the image to be detected, and uses a first-order discrete wavelet transform based on the bior1.3 basis function to convert the image to be detected into a diagonal high-frequency signal in the frequency domain.
[0036] The compression module is used to calculate multiple curvature fields from multiple denoised velocity fields corresponding to the image to be detected using an approximate curvature calculation formula, and to compress the curvature signals of the multiple curvature fields into a single discriminative curvature field over a time scale.
[0037] The extraction module is used to extract feature vectors of diagonal high-frequency signals in the curvature field and frequency domain to generate a joint characterization that can be detected.
[0038] The detection module is used to determine whether the image to be detected was generated by a diffusion model based on joint characterization.
[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0040] 1. This invention uses a pre-trained diffusion model as the benchmark model for generating probability flow trajectories, and uses the curvature features of the probability flow trajectory as the main discrimination signal, supplemented by high-frequency diagonal wavelet signals, to jointly form a joint representation for detecting abnormal information. This enables blind box detection of images produced by various algorithms and models without prior identification of the image source or diffusion generation model type, and is suitable for various complex application scenarios.
[0041] 2. This invention introduces a dual-pipeline training strategy. The first pipeline extracts second-order curvature features, and the second pipeline extracts zero-order diagonal high-frequency wavelet features. The extracted feature information is iteratively optimized in the dual pipelines by combining the loss function, thereby amplifying the abnormal information in the curvature and frequency domains and effectively improving the final classification accuracy. In the first pipeline, the velocity field is converted into a curvature field based on the approximate curvature calculation formula, and the time dimension of the curvature field is compressed by the pseudo-Gaussian curvature compression strategy to generate a unique discriminative curvature field for detection, ensuring the effectiveness and robustness of the model for extracting second-order curvature features. The zero-order diagonal high-frequency wavelet features extracted by the first pipeline are used to supplement the judgment of second-order curvature features. Relying on the weaker sensitivity of zero-order features to input changes, the model's discrimination ability and overall stability on fuzzy samples are ensured.
[0042] 3. This invention generates probability flow trajectories based on a pre-trained large model and extracts features using the standard ResNet-50 model. It eliminates the need for manually designing feature templates or rules, reducing human intervention and thus improving the scalability and maintainability of the method. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the method steps of the present invention; Figure 2 This is a schematic diagram of the method flow of the present invention; Figure 3 This is a schematic diagram of the system structure of the present invention; Figure labeling: Conversion module 10, Compression module 20, Extraction module 30, Detection module 40. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0045] In images generated by diffusion models, due to the limitations of the diffusion model framework, their probability flow trajectories tend to have smoother and more consistent velocity fields, resulting in gentler curvature. In contrast, the probability flow trajectories of real images have velocity fields with greater variance, leading to larger extreme values in their curvature – a common invariant feature across different diffusion generation models. However, since curvature is a second-order feature, it is exceptionally sensitive to slight image perturbations. Therefore, frequency domain features can be used as a supplement to zero-order features to stabilize detection robustness. This invention trains a classifier based on a joint representation of probability flow curvature features and diagonal high-frequency wavelet components, enabling the multilayer perceptron to detect accurate and reliable results. The specific steps are as follows.
[0046] Example 1, in this example, as Figure 1 and Figure 2 As shown, a method for generating image blind box detection based on a diffusion model is presented. Blind box detection refers to a general detection method that does not require prior knowledge of the image source model. The method specifically includes the following steps:
[0047] Step S1: Using a pre-trained diffusion model (such as the ADM model) as the baseline model, construct an ordinary differential equation integral pipeline to generate a denoising velocity field for the image to be detected, from the data distribution at time t=0 to the Gaussian noise distribution at time t=1, for a total of T time points. This forms a probability flow trajectory, which refers to the continuous evolution path of the image from the data distribution to the noise distribution in the model. It consists of a series of denoising velocity fields and describes the dynamic evolution of the image on the Wasserstein manifold.
[0048] Step S2: The denoised velocity field at T time points is converted into T-1 curvature fields using the approximate curvature calculation formula, and then compressed using the pseudo-Gaussian compression strategy to obtain a discriminative curvature field. The curvature field is the curvature distribution map of the probability flow trajectory on the Wasserstein manifold, reflecting the degree of curvature of the probability flow trajectory.
[0049] Step S3: Use the first-order discrete wavelet transform (DWT, used to transform an image from the spatial domain to the frequency domain, to achieve multi-scale decomposition and separate components of different frequencies), based on the bior1.3 (a type of biorthogonal wavelet basis function) basis function and using symmetric boundary extension to convert the image to be detected into the frequency domain and obtain the diagonal high-frequency wavelet components.
[0050] Step S4: Use dual ResNet-50 models to extract the second-order features of the discriminative curvature field and the zero-order features of the diagonal high-frequency wavelet components respectively. The last projection layer of the dual ResNet-50 models shares weights, projects the corresponding features to the shared subspace, and forms complementary discriminative information. The discriminative curvature field is input into the first ResNet-50 model (referred to as ResNet-50(1)) neural network to extract the features of the probability flow curvature, which is the second-order feature. The diagonal high-frequency wavelet components are input into the second ResNet-50 model (referred to as ResNet-50(2)) neural network to extract the frequency domain features of the image to be detected, which is the zero-order feature.
[0051] Step S5: Concatenate the second-order features with the zero-order features to form a joint representation, input it into a multilayer perceptron (MLP), and determine whether the image to be detected is generated by the diffusion model based on the output of the multilayer perceptron.
[0052] The image to be detected is generated by a variety of different diffusion generation models, including image modal information but not text modal information. The detection method in this invention does not depend on whether the image to be detected is generated by a specific diffusion generation model, and has universal applicability. It belongs to a general blind box detection method. The diffusion model can use the ADM model as the benchmark model for generating probability flow trajectories. The model selection and the number of diffusion steps can be flexibly configured according to actual needs. This embodiment does not impose any restrictions on this.
[0053] In this embodiment, the generated image blind box detection method uses a pre-trained diffusion model to generate a denoised velocity field for each image to be detected. At the same time, it uses a first-order discrete wavelet transform to generate a frequency domain image, and extracts the discriminative curvature field through an approximate curvature calculation formula and a pseudo-Gaussian compression strategy. It extracts curvature and diagonal high-frequency wavelet features through a ResNet-50 model with two shared projection layers, and splices them into a joint representation. Finally, a multilayer perceptron (MLP) is used to determine the authenticity of the image, which can reliably distinguish between real images and images generated by the diffusion model.
[0054] Specifically, step S1 includes:
[0055] Freeze the parameters of the diffusion model (such as the ADM model), construct the ordinary differential equation integration pipeline from t=0 to t=1, and use the one-to-one mapping relationship between the data distribution and Gaussian noise distribution constructed by the pre-trained diffusion model to deterministically add noise to the image to be detected.
[0056] Starting at time t=0 and ending at time t=1, the time interval from 0 to 1 is divided into T uniform intervals. The images to be detected are input into the ordinary differential equation integration pipeline one by one. The integration starts from the first interval and continues to the last interval to obtain the denoising velocity field corresponding to each image at T time intervals. This constitutes the probability flow trajectory of the data distribution being transformed into a Gaussian noise distribution. The denoising velocity fields at T time intervals together describe the probability flow trajectory of the images to be detected on the Wasserstein manifold from the data distribution to the Gaussian noise distribution. Each denoising velocity field is a tensor vector field corresponding to the RGB three channels of the image to be detected. Each element represents the direction of movement of the corresponding pixel towards the Gaussian noise distribution on the Wasserstein manifold.
[0057] The solution for the denoised velocity field is based on a reparameterized ordinary differential equation, expressed as:
[0058] , , for The reparameterized form of time and satisfying , For noise prediction networks, for Image features at any given time.
[0059] Specifically, step S2 includes:
[0060] The approximate curvature calculation formula is to perform a second-order Taylor truncation on the midpoint image of the probability flow trajectory, and then perform an approximate difference calculation on the resulting second-order terms to obtain T-1 curvature fields.
[0061] The pseudo-Gaussian compression strategy selects the maximum and minimum values on the time scale for the T-1 curvature fields per pixel, and multiplies the maximum and minimum values per pixel to obtain a discriminative curvature field.
[0062] Among them, T-1 curvature fields are obtained by using the approximate curvature calculation formula for the T denoised velocity fields. The approximate curvature calculation formula is as follows:
[0063] , for The curvature field of time, This represents the difference between adjacent time steps. Noise figure The difference between the outputs of the noise prediction network at adjacent time steps. This represents the difference in noise figure between adjacent time steps;
[0064] The curvature signals of T-1 curvature fields are compressed into a single discriminative curvature field over time using a pseudo-Gaussian compression strategy. The expression for the pseudo-Gaussian compression strategy is as follows:
[0065] , To identify curvature fields, the curvature field identification method will be used. Input a ResNet-50(1) neural network to extract features of probabilistic flow curvature.
[0066] Specifically, step S3 includes:
[0067] The images to be detected are subjected to a first-order discrete wavelet transform based on the bior1.3 basis function to obtain a frequency domain image. The frequency domain image includes an approximate low-frequency component, a horizontal (LH) detail subband, a vertical (HL) detail subband, and a diagonal (HH) detail subband. The parts other than the diagonal (HH) detail subband are discarded. The images are then upsampled by bilinear interpolation to align with the original spatial resolution and obtain the diagonal high-frequency wavelet component of the original resolution.
[0068] Specifically, the dual ResNet-50 model in step S4 includes a first ResNet-50 model and a second ResNet-50 model. The discriminative curvature field is input into the neural network of the first ResNet-50 model to extract the features of the probabilistic flow curvature. The diagonal high-frequency wavelet components are input into the neural network of the second ResNet-50 model to extract the frequency domain features of the image to be detected. Both dual ResNet-50 models adopt the ResNet-50 network structure, and the last projection layer of the dual ResNet-50 models shares the same weight parameters. Both ResNet-50 (1) and ResNet-50 (2) adopt the standard ResNet-50 network structure. This network is a publicly available general model and is existing technology. Except for the last projection layer, its network hierarchy and parameter configuration are consistent with the ResNet-50 in the publicly available literature, and its structure has not been modified.
[0069] Specifically, step S4 includes:
[0070] When the discriminative curvature field is input into the first ResNet-50 model neural network to extract the probabilistic flow curvature features, the last projection layer of the first ResNet-50 model neural network shares weights with the last projection layer of the second ResNet-50 model neural network, projecting the second-order features and the zero-order features into the shared subspace, so that the second-order features and the zero-order features form complementary discriminative information.
[0071] When the diagonal high-frequency wavelet components are input into the second ResNet-50 model neural network to extract the frequency domain features of the image to be detected, the last projection layer of the second ResNet-50 model neural network shares weights with the last projection layer of the first ResNet-50 model neural network, projecting the 0th-order features and 2nd-order features into the shared subspace, so that the 0th-order features and 2nd-order features form complementary discriminative information.
[0072] Curvature features (2nd order) are sensitive to structural changes in images and can effectively capture smoothness anomalies in probability flow trajectories of images generated by diffusion models. Frequency domain features (0th order) are sensitive to texture details in images and can supplement the discriminative information of curvature features in local noise patterns. By sharing a projection layer, the two types of features are mapped to the same subspace, enabling them to calibrate and complement each other during training, forming a reinforced joint discriminative signal, which effectively improves the robustness and generalization ability of blind box detection.
[0073] Specifically, in step S5, the second-order features and the zero-order features are concatenated to form a joint representation, which includes:
[0074] The probability flow curvature features output by the first ResNet-50 model and the frequency domain features output by the second ResNet-50 model are concatenated along one dimension of the feature vector with a length of 1 to form a joint representation. The length of this dimension remains unchanged after concatenation, while the length of the other concatenated dimension is twice the total length of this dimension before concatenation.
[0075] Specifically, step S5 further includes: processing the probability flow curvature features and frequency domain features based on a dual-pipeline training strategy to train a multilayer perceptron. The dual-pipeline includes a first pipeline and a second pipeline. The first pipeline corresponds to the first ResNet-50 model and is used to extract the curvature features of the probability flow trajectory of the image to be detected on the Wasserstein manifold. Based on the curvature comparison of the probability flow trajectory on the Wasserstein manifold, the difference between the probability flow trajectory of the real and generated images can be intuitively reflected, providing a quantifiable explanation for the detection results. The second pipeline corresponds to the second ResNet-50 model and is used to extract the frequency domain features of the image to be detected in the frequency domain. The first and second pipelines extract features independently to avoid mutual interference between the two types of features during early fusion. The dual-pipeline training specifically includes:
[0076] The first ResNet-50 model was trained using second-order features, the second ResNet-50 model was trained using 0th-order features, and the multilayer perceptron was trained using joint representations.
[0077] The output of the multilayer perceptron and the true labels of the samples are used to calculate the loss function and train the multilayer perceptron, the first ResNet-50 model and the second ResNet-50 model.
[0078] The learning rates of the multilayer perceptron, the first ResNet-50 model, and the second ResNet-50 model are decoupled. The learning rate is dynamically planned according to the output of the loss function. The model parameters are obtained from the pre-training and optimized according to the parameters. Then, the above steps are executed. The judgment result output by the optimized multilayer perceptron determines whether the image to be detected is generated by the diffusion model.
[0079] The output of the trained multilayer perceptron is used as the basis for the final determination of whether the image to be detected was generated by the diffusion model.
[0080] In this embodiment, the present invention sets up a blind box detection method for generated images based on a diffusion model. It combines probabilistic flow curvature features and diagonal high-frequency wavelet components to determine whether an image is generated by a diffusion model. This method does not require prior knowledge of the diffusion model from which the image originates, has strong versatility and detection accuracy, and is suitable for diffusion model-generated image recognition in complex scenarios.
[0081] Example 2 differs from Example 1 in that, as follows: Figure 3 As shown, the present invention also provides a generated image blind box detection system based on a diffusion model, which can be implemented by software on a device with computing capabilities. The system functions are loaded into memory by the processor in the computing device by calling computer program instructions stored in non-volatile memory, thereby forming corresponding logical modules. It is applied to the generated image blind box detection method based on a diffusion model shown in Example 1. The technical implementation principle and method are consistent, and will not be repeated here. Each module can be a physical structural unit or a logical functional module running on a computing platform. Its deployment form can be selected as centralized deployment or distributed deployment according to specific application requirements. The modules can interact with each other through function calls, message passing or shared memory.
[0082] The image-generated blind box detection system specifically includes:
[0083] The conversion module 10 uses a pre-trained diffusion model to generate a denoised velocity field of the probability flow trajectory for the image to be detected, and uses a first-order discrete wavelet transform based on the bior1.3 basis function to convert the image to be detected into a diagonal high-frequency signal in the frequency domain.
[0084] Compression module 20 is used to calculate multiple curvature fields from multiple denoised velocity fields corresponding to the image to be detected through an approximate curvature calculation formula, and to compress the curvature signals of multiple curvature fields into a discriminative curvature field on a time scale.
[0085] Extraction module 30 is used to extract feature vectors of the diagonal high-frequency signals in the curvature field and frequency domain to generate a joint characterization that can be detected;
[0086] Detection module 40 is used to determine whether the image to be detected was generated by a diffusion model based on joint characterization;
[0087] The following are optional implementation methods for this image-generated blind box detection system:
[0088] Optionally, the conversion module 10 includes:
[0089] For pre-trained ADM models based on frozen parameters, an ordinary differential equation integral pipeline that can be applied to the data distribution is constructed to generate a corresponding denoised velocity field for each image to be detected, forming a probabilistic flow trajectory.
[0090] The first-order discrete wavelet transform based on the bior1.3 basis function is used to convert the image to be detected into a diagonal high-frequency signal in the frequency domain;
[0091] Optionally, the compression module 20 includes:
[0092] It is used to calculate the denoised velocity field based on the approximate curvature calculation formula, and obtain the curvature field;
[0093] This is used to compress curvature fields over time based on a pseudo-Gaussian compression strategy to obtain a uniquely discriminative curvature field.
[0094] Optionally, the extraction module 30 specifically includes:
[0095] Used to extract curvature features of discriminative curvature fields based on ResNet-50(1) neural network;
[0096] Used to extract frequency domain features of diagonal high-frequency signals based on ResNet-50(2) neural network;
[0097] Used to concatenate the extracted curvature features and frequency domain features into a joint representation;
[0098] Optionally, the detection module 40 specifically includes:
[0099] The joint representation is input into a multilayer perceptron to obtain a preliminary detection output;
[0100] The initial detection output is mapped to probability values through the corresponding activation function.
[0101] A threshold is set to determine whether an image is generated by a diffusion model. The threshold can be adjusted according to actual needs.
[0102] Specifically, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store executable instructions, and the processor is used to read the executable instructions stored in the memory and execute the image blind box detection method in Embodiment 1 or the image blind box detection system in Embodiment 2. The present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by the processor, implements the image blind box detection method in Embodiment 1 or the image blind box detection system in Embodiment 2.
[0103] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating blind boxes using a diffusion model, characterized in that, Specifically, the following steps are included: Step S1: Using the pre-trained diffusion model as the baseline model, construct an ordinary differential equation integral pipeline to generate a denoising velocity field for the image to be detected from the time t=0 of the data distribution to the time t=1 of the Gaussian noise distribution, which constitutes a probability flow trajectory. Step S2: Convert the denoised velocity field at T time points into T-1 curvature fields using the approximate curvature calculation formula, and then compress it using a pseudo-Gaussian compression strategy to obtain a discriminative curvature field. Step S3: Using first-order discrete wavelet transform, based on bior1.3 basis functions and symmetric boundary extension, the image to be detected is converted into the frequency domain and diagonal high-frequency wavelet components are obtained; Step S4: Use the dual ResNet-50 model to extract the second-order features of the discriminative curvature field and the zero-order features of the diagonal high-frequency wavelet components respectively. The last projection layer of the dual ResNet-50 model shares weights, projects the corresponding features to the shared subspace, and forms complementary discriminative information. Step S5: Concatenate the second-order features with the zero-order features to form a joint representation, input it into the multilayer perceptron, and determine whether the image to be detected is generated by the diffusion model based on the output of the multilayer perceptron. The image to be detected is generated by a variety of different generation models, including image modal information but not text modal information.
2. The image blind box detection method based on a diffusion model according to claim 1, characterized in that, Step S1 specifically includes: The parameters of the diffusion model are frozen, and an ordinary differential equation integral pipeline is constructed from time t=0 to t=1. The ordinary differential equation integral pipeline uses the one-to-one mapping relationship between the data distribution and the Gaussian noise distribution constructed by the pre-trained diffusion model to deterministically add noise to the image to be detected. Starting at time t=0 and ending at time t=1, the time interval from 0 to 1 is divided into T uniform intervals. The images to be detected are input into the ordinary differential equation integration pipeline one by one. The integration starts from the first interval and continues to the last interval. The denoising velocity field corresponding to T times for each image is obtained one by one, thus forming a probability flow trajectory that transforms the data distribution into a Gaussian noise distribution.
3. The image blind box detection method based on a diffusion model according to claim 1, characterized in that, Step S2 specifically includes: The approximate curvature calculation formula is to perform second-order Taylor truncation on the midpoint image of the probability flow trajectory, and then perform approximate difference calculation on the obtained second-order terms to obtain T-1 curvature fields. The pseudo-Gaussian compression strategy selects the maximum and minimum values on the time scale for each pixel's T-1 curvature fields, and multiplies the maximum and minimum values for each pixel to obtain a discriminative curvature field.
4. The image blind box detection method based on a diffusion model according to claim 1, characterized in that, Step S3 specifically includes: The images to be detected are subjected to a first-order discrete wavelet transform based on the bior1.3 basis function to obtain a frequency domain image. The frequency domain image includes an approximate low-frequency component, a horizontal detail sub-band, a vertical detail sub-band, and a diagonal detail sub-band. The parts other than the diagonal detail sub-band are discarded, and upsampling is performed by bilinear interpolation to align with the original spatial resolution to obtain the diagonal high-frequency wavelet component of the original resolution.
5. The image blind box detection method based on a diffusion model according to claim 1, characterized in that, The dual ResNet-50 model in step S4 includes a first ResNet-50 model and a second ResNet-50 model. The discriminative curvature field is input into the neural network of the first ResNet-50 model to extract the features of the probabilistic flow curvature, and the diagonal high-frequency wavelet components are input into the neural network of the second ResNet-50 model to extract the frequency domain features of the image to be detected. Both dual ResNet-50 models adopt the ResNet-50 network structure, and the last projection layer of the dual ResNet-50 models shares the same weight parameters.
6. The image blind box detection method based on a diffusion model according to claim 5, characterized in that, Step S4 specifically includes: When the discriminative curvature field is input into the first ResNet-50 model neural network to extract the features of the probability flow curvature, the last projection layer of the first ResNet-50 model neural network and the last projection layer of the second ResNet-50 model neural network share weights, projecting the second-order features and the zero-order features into the shared subspace, so that the second-order features and the zero-order features form complementary discriminative information. When the diagonal high-frequency wavelet components are input into the second ResNet-50 model neural network to extract the frequency domain features of the image to be detected, the last projection layer of the second ResNet-50 model neural network shares weights with the last projection layer of the first ResNet-50 model neural network, projecting the 0th-order features and 2nd-order features into the shared subspace, so that the 0th-order features and 2nd-order features form complementary discriminative information.
7. The image blind box detection method based on a diffusion model according to claim 6, characterized in that, In step S5, the second-order features and the zero-order features are concatenated to form a joint representation, specifically including: The probability flow curvature feature output by the first ResNet-50 model and the frequency domain feature output by the second ResNet-50 model are concatenated along one dimension of the feature vector with a length of 1 to form a joint representation. The length of this dimension remains unchanged after concatenation, while the length of the other concatenated dimension is twice the total length of this dimension before concatenation.
8. The image blind box detection method based on a diffusion model according to claim 7, characterized in that, Step S5 further includes: processing the probabilistic flow curvature features and frequency domain features based on a dual-pipeline training strategy to train a multilayer perceptron, wherein the dual-pipeline includes a first pipeline and a second pipeline, the first pipeline corresponds to a first ResNet-50 model, and the second pipeline corresponds to a second ResNet-50 model.
9. The image blind box detection method based on a diffusion model according to claim 8, characterized in that, The dual-channel training specifically includes: The first ResNet-50 model was trained using second-order features, the second ResNet-50 model was trained using 0th-order features, and the multilayer perceptron was trained using joint representations. The output of the multilayer perceptron and the true labels of the samples are used to calculate the loss function and train the multilayer perceptron, the first ResNet-50 model and the second ResNet-50 model. The learning rates of the multilayer perceptron, the first ResNet-50 model, and the second ResNet-50 model are decoupled, and the learning rates are dynamically planned based on the output of the loss function. The output of the multilayer perceptron after training is used as the basis for the final determination of whether the image to be detected was generated by the diffusion model.
10. A generated image blind box detection system based on a diffusion model, applied to the generated image blind box detection method based on a diffusion model as described in any one of claims 1-9, characterized in that, include: The conversion module uses a pre-trained diffusion model to generate a denoised velocity field of probability flow trajectory for the image to be detected, and uses a first-order discrete wavelet transform based on the bior1.3 basis function to convert the image to be detected into a diagonal high-frequency signal in the frequency domain. The compression module is used to calculate multiple curvature fields from multiple denoised velocity fields corresponding to the image to be detected using an approximate curvature calculation formula, and to compress the curvature signals of the multiple curvature fields into a single discriminative curvature field over a time scale. The extraction module is used to extract feature vectors of diagonal high-frequency signals in the curvature field and frequency domain to generate a joint characterization that can be detected. The detection module is used to determine whether the image to be detected was generated by a diffusion model based on joint characterization.
Citation Information
Patent Citations
Unsupervised anomaly detection method based on adaptive diffusion model
CN118570118A
AI generated picture blind box detection method and device based on semantic consistency difference
CN120495792A