Generative artificial intelligence generated image detection method, system, device and medium
By inserting the adapter of GAN and DM branches into the pretrained image encoder, and extracting and fusing image representations, the problem of difficulty in detecting GAN and DM generated images simultaneously is solved in the prior art, and an efficient and generalized image generation detection effect is achieved.
Patent Information
- Application Number
- CN202510036467.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2045-01-09
AI Technical Summary
The existing generated image detection methods are difficult to efficiently detect generated images based on GAN and DM at the same time, especially when facing another type of generated images, the detection effect is reduced and cannot meet the detection needs in real scenarios.
The detection model is constructed, including pretrained image encoder and classifier, and two sets of independent adapters inserted in the pretrained image encoder, namely the GAN branch and the DM branch. Image characterization is extracted by these adapters and fused it into the classifier to output the detection results.
The ability to detect two main generated images based on GAN and DM is realized, with high generalization and strong practicality, and the average identification accuracy can reach more than 90%.
Smart Images

Figure CN119444750B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of generated image detection technology, and in particular to a generative artificial intelligence generated image detection method, system, device and medium. Background Art
[0002] Generative AI images refer to a type of images that are artificially synthesized using artificial intelligence technology. With the continuous development of generative technology, today's generated images have the characteristics of controllable content, realistic visual effects, and low generation threshold. Malicious abuse of generative technology may cause a series of serious social security problems. Therefore, how to accurately detect such generated images is an urgent problem to be solved in the current field of visual content security.
[0003] Thanks to the rich prior knowledge of real images, past studies have shown that models that have been pre-trained on real images can be effectively used for generated image detection. However, such models often focus too much on the global semantic information of the entire image and cannot fully explore the subtle artifacts in the local area of the generated image, resulting in the detection effect still needs to be improved. In addition, the currently widely circulated generated images can be mainly divided into two categories, namely, images generated based on the Generative Adversarial Network (GAN) and images generated based on the Diffusion Model (DM). Existing generated image detection methods can often only perform detailed analysis and detection on one of the two, and the detection effect is greatly reduced when facing the other type of generated images, which cannot meet the detection needs in real scenarios.
[0004] In view of this, the present invention is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide a generative artificial intelligence generated image detection method, system, device and medium, which can simultaneously detect two main types of generated images based on GAN and DM, with high generalization, strong practicality and high identification accuracy.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] A generative artificial intelligence generated image detection method, comprising:
[0008] A detection model is constructed, including: a pre-trained image encoder and a classifier, and two sets of independent adapters inserted in the pre-trained image encoder, the two sets of adapters are called GAN branches and DM branches respectively; each branch independently cooperates with the pre-trained image encoder to extract the image representation of the corresponding branch, the pre-trained image encoder includes several processing stages connected in series, the number of adapters in each branch is the same as the number of processing stages, and they are connected one-to-one; wherein GAN is a generative adversarial network, and DM is a diffusion model;
[0009] During the detection process, the first processing stage of the pre-trained image encoder outputs the image features of the image to be detected and enters the corresponding adapter of a branch. The adapter uses a block token decentralization strategy to highlight the generation traces in the image features. The output of the adapter is fused with the output of the first processing stage as the input of the next processing stage, and the process is repeated continuously. Finally, the outputs of all adapters are combined as the image representation of the corresponding branch; the image representations of the two branches are fused and input into the classifier to output the detection result.
[0010] A generative artificial intelligence generated image detection system, the system comprising: a detection model;
[0011] The detection model comprises: a pre-trained image encoder and a classifier, and two sets of independent adapters inserted in the pre-trained image encoder, the two sets of adapters are respectively called GAN branches and DM branches; each branch independently cooperates with the pre-trained image encoder to extract the image representation of the corresponding branch, the pre-trained image encoder comprises a number of processing stages connected in series, the number of adapters in each branch is the same as the number of processing stages, and they are connected one-to-one; wherein GAN is a generative adversarial network, and DM is a diffusion model;
[0012] Generative image detection is implemented based on the detection model. During the detection process, the first processing stage of the pre-trained image encoder outputs the image features of the image to be detected and enters the corresponding adapter of a branch. The adapter adopts a block token decentralization strategy to highlight the generation traces in the image features. The output of the adapter is fused with the output of the first processing stage as the input of the next processing stage, and the process is repeated continuously. Finally, the outputs of all adapters are integrated as the image representation of the corresponding branch. The image representations of the two branches are fused and input into the classifier to output the detection result.
[0013] A processing device, comprising: one or more processors; a memory for storing one or more programs;
[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0015] A readable storage medium stores a computer program, which implements the above method when the computer program is executed by a processor.
[0016] It can be seen from the technical solution provided by the present invention that fine-tuning based on the pre-trained image encoder consumes less training resources and is plug-and-play; the inserted adapter can adaptively highlight the generation traces in the image features and mine the local detail artifacts of the generated image, with high flexibility; based on the solution of the present invention, the two main types of generated images mentioned above can be detected at the same time, with high generalization and practicality, and the average identification accuracy can reach more than 90%. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0018] Figure 1 A flow chart of a generative artificial intelligence generated image detection method provided by an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of the workflow of the pre-trained image encoder and adapter provided in an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of the internal structure of an adapter provided by an embodiment of the present invention;
[0021] Figure 4 A schematic diagram of an alternate training optimization solution provided by an embodiment of the present invention;
[0022] Figure 5 A schematic diagram of a processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
[0024] First, the terms that may be used in this article are explained as follows:
[0025] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.
[0026] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.
[0027] Unless otherwise specified or limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this article can be understood according to specific circumstances.
[0028] The following is a detailed description of a generative artificial intelligence generated image detection method, system, device and medium provided by the present invention. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field. If the specific conditions are not indicated in the embodiments of the present invention, they are carried out according to the conventional conditions in the field or the conditions recommended by the manufacturer. The reagents or instruments used in the embodiments of the present invention that do not indicate the manufacturer are all conventional products that can be purchased commercially.
[0029] Embodiment 1
[0030] The embodiment of the present invention provides a generative artificial intelligence generated image detection method, such as Figure 1 As shown, it mainly includes the following steps:
[0031] Step 1: Build a detection model.
[0032] In an embodiment of the present invention, the constructed detection model mainly includes: a pre-trained image encoder and a classifier, and two sets of independent adapters inserted in the pre-trained image encoder, the two sets of adapters are respectively called GAN (generative adversarial network) branches and DM (diffusion model) branches; each branch independently cooperates and interacts with the pre-trained image encoder to extract the image representation of the corresponding branch, the pre-trained image encoder includes several processing stages connected in series, the number of adapters in each branch is the same as the number of processing stages, and they are connected one-to-one.
[0033] Step 2: Generate image detection process based on the detection model.
[0034] In an embodiment of the present invention, during the detection process, the first processing stage of the pre-trained image encoder outputs the image features of the image to be detected and enters the corresponding adapter of a branch. The adapter adopts a block token decentralization strategy to highlight the generation traces in the image features. The output of the adapter is fused with the output of the first processing stage and used as the input of the next processing stage. This is repeated continuously, and finally the outputs of all adapters are combined as the image representation of the corresponding branch; the image representations of the two branches are fused and input into the classifier to output the detection result.
[0035] Preferably, the adapter adopts a block token decentralization strategy to highlight the generation traces in the image features, including: the image features input into the adapter are in the form of tokens, including: multiple block tokens and a category token; wherein the category token contains global information of the entire image, and each block token contains local information of the corresponding image block; through the block token decentralization strategy, the weights of the block tokens corresponding to the edge contour and the background area are increased to obtain features that highlight the generation traces in the image features.
[0036] Preferably, the method of increasing the weights of the block tokens corresponding to the edge contour and the background area to obtain the characteristics of the generation traces in the highlighted image features includes: respectively calculating the attention scores of the category token and each block token; respectively performing a negation operation on each attention score, and using a normalized exponential function to constrain the negation operation result to a probability distribution to obtain the weight corresponding to each block token; using the weights to perform weighted calculations on the corresponding block tokens, and inputting all weighted block tokens into a convolutional network for analysis and processing, combining the output of the convolutional network with the category token to obtain the characteristics of the generation traces in the highlighted image features.
[0037] The above scheme provided by the embodiment of the present invention can be used to detect generative artificial intelligence images. In terms of implementation, it can be deployed on the backend servers of various video websites and online forums, etc., to effectively detect, mark and intercept generated images before publishing, and eliminate possible negative effects. At the same time, it can also be applied to security supervision departments to analyze and collect evidence of suspicious images spread on the network platform to maintain network security. Of course, this is only an example, and the specific application direction can be selected by the user according to the actual situation.
[0038] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the method provided by the embodiment of the present invention is described in detail with reference to specific embodiments below.
[0039] 1. Generate image detection scheme.
[0040] In an embodiment of the present invention, a generative artificial intelligence image detection method is proposed, which guides the network to focus on artifacts in local detail areas through a block token decentralization method. At the model structure level, an adapter structure based on block token decentralization is proposed. In order to be able to detect two main types of generated images based on GAN and DM, the adapter is provided with two groups, one group is called GAN branch, and the other group is called DM branch. For an input image, the GAN branch and the DM branch independently cooperate with the pre-trained image encoder to extract the image representation of the GAN branch and the image representation of the DM branch respectively. The two branches, the pre-trained image encoder and the classifier together form a complete detection model (generated image detection model). The image representations of the two branches are added and input into the classifier to obtain the final generated image detection result. Considering that the principles of the cooperation and interaction between the two branches and the pre-trained image encoder are exactly the same, and the structures of all adapters are exactly the same, therefore, a single branch is taken as an example for introduction below. The single branch can be any branch of the GAN branch representation and the DM branch representation.
[0041] In an embodiment of the present invention, the pre-trained image encoder can be selected as needed. For example, the image encoder part of a pre-trained CLIP (Contrastive Language Image Pre-training) model can be selected as a research object, and its parameters can be frozen as the pre-trained image encoder in the present invention. Figure 2 The pre-trained image encoder contains four cascaded stages, each of which has a parameter-trainable adapter inserted for fine-tuning. For the output of each stage, the corresponding adapter will further analyze and fine-tune it, and then the output of the corresponding stage and the adapter output will be weighted and fused as the input features of the next stage. Finally, all adapters (for example, Figure 2 The output features of the four adapters in the image are fused to obtain the image representation analyzed by the model, that is, the image representation of a single branch.
[0042] like Figure 3 The following is a schematic diagram of the internal structure of the adapter. The input features of the adapter are stored in the form of tokens, which can be divided into N (i.e. the number of image blocks) block tokens and one category token. Specifically, the block tokens represent the local information of each corresponding image block in the original image, while the global information of the entire image is aggregated into the category tokens for unified representation.
[0043] In an embodiment of the present invention, the specific principle of storing image information in the form of tokens can refer to conventional technologies. For example, the image is pre-divided into several image blocks and special tags (called category tags) are added. These image blocks and category tag features are the corresponding block tokens and category tokens.
[0044] In the original pre-trained image encoder, the model tends to only focus on the block token information corresponding to a few local areas, such as the area occupied by the main object in the image. However, traces of image generation may also appear in other neglected areas, such as object edge contours, image background and other areas. Therefore, the present invention proposes a block token decentralization strategy to strengthen the attention to these areas. Specifically, the attention mechanism is first used to calculate the attention scores of the category token and each block token respectively. That is, ;in, is the i-th (i=1,..,N) block token, is the attention score of the ith block token, is the attention mechanism. Generally speaking, neglected edge and background areas tend to have lower attention scores. The attention score is then inverted and constrained to a probability distribution using the Softmax function (normalized exponential function) to obtain the block weight of the i-th block token. That is, a higher weight is assigned to the block tokens with lower attention scores. The weights are then used to multiply the original block tokens and input into the convolutional network for analysis and processing. Finally, they are recombined with the original category tokens as the output of the adapter.
[0045] The two branches use the same process to obtain the image representation of the corresponding branch, and obtain the final image representation through feature fusion (i.e., element-by-element addition). The detection result is then obtained through the classifier. The detection result is used to represent the probability of belonging to the generated image and the non-generated image. Specifically, the classifier can output a score between 0 and 1. The closer the score is to 1, the greater the probability of belonging to the generated image category, and the closer to 0, the greater the probability of belonging to the non-generated image category.
[0046] 2. Alternating training optimization plan.
[0047] In order to ensure the performance of the detection model, the embodiment of the present invention provides an alternating training optimization scheme (alternating training strategy) to guide the network to simultaneously mine the detection clues of GAN and DM generated images.
[0048] like Figure 4 As shown in the figure, two stages of the alternating training optimization scheme are shown. The upper part is the GAN branch optimization stage, and the lower part is the DM branch optimization stage. (1) In the GAN branch optimization stage, real images and GAN-generated images are input for training, while the parameters of the DM branch are frozen, the model parameters of the GAN branch and the classifier are optimized, and the GAN branch is promoted to learn the detection information related to the GAN image; (2) In the DM branch optimization stage, real images and DM-generated images are input for training, while the parameters of the GAN branch are frozen, and the model parameters of the DM branch and the classifier are optimized. The DM branch is promoted to learn the detection information related to the DM image. The two stages are alternately optimized, and finally a detection model that can detect both GAN and DM generated images is obtained.
[0049] The training loss Loss can be calculated by the cross entropy loss function CrossEntropy, expressed as:
[0050] ;
[0051] Among them, y is the classification score (detection result) output by the allocator, and label is the label information of the image.
[0052] above Figure 2 and Figure 4 In the example, the snowflake symbol indicates frozen parameters, and the flame symbol indicates trainable parameters. Figure 4 The meaning is similar in the text; in addition, the input image content in the figure is only an example and does not constitute a limitation. In actual applications, users can select the required image as needed and input it into the above-mentioned detection model to generate image detection.
[0053] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0054] Embodiment 2
[0055] The present invention also provides a generative artificial intelligence generated image detection system, which mainly includes: a detection model;
[0056] The detection model comprises: a pre-trained image encoder and a classifier, and two sets of independent adapters inserted in the pre-trained image encoder, the two sets of adapters are respectively called GAN branches and DM branches; each branch independently cooperates with the pre-trained image encoder to extract the image representation of the corresponding branch, the pre-trained image encoder comprises a number of processing stages connected in series, the number of adapters in each branch is the same as the number of processing stages, and they are connected one-to-one; wherein GAN is a generative adversarial network, and DM is a diffusion model;
[0057] Generative image detection is implemented based on the detection model. During the detection process, the first processing stage of the pre-trained image encoder outputs the image features of the image to be detected and enters the corresponding adapter of a branch. The adapter adopts a block token decentralization strategy to highlight the generation traces in the image features. The output of the adapter is fused with the output of the first processing stage as the input of the next processing stage, and the process is repeated continuously. Finally, the outputs of all adapters are integrated as the image representation of the corresponding branch. The image representations of the two branches are fused and input into the classifier to output the detection result.
[0058] Preferably, the system also includes: a model training unit, which adopts an alternating training strategy to train the GAN branch and the DM branch, and the alternating training strategy includes: a GAN branch optimization stage and a DM branch optimization stage; wherein: in the GAN branch optimization stage, real images and GAN-generated images are input for training, and the parameters of the DM branch are frozen, and the model parameters of the GAN branch and the classifier are optimized; in the DM branch optimization stage, real images and DM-generated images are input for training, and the parameters of the GAN branch are frozen, and the model parameters of the DM branch and the classifier are optimized.
[0059] Preferably, the adapter adopts a block token decentralization strategy to highlight the generation traces in the image features, including: the image features input into the adapter are in the form of tokens, including: multiple block tokens and a category token; wherein the category token contains global information of the entire image, and each block token contains local information of the corresponding image block; through the block token decentralization strategy, the weights of the block tokens corresponding to the edge contour and the background area are increased to obtain features that highlight the generation traces in the image features.
[0060] Preferably, the method of increasing the weights of the block tokens corresponding to the edge contour and the background area to obtain the characteristics of the generation traces in the highlighted image features includes: respectively calculating the attention scores of the category token and each block token; respectively performing a negation operation on each attention score, and using a normalized exponential function to constrain the negation operation result to a probability distribution to obtain the weight corresponding to each block token; using the weights to perform weighted calculations on the corresponding block tokens, and inputting all weighted block tokens into a convolutional network for analysis and processing, combining the output of the convolutional network with the category token to obtain the characteristics of the generation traces in the highlighted image features.
[0061] The above-mentioned system provided by the embodiment of the present invention is mainly used to implement the method provided by the aforementioned embodiment. Therefore, the system may also be configured with a model building unit and an image detection unit to correspondingly execute steps 1 and 2 in the aforementioned embodiment. Considering that a detailed introduction has been made in the aforementioned embodiment, they will not be repeated here.
[0062] Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0063] Embodiment 3
[0064] The present invention also provides a processing device, such as Figure 5 As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the methods provided in the aforementioned embodiments.
[0065] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.
[0066] In the embodiment of the present invention, the specific types of the memory, input device and output device are not limited; for example:
[0067] The input device may be a touch screen, an image acquisition device, a physical button or a mouse, etc.;
[0068] The output device may be a display terminal;
[0069] The memory may be a random access memory (RAM) or a non-volatile memory such as a disk storage.
[0070] Embodiment 4
[0071] The present invention also provides a readable storage medium storing a computer program, which implements the method provided in the above embodiment when the computer program is executed by a processor.
[0072] In the embodiment of the present invention, the readable storage medium as a computer-readable storage medium can be set in the aforementioned processing device, for example, as a memory in the processing device. In addition, the readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk, etc., which can store program codes.
[0073] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.
Claims
1. A generative artificial intelligence generated image detection method, characterized in that: include: A detection model is constructed, including: a pre-trained image encoder and a classifier, and two sets of independent adapters inserted in the pre-trained image encoder, the two sets of adapters are called GAN branches and DM branches respectively; each branch independently cooperates with the pre-trained image encoder to extract the image representation of the corresponding branch, the pre-trained image encoder includes several processing stages connected in series, the number of adapters in each branch is the same as the number of processing stages, and they are connected one-to-one; wherein GAN is a generative adversarial network, and DM is a diffusion model; During the detection process, the first processing stage of the pre-trained image encoder outputs the image features of the image to be detected and enters the corresponding adapter of a branch. The adapter uses a block token decentralization strategy to highlight the generation traces in the image features. The output of the adapter is fused with the output of the first processing stage as the input of the next processing stage, and the process is repeated continuously. Finally, the output of all adapters is combined as the image representation of the corresponding branch. The image representations of the two branches are fused and input into the classifier to output the detection result. Among them, the GAN branch and the DM branch adopt an alternating training strategy, including: a GAN branch optimization stage and a DM branch optimization stage; in the GAN branch optimization stage, real images and GAN-generated images are input for training, and the parameters of the DM branch are frozen at the same time, and the model parameters of the GAN branch and the classifier are optimized; in the DM branch optimization stage, real images and DM-generated images are input for training, and the parameters of the GAN branch are frozen at the same time, and the model parameters of the DM branch and the classifier are optimized.
2. The generative artificial intelligence generated image detection method according to claim 1, characterized in that: The adapter adopts a block token decentralization strategy to highlight the generation traces in the image features, including: The image features input to the adapter are in the form of tokens, including: multiple block tokens and a category token; wherein the category token contains global information of the entire image, and each block token contains local information of the corresponding image block; Through the block token decentralization strategy, the weights of the block tokens corresponding to the edge contour and background area are increased to obtain features that highlight the generation traces in the image features.
3. The generative artificial intelligence generated image detection method according to claim 2, characterized in that: The step of increasing the weights of the block tokens corresponding to the edge contour and the background area to obtain the features of highlighting the generation traces in the image features includes: Calculate the attention scores of the category token and each block token separately; Perform the inversion operation on each attention score, and use the normalized exponential function to constrain the inversion result to the probability distribution to obtain the weight corresponding to each block token; The corresponding block tokens are weighted by using weights, and all weighted block tokens are input into the convolutional network for analysis and processing. The output of the convolutional network is combined with the category token to obtain features that highlight the generation traces in the image features.
4. A generative artificial intelligence generated image detection system, characterized in that: The system includes: a detection model; The detection model comprises: a pre-trained image encoder and a classifier, and two sets of independent adapters inserted in the pre-trained image encoder, the two sets of adapters are respectively called GAN branches and DM branches; each branch independently cooperates with the pre-trained image encoder to extract the image representation of the corresponding branch, the pre-trained image encoder comprises a number of processing stages connected in series, the number of adapters in each branch is the same as the number of processing stages, and they are connected one-to-one; wherein GAN is a generative adversarial network, and DM is a diffusion model; Generative image detection is implemented based on the detection model. During the detection process, the first processing stage of the pre-trained image encoder outputs the image features of the image to be detected and enters the corresponding adapter of a branch. The adapter uses a block token decentralization strategy to highlight the generation traces in the image features. The output of the adapter is fused with the output of the first processing stage as the input of the next processing stage, and the process is repeated continuously. Finally, the outputs of all adapters are integrated as the image representation of the corresponding branch; the image representations of the two branches are fused and input into the classifier to output the detection result; It also includes: a model training unit, which uses an alternating training strategy to train the GAN branch and the DM branch, and the alternating training strategy includes: a GAN branch optimization stage and a DM branch optimization stage; wherein: In the GAN branch optimization phase, real images and GAN-generated images are input for training, while the parameters of the DM branch are frozen and the model parameters of the GAN branch and classifier are optimized; In the DM branch optimization stage, real images and DM-generated images are input for training, while the parameters of the GAN branch are frozen and the model parameters of the DM branch and classifier are optimized.
5. The generative artificial intelligence generated image detection system according to claim 4, characterized in that: The adapter adopts a block token decentralization strategy to highlight the generation traces in the image features, including: The image features input to the adapter are in the form of tokens, including: multiple block tokens and a category token; wherein the category token contains global information of the entire image, and each block token contains local information of the corresponding image block; Through the block token decentralization strategy, the weights of the block tokens corresponding to the edge contour and background area are increased to obtain features that highlight the generation traces in the image features.
6. A generative artificial intelligence generated image detection system according to claim 5, characterized in that: The step of increasing the weights of the block tokens corresponding to the edge contour and the background area to obtain the features of highlighting the generation traces in the image features includes: Calculate the attention scores of the category token and each block token separately; Perform the inversion operation on each attention score, and use the normalized exponential function to constrain the inversion result to the probability distribution to obtain the weight corresponding to each block token; The corresponding block tokens are weighted by using weights, and all weighted block tokens are input into the convolutional network for analysis and processing. The output of the convolutional network is combined with the category token to obtain features that highlight the generation traces in the image features.
7. A processing device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.
8. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Detecting cells of interest in large image datasets using artificial intelligence
CA3130616A1
Medical image processing method based on attention mechanism and related equipment
CN114120030A