A method and system for constructing a synthetic image detection framework

By constructing a synthetic image detection framework based on visual transformer, using a variety of encoding information of the picture pairs for fusion training, solving the problem of sensitivity and data dependencies in the existing technology to generate models, and achieve efficient synthetic image recognition and reduced reduction The effect of training cost.

CN119169396BActive Publication Date: 2025-01-28BEIJING ACAD OF ARTIFICIAL INTELLLIGENCE

Patent Information

Application Number
CN202411667066.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-01-28
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

When identifying synthetic images in the prior art, discriminators are more sensitive to generative models. With the continuous advancement of generative models, the performance of existing discriminative models will continue to decline, and a large amount of data is required for training, which is difficult to solve at low cost. question.

Method used

Use the visual transformer structure to build a synthetic image detection framework. By obtaining pictures (real pictures and generating pictures), pre -processing and coding, extraction of high -exposure negatives, low -pass filter diagrams and dark channel diagrams, and original image codes Fusion, use Transformer encoding models and multi -layer perceptions for training to obtain the category of images.

Benefits of technology

This method can fully extract image features, reduce dependence on generating models, significantly increase model training speed, reduce the amount of data, and reduce training costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169396B_ABST
    Figure CN119169396B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for constructing a synthetic image detection framework, and belongs to the field of image recognition technology. The method includes: obtaining a certain number of image pairs as a training set; preprocessing each image in the training set to form a one-dimensional sequence and inputting it into the linear layer of the visual conversion model for encoding to obtain a sequence code; extracting the high-exposure negative, frequency domain low-pass filter image and dark channel image of each image in the training set for encoding to obtain an additional code; adding the original image code obtained after adding it to the sequence code and the position code is input into the transformer coding model for fusion, extracting global features and inputting them into a multi-layer perceptron for training, and obtaining the category to which each image belongs. The present application uses a visual transformer structure to process images, adds additional codes, and obtains global features for classification; in addition, an image-to-image generation method is used to obtain pairs of real images and generated images, which greatly improves the model training speed and reduces the dependence on the amount of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method and system for constructing a synthetic image detection framework. Background Art

[0002] In recent years, generative models have made great breakthroughs in the field of vision, especially the introduction of diffusion models, which makes it possible to generate high-quality images. In order to prevent synthetic images from affecting human society and production, it is extremely valuable to identify these images. However, there are relatively few studies on AI image identification, which can be generally divided into image-based methods and model-based methods. The former focuses on the classification of images and extracts features from images for identification; the latter studies the internal information when a specific model generates an image and relies on open source image generation models. Current research in this field has the following problems: (1) The discriminator is sensitive to the generative model. With the advent of more and more powerful generative models, the performance of existing discriminant models will continue to decline, and new solutions need to be given based on new models; (2) A large amount of data is required for training. For many paid models on the Internet, it is difficult to solve the problem in a low-cost way. Summary of the invention

[0003] In order to solve the problems existing in the prior art, the present invention provides the following technical solutions.

[0004] A first aspect of the present invention provides a method for constructing a synthetic image detection framework, comprising:

[0005] S101, obtaining a certain number of image pairs as a training set;

[0006] S102, preprocessing each image in the training set to form a one-dimensional sequence, and inputting the one-dimensional sequence into a linear layer of a visual conversion model for encoding to obtain a sequence code;

[0007] S103, respectively extracting the high-exposure negative, the frequency domain low-pass filter image, and the dark channel image of each image in the training set for encoding to obtain additional encoding;

[0008] S104, inputting the original image code obtained by adding the sequence code and the position code and the additional code into the transformer coding model for fusion, and extracting global features;

[0009] S105, inputting the global features into a multi-layer perceptron for training to obtain the category to which each picture belongs.

[0010] Furthermore, the picture pair includes a real picture and a generated picture corresponding to the real picture.

[0011] Furthermore, before obtaining a certain number of image pairs as training sets, the method includes: inputting a plurality of real images into a diffusion model respectively, and generating a plurality of generated images containing differences by adjusting the noise addition ratio of the diffusion model.

[0012] Furthermore, preprocessing each image in the training set to form a one-dimensional sequence includes: dividing each image in the training set into a plurality of blocks, and using the plurality of blocks as the one-dimensional sequence.

[0013] Furthermore, the original image code obtained by adding the sequence code and the position code and the additional code are input into the transformer coding model for fusion, and the hidden vector of the transformer coding model output corresponding to the additional code CLS position is extracted as the global feature.

[0014] Furthermore, inputting the global features into a multilayer perceptron for training to obtain the category to which each image belongs includes: inputting the global features into a multilayer perceptron, using cross entropy as a loss function for training, and obtaining the category probability of each image.

[0015] A second aspect of the present invention provides a synthetic image detection framework construction system, comprising:

[0016] An image pair acquisition module is used to acquire a certain number of image pairs as training sets;

[0017] A sequence encoding module is used to pre-process each image in the training set to form a one-dimensional sequence, and input the one-dimensional sequence into the linear layer of the visual conversion model for encoding to obtain a sequence code;

[0018] An additional coding module is used to extract the high-exposure negative, the frequency domain low-pass filter image and the dark channel image of each image in the training set for encoding to obtain additional coding;

[0019] A feature extraction module is used to input the original image code obtained by adding the sequence code and the position code and the additional code into the transformer coding model for fusion, so as to extract the global features;

[0020] The classification module is used to input the global features into a multi-layer perceptron for training to obtain the category to which each image belongs.

[0021] A third aspect of the present invention provides a memory storing a plurality of instructions, wherein the instructions are used to implement a method for constructing a synthetic image detection framework as described in the first aspect.

[0022] The fourth aspect of the present invention provides an electronic device, comprising a processor and a memory connected to the processor, the memory storing a plurality of instructions, the instructions being loaded and executed by the processor so that the processor can execute a method for constructing a synthetic image detection framework as described in the first aspect.

[0023] A fifth aspect of the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the method for constructing a synthetic image detection framework as described in the first aspect.

[0024] The beneficial effects of the present invention are as follows: a method and system for constructing a synthetic image detection framework provided by the present invention adopts a visual Transformer structure instead of a traditional convolutional neural network to process images, which can fully extract image features, and at the same time encode information such as image contrast, frequency domain information and dark channel and fuse them with the original image to obtain global features for classification; in addition, the present application adopts an image-to-image generation method to obtain pairs of real images and generated images, and by comparing the details of the real images and the generated images, the model training speed can be greatly improved, the dependence on the amount of data can be reduced, and the training cost can be significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a schematic diagram of the process of the synthetic image detection method of the present invention;

[0026] Figure 2 A schematic diagram of obtaining a generated image from a real image according to the present invention;

[0027] Figure 3 It is a functional structure diagram of the synthetic image detection system described in the present invention. DETAILED DESCRIPTION

[0028] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0029] The method provided by the present invention can be implemented in the following terminal environment, and the terminal may include one or more of the following components: a processor, a memory, and a display screen. The memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method described in the following embodiment.

[0030] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory.

[0031] The memory may include random access memory (RAM) or read-only memory (ROM). The memory may be used to store instructions, programs, codes, code sets or instructions.

[0032] The display screen is used to display the user interface of each application.

[0033] In addition, those skilled in the art can understand that the structure of the above terminal does not constitute a limitation on the terminal, and the terminal may include more or fewer components, or combine certain components, or arrange the components differently. For example, the terminal also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, and a power supply, which will not be described in detail here.

[0034] Embodiment 1

[0035] like Figure 1 As shown, an embodiment of the present invention provides a method for constructing a synthetic image detection framework, including:

[0036] S101, obtaining a certain number of picture pairs as training sets; the picture pairs include real pictures and generated pictures corresponding to the real pictures;

[0037] S102, preprocessing each image in the training set to form a one-dimensional sequence, and inputting the one-dimensional sequence into a linear layer of a visual conversion model for encoding to obtain a sequence code;

[0038] S103, respectively extracting the high-exposure negative, the frequency domain low-pass filter image, and the dark channel image of each image in the training set for encoding to obtain additional encoding;

[0039] S104, inputting the original image code obtained by adding the sequence code and the position code and the additional code into the transformer coding model for fusion, and extracting global features;

[0040] S105, inputting the global features into a multi-layer perceptron for training to obtain the category to which each picture belongs.

[0041] Specifically, before step S101, multiple real images are respectively input into the diffusion model, and multiple generated images with different differences are generated by adjusting the noise addition ratio of the diffusion model, such as Figure 2 As shown, a real image and a generated image corresponding to the real image are taken as an image pair; in step S102, if it is assumed that the resolution of each image in the training set is , this application is to set the resolution to Each picture is divided into multiple Blocks of size, total block, then The blocks are input as a one-dimensional sequence to the linear layer of the visual conversion model for encoding to obtain sequence coding; in step S103, the high-exposure negative film, frequency domain low-pass filter map and dark channel map of each picture in the training set are respectively proposed, and a multi-layer perceptron (MLP) is used to encode them to obtain additional coding, and the additional coding is used as additional information, that is, the hidden vector of the [CLS] position for fusion with the original image coding in step S104 in the transformer coding model. Through this step, the high-exposure negative film, frequency domain low-pass filter map and dark channel map of each picture are respectively encoded, and the splicing of the additional coding with the original image coding can realize the separation and aggregation of multiple types and scales of information for each picture at the image level; in step S104, the original image coding obtained by adding the sequence coding and the position coding and the additional coding are input into the transformer coding model for fusion, and the hidden vector of the transformer coding model output corresponding to the additional coding [CLS] position is extracted. As a global feature; in step S105, the global feature is input into a multi-layer perceptron (MLP), and the cross entropy is used as the loss function for training. The category probability corresponding to each image is calculated through the final softmax layer of the MLP. ,Right now ,in and is the learning parameter of the multilayer perceptron; when cross entropy is used as the loss function for training, , ,in is the category corresponding to the image, that is, whether the image is a generated image generated by the generative model, is the probability of belonging to this category output by the multilayer perceptron.

[0042] Embodiment 2

[0043] like Figure 3 As shown, another aspect of the present invention also includes a functional module architecture that is completely consistent with the aforementioned method flow, that is, an embodiment of the present invention also provides a synthetic image detection framework construction system, including:

[0044] The picture pair acquisition module 201 is used to acquire a certain number of picture pairs as a training set;

[0045] A sequence encoding module 202 is used to pre-process each image in the training set to form a one-dimensional sequence, and input the one-dimensional sequence into a linear layer of a visual conversion model for encoding to obtain a sequence code;

[0046] The additional coding module 203 is used to extract the high-exposure negative, the frequency domain low-pass filter image and the dark channel image of each image in the training set for coding to obtain additional coding;

[0047] A feature extraction module 204 is used to input the original image code obtained by adding the sequence code and the position code and the additional code into the transformer coding model for fusion, so as to extract the global feature;

[0048] The classification module 205 is used to input the global features into a multi-layer perceptron for training to obtain the category to which each picture belongs.

[0049] The system can be implemented through the synthetic image detection framework construction method provided in the above-mentioned embodiment 1. The specific implementation method can be found in the description of embodiment 1 and will not be repeated here.

[0050] The present invention also provides a memory storing a plurality of instructions, wherein the instructions are used to implement the method for constructing a synthetic image detection framework as described in the first embodiment.

[0051] The present invention also provides an electronic device, comprising a processor and a memory connected to the processor, wherein the memory stores a plurality of instructions, and the instructions can be loaded and executed by the processor so that the processor can execute the method for constructing a synthetic image detection framework as described in Example 1.

[0052] The present invention also provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the method for constructing a synthetic image detection framework as described in the first aspect.

[0053] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for constructing a synthetic image detection framework, characterized in that: include: S101, obtaining a certain number of image pairs as a training set; S102, preprocessing each image in the training set to form a one-dimensional sequence, and inputting the one-dimensional sequence into a linear layer of a visual conversion model for encoding to obtain a sequence code; S103, respectively extracting the high-exposure negative, the frequency domain low-pass filter image, and the dark channel image of each image in the training set for encoding to obtain additional encoding; S104, inputting the original image code obtained by adding the sequence code and the position code and the additional code into the transformer coding model for fusion, and extracting global features; S105, inputting the global features into a multi-layer perceptron for training to obtain the category to which each picture belongs.

2. A method for constructing a synthetic image detection framework as claimed in claim 1, characterized in that: The picture pair includes a real picture and a generated picture corresponding to the real picture.

3. A method for constructing a synthetic image detection framework as claimed in claim 2, characterized in that: Before obtaining a certain number of image pairs as training sets, the method includes: inputting a plurality of real images into a diffusion model respectively, and generating a plurality of generated images containing differences by adjusting the noise addition ratio of the diffusion model.

4. A method for constructing a synthetic image detection framework as claimed in claim 1, characterized in that: Preprocessing each picture in the training set to form a one-dimensional sequence includes: dividing each picture in the training set into a plurality of blocks, and using the plurality of blocks as the one-dimensional sequence.

5. A method for constructing a synthetic image detection framework as claimed in claim 1, characterized in that: The original image code obtained by adding the sequence code and the position code and the additional code are input into the transformer coding model for fusion, and the hidden vector of the transformer coding model output corresponding to the additional code CLS position is extracted as the global feature.

6. A method for constructing a synthetic image detection framework as claimed in claim 1, characterized in that: Inputting the global features into a multilayer perceptron for training to obtain the category to which each picture belongs includes: inputting the global features into a multilayer perceptron, using cross entropy as a loss function for training to obtain the category probability of each picture.

7. A synthetic image detection framework construction system, characterized in that: include: An image pair acquisition module is used to acquire a certain number of image pairs as training sets; A sequence encoding module is used to pre-process each image in the training set to form a one-dimensional sequence, and input the one-dimensional sequence into the linear layer of the visual conversion model for encoding to obtain a sequence code; An additional coding module is used to extract the high-exposure negative, the frequency domain low-pass filter image and the dark channel image of each image in the training set for encoding to obtain additional coding; A feature extraction module is used to input the original image code obtained by adding the sequence code and the position code and the additional code into the transformer coding model for fusion, so as to extract the global features; The classification module is used to input the global features into a multi-layer perceptron for training to obtain the category to which each image belongs.

8. A memory, characterized in that: A plurality of instructions are stored, and the instructions are used to implement the method for constructing a synthetic image detection framework as described in any one of claims 1 to 6.

9. An electronic device, characterized in that: It includes a processor and a memory connected to the processor, wherein the memory stores a plurality of instructions, and the instructions can be loaded and executed by the processor so that the processor can execute the method for constructing a synthetic image detection framework as described in any one of claims 1 to 6.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for constructing a synthetic image detection framework as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Image processing method and device

    CN115375909A

  • Image processing method combining contourlet change and Vision Transform

    CN117274628A

Cited By

  • Synthetic image detection method based on double-domain feature fusion enhancement

    CN122597863A