AI-generated image general detection method, system and computer equipment based on high and low level feature fusion
The AI-generated image detection method, which integrates high- and low-level features, utilizes the DINOv2:ViT-L/14 model to extract semantic and noise features. This solves the problems of cross-model generalization and low computational efficiency in existing detection methods, enabling efficient detection of images with unknown generation methods and improving information discrimination capabilities.
Patent Information
- Application Number
- CN202510744178.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-06-05
AI Technical Summary
Existing AI-generated image detection methods are difficult to generalize across models, have low computational efficiency, cannot effectively detect images with unknown or mixed generation methods, and have high computational costs, making it difficult to meet real-time detection requirements.
A method based on high- and low-level feature fusion is adopted. The semantic features of the image are extracted by the DINOv2:ViT-L/14 model and combined with noise features for feature concatenation. A linear multilayer perceptron is used for detection, and the results of real and fake image classification are output.
It achieves the ability to generalize to unknown generative models, simplifies detection steps, improves detection efficiency, meets real-time detection needs, enhances the ability to identify and detect fake information, and is suitable for social media image authenticity detection and large model training sample screening.
Smart Images

Figure CN120635647B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of AI image authenticity detection, in particular to an AI-generated image general detection method and system based on high and low level feature fusion and a computer device. BACKGROUND
[0002] In recent years, with the rapid development of deep learning technology, generative models have made significant progress in generating realistic images. Text-to-image commercial platforms can generate realistic images with high quality, multiple scenarios, and strong semantic consistency. At the same time, the low threshold of these text-to-image applications makes almost everyone able to produce a large number of false images. Due to the visual understandability and cognitive rationality, generated images are particularly convincing in many situations, which has raised many security and privacy issues.
[0003] The existing general detection methods for generated images can be roughly divided into four categories:
[0004] (1) Data-driven detection: construct a training set containing a large number of true and false samples, conduct large-scale training, and promote the model to learn the feature differences between true and false samples;
[0005] (2) Feature statistical analysis-based detection: distinguish generated images from real images by analyzing statistical or physical feature differences in images;
[0006] (3) Feature reconstruction-based detection: map the image to be detected back to the latent space of the generative model, perform feature reconstruction, and judge the image authenticity according to the feature difference before and after reconstruction;
[0007] (4) Data distribution difference-based detection: compare the distribution differences of generated images and real images in the latent space or feature space, and train a detection model to learn to distinguish true and false images.
[0008] However, the above detection methods all rely on the data set training of specific generative models (such as GAN models or diffusion models), and it is difficult to effectively generalize to images of unknown generation methods or mixed generation methods. Moreover, some deep learning-based detection methods have high computational cost and complex processing steps, making it difficult to meet real-time detection requirements and have low computational efficiency. SUMMARY
[0009] The present application provides an AI-generated image general detection method based on high and low level feature fusion, which aims to solve the technical problems of the detection methods in the prior art that are difficult to cross-model generalization and have low computational efficiency.
[0010] The present application provides an AI-generated image general detection method based on high and low level feature fusion, which includes:
[0011] obtaining a to-be-tested image;
[0012] extracting noise features of the to-be-tested image;
[0013] extracting semantic features of the to-be-tested image based on a DINOv2:ViT-L / 14 model;
[0014] performing feature splicing on the noise features and the semantic features to obtain fused features;
[0015] inputting the fused features into a detection model and outputting a detection result, wherein the detection result includes an AI-generated image and a real image.
[0016] Preferably, the step of extracting noise features of the to-be-tested image comprises:
[0017] randomly extracting local patches with the same resolution in the to-be-tested image;
[0018] calculating a texture richness measure value of each local patch in each channel;
[0019] selecting a local image corresponding to a texture richness measure value meeting a preset range as a texture-poor patch;
[0020] performing high-pass filtering on the texture-poor patch in each channel based on a Gaussian high-pass filter to obtain a high-frequency noise component;
[0021] extracting a noise token of the target image in the texture-poor patch according to the high-frequency noise component, and taking the noise token as the noise feature of the target image.
[0022] Preferably, the step of calculating a texture richness measure value of each local patch in each channel comprises:
[0023] obtaining the total number of rows and the total number of columns of pixels of each local patch;
[0024] obtaining the gray value of a single pixel in a single channel of each local patch;
[0025] based on the gray value of a single pixel in a single channel, the total number of rows and the total number of columns of pixels of each local patch, calculating the sum of the absolute difference values between each pixel and the gray value of the domain pixel in a single channel of each local patch and summing up to obtain a texture richness measure value.
[0026] Preferably, the step of extracting semantic features of the to-be-tested image based on a DINOv2:ViT-L / 14 model comprises:
[0027] importing a DINOv2:ViT-L / 14 model and pre-training parameters, loading the pre-training parameters into the DINOv2:ViT-L / 14 model, and freezing the pre-training parameters;
[0028] extracting high-level semantic features and multiple local semantic features of the to-be-tested image based on the DINOv2:ViT-L / 14 model;
[0029] averaging the number of local semantic features to obtain average local semantic features;
[0030] using the high-level semantic features and the average local semantic features as semantic features of the to-be-tested image.
[0031] Preferably, the step of splicing the noise features and the semantic features to obtain the fusion features comprises:
[0032] obtaining the semantic features, wherein the semantic features include high-level semantic features and average local semantic features;
[0033] obtaining noise tokens corresponding to the noise features, and adjusting the shape of the noise tokens based on the shape of the high-level semantic features to make the shapes consistent;
[0034] In the channel of the noise token, the dimensions of the noise token, the high-level semantic features and the average local semantic features are spliced into a tensor corresponding to a preset value to obtain high-low level fusion features.
[0035] linear tensor flattening is performed on the high-low level fusion features to obtain fusion features.
[0036] Preferably, the step of inputting the fusion features into the detection model and outputting the detection result comprises:
[0037] obtaining training data and adding random data augmentation to the training data, wherein the random data augmentation includes random flipping and adding noise to the training image;
[0038] training the detection model into a true-false two-class detection model based on a binary cross-entropy loss function, wherein the detection model includes a linear multi-layer perceptron composed of multiple fully connected layers, and the linear multi-layer includes a ReLU activation function layer and a Dropout layer;
[0039] inputting the fusion features into the true-false two-class detection model to output a detection result.
[0040] The application also provides an AI-generated image general detection system based on high-low level feature fusion, comprising:
[0041] The first acquisition module is configured to acquire a to-be-tested image.
[0042] The noise feature extraction module is configured to extract noise features of the to-be-tested image.
[0043] The semantic feature extraction module is configured to extract semantic features of the to-be-tested image based on a DINOv2: ViT-L / 14 model.
[0044] The splicing module is configured to splice the noise features and the semantic features to obtain fused features.
[0045] The detection module is configured to input the fused features into a detection model and output a detection result, wherein the detection result includes an AI-generated image and a real image.
[0046] Preferably, the noise feature extraction module comprises:
[0047] The local patch extraction unit is configured to randomly extract local patches with the same resolution in the to-be-tested image.
[0048] The calculation unit is configured to calculate a texture richness measure value of each local patch in each channel.
[0049] The screening unit is configured to screen out local images corresponding to texture richness measure values meeting a preset range as texture-poor patches.
[0050] The high-pass filtering unit is configured to perform high-pass filtering on the texture-poor patches in each channel based on a Gaussian high-pass filter to obtain high-frequency noise components.
[0051] The noise token extraction unit is configured to extract noise tokens of the target image in the texture-poor patches according to the high-frequency noise components, and take the noise tokens as noise features of the target image.
[0052] The present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0053] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the above method.
[0054] The application has the beneficial effects that: the application provides a general feature that can be learned and fused by using the extraction strategy and fusion mechanism of high-level features (semantic features) and low-level features (noise features) of images, which can effectively realize the generalization of unknown generated models, effectively generalize to images generated by unknown generation methods or mixed generation methods, simplify the detection steps, be more general, meet the real-time detection requirements, have shorter time consumption, and improve the detection efficiency; by detecting the authenticity of the to-be-detected image, the authenticity of the images widely spread in social media can be effectively inferred, a general forensics scheme for AIGC forgery is provided, and the ability of the public to distinguish and be vigilant about fake information is improved. Meanwhile, the application can also be applied to other fields such as large model training sample screening and multi-modal information detection, and has a wide application prospect. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 The method flowchart of an embodiment of the application is shown.
[0056] Figure 2 The internal structure diagram of the computer device of an embodiment of the application is shown.
[0057] The implementation, functional characteristics and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0058] It should be understood that the specific embodiments described herein are only used to explain the application and not to limit the application.
[0059] As shown in Figure 1 , Figure 2 The application provides an AI generated image general detection method based on high and low level feature fusion, which comprises:
[0060] S1, acquiring a to-be-detected image;
[0061] S2, extracting noise features of the to-be-detected image;
[0062] S3, extracting semantic features of the to-be-detected image based on a DINOv2:ViT-L / 14 model;
[0063] S4, feature splicing is performed on the noise features and the semantic features to obtain fused features;
[0064] S5, inputting the fused features into a detection model and outputting a detection result, wherein the detection result comprises an AI generated image and a real image.
[0065] As described in steps S1-S5 above, the present application fuses the noise features and semantic features of the image to be detected, and this fused feature is more general, which can make the detection model generalize to unknown generation models, and is not limited to the detection of fake faces, effectively realizing the general detection of generated images. According to the prior art, the low-level noise patterns and high-frequency components such as texture details of the image show more obvious differences in the texture-poor regions of real images and generated images, so the noise features in the texture-poor regions are more worthy of attention. Based on this, the noise features of the image to be detected are extracted, and the noise feature extraction process is mainly aimed at the high-frequency components such as noise patterns and texture details in the image, and the semantic feature extraction process uses a pre-trained DINOv2:ViT-L / 14 network to extract and output high-level semantic features in the image to be detected. DINOv2 is a large self-supervised model based on Vision Transformer (ViT) architecture by Meta AI, which can learn universal visual features from any image set without fine-tuning, suitable for various downstream visual tasks including image classification, and is one of the most advanced visual feature extraction models. Through the pre-trained DINOv2:ViT-L / 14 model, high-level semantic features for forensics can be extracted from generated images unknown to the training process. Since the DINOv2 model itself is fully trained on a large-scale integrated image data pool through advanced training engineering, it has the ability to learn, abstract and represent features from shallow to deep, so the pre-trained parameters of DINOv2 have the ability to sample embed any scene image. In theory, DINOv2 has multiple capabilities required for general detection of AI-generated images. The present application discards the past method of using ProGAN as training samples only, and chooses the training method of combining ProGAN and ADM double generation samples, so that the detection model can better consider the high-level semantic features and low-level noise features of the image to be detected, and break the feature learning limitations brought by the single generation sample training mode.
[0066] The feature alignment and splicing process is used to align and splice the low-level noise features and high-level semantic features extracted from the original image, so that they are organically combined together to form a fused feature that can be directly accepted by a linear classifier.
[0067] The detection model is a linear multi-layer perception (MLP) composed of multiple fully connected layers. The linear layers contain Relu activation function layers and Dropout (random inactivation) throw layers, respectively, for non-linear feature mapping and preventing model overfitting. The detection model accepts the flattened fusion features, trains a true-false binary classification detection model through BCELoss (Binary Cross Entropy Loss), and finally outputs a probability value between 0 and 1 as the detection result. In the training set, the real image is marked as "0", and the generated image is marked as "1". When the probability value output by the detection model is greater than or equal to 0.5, the image to be tested is judged to be a generated image, otherwise it is judged to be a real image. The present application provides a fusion type and learnable general feature for the detection model through the extraction strategy and fusion mechanism of high-level features (semantic features) and low-level features (noise features), which can effectively realize the generalization of unknown generated models, effectively generalize to images of unknown generation methods or mixed generation methods, and simplify the detection step, which is more general, can meet the real-time detection demand, has shorter time consumption, and can improve the detection efficiency; by detecting the authenticity of the image to be tested, the authenticity of the widely spread images in the social media can be effectively inferred, a general forensics scheme for AIGC (Artificial Intelligence Generated Content) forgery is provided, and the ability of the public to distinguish and be vigilant about fake information is improved. At the same time, the present application can also be applied to other fields such as large model training sample screening and multi-modal information detection, and has wide application prospect.
[0068] In one embodiment, the step S2 of extracting the noise features of the image to be tested comprises:
[0069] S21, randomly extracting local image blocks with the same resolution in the image to be tested;
[0070] S22, calculating the texture richness measure value of each local image block in each channel;
[0071] S23, screening out local images corresponding to texture richness measure values meeting a preset range as texture-poor image blocks;
[0072] S24, performing high-pass filtering on the texture-poor image blocks in each channel based on a Gaussian high-pass filter to obtain high-frequency noise components;
[0073] S25, extracting noise tokens of the target image in the texture-poor image blocks according to the high-frequency noise components, and taking the noise tokens as the noise features of the target image.
[0074] As described in steps S21-S25 above, the low-level noise pattern and high-frequency components such as texture details of the image show more obvious differences in the texture-poor areas of the real image and the generated image, and thus the noise features in the texture-poor areas are more worthy of attention. The embodiment first randomly extracts local patches of the same resolution (for example, 32x32) in the image to be tested. In each channel of the local patch, the texture richness measure value of the local patch in the single channel is calculated, and a certain number of local patches with relatively low channel texture richness measure values are retained. Then, the retained texture-poor patches are high-pass filtered on each channel by a Gaussian high-pass filter, and the high-frequency noise components in each texture-poor patch are extracted as the noise features of the texture-poor patches. Finally, the noise features of the texture-poor patches are averaged in the corresponding channel to obtain the noise token of the original image in the texture-poor area. The final output low-level noise features are equal to the resolution of each local patch, and maintain channel independence (i.e., the low-level noise features are feature vectors such as [3, 32, 32]).
[0075] In one embodiment, the step S22 of calculating the texture richness measure value of each local patch in each channel includes:
[0076] S221, obtaining the total number of rows or columns of pixels of each local patch;
[0077] S222, obtaining the gray value of a single pixel in a single channel of each local patch;
[0078] S223, based on the gray value of a single pixel in a single channel, the total number of rows or columns of pixels of each local patch, the sum of the absolute difference between each pixel and the gray value of the domain pixel in a single channel of each local patch is calculated and summed to obtain the texture richness measure value.
[0079] As described in steps S221-S223 above, the specific calculation formula of the texture richness measure value is:
[0080] ;
[0081] wherein, the I div indicates the texture richness measure value of a single local patch in a single channel, M indicates the total number of rows or columns of pixels in the local patch (the patch has the same length and width), x is the gray value of a single pixel in a single channel of the local patch, and i and j represent the current row value and column value of the pixel in the local patch, respectively. By calculating the texture richness measure value, the process of extracting noise features can pay more attention to the texture-poor areas in the image, provide real and accurate basis for the subsequent image detection results, and effectively filter irrelevant low-frequency information in the texture-poor areas in the frequency domain through a simple Gaussian high-pass filter, thereby achieving effective preservation of noise features.
[0082] In one embodiment, the step S3 of extracting the semantic features of the to-be-tested image based on the DINOv2:ViT-L / 14 model comprises:
[0083] S31, import the DINOv2:ViT-L / 14 model and pre-training parameters, load the pre-training parameters into the DINOv2:ViT-L / 14 model, and freeze the pre-training parameters;
[0084] S32, extract high-level semantic features and multiple local semantic features of the to-be-tested image based on the DINOv2:ViT-L / 14 model;
[0085] S33, average value calculation is performed on the number dimensions of multiple local semantic features to obtain average local semantic features;
[0086] S34, the high-level semantic features, multiple local semantic features and average local semantic features are taken as the semantic features of the to-be-tested image.
[0087] As described in steps S31-S34 above, the DINOv2:ViT-L / 14 model is imported and the official pre-training parameters are loaded into the model, and the model parameters are frozen (without fine-tuning training) as a semantic feature extraction module. Since ViT-L / 14 is used as the network architecture, the hidden layer dimension in DINOv2:ViT-L / 14 is 1024, and each semantic feature size is strictly limited to 14x14. After receiving an image to be tested with a resolution pre-processed to the largest multiple of 14 (less than the original image resolution), the DINOv2:ViT-L / 14 model mainly outputs two types of features: classification tokens (high-level semantics) and local block tokens (local semantics). The classification token contains the top-level semantics of the entire image, with a shape of [1, 1024]. The local block token contains all the local semantic information of N local blocks, with a shape of [N, 1024]. The number N can be obtained by dividing the resolution of the input image by the resolution of the local block. To prevent the dimension of the output feature from being too high and to balance the feature representation of all local block tokens, the average value of all local block tokens in the number dimension is taken to obtain an average local block token with a shape of [1, 1024], which is the average local semantic feature. Based on the DINOv2:ViT-L / 14 model, the application extracts semantic features, which can capture the subtle differences between generated images and real images in the feature layer and extract more diverse local semantic features, which enables the detection model to pay sufficient attention to local gray level fluctuation abnormalities and global consistency defects. The features output by the network structure of ViT-L / 14 are usually high-dimensional, and the detection model (MLP, Multilayer Perceptron, multilayer perceptron) can map them to a more suitable space for classification through nonlinear transformation, thereby improving the separation degree.
[0088] In one embodiment, the step S4 of fusing the noise feature and the semantic feature to obtain a fusion feature includes:
[0089] S41, obtaining the semantic feature, wherein the semantic feature includes a high-level semantic feature and an average local semantic feature;
[0090] S42, obtaining a noise token corresponding to the noise feature, and adjusting the shape of the noise token based on the shape of the high-level semantic feature to make the shapes consistent;
[0091] S43, concatenating the dimensions of the noise token, the high-level semantic feature, and the average local semantic feature into a tensor corresponding to a preset value in the channel of the noise token to obtain a high-low level fusion feature;
[0092] S44, performing linear tensor flattening on the high-low level fusion feature to obtain a fusion feature.
[0093] As described in steps S41-S44 above, the low-level noise features and high-level semantic features are output by the noise feature extraction module and the semantic feature extraction module. Then, all the features are aligned and spliced, and adjusted to a shape that can be directly accepted by a linear layer. Specifically, first, the shape of the noise token output by the noise feature extraction module is adjusted from [3, 32, 32] to [3, 1024], so that its pixel dimension is consistent with the hidden layer dimension of the high-level semantic feature. Second, the noise token, the classification token, and the average local block token are spliced in the channel dimension of the noise token into a tensor with a shape of [5, 1024], constituting the high-low level fusion features of the image to be detected. Finally, the fused features are flattened into a linear tensor like
[5120] to facilitate the detection model to accept.
[0094] In one embodiment, the step S5 of inputting the fusion features into the detection model and outputting a detection result comprises:
[0095] S51, obtaining training data and adding random data augmentation to the training data, the random data augmentation including random flipping and adding noise to the training image;
[0096] S52, training the detection model into a true-false two-class detection model based on a binary cross-entropy loss function, the detection model including a linear multi-layer perceptron composed of multiple fully connected layers, and the linear multi-layers including a ReLU activation function layer and a Dropout layer;
[0097] S53, inputting the fusion features into the true-false two-class detection model and outputting a detection result.
[0098] As described in steps S51-S53 above, the detection model is a linear multi-layer perceptron (MLP) composed of multiple fully connected layers. The linear layers include a ReLU activation function layer and a Dropout layer, respectively used for non-linear feature mapping and preventing model overfitting. The detection model accepts the flattened fusion features and trains a true-false two-class detection model through a BCELoss. In addition, in order to reduce the interference caused by the post-processing image and improve the generalization of the detection model, random data augmentation is added before the training process starts, and the training data is randomly preprocessed such as image flipping and noise adding. During the test process, the detection model receives a flattened fusion feature tensor, maps through the layers, and finally outputs a probability value between 0 and 1 as the detection result. In the data set, the real image is labeled as “0” and the generated image is labeled as “1”. When the probability value output by the detection model is greater than or equal to 0.5, the image to be detected is judged as a generated image, otherwise it is judged as a real image.
[0099] The application is based on the strategy of double-branch feature splicing. The low-level noise feature and the DINOv2 used for extracting high-level features are split into two parallel branches that do not interfere with each other. The low-level noise feature and the high-level semantic feature come from two different processing methods of the same image, are processed respectively, and finally are combined into a fusion feature through feature splicing. The feature engineering in this scheme is performed in parallel first, and then sequentially after feature splicing. Experiments show that this scheme can effectively utilize low-level noise features and high-level features, thereby making the generated detection results more accurate.
[0100] The application also provides an AI-generated image general detection system based on high and low-level feature fusion, comprising:
[0101] A first acquisition module is configured to acquire a to-be-detected image.
[0102] A noise feature extraction module is configured to extract noise features of the to-be-detected image.
[0103] A semantic feature extraction module is configured to extract semantic features of the to-be-detected image based on a DINOv2:ViT-L / 14 model.
[0104] A splicing module is configured to perform feature splicing on the noise features and the semantic features to obtain fusion features.
[0105] A detection module is configured to input the fusion features into a detection model and output a detection result, wherein the detection result includes an AI-generated image and a real image.
[0106] In one embodiment, the noise feature extraction module comprises:
[0107] A local patch extraction unit is configured to randomly extract local patches with the same resolution in the to-be-detected image.
[0108] A calculation unit is configured to calculate a texture richness measure value of each local patch in each channel.
[0109] A screening unit is configured to screen out local images corresponding to texture richness measure values that meet a preset range as texture-poor patches.
[0110] A high-pass filter unit is configured to perform high-pass filtering on the texture-poor patches in each channel based on a Gaussian high-pass filter to obtain high-frequency noise components.
[0111] A noise token extraction unit is configured to extract noise tokens of the target image in the texture-poor patches according to the high-frequency noise components, and take the noise tokens as noise features of the target image.
[0112] It should be noted that each module and unit in the AI generated image general detection system based on high and low level feature fusion corresponds to each step in the AI generated image general detection method based on high and low level feature fusion.
[0113] As shown in Figure 2 The computer device can be a server, and the internal structure thereof can be as shown in Figure 2 The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store all data required in the process of the AI generated image general detection method based on high and low level feature fusion. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the AI generated image general detection method based on high and low level feature fusion.
[0114] Those skilled in the art can understand that Figure 2 The structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied.
[0115] The computer program is executed by the processor to implement the AI generated image general detection method based on high and low level feature fusion.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, storage, databases, or other media in this application and in examples provided herein, unless specifically stated otherwise, can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0117] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, device, article, or method that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, device, article, or method. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, device, article, or method that includes the element.
[0118] The above description is only the preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. An AI-generated image general detection method based on high and low-level feature fusion, characterized in that, The method comprises the following steps: acquiring a to-be-tested image; extracting noise features of the to-be-tested image; extracting semantic features of the to-be-tested image based on a DINOv2:ViT-L / 14 model; performing feature splicing on the noise features and the semantic features to obtain fusion features; inputting the fusion features into a detection model and outputting a detection result, wherein the detection result comprises an AI-generated image and a real image; the step of extracting the noise features of the to-be-tested image comprises the following steps: randomly extracting local image blocks with the same resolution in the to-be-tested image; calculating a texture richness measure value of each local image block in each channel; screening out local images corresponding to texture richness measure values meeting a preset range as texture-poor image blocks; performing high-pass filtering on the texture-poor image blocks in each channel based on a Gaussian high-pass filter to obtain high-frequency noise components; extracting noise tokens of the texture-poor image blocks of the to-be-tested image based on the high-frequency noise components, and taking the noise tokens as the noise features of the to-be-tested image; the step of calculating the texture richness measure value of each local image block in each channel comprises the following steps: acquiring the total number of rows and the total number of columns of pixels of each local image block; acquiring the gray value of a single pixel in a single channel of each local image block; based on the gray value of a single pixel in a single channel, the total number of rows and the total number of columns of pixels of each local image block, calculating the sum of the absolute difference values between each pixel and the gray values of the surrounding pixels in a single channel of each local image block and summing up to obtain the texture richness measure value; the step of performing feature splicing on the noise features and the semantic features to obtain fusion features comprises the following steps: acquiring the semantic features, wherein the semantic features comprise high-level semantic features and average local semantic features; acquiring noise tokens corresponding to the noise features, and adjusting the shape of the noise tokens based on the shape of the high-level semantic features to make the shapes consistent; in the channel of the noise tokens, splicing the dimensions of the noise tokens, the high-level semantic features and the average local semantic features into a tensor corresponding to a preset value to obtain high-low level fusion features; performing linear tensor flattening on the high-low level fusion features to obtain fusion features. 2.The AI-generated image general detection method based on high and low level feature fusion according to claim 1, characterized in that, the step of extracting the semantic features of the to-be-tested image based on the DINOv2:ViT-L / 14 model comprises the following steps: importing a DINOv2:ViT-L / 14 model and pre-training parameters, loading the pre-training parameters into the DINOv2:ViT-L / 14 model, and freezing the pre-training parameters; extracting high-level semantic features and multiple local semantic features of the to-be-tested image based on the DINOv2:ViT-L / 14 model; averaging the number dimensions of the multiple local semantic features to obtain average local semantic features; taking the high-level semantic features and the average local semantic features as the semantic features of the to-be-tested image. 3.The AI-generated image general detection method based on high and low level feature fusion according to claim 1, characterized in that, the step of inputting the fusion features into a detection model and outputting a detection result comprises the following steps: acquiring training data and adding random data augmentation to the training data, wherein the random data augmentation comprises randomly flipping and adding noise to the training images; The detection model is trained as a true-false two-class detection model based on a binary cross-entropy loss function, and the detection model includes a linear multi-layer perceptron composed of multiple fully connected layers, and the linear multi-layers include ReLU activation function layers and Dropout layers; The fusion feature is input into the true-false two-class detection model to output a detection result.
4. An AI-generated image general detection system based on high and low-level feature fusion, characterized in that, Comprise: The first acquisition module is used for acquiring a to-be-tested image; The noise feature extraction module is used for extracting noise features of the to-be-tested image; The semantic feature extraction module is used for extracting semantic features of the to-be-tested image based on a DINOv2:ViT-L / 14 model; The splicing module is used for splicing the noise features and the semantic features to obtain fusion features; The detection module is used for inputting the fusion features into a detection model and outputting a detection result, wherein the detection result includes an AI-generated image and a real image; The noise feature extraction module comprises: The local patch extraction unit is used for randomly extracting local patches with the same resolution in the to-be-tested image; The calculation unit is used for calculating a texture richness measure value of each local patch in each channel; The screening unit is used for screening local images corresponding to texture richness measure values meeting a preset range as texture-poor patches; The high-pass filter unit is used for performing high-pass filtering on the texture-poor patches in each channel based on a Gaussian high-pass filter to obtain high-frequency noise components; The noise token extraction unit is used for extracting noise tokens of the texture-poor patches of the to-be-tested image according to the high-frequency noise components, and taking the noise tokens as noise features of the to-be-tested image; The calculation unit comprises: The first acquisition subunit is used for acquiring total row and column numbers of pixels of each local patch; The second acquisition subunit is used for acquiring a gray value of a single pixel in a single channel of each local patch; The calculation subunit is used for calculating a sum of absolute differences between each pixel and field pixel gray values in a single channel of each local patch based on the gray value of the single pixel in the single channel and the total row and column numbers of pixels of each local patch, and summing up to obtain a texture richness measure value; The splicing module comprises: The semantic feature acquisition unit is used for acquiring the semantic features, wherein the semantic features include high-level semantic features and average local semantic features; The adjustment unit is used for acquiring noise tokens corresponding to the noise features, and adjusting shapes of the noise tokens based on a shape of the high-level semantic features to make the shapes consistent; The high-low level fusion feature unit is used for splicing dimensions of the noise tokens, the high-level semantic features and the average local semantic features into a tensor corresponding to a preset value in a channel of the noise tokens to obtain high-low level fusion features; The linear tensor flattening unit is used for performing linear tensor flattening on the high-low level fusion features to obtain fusion features. 5.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-4 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 3.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 3.
Citation Information
Patent Citations
Generalized deeply-forged image detection method and system based on noise perception
CN118196865A
Document image tampering positioning method
CN118587411A