Universal AIGC image detection method and device based on edge enhancement, electronic equipment and storage medium
Through edge perception and artifact enhancement methods, high-frequency information feature maps are extracted for AIGC image detection, which solves the cross-domain generalization problem of different generative models and realizes unified and efficient detection of multiple generative models.
Patent Information
- Application Number
- CN202510774735.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-19
AI Technical Summary
Existing AIGC image detection methods have insufficient generalization capabilities when facing different generative models, cannot effectively distinguish generated images with more subtle frequency artifacts, and lack cross-domain adaptability.
Through edge perception and edge artifact enhancement, high-frequency information feature maps are extracted and input into the trained classification network for true and false probability prediction. The artifact features generated by the generative model during the upsampling process are used for unified detection.
It improves the generalization ability and cross-domain adaptability of AIGC image detection, significantly improves the detection sensitivity, makes it suitable for image detection of various generative models, and reduces computational overhead.
Smart Images

Figure CN120673149A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a general AIGC image detection method, device, electronic device and storage medium based on edge enhancement. Background Art
[0002] Artificial Intelligence Generative Generated Content Image Detection (AIGC) image detection is the process of accurately identifying and distinguishing AI-generated images from real images using computer algorithms and models. With the widespread application of AI technology in image generation, AIGC image detection has become a key step in ensuring the authenticity of image sources.
[0003] Currently, generative models such as Generative Adversarial Networks (GANs) and Diffusion Models (DMs) have made significant progress in the field of AIGC, with the images they generate being almost indistinguishable from real images. However, existing AIGC image detection methods typically target specific generative models, such as only GANs or only diffusion models, and lack a unified framework for simultaneously detecting images generated by multiple generative techniques. Differences in training data, upsampling strategies, and optimization objectives across different generative models lead to degraded cross-domain detector performance. Therefore, existing AIGC image detection methods suffer from insufficient generalization capabilities when faced with different generative models.
[0004] In addition, many studies have focused on extracting generalizable features based on the prior knowledge of generative models, especially the checkerboard artifacts caused by upsampling operations in the frequency domain. Frequency artifact detection is a key method for developing generalizable AIGC detectors. By distinguishing different frequency bands, the study masks different Fast Fourier Transform (FFT) frequency bands, namely low frequency, medium frequency and high frequency, and analyzes the frequency distribution in real and synthetic face images to determine authenticity. The amplitude and phase of the image after DFT transformation are combined to serve as the basis for judging true and false binary classification. Existing frequency domain analysis methods, such as Fast Fourier Transform (FFT) and Discrete Cosine Transform (DCT), can capture periodic artifacts, but are not applicable to some generated images where frequency artifacts are more subtle.
[0005] Therefore, how to improve the generalization ability and cross-domain adaptability of the AIGC image detection method is a technical problem that needs to be solved. Summary of the Invention
[0006] In view of this, the object of the present invention is to provide a general AIGC image detection method, device, electronic device, and storage medium based on edge enhancement, so as to improve the generalization capability and cross-domain adaptability of the AIGC image detection method. To achieve the above-mentioned object, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a general AIGC image detection method based on edge enhancement, the method comprising: performing edge perception on the AIGC image to obtain an edge map; performing edge artifact enhancement on the AIGC image using the edge map; wherein the edge artifact is a feature generated by upsampling processing in the process of generating the AIGC image; performing a local pixel difference extraction operation on the AIGC image after edge artifact enhancement to obtain a high-frequency information feature map; inputting the high-frequency information feature map into a trained classification network to perform category prediction to obtain the authenticity probability of the AIGC image.
[0008] In a second aspect, the present invention provides a general AIGC image detection device based on edge enhancement, comprising: an edge perception module, an edge artifact enhancement module, a pixel difference extraction module and a classification module; the edge perception module is used to perform edge perception on the AIGC image to obtain an edge map; the edge artifact enhancement module is used to perform edge artifact enhancement on the AIGC image using the edge map; the pixel difference extraction module is used to perform a local pixel difference extraction operation in the AIGC image after edge artifact enhancement to obtain a high-frequency information feature map; the classification module is used to input the high-frequency information feature map into a trained classification network to perform category prediction to obtain the authenticity probability of the AIGC image.
[0009] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the general AIGC image detection method based on edge enhancement described in the first aspect.
[0010] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the general AIGC image detection method based on edge enhancement described in the first aspect is implemented.
[0011] The present invention provides a general AIGC image detection method, device, electronic device, and storage medium based on edge enhancement. First, edge perception is performed on the AIGC image to obtain an edge map. Then, the edge map is enhanced for edge artifacts. Edge artifacts are features generated by upsampling during the generation of the AIGC image. Most generative models undergo upsampling operations during the image generation process. Therefore, the embodiments of the present invention can achieve the effect of unified detection of images generated by multiple generative models, solving the problem of cross-domain generalization. Furthermore, high-frequency information feature maps are extracted from the AIGC image after edge artifact enhancement through pixel difference analysis. This is equivalent to focusing on the generation traces of the edge area to enhance the feature expression ability, which can significantly improve the detection sensitivity. Finally, the extracted high-frequency information feature map is input into the classification network for classification to obtain the authenticity probability of the AIGC image. The entire process does not require prior knowledge of the generation model, does not rely on a specific generation model, and is only based on the artifact features generated by general upsampling. It is suitable for unknown generation technologies in open scenarios.
[0012] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 This is a schematic diagram of the image generation principles of the two existing generative models;
[0015] Figure 2 A schematic flow chart of a general AIGC image detection method based on edge enhancement provided by an embodiment of the present invention;
[0016] Figure 3 A schematic diagram showing the visualization of the edges of an interpolated pseudo image and a real image provided by an embodiment of the present invention;
[0017] Figure 4 A schematic diagram of the structure of an encoder provided in an embodiment of the present invention;
[0018] Figure 5 An example diagram of a general AIGC image detection process based on edge enhancement provided by an embodiment of the present invention;
[0019] Figure 6A visualization of the class activation map of features extracted from a classification network provided by an embodiment of the present invention;
[0020] Figure 7 A functional module diagram of a general AIGC image detection device based on edge enhancement provided by an embodiment of the present invention;
[0021] Figure 8 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0023] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but is merely intended to represent selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.
[0024] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0025] See Figure 1 , Figure 1 This is a schematic diagram of the image generation principles of the two existing generative models. Figure 1 (a) shows the image generation process of the GAN model architecture. Figure 1(b) in Figure 3 shows the image generation process of the DM model architecture. Taking the GAN model as an example, the image generation process mainly involves inputting random noise into the model and processing it through the convolutional layer. During this process, a conditional embedding vector is added. This vector is composed of a sketch, image attribute information (including depth), and image description information (including key points, semantic information, and hints). The model gradually generates an image based on the input conditional embedding vector.
[0026] Considering that the current methods for detecting AIGC images (i.e., determining whether an image is generated by AI) often perform poorly when faced with new generative models that have never been seen before. In addition, these detection methods also have difficulty maintaining stable detection results in different types of image data (i.e., different "domains") and have weak generalization capabilities. In order to improve the generalization ability of the detection method, the "data enhancement" technology can be used to increase the diversity of training data. For example, continue with Figure 1 Taking the GAN model in
[15] as an example, by adding JPEG compression and blurring during the training process, the detection model can learn more about image changes, thereby improving its generalization performance for GAN-generated images.
[0027] However, although JPEG compression and blur enhancement have some effect on the generated images of GAN models, they cannot effectively deal with more complex and more widely distributed generation models, such as Figure 1 The DM model in [1] has unique characteristics and more complex variations, making it difficult to handle with simple data augmentation strategies alone. Detection methods targeting images generated by DM models typically use a frozen diffusion model, introduce noise, and then denoise the input image. By analyzing the diffusion-specific reconstruction loss, these methods can effectively distinguish between real images and DM-generated images, fully leveraging the unique characteristics of the diffusion model generation process. However, considering the DM model in detection limits the generalization ability of GAN-generated image detection.
[0028] In addition to detection methods targeting DM or GAN models separately, joint detection methods for images generated by DM and GAN models have also emerged. These joint detection methods take into account that the process of generating high-resolution images, whether using GAN or DM models, typically involves multiple upsampling steps, which can produce specific artifacts in the image (such as unnatural edges and inconsistent textures). Detection can be achieved by mining artifact features. For example, by subtracting local pixel values from each other, the relationship between pixels is explored to detect possible inconsistencies in the generated image. Another example is that some methods focus on low-frequency blocks (primarily the overall structure and large-scale features of the image), resize them using bilinear interpolation, and apply a rich model filter (SRM) to highlight generation inconsistencies. Furthermore, images can be divided into texture-rich and texture-poor regions based on the intensity difference between pixels and surrounding pixels, and two-stream network fusion detection can be used. Although these existing joint detection methods all mine artifact features, the generalizability of this feature information is limited.
[0029] During the research process, the inventors found that the above-mentioned detection methods either have weak generalization capabilities or fail to effectively utilize artifact features, ignoring the more significant generation traces in high-frequency edge areas. As a result, the existing detection methods still face many challenges in generalizing AI-generated images.
[0030] In order to solve the above technical problems and improve the generalization ability and cross-domain adaptability of AIGC image detection method, please refer to Figure 2 , Figure 2 A schematic flow chart of a general AIGC image detection method based on edge enhancement provided by an embodiment of the present invention includes steps S201 to S204, which are described as follows:
[0031] S201: Perform edge perception on the AIGC image to obtain an edge map;
[0032] S202: Using the edge map to enhance edge artifacts of the AIGC image; wherein the edge artifacts are features generated by upsampling during the generation of the AIGC image;
[0033] S203: performing neighborhood pixel correlation statistics in the AIGC image after edge artifact enhancement and extracting a high-frequency information feature map;
[0034] S204: Input the high-frequency information feature map into the trained classification network to perform category prediction and obtain the authenticity probability of the AIGC image.
[0035] It can be understood that the true and false probability refers to the probability that the AIGC image is a true image and a false image.
[0036] To understand the technical principles of the detection method provided by the embodiment of the present invention, please refer to Figure 3 , Figure 3 A schematic diagram illustrating visualization of the edges of an interpolated pseudo image and a real image provided by an embodiment of the present invention.
[0037] exist Figure 3 In the image generated by AI, the difference in pixel distribution between the pixel blocks in the flat area and the pixel blocks in the edge area can be observed. The AI-generated image is upsampled. This operation is equivalent to interpolation of the pixel blocks in the flat area and the pixel blocks in the edge area. Comparing the interpolated pixel blocks in the flat area with the pixel blocks in the flat area in the real image, it can be found that the pixel distribution of the two is similar. However, comparing the interpolated pixel blocks in the edge area with the pixel blocks in the edge area in the real image, it can be found that there is a big difference in the pixel distribution of the two.
[0038] from Figure 3 It can be seen that the artifact features after interpolation are easier to identify in edge areas than in flat areas. This also shows that it is difficult for the image generated by the generative model to accurately replicate the pixel distribution of the real image in edge areas, such as textures and contours. Taking advantage of this feature, the detection method provided by the embodiment of the present invention first performs edge perception, extracts edge features, and then enhances the edge features. Edge artifacts are features generated by upsampling in the process of generating AIGC images, and most generative models undergo upsampling operations in the process of generating images. Therefore, the embodiment of the present invention can achieve the effect of unified detection of images generated by multiple generative models, solving the problem of cross-domain generalization. Furthermore, the embodiment of the present invention extracts high-frequency information feature maps in the AIGC image after edge artifact enhancement, which is equivalent to focusing on the generation traces of the edge area to enhance the feature expression ability, which can significantly improve the detection sensitivity.
[0039] In order to better understand the above detection process, the above steps S201 to S204 will be described in detail below with reference to relevant drawings.
[0040] In step S201, an AIGC image generated by any generative model may be obtained, and the generative model may include, but is not limited to, a GAN model and a DM model. Before edge sensing is performed on the AIGC image, the AIGC image may be preprocessed and converted into a format suitable for a classification network.
[0041] In the embodiment of the present invention, during preprocessing, the AIGC image can be resized to a fixed size (e.g., 256x256 pixels) and pixel values normalized to the range [0, 1] or standardized to a mean of 0 and a variance of 1. This ensures that the AIGC image meets the input requirements of subsequent models. Furthermore, data augmentation can be performed by performing operations such as random cropping and horizontal flipping on the image.
[0042] As previously analyzed, the generative model of the pre-processed AIGC image is prone to leaving traces when processing complex textures (such as animal hair and clothing wrinkles). To effectively capture these details, in step S201, edge perception can be performed on the AIGC image to obtain an edge map. In addition to using some existing edge detection methods, an embodiment of the present invention also provides an implementation method, including steps a1 to a2:
[0043] Step a1: Obtain the gradient of the AIGC image in the horizontal and vertical directions;
[0044] In an embodiment of the present invention, during the implementation of step a1, the convolution kernels in the horizontal and vertical directions may be determined first, and then the AIGC image may be convolved using the convolution kernels in the horizontal and vertical directions to obtain the gradients in the horizontal and vertical directions.
[0045] As an optional implementation, the convolution kernel can be, but is not limited to, a lightweight Sobel convolution kernel. The convolution kernel can be used to convolve each channel of the image to obtain the gradient. Assume that the AIGC image is denoted as Among them, B, C, H, and W represent the number of AIGC images processed simultaneously, the number of channels, the image width, and the image height, that is, the number of pixels in the horizontal and vertical directions of the image. Then the Sobel convolution kernel is used to calculate the horizontal gradient G x and the vertical gradient G y As shown in the formula:
[0046]
[0047] By using lightweight convolution kernels for gradient processing, the computational overhead is significantly reduced compared to complex frequency domain transformations or data augmentation strategies.
[0048] Step a2: Merge the gradients in the horizontal and vertical directions to obtain an edge map.
[0049] In the embodiment of the present invention, there are two ways to merge gradients. One is to take the absolute values of the gradients in the horizontal direction and the vertical direction and sum them up, as shown in the following example: Another form is: This is the edge map in the embodiment of the present invention.
[0050] In order to highlight edge artifact features and improve detection sensitivity, after obtaining the edge map, in step S202, the embodiment of the present invention uses the edge map to enhance the edge artifacts of the AIGC image. The edge artifacts are features generated by upsampling in the process of generating the AIGC image, which provides a data basis for the subsequent extraction of high-frequency edge features.
[0051] In the embodiment of the present invention, the implementation of step S202 includes steps b1 to b2, which are described as follows:
[0052] Step b1: obtaining a preset edge artifact weight;
[0053] Step b2: The edge artifact weight is used as the weight coefficient of the edge map and weighted fused with the AIGC image to complete edge artifact enhancement.
[0054] The above steps b1 to b2 can be expressed by the following formula:
[0055]
[0056] Among them, x enhanced is the image after edge artifact enhancement. λ is the edge artifact weight, which can be customized, for example, set to 1.0.
[0057] Next, the present invention uses the edge artifact enhanced image to extract high-frequency information features from the AIGC image, which are used in the model to perform true-false classification, see step S203.
[0058] In step S203, the embodiment of the present invention performs a local pixel difference extraction operation in the AIGC image after edge artifact enhancement to obtain a high-frequency information feature map. The implementation includes steps c1 to c4, which are described as follows:
[0059] Step c1: obtaining a sliding window of a preset size;
[0060] Step c2: traverse the pixels in the AIGC image according to the sliding window, and each time determine a reference pixel from multiple pixels located in the sliding window;
[0061] Step c3: Calculate the pixel difference between each pixel in the sliding window and the reference pixel;
[0062] Step c4: Replace the original pixel value with the difference value corresponding to each of the multiple pixels until all pixels are traversed to obtain a high-frequency information feature map.
[0063] In this embodiment of the present invention, the sliding window size is 2*2, which ensures that all pixels within the sliding window are adjacent to each other. Using the sliding window, an image can be divided into multiple pixel blocks. For example, if the width and height of an image are both 224 pixels and the sliding window side length is 2, it can be divided into 112 2*2 pixel blocks. Local pixel difference extraction is then performed within each pixel block to extract high-frequency information.
[0064] For ease of understanding, assume that the adjacent pixel values in the upper left, upper right, lower left, and lower right of the sliding window are W1, W2, W3, and W4, and select a reference pixel value from them as W j , which means W j It can be any one of W1, W2, W3, and W4. Calculate W1, W2, W3, and W4 respectively and W j The pixel difference between: ΔW1=W1-W j , ΔW2=W2-W j , ΔW3=W3-W j , ΔW4=W4-W j Then replace W1, W2, W3, W4 with ΔW1, ΔW2, ΔW3, ΔW4, and so on until the pixel values in the entire image are replaced, thereby obtaining a high-frequency information feature map.
[0065] Optionally, based on the above technical principles, a neighborhood pixel relationship filter can be designed, which is denoted as The high-frequency information feature map can be obtained by inputting the AIGC image after edge artifact enhancement into the filter, as shown in the following figure:
[0066] The above steps c1 to c4 are equivalent to amplifying the generation traces in the generated image, making it easier for the classification model to learn these features.
[0067] Next, the high-frequency information feature map obtained in step S203 can be input into a pre-trained classification network to perform authenticity prediction.
[0068] In the embodiment of the present invention, the classification network is composed of an encoder and a decoder. Figure 4 , Figure 4A schematic diagram of the structure of an encoder provided for an embodiment of the present invention. In this embodiment of the present invention, the encoder consists of an input stream, an intermediate stream, and an output stream, with multiple repeated model blocks in the middle. The input stream begins with a convolutional layer (Conv32, 3×3, stride 2) with 32 output channels, a 3×3 convolution kernel, and a stride of 2 for downsampling and feature extraction. This is followed by another convolutional layer (Conv64, 3×3), increasing the number of output channels to 64, with the convolution kernel size still 3×3 and a stride of 1 for further feature extraction. The intermediate stream contains multiple model blocks for deep feature extraction and learning complex data representations. Each model block may contain convolutional layers, activation functions, normalization layers, and possible residual connections to facilitate information flow and gradient propagation. At the end of the network, the output stream has two depthwise separable convolutional layers (stepConv1536, 3×3 and stepConv2048, 3×3) for further feature processing and preparing the final output. Through multiple convolutional layers and model blocks, the network can extract multi-level features from the input data. The reuse of model blocks makes the network design more modular. This network structure provides a powerful framework for processing classification tasks through deep feature extraction and modular design.
[0069] The model block design uses depthwise separable convolutions to reduce the amount of computation and the number of parameters, improving the model's computational efficiency. By stacking multiple depthwise separable convolutional layers, the model can extract features at different levels. This helps capture complex patterns and details in images. A convolutional layer with a stride of 2 is also used to downsample and reduce the size of the feature map. Finally, the convolutional layer is connected through residual connections, helping to alleviate the vanishing gradient problem in deep networks.
[0070] The depthwise separable convolutional layer uses multiple 1×1 convolutional layers, where the outputs of each 1×1 convolutional layer are concatenated. The primary function of the 1×1 convolutional layer is to adjust the number of channels without changing the spatial dimension. Compared to 3×3 or larger convolution kernels, 1×1 convolutional layers require significantly fewer parameters, thereby improving parameter efficiency. By using multiple 1×1 convolutional layers and concatenating their outputs, the model can learn feature representations for different channel combinations. This multi-channel feature fusion helps capture richer feature information.
[0071] The high-frequency information feature map obtained in the previous work is fed into the encoder for encoding, resulting in a high-dimensional feature vector. The decoder can be a binary classification layer, that is, a fully connected layer that outputs two categories. The two values output by the decoder are converted into probabilities using the Softmax activation function.
[0072] Optionally, in the process of training the classification network, the training process can be designed according to actual needs, including the selection of optimizer, learning rate setting, loss function, training parameters and monitoring strategy. For example, the AdamW optimizer can be used, the initial learning rate can be set to 2e-3, the weight decay can be set to 1e-4, and the cross entropy loss can be used. To train the model, the final loss can be expressed as Where y is the label of whether the image is AI generated, D θ Represents the encoder, θ represents the weight parameters learned by the encoder, Linear represents the decoder, and F represents the high-frequency information feature map. Monitoring strategies include setting training batches (for example, 32 images per batch), the number of iterations (for example, 50), and early stopping strategies (for example, terminating training when the validation set loss no longer decreases) to ensure smooth training. Additionally, the validation set's epoch-by-epoch accuracy (Acc) and average precision (AP) can be monitored.
[0073] It can be understood that after the high-frequency information features obtained in step S203 are input into the classification network, the encoder encodes the high-frequency information features into a high-dimensional feature vector, and then inputs the high-dimensional feature vector into the decoder for classification, and outputs the probability that the AIGC image is a real picture and a generated image.
[0074] To understand the above detection process and results, please refer to Figure 5 and Figure 6 , Figure 5 This is an example diagram of a general AIGC image detection process based on edge enhancement provided by an embodiment of the present invention. Figure 6 A visualization diagram of the Class Activation Mapping (CAM) of features extracted from a classification network provided by an embodiment of the present invention.
[0075] exist Figure 5 In the process, the original image can first be edge-perceived to obtain an edge map, and then the edge map and the original image are merged to enhance the edge artifact features to obtain an edge-enhanced image. High-frequency information features are then extracted from the image and input into the encoder in the classification network. The encoder encodes the high-frequency information features into a high-dimensional feature vector and inputs it into the decoder. The decoder performs classification processing and outputs the probability that the original image is real or generated.
[0076] from Figure 6 It can be seen that the classification network provided by the embodiment of the present invention mainly focuses on the edges of objects with complex textures, such as animal fur, clothing wrinkles, outdoor trees, grass and rocks, indicating that the classification network can effectively learn and utilize the artifact features introduced by sampling interpolation, especially in edge areas with large pixel intensity differences.
[0077] In summary, the general AIGC image detection method based on edge enhancement provided by the embodiment of the present invention has the following advantages:
[0078] First, the embodiments of the present invention take into account that generative models often perform upsampling operations when generating images. This makes it difficult for edge regions, such as textures and contours, to accurately replicate the pixel distribution of the real image, leaving obvious artifacts of generation. Leveraging this characteristic, the present method utilizes edge perception to highlight edge artifacts, enhancing feature representation and significantly improving detection sensitivity.
[0079] Secondly, the embodiment of the present invention performs authenticity detection by utilizing the artifact features that are prevalent in the upsampling process. Since all generative models introduce artifact features in the process of generating images, the embodiment of the present invention realizes unified detection of multiple generative models, including multiple derived unknown models based on GAN architecture and diffusion model architecture, thereby solving the problem of cross-domain generalization.
[0080] In addition, the embodiment of the present invention is highly interpretable. CAM visualization can show that model decisions mainly rely on generation traces in edge areas, such as areas with rich texture details such as animal hair and clothing wrinkles, verifying the theoretical motivation of the embodiment of the present invention. In addition, lightweight convolution kernel preprocessing is used in the implementation of the embodiment of the present invention, which significantly reduces computational overhead compared to complex frequency domain transformations or data enhancement strategies, making it suitable for large-scale deployment. At the same time, the embodiment of the present invention does not require prior knowledge of the generation model, does not rely on a specific generation model, and is only based on artifact features generated by universal upsampling, making it suitable for unknown generation technologies in open scenarios.
[0081] In order to execute the corresponding steps in the above embodiments and various possible methods, the following provides an implementation method of a general AIGC image detection device based on edge enhancement, please refer to Figure 7 , Figure 7 This is a functional module diagram of a general AIGC image detection device based on edge enhancement provided by an embodiment of the present invention. It should be noted that the basic principles and technical effects of the general AIGC image detection device based on edge enhancement provided by this embodiment are the same as those of the above-mentioned embodiments. For the sake of simplicity, any parts not mentioned in this embodiment can be referred to the corresponding contents of the above-mentioned embodiments. The general AIGC image detection device based on edge enhancement 70 includes: an edge perception module 701, an edge artifact enhancement module 702, a pixel difference extraction module 703, and a classification module 704;
[0082] The edge perception module 701 is used to perform edge perception on the AIGC image to obtain an edge map;
[0083] The edge artifact enhancement module 702 is used to enhance the edge artifacts of the AIGC image using the edge map;
[0084] A pixel difference extraction module 703 is used to perform a local pixel difference extraction operation in the AIGC image after edge artifact enhancement to obtain a high-frequency information feature map;
[0085] The classification module 704 is used to input the high-frequency information feature map into the trained classification network to perform category prediction and obtain the authenticity probability of the AIGC image.
[0086] It is understandable that the edge perception module 701, the edge artifact enhancement module 702, the pixel difference extraction module 703 and the classification module 704 can be executed in a coordinated manner. Figure 2 Each step in the process is performed to achieve the corresponding technical effects.
[0087] It should be noted that the basic principles and technical effects of the general AIGC image detection device 70 based on edge enhancement provided in this embodiment are the same as those in the above-mentioned embodiments. For the sake of brief description, for the parts not mentioned in the general AIGC image detection device 70 based on edge enhancement in the embodiment of the present invention, please refer to the corresponding content in the above-mentioned embodiments.
[0088] Optionally, the above modules can be stored in the form of software or firmware. Figure 8 The memory 801 shown in FIG. 80 is stored in the operating system (OS) of the electronic device 80 and can be used by Figure 8 Meanwhile, the data, program codes, etc. required to execute the above modules may be stored in the memory 801.
[0089] See Figure 8 , Figure 8 This is a block diagram of the structure of an electronic device provided in an embodiment of the present invention. The device includes a memory 801, a processor 802, and a communication interface 803. The memory 801, processor 802, and communication interface 803 are electrically connected to each other, directly or indirectly, to enable data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.
[0090] Optionally, the bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0091] In the embodiment of the present invention, the processor 802 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiment of the present invention. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in the memory 801, and the processor 802 reads the program instructions in the memory 801 and performs the steps of the above method in combination with its hardware.
[0092] In an embodiment of the present invention, the memory 801 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or a volatile memory (Volatile Memory), such as RAM. The memory may also be any other medium that can be used to carry or store the desired program executable code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in an embodiment of the present invention may also be a circuit or any other device that can implement a storage function, for storing instructions and / or data.
[0093] The memory 801 can be used to store software programs and modules, such as the instructions / modules of the general AIGC image detection device 70 based on edge enhancement provided in an embodiment of the present invention, which can be stored in the memory 801 in the form of software or firmware (Firmware) or in the operating system (OS) of the electronic device 80. The processor 802 executes the software programs and modules stored in the memory 801 to perform various functional applications and data processing. The communication interface 803 can be used for signaling or data communication with other node devices.
[0094] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0095] I understand. Figure 8 The structure shown is for illustration only. The electronic device 80 may also include Figure 8 More or fewer components than shown, or with Figure 8 Different configurations shown. Figure 8The components shown may be implemented in hardware, software, or a combination thereof.
[0096] Based on the above embodiments, the present application also provides a storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the general AIGC image detection method based on edge enhancement provided in the above embodiments.
[0097] Based on the above embodiments, an embodiment of the present invention further provides a computer program. When the computer program is run on a computer, the computer executes the general AIGC image detection method based on edge enhancement provided in the above embodiments.
[0098] Based on the above embodiments, an embodiment of the present invention further provides a chip, which is used to read a computer program stored in a memory and to execute the general AIGC image detection method based on edge enhancement provided in the above embodiments.
[0099] An embodiment of the present invention further provides a computer program product, comprising instructions, which, when executed on a computer, enables the computer to execute the general AIGC image detection method based on edge enhancement provided in the above embodiment.
[0100] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0103] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A general AIGC image detection method based on edge enhancement, characterized in that: The method comprises: Perform edge perception on the AIGC image to obtain an edge map; Using the edge map to enhance edge artifacts on the AIGC image; wherein the edge artifacts are features generated by upsampling during the generation of the AIGC image; Performing a local pixel difference extraction operation on the AIGC image after edge artifact enhancement to obtain a high-frequency information feature map; The high-frequency information feature map is input into the trained classification network to perform category prediction to obtain the authenticity probability of the AIGC image.
2. The general AIGC image detection method based on edge enhancement according to claim 1, characterized in that: Perform edge perception on the AIGC image to obtain an edge map, including: Obtaining the gradients of the AIGC image in the horizontal and vertical directions; The gradients in the horizontal direction and the vertical direction are combined to obtain the edge map.
3. The general AIGC image detection method based on edge enhancement according to claim 2, characterized in that: Obtaining the gradients of the AIGC image in the horizontal direction and the vertical direction, including: Determine the convolution kernels in the horizontal and vertical directions; The AIGC image is convolved using the respective convolution kernels in the horizontal direction and the vertical direction to obtain gradients in the horizontal direction and the vertical direction.
4. The general AIGC image detection method based on edge enhancement according to claim 1, characterized in that: Performing edge artifact enhancement on the AIGC image using the edge map includes: Get the preset edge artifact weight; The edge artifact weight is used as a weighted coefficient of the edge map and weighted fused with the AIGC image to complete edge artifact enhancement.
5. The general AIGC image detection method based on edge enhancement according to claim 1, characterized in that: Performing neighborhood pixel correlation analysis in the AIGC image after edge artifact enhancement and extracting a high-frequency information feature map includes: Get a sliding window of preset size; Traversing pixels in the AIGC image according to the sliding window, each time determining a reference pixel from a plurality of pixels located in the sliding window; Calculating a pixel difference between each pixel in the sliding window and the reference pixel; The original pixel values are replaced by the difference values corresponding to the multiple pixels until all pixels are traversed to obtain the high-frequency information feature map.
6. The general AIGC image detection method based on edge enhancement according to claim 1, characterized in that: Inputting the high-frequency information feature map into the trained classification network to perform category prediction to obtain the authenticity probability of the AIGC image, including: The high-frequency information features are input into the encoder of the classification network to obtain a high-dimensional feature vector, and then the high-dimensional feature vector is input into the decoder of the classification network for classification to obtain the true or false probability.
7. The general AIGC image detection method based on edge enhancement according to any one of claims 1 to 6, characterized in that: Before performing edge perception on the AIGC image to obtain the edge map, the method further includes: The AIGC image is preprocessed and converted into a format suitable for the classification network.
8. A general AIGC image detection device based on edge enhancement, characterized in that: include: Edge perception module, edge artifact enhancement module, pixel difference extraction module and classification module; The edge perception module is used to perform edge perception on the AIGC image to obtain an edge map; The edge artifact enhancement module is configured to perform edge artifact enhancement on the AIGC image using the edge map; The pixel difference extraction module is used to perform a local pixel difference extraction operation in the AIGC image after edge artifact enhancement to obtain a high-frequency information feature map; The classification module is used to input the high-frequency information feature map into the trained classification network to perform category prediction and obtain the authenticity probability of the AIGC image.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the general AIGC image detection method based on edge enhancement according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the universal AIGC image detection method based on edge enhancement according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Multi-task edge enhanced image forgery detection method and device
CN117649581A
Image detection method and device
CN118314357A
Neural network-based forgery detection method and system
CN119339222A
AIGC image detection method and system based on deep fusion network
CN119723283A
Cited By
Intelligent generated image detection method based on multi-granularity artifact feature fusion
CN121147726A