Digital fingerprint extraction and traceability method for diffusion model generated image
By performing texture detection and feature extraction on images generated by the diffusion model, and using a parallel single classifier to achieve high-precision traceability of the diffusion model, the problems of insufficient generalization ability and high expansion cost of the traceability method in the existing technology are solved, and efficient and accurate image traceability is achieved.
Patent Information
- Application Number
- CN202510924630.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-10
AI Technical Summary
Existing technologies lack a black-box diffusion model image tracing method that combines high precision, strong robustness, and low expansion cost. It is difficult to accurately trace the images generated by the diffusion model, and existing methods are insufficient in generalization ability and applicability.
By detecting the texture richness of the image to be detected, screening high-texture sub-blocks and recombining them, combining Haar wavelet transform and residual calculation with high-pass filter, and using pre-trained Vision Transformer and DINO models to extract spatial texture features and frequency domain features, finally predicting the source of the diffusion model through parallel single classifiers.
It achieves high-precision, low-expansion-cost traceability of images generated by the diffusion model, and can quickly and accurately trace the source of image generation, reducing maintenance costs and computing power consumption.
Smart Images

Figure CN120766321A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image tracing technology, and in particular to a method, device and storage medium for extracting and tracing digital fingerprints of images generated by a diffusion model. Background Art
[0002] With the rapid development of generative artificial intelligence (AIGC), diffusion models have become a mainstream framework for image generation. Since the advent of core methods such as DDPM (denoising diffusion probabilistic model) and DDIM (denoising diffusion implicit model), commercial products such as DALL E, Stable Diffusion, and Midjourney have adopted this technology, significantly improving image clarity and diversity while also significantly enhancing user control over the production process. However, this rapid adoption of this technology has also been accompanied by a surge in the risk of model abuse. Images forged using diffusion models are being used to manipulate public opinion and even infringe on intellectual property rights. Such behavior not only severely impacts information credibility but also poses a direct threat to corporate brand security. Against this backdrop, establishing a reliable authentication and traceability technology system has become a top priority. Accurately determining whether an image is AI-generated is crucial, while also enabling the tracing of the source of the specific generation model, effectively building a technical barrier to mitigate these risks.
[0003] Existing traceability technologies are mainly divided into two categories: generation-side fingerprint embedding and black-box traceability. The generation-side fingerprint embedding method actively embeds concentric ring watermarks, invisible signals and other feature identifiers into the Gaussian noise of the model training set, parameters or diffusion process. Even if the image undergoes processing such as cropping and compression, it can still maintain robustness. However, it can only verify pictures that have been manually embedded with fingerprints, and cannot trace images generated by third-party models, so its application scope is limited. In the application number CN202411129492.4, entitled "A method, device and equipment for AIGC image detection based on feature fusion", a feature fusion idea was designed to address the negative impact of forged content. Multi-level features are jointly learned to distinguish content generated by different models in real scenarios. Although a forgery detection method based on the frequency domain is proposed in the application number CN202210229571.7, entitled "A deep forgery detection method based on frequency domain filtering residuals", this method cannot cope with the task of tracing the source of forged content. Black-box attribution methods don't require access to or modification of the model and can theoretically be applied to any model. However, current research has largely focused on GAN / VAE scenarios. Solutions targeting diffusion models are scarce and lack precision, often only distinguishing "coarse categories" of models while struggling to pinpoint specific weighted versions. Application number CN202410010345.9, titled "A Method and Apparatus for Detecting Generated Images," doesn't consider state-of-the-art generative techniques, resulting in drawbacks in generalization and applicability.
[0004] Traditional detection methods such as frequency domain analysis, deconvolution artifacts, reconstruction, and manifold projection consume a lot of computing power and lack applicability and generalization capabilities. Existing multi-class classifier frameworks have high maintenance costs and poor scalability. As new models continue to emerge, using a single N-class classifier requires retraining the entire traceability model for each new class, resulting in huge computing overhead and deployment delays.
[0005] In summary, there is currently a lack of a black-box diffusion model image traceability method that combines high precision, strong robustness, and low scalability. This paper addresses this issue by providing a scalable traceability technique based on feature extraction using high-pass residuals and texture filtering, combined with a parallel single classifier, to achieve accurate and efficient traceability of images generated by various diffusion models. Summary of the Invention
[0006] The purpose of the present invention is to address the shortcomings of the prior art and provide a method for extracting and tracing digital fingerprints of images generated by a diffusion model, comprising the following steps: S1: Detecting the texture richness of the image to be detected, screening high-texture sub-blocks and recombining them to obtain a recombined image, and performing Haar wavelet transform and residual calculation on the image to be detected through a high-pass filter to obtain a medium- and high-frequency residual image; S2: Input the recombined image block into the pre-trained Vision Transformer model to obtain a spatial texture feature vector, and input the mid- and high-frequency residual map into the pre-trained DINO model to obtain a frequency domain feature vector; S3: splicing the spatial texture feature vector and the frequency domain feature vector, and predicting the diffusion model source through a parallel single classifier.
[0007] Preferably, in step S1, texture richness detection is performed on the image to be detected, high-texture sub-blocks are screened and reconstructed to obtain a reconstructed image, further comprising: S111: Crop the image to be detected into pieces with a side length of After the square is formed, it is divided into The side length is High-texture sub-tiles; S112: Calculating the texture score of the high-texture sub-block according to the Sobel edge operator; S113: Filter the texture scores in descending order The sub-blocks are reassembled according to the original spatial positions to obtain the reassembled image with a side length half of the original one.
[0008] Preferably, in step S112, calculating the texture score of the high-texture sub-block according to the Sobel edge operator further includes: The Sobel edge operator is used to calculate the gradient magnitude and gradient direction for each high texture sub-block. The texture score is calculated as follows: in, The gradient direction is the Soble gradient value in the x direction, The gradient direction is the Soble gradient value in the y direction, is the number of high-texture sub-blocks, is the horizontal convolution kernel of the Sobel operator, is the vertical convolution kernel of the Sobel operator, is the pixel matrix of the high texture sub-block, are the coordinates of the pixels in the high texture sub-block.
[0009] Preferably, in step S1, the image to be detected is subjected to Haar wavelet transform and residual calculation through a high-pass filter to obtain a medium- and high-frequency residual map, further comprising: S121: Splitting the RGB channels of the image to be detected into three single-channel grayscale images using the high-pass filter; S122: Performing a first-level Haar wavelet transform on each of the single-channel grayscale images to obtain a low-frequency subband; S123: Restoring the low-frequency subband to the same resolution as the image to be detected by bilinear interpolation, and performing subtraction with the single-channel grayscale image to generate a single-channel residual image; S124: Merge the single-channel grayscale images to obtain the mid- and high-frequency residual images.
[0010] Preferably, in step S2, the recombined image block is input into a pre-trained Vision Transformer model to obtain a spatial texture feature vector, further comprising: S211: The pre-trained Vision Transformer model adds the reorganized image block to the position information, performs linear projection and vectorization under the attention mechanism to obtain independent token information; S212: weighting the independent token information according to the texture ranking according to a weighting function to obtain a weighted token; S213: Summing the weighted tokens to obtain the spatial texture feature vector, and freezing the ViT parameters.
[0011] Preferably, in step S212, weighting the independent token information according to the texture ranking according to a weighting function to obtain a weighted token further includes: According to the weighting function The independent token information is weighted according to the texture ranking to obtain a weighted token, and the i-th weighted token is as follows: in, is the weight base of the i-th token, It is the sum of all token weight bases.
[0012] Preferably, in step S2, the mid-high frequency residual map is input into a pre-trained DINO model to obtain a frequency domain feature vector, further comprising: S221: Input the mid- and high-frequency residual map into the pre-trained DINOv2 model to obtain a one-dimensional vector feature; S222: Extract CLS Token to obtain the frequency domain feature vector, and freeze DINO parameters.
[0013] Preferably, in step S3, the spatial texture feature vector and the frequency domain feature vector are spliced together, and the diffusion model source is predicted by a parallel single classifier, including: S31: concatenate the spatial texture feature vector and the frequency domain feature vector to obtain a merged vector; S32: inputting the merged vector into a plurality of parallel single classifiers, each single classifier corresponding to a diffusion model; S33: The single classifier is an MLP structure based on DeepSAD, which maps positive samples to the center of the hypersphere and negative samples to positions far from the center of the sphere. S34: Output the diffusion model identifier with the highest probability that exceeds the set threshold, otherwise return an error.
[0014] Based on the same concept, the present invention also provides a computer device, characterized in that it includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the method for extracting and tracing the digital fingerprint of an image generated by a diffusion model as described in any one of the embodiments. Based on the same concept, the present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the digital fingerprint extraction and tracing method for generating images based on a diffusion model as described in the embodiment.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention detects the texture richness of the image to be detected, selects high-texture sub-blocks and reconstructs them to obtain a reconstructed image. This method filters the parts with less texture in advance to reduce the amount of useless information carried by these parts into the extracted features. The image to be detected is then subjected to a high-pass filter to perform Haar wavelet transform and residual calculation to obtain a medium- and high-frequency residual map, thereby highlighting subtle texture differences. The present invention decouples feature extraction and probability prediction by inputting the reconstructed image blocks into a pre-trained Vision Transformer model to obtain spatial texture feature vectors, and inputting the mid- and high-frequency residual maps into a pre-trained DINO model to obtain frequency domain feature vectors, thereby greatly saving computing power. The present invention splices spatial texture feature vectors and frequency domain feature vectors, and predicts the source of the diffusion model through parallel single classifiers, that is, changing a multi-classifier into multiple single classifiers. This allows the artificial intelligence network to generate new images of new categories or new pictures, thus ensuring the scalability of the traceability tool and reducing maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Various other advantages and benefits will become apparent to those skilled in the art by reading the following detailed description of the preferred embodiment.The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the invention.
[0017] Figure 1 This is a flow chart of the method for extracting and tracing the digital fingerprint of an image generated by a diffusion model according to the present invention; Figure 2 Another flow chart of the method for extracting and tracing the digital fingerprint of an image generated by a diffusion model according to the present invention; Figure 3 Schematic diagram of texture richness detection according to the present invention; Figure 4 Schematic diagram of the high-pass filter of the present invention; Figure 5 is a schematic diagram of ViT of the present invention; Figure 6 This is the TSNE display diagram of the feature extraction part in the experiment of this invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Obviously, the embodiments described are part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.
[0019] Those skilled in the art will understand that, unless otherwise specified, the singular forms "a," "an," and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0020] First embodiment To address the problems of strong authenticity of diffusion model-generated images, difficulty in capturing fingerprint information, and difficulty in tracing their origins, as well as the shortcomings of existing technical solutions for tracing the origins of diffusion model-generated images, this embodiment aims to propose a digital fingerprint extraction and model tracing method with high accuracy, low expansion cost, and high robustness. This method can not only identify whether an image comes from the real world, but also determine the source of the image generation.
[0021] See also Figure 1 and Figure 2 As shown, this embodiment provides a method for extracting and tracing digital fingerprints of images generated by a diffusion model, including the following steps: S1: Detect the texture richness of the image to be detected, filter out high-texture sub-blocks and reconstruct them to obtain a reconstructed image, and perform Haar wavelet transform and residual calculation on the image to be detected through a high-pass filter to obtain a medium- and high-frequency residual map.
[0022] See also Figure 3 As shown, in step S1, texture richness detection is performed on the image to be detected, high-texture sub-blocks are screened and reconstructed to obtain a reconstructed image, further comprising: S111: Crop the image to be detected into pieces with a side length of After the square is formed, it is divided into The side length is Specifically, in this embodiment, the high-texture sub-block is constructed by finding the width and height of the image to be detected, taking the shorter side as the side length of the square, and determining the coordinates of the upper left vertex of the cropping frame based on the center of the image. The area with the coordinates as the upper left corner and the side length as the side length of the square is extracted from the original image to generate a square image. mn is usually set to 5 to 7, that is, the side length of a single sub-block is 16, 32, 64, or 128. S112: Calculate the texture score of the high-texture sub-block according to the Sobel edge operator; S113: Before filtering in descending order according to texture score The sub-blocks are reassembled according to the original spatial positions to obtain a recombined image with a side length half of the original one. Specifically, in this embodiment, by evaluating the texture richness, the smooth and pure color parts in the image are filtered out, and the ranking information of the texture richness of the blocks is obtained, and the blocks are sorted in the order of rows first and columns to form a recombined image with a side length half of the original one.
[0023] Preferably, in step S112, calculating the texture score of the high-texture sub-block according to the Sobel edge operator further includes: For each high-texture sub-block, the Sobel edge operator is used to calculate the gradient magnitude and gradient direction. The texture score is calculated as follows: in, The gradient direction is the Soble gradient value in the x direction, The gradient direction is the Soble gradient value in the y direction, is the number of high-texture sub-tiles, is the horizontal convolution kernel of the Sobel operator, is the vertical convolution kernel of the Sobel operator, is the pixel matrix of the high-texture sub-tile, are the coordinates of the pixel within the high texture sub-tile.
[0024] Since images often have a lot of texture information but are composed of large blocks of pure color, these parts have low information entropy and it is difficult to have more feature information for tracing. In this way, we filter the parts with less texture in advance to reduce the amount of useless information carried by these parts into the extracted features.
[0025] See also Figure 4 As shown, in step S1, the image to be detected is subjected to Haar wavelet transform and residual calculation through a high-pass filter to obtain a medium- and high-frequency residual map, further comprising: S121: A high-pass filter is used to split the RGB channels of the image to be detected into three single-channel grayscale images. Specifically, in this embodiment, the three channels of the image to be detected correspond to R (red), G (green), and B (blue), respectively. Three independent single-channel grayscale images are extracted, and the high-pass filter retains the high-frequency information of the image (such as edges, textures, and details) and suppresses low-frequency information (such as smooth areas and gradient backgrounds). S122: performing a first-level Haar wavelet transform (Haar wavelet transform) on each single-channel grayscale image to obtain a low-frequency subband. Specifically, in this embodiment, the LL (low-frequency) subband is obtained to obtain the low-frequency information of the original RGB image; S123: Restore the low-frequency subband to the same resolution as the image to be detected by bilinear interpolation, and perform a difference with the single-channel grayscale image to generate a single-channel residual image. Specifically, in this embodiment, bilinear interpolation is performed on the LL subband to restore the size, and a residual operation is performed on the original images of the three grayscale images and the three LL subband images to obtain three residual images of mid- and high-frequency information; S124: Merge the single-channel grayscale images to obtain a mid-high frequency residual image to highlight the subtle texture differences generated by the diffusion model. Specifically, in this embodiment, the three mid-high frequency information grayscale images are restored to three-channel mid-high frequency information images and merged.
[0026] S2: Input the recombined image block into the pre-trained Vision Transformer model to obtain the spatial texture feature vector, and input the mid-high frequency residual image into the pre-trained DINO model to obtain the frequency domain feature vector. Specifically, in this embodiment, please refer to Figure 6 As shown in the figure, the rearranged sub-block sequence is spliced in order and input into the pre-trained Vision Transformer model to extract the spatial texture feature vector. The ranking information is added as a weight to the vector synthesis to increase the attention to the texture-rich area. The pre-trained DINO model is input to extract feature vectors, and self-supervised training is used to control the model's focus on texture information detection rather than semantic information detection.
[0027] See also Figure 5 As shown, in step S2, the reorganized image block is input into the pre-trained Vision Transformer model to obtain a spatial texture feature vector, further comprising: S211: The pre-trained Vision Transformer model adds the reorganized image blocks to the position information, performs linear projection and vectorization under the attention mechanism, and obtains independent token information. Specifically, in this embodiment, 16 image blocks are respectively added to the position information, and linear projection and vectorization under the attention mechanism are performed to obtain 16 independent token information; S212: weighting the independent token information by texture ranking according to a weighting function to obtain a weighted token; S213: The weighted tokens are summed to obtain a spatial texture feature vector, and the ViT parameters are frozen. Specifically, in this embodiment, the weighted tokens are added together to obtain a one-dimensional vector with a length of 768. During training, in order to ensure high scalability and low expansion cost, this Vision Transformer model will freeze all parameters and will not participate in training.
[0028] Preferably, in step S212, weighting the independent token information by texture ranking according to a weighting function to obtain a weighted token further includes: According to the weighting function The independent token information is weighted by texture ranking to obtain the weighted token. The i-th weighted token is as follows: is the weight base of the i-th token, It is the sum of the weight bases of all tokens. Specifically, in this embodiment, texture richness detection is performed on the image to be detected, high-texture sub-blocks are screened and reassembled to obtain a reassembled image. This will cause the position information between blocks to change from spatial correlation to a simple texture richness ranking. This position relationship is different from the original position encoding in the trained Vision transformer. However, in order to minimize interference with the pre-trained model itself, this embodiment only weights the tokens of each block according to the ranking information obtained from the reassembled image.
[0029] Preferably, in step S2, the mid-high frequency residual map is input into the pre-trained DINO model to obtain the frequency domain feature vector, further comprising: S221: Input the mid- and high-frequency residual image into the pre-trained DINOv2 model to obtain a one-dimensional vector feature. Specifically, in this embodiment, the image is input into DINO, which uses the v2 version of DINO to obtain a one-dimensional vector with a length of 768. Self-supervised training is used to control the model's focus on texture information detection rather than semantic information detection; S222: Extract CLS Token to obtain frequency domain feature vectors and freeze DINO parameters. Specifically, in this embodiment, in order to ensure high scalability and low expansion cost during training, this module will freeze all parameters of the pre-trained DINOv2 model and will not participate in training.
[0030] As mentioned above, if feature extraction relies in part on information from training, then any new model added would necessarily require complete retraining. This embodiment uses pre-trained models and freezes parameters during training, allowing the same set of feature extraction models to be used consistently. This significantly saves computing power and allows for decoupling of feature extraction and probability prediction.
[0031] S3: Splice the spatial texture feature vector and the frequency domain feature vector, and predict the diffusion model source through a parallel single classifier. Specifically, in this embodiment, the two feature vectors are spliced and fed into The parallel single classifier calculation belongs to The probability of the diffusion model is calculated, and the single classifier with the highest output probability is selected as the output.
[0032] Preferably, in step S3, the spatial texture feature vector and the frequency domain feature vector are concatenated, and the diffusion model source is predicted by a parallel single classifier, including: S31: splicing the spatial texture feature vector and the frequency domain feature vector to obtain a merged vector. Specifically, in this embodiment, the spatial texture feature vector and the frequency domain feature vector are spliced to obtain a one-dimensional vector with a length of 1536; S32: Input the merged vector into several parallel single classifiers, each of which corresponds to a diffusion model. Specifically, in this embodiment, the one-dimensional vector is input into multiple single classifiers, each of which is responsible for determining the attribution of one type of image to one model. S33: The single classifier is an MLP structure based on DeepSAD, which maps positive samples to the near-center area of the hypersphere and negative samples to a position far from the center of the sphere. Specifically, in this embodiment, the newly added When using a diffusion model, only one additional classifier needs to be trained, and no existing modules need to be retrained, thus achieving high scalability. Each single classifier uses a simple MLP to map positive samples, that is, images of the model and image category that the single classifier is responsible for, to a sphere in the hyperspace, and negative samples to a position far away from the center of the sphere. S34: Output the diffusion model identifier with the highest probability and exceeding the set threshold, otherwise return an error. Specifically, in this embodiment, the output of each single classifier is sorted, and the model corresponding to the item with the highest output is taken as the result output. If there is no model with a probability prediction higher than 0.7, an error result is output.
[0033] This example uses the CelebA-HQ dataset, four models trained on the CelebA-HQ dataset, and four face images generated by current mainstream models using prompt words, for a total of one real image and eight models, with a 50% probability of horizontal rotation.
[0034] During training, the feature extraction part is completely frozen and gradient backpropagation is not performed. After all images are processed, 80% are taken as the training set and 20% as the test set. Nine single classifiers are trained. Each classifier outputs a probability prediction, and the highest one is taken as the output result. Each single classifier is trained for 30 rounds and tested after each round of training. The model with the highest ACC on the test set within 30 rounds is saved. The tracing accuracy exceeds 84% under Gaussian noise with different standard deviations and JPEG compression with different quality factors.
[0035] Because it is necessary to deal with a large number of types of images (faces, cars, birds, airplanes, etc.) and images of various models (DDPM, DALL-E, Midjourney, etc.), these images may not be applicable to the same probability predictor. After being put into actual use, in order to adapt to various new situations and carry out subsequent expansion, maintainers need to repeat training a large number of times in terms of both types and models, which is undoubtedly a huge waste of computing power. In terms of structure, this embodiment changes a multi-classifier into multiple single classifiers. In this way, whether encountering new categories of images or new image-generating artificial intelligence networks, this can well ensure the scalability of the traceability tool and reduce maintenance costs.
[0036] This embodiment designs a method based on digital fingerprint extraction, mainly for diffusion models, for images of completely unknown origin. It authenticates and traces the image, and quickly locates the model that generated the image. It has the advantages of lightweight, high scalability, high detection accuracy, and high robustness.
[0037] Second embodiment Based on the same concept, this embodiment also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of a digital fingerprint extraction and tracing method for diffusion model-generated images in the first embodiment of the present invention.
[0038] This embodiment also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of a digital fingerprint extraction and tracing method for diffusion model-generated images in an embodiment of the present invention.
[0039] It can be understood that, for the aforementioned method for extracting and tracing digital fingerprints of images generated by a diffusion model, if it is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer server, or a network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.
[0040] Computer-readable storage media may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0041] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A digital fingerprint extraction and traceability method for images generated by a diffusion model, characterized in that: The following steps are involved: S1: Detecting the texture richness of the image to be detected, screening high-texture sub-blocks and recombining them to obtain a recombined image, and performing Haar wavelet transform and residual calculation on the image to be detected through a high-pass filter to obtain a medium- and high-frequency residual image; S2: Input the recombined image block into the pre-trained Vision Transformer model to obtain a spatial texture feature vector, and input the mid- and high-frequency residual map into the pre-trained DINO model to obtain a frequency domain feature vector; S3: splicing the spatial texture feature vector and the frequency domain feature vector, and predicting the diffusion model source through a parallel single classifier.
2. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 1, characterized in that: In step S1, texture richness detection is performed on the image to be detected, high-texture sub-blocks are screened and reconstructed to obtain a reconstructed image, further comprising: S111: Crop the image to be detected into pieces with a side length of After the square is formed, it is divided into The side length is High-texture sub-tiles; S112: Calculating the texture score of the high-texture sub-block according to the Sobel edge operator; S113: Filter the texture scores in descending order The sub-blocks are reassembled according to the original spatial positions to obtain the reassembled image with a side length half of the original one.
3. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 2, characterized in that: In step S112, the texture score of the high-texture sub-block is calculated according to the Sobel edge operator, further comprising: The Sobel edge operator is used to calculate the gradient magnitude and gradient direction for each high texture sub-block. The texture score is calculated as follows: in, The gradient direction is the Soble gradient value in the x direction, The gradient direction is the Soble gradient value in the y direction, is the number of high-texture sub-blocks, is the horizontal convolution kernel of the Sobel operator, is the vertical convolution kernel of the Sobel operator, is the pixel matrix of the high texture sub-block, are the coordinates of the pixels in the high texture sub-block.
4. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 3, characterized in that: In step S1, the image to be detected is subjected to Haar wavelet transform and residual calculation through a high-pass filter to obtain a medium- and high-frequency residual map, further comprising: S121: Splitting the RGB channels of the image to be detected into three single-channel grayscale images using the high-pass filter; S122: Performing a first-level Haar wavelet transform on each of the single-channel grayscale images to obtain a low-frequency subband; S123: Restoring the low-frequency subband to the same resolution as the image to be detected by bilinear interpolation, and performing subtraction with the single-channel grayscale image to generate a single-channel residual image; S124: Merge the single-channel grayscale images to obtain the mid- and high-frequency residual images.
5. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 4, characterized in that: In step S2, the recombined image block is input into a pre-trained Vision Transformer model to obtain a spatial texture feature vector, further comprising: S211: The pre-trained Vision Transformer model adds the reorganized image block to the position information, performs linear projection and vectorization under the attention mechanism to obtain independent token information; S212: weighting the independent token information according to the texture ranking according to a weighting function to obtain a weighted token; S213: Summing the weighted tokens to obtain the spatial texture feature vector, and freezing the ViT parameters.
6. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 5, characterized in that: In step S212, the independent token information is weighted by texture ranking according to a weighting function to obtain a weighted token, further comprising: According to the weighting function The independent token information is weighted according to the texture ranking to obtain a weighted token, and the i-th weighted token is as follows: in, is the weight base of the i-th token, It is the sum of all token weight bases.
7. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 6, characterized in that: In step S2, the mid-high frequency residual map is input into the pre-trained DINO model to obtain a frequency domain feature vector, further comprising: S221: Input the mid- and high-frequency residual map into the pre-trained DINOv2 model to obtain a one-dimensional vector feature; S222: Extract CLS Token to obtain the frequency domain feature vector, and freeze DINO parameters.
8. The method for extracting and tracing digital fingerprints of diffusion model-generated images according to claim 7, characterized in that: In step S3, the spatial texture feature vector and the frequency domain feature vector are spliced together, and the diffusion model source is predicted by a parallel single classifier, including: S31: concatenate the spatial texture feature vector and the frequency domain feature vector to obtain a merged vector; S32: Inputting the merged vector into a plurality of parallel single classifiers, each single classifier corresponding to a diffusion model; S33: The single classifier is an MLP structure based on DeepSAD, which maps positive samples to the center of the hypersphere and negative samples to positions far from the center of the sphere; S34: Output the diffusion model identifier with the highest probability that exceeds the set threshold, otherwise return an error.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the method for extracting and tracing digital fingerprints of images generated by a diffusion model according to any one of claims 1 to 8.
10. A storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the method for extracting and tracing digital fingerprints of diffusion model-generated images according to any one of claims 1 to 8.
Citation Information
Patent Citations
A deepfake detection method based on frequency domain filtering residual
CN114757877B
A detection method and device for generating an image
CN117523323B
Feature fusion-based AIGC image detection method, device and equipment
CN118968247A