Artificial intelligence generated image detection method and device, equipment and storage medium
By employing an image detection model with efficient feature extraction and composite scaling branches, combined with a self-attention layer and logistic regression branches, this approach solves the problem of difficulty in distinguishing AI-generated images in existing technologies, achieving higher detection accuracy and robustness.
Patent Information
- Application Number
- CN202511270643.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2026-01-06
AI Technical Summary
Existing image detection technologies struggle to effectively distinguish lifelike facial images generated by artificial intelligence. These technologies typically rely on basic visual attributes such as color, texture, and shape, making it difficult to accurately identify forged images.
An image detection model employing an efficient feature extraction branch and a composite scaling processing branch is used to extract low-level details of the image and perform deep fusion processing. Combined with a self-attention layer and a logistic regression branch, it achieves feature fusion and judgment of the image, thereby improving detection accuracy.
It effectively improves the accuracy of identifying AI-generated images and enhances the robustness and accuracy of image detection models.
Smart Images

Figure CN121281111A_ABST
Abstract
Description
Technical Field
[0001] The technical field of this disclosure, more specifically, relates to a method, apparatus, device, and storage medium for detecting artificial intelligence-generated images. Background Technology
[0002] With the rapid development of AI image generation technology, AI-generated images are often quite realistic, making it difficult to distinguish them from fakes. Currently, existing image detection technologies typically focus on basic visual attributes such as color, texture, and shape as detection criteria to identify the content reflected in the image. However, existing AI networks are usually generative adversarial networks, which can produce highly realistic fake facial images that are difficult to detect. Summary of the Invention
[0003] One objective of this disclosure is to provide a new technical solution for detecting artificial intelligence-generated images.
[0004] According to a first aspect of this disclosure, a method for detecting artificial intelligence-generated images is provided, the method comprising:
[0005] Acquire the image to be detected;
[0006] The first branch feature map of the image to be detected is obtained by using the efficient feature extraction branch in the preset image detection model;
[0007] The second branch feature map of the image to be detected is obtained through the composite scaling processing branch in the image detection model;
[0008] The first branch feature map and the second branch feature map are fused together to obtain the output feature map;
[0009] Based on the output feature map, it is determined whether the image to be detected is an artificial intelligence-generated image.
[0010] Optionally, before acquiring the image to be detected, the method further includes:
[0011] Obtain training samples; wherein, the training samples include a first image frame with a first set number of frames and a second image frame with a second set number of frames; the first image frame is obtained by extracting a first video file with a real human face through a preset multi-task cascaded convolutional network, and the second image frame is obtained by extracting a second video file with a generated human face through the multi-task cascaded convolutional network.
[0012] By using training samples, the pre-set efficient feature extraction model and composite scaling processing model are trained to obtain the trained efficient feature extraction model and composite scaling processing model.
[0013] Optionally, the efficient feature extraction branch includes a first feature extraction activation group of the first input node, a second feature extraction activation group of the first intermediate node, and a third feature extraction activation group of the first output node; obtaining the first branch feature map of the image to be detected through the efficient feature extraction branch in the preset image detection model includes:
[0014] The low-level details of the image to be detected are extracted by the first feature extraction activation group of the input node to obtain the low-level feature map of the image to be detected.
[0015] The low-level feature map is deeply fused and converted into a high-level semantic feature map by using the second feature extraction activation group of the intermediate node.
[0016] The semantic feature map is subjected to feature dimensionality reduction processing by extracting the third feature activation group of the output node to obtain the first branch feature map.
[0017] Optionally, all first feature extraction activation groups in the first feature extraction activation group of the first input node (excluding the first first feature extraction activation group), all second feature extraction activation groups in the first intermediate node, and all third feature extraction activation groups in the third feature extraction activation group of the first output node (excluding the last third feature extraction activation group) are configured with linear skip connections.
[0018] Optionally, the composite scaling processing branch includes an input convolutional layer of the second input node, an intermediate convolutional layer of the second intermediate node, and an output convolutional layer of the second output node, wherein a self-attention layer is set between adjacent target convolutional layers in the intermediate convolutional layer; obtaining the second branch feature map of the image to be detected through the composite scaling processing branch in the image detection model includes:
[0019] The input convolutional layer of the second input node is used to extract features from the image to be detected, thereby obtaining an initial feature map;
[0020] The initial features are squeezed and stimulated through the intermediate convolutional layer and self-attention layer of the second intermediate node to obtain an enhanced key feature map;
[0021] The enhanced key features are reduced in dimensionality through the output convolutional layer of the second output node to obtain the second branch feature map.
[0022] Optionally, the image detection model further includes an orthogonal fusion branch; the process of fusing the first branch feature map and the second branch feature map to obtain the output feature map includes:
[0023] Through the orthogonal fusion branch, the first dimension of the first branch feature map and the second dimension of the second branch feature map are first set to the same specific dimension, and then the first branch feature map and the second branch feature map with the specific dimension are fused to obtain the output feature map.
[0024] Optionally, the image detection model further includes a logistic regression branch; determining whether the image to be detected is an AI-generated image based on the output feature map includes:
[0025] The output feature map is input into the logistic regression branch to obtain the logistic decision character;
[0026] Based on the image labels reflected by the logical operators, it is determined whether the image to be detected is an artificial intelligence-generated image.
[0027] According to a second aspect of this disclosure, an artificial intelligence-generated image detection apparatus is also provided, the apparatus comprising:
[0028] The acquisition module is used to acquire the image to be detected;
[0029] The first obtaining module is used to obtain the first branch feature map of the image to be detected through the efficient feature extraction branch in the preset image detection model;
[0030] The second obtaining module is used to obtain the second branch feature map of the image to be detected through the composite scaling processing branch in the image detection model;
[0031] The third module is used to fuse the first branch feature map and the second branch feature map to obtain the output feature map.
[0032] The determination module is used to determine whether the image to be detected is an artificial intelligence-generated image based on the output feature map.
[0033] According to a third aspect of this disclosure, an electronic device is also provided, including a memory and a processor, the memory being used to store a computer program; the processor being used to execute the computer program to implement the method according to a first aspect of this disclosure.
[0034] According to a fourth aspect of this disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the method described according to a first aspect of this disclosure.
[0035] According to a fifth aspect of this disclosure, a computer program product is also provided, including a computer program that, when executed by a processor, implements the method described according to a first aspect of this disclosure.
[0036] One beneficial effect of this disclosure is that the AI-generated image detection method provided by the present invention can acquire the image to be detected, and then obtain the first branch feature map and the second branch feature map of the image to be detected through the two branches of efficient feature extraction and composite scaling processing in the image detection model. The first branch feature map and the second branch feature map are fused to obtain the output feature map. Based on the output feature map, it is determined whether the image to be detected is an AI-generated image, which effectively improves the accuracy of identifying AI-generated images.
[0037] Other features and advantages of the embodiments of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of the present disclosure and, together with their description, serve to explain the principles of the embodiments of the present disclosure.
[0039] Figure 1 This is a flowchart illustrating an artificial intelligence-generated image detection method according to one embodiment;
[0040] Figure 2 This is a schematic diagram of the structure of an efficient feature extraction branch in an image detection model according to one embodiment;
[0041] Figure 3 This is a block diagram of a detection device for artificial intelligence-generated images according to one embodiment;
[0042] Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to one embodiment. Detailed Implementation
[0043] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the parts and steps set forth in these embodiments do not limit the scope of the invention.
[0044] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0045] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0046] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0047] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0048] <Method Implementation>
[0049] Figure 1 This is a flowchart illustrating an AI-generated image detection method according to one embodiment. The implementing entity can be a server, personal computer, or mobile phone, etc., and is not limited thereto.
[0050] like Figure 1 As shown, the detection method for artificial intelligence-generated images in this embodiment may include the following steps S110 to S150:
[0051] Step S110: Obtain the image to be detected.
[0052] In this embodiment, the image to be detected can be a fake or a real face image. Here, fake images are generally images generated by artificial intelligence.
[0053] Step S120: Obtain the first branch feature map of the image to be detected through the efficient feature extraction branch in the preset image detection model.
[0054] In some embodiments, in order to obtain the first branch feature map, the efficient feature extraction branch includes a first feature extraction activation group of the first input node, a second feature extraction activation group of the first intermediate node, and a third feature extraction activation group of the first output node. This step S120 may include the following steps S310 to S330:
[0055] Step S310: Extract low-level details of the image to be detected by using the first feature extraction activation group of the input node to obtain a low-level feature map of the image to be detected.
[0056] Step S320: The low-level feature map is deeply fused and converted into a high-level semantic feature map by extracting the activation group of the second feature of the intermediate node.
[0057] Step S330: Extract activation groups from the third feature of the output node to perform feature dimensionality reduction on the semantic feature map to obtain the first branch feature map.
[0058] In this embodiment, as Figure 2As shown, the efficient feature extraction branch can be obtained by adjusting the Inception-V3 network model based on the depthwise separable convolution in the Xception network structure. The efficient feature extraction branch consists of three parts: the input node Entryflow, the middle node Middleflow, and the output node Exitflow. The input node Entryflow contains first feature extraction activation groups 1A to 1D. The middle node Middleflow contains second feature extraction activation group 2, which is stacked eight times. The output node Exitflow contains third feature extraction activation groups 3A and 3B. The efficient feature extraction branch can be a deep convolutional neural network branch built based on the Xception network structure. This branch can apply knowledge learned in a specific task to related tasks, enabling it to process the image to be detected through low-level feature extraction, high-level semantic feature deep processing, and adaptation of the dimensions of the second branch feature map output by the composite scaling branch, thus obtaining a first branch feature map that meets the requirements.
[0059] In this embodiment, by setting this efficient feature extraction branch, compared with the InceptionV3 network model, under the same parameter conditions, the computational complexity required by this efficient feature extraction branch is lower, and it has a stronger feature extraction effect and better transferability. By selecting this efficient feature extraction branch as the backbone network, the efficiency of identifying the image to be detected can be effectively improved.
[0060] In some embodiments, in order to improve the robustness of the efficient feature extraction branch, all first feature extraction activation groups other than the first first feature extraction activation group in the first feature extraction activation group of the first input node, the second feature extraction activation group of the first intermediate node, and all third feature extraction activation groups other than the last third feature extraction activation group in the third feature extraction activation group of the first output node are provided with linear skip connections.
[0061] In this embodiment, as Figure 2 As shown, the first feature extraction activation groups 1B-1D, the second feature extraction activation group 2 (stacked eight times), and the third feature extraction activation group 3A all have linear skip connections. All 12 feature extraction activation groups in the efficient feature extraction branch contain linear skip connections. From a training perspective, this solves the problems of gradient vanishing and network degradation, making deep networks trainable without performance degradation. From a feature perspective, it fuses multi-scale features, preserves original information, and enhances the expressive power and robustness of features.
[0062] Step S130: The second branch feature map of the image to be detected is obtained through the composite scaling processing branch in the image detection model.
[0063] In some embodiments, step S130 may include the following steps S410 to S430:
[0064] Step S410: Through the input convolutional layer of the second input node, feature extraction is performed on the image to be detected to obtain an initial feature map.
[0065] Step S420: The initial features are squeezed and stimulated through the intermediate convolutional layer and self-attention layer of the second intermediate node to obtain the enhanced key feature map.
[0066] Step S430: The enhanced key features are reduced in dimensionality through the output convolutional layer of the second output node to obtain the second branch feature map.
[0067] In this embodiment, the composite scaling processing branch is constructed based on an attention mechanism and the EfficientNetB4 network model. The input convolutional layer of the second input node can be a single Conv3×3 layer. The intermediate convolutional layers of the second intermediate node can include stacked 3×3MBConv1 layers twice, stacked 3×3MBConv6 layers four times, stacked 5×5MBConv6 layers four times, stacked 3×3MBConv6 layers six times, stacked 5×5MBConv6 layers six times, stacked 5×5MBConv6 layers eight times, and stacked 3×3MBConv6 layers twice. The output convolutional layer of the second output node can be a single Conv3×3 layer. Furthermore, the EfficientNetB4 network model here is a scaling convolutional neural network. A self-attention layer is added between the stacked 5×5MBConv6 layers four times and the stacked 3×3MBConv6 layers six times in the composite scaling processing branch. This layer replaces the original feature map with a 28x28x56 attention feature map, thereby enhancing the key feature map output by the intermediate layer.
[0068] In this embodiment, by setting a composite scaling processing branch, the interference of a large amount of redundant environmental information in the face image can be effectively reduced, thereby improving the accuracy of the image detection model. Adding a self-attention layer to the composite scaling processing branch can highlight the parts that are more relevant to the face authentication task, such as the nose, eyes, and mouth; while relatively flat areas with small gradients in the face are relatively unimportant information for the authentication task; finally, the feature map containing attention replaces the original feature map, thereby improving the performance of the image detection model.
[0069] Step S140: The first branch feature map and the second branch feature map are fused to obtain the output feature map.
[0070] In some embodiments, the image detection model further includes an orthogonal fusion branch; step S140 may include the following step S510:
[0071] Step S510: Through orthogonal fusion branching, first set the first dimension of the first branch feature map and the second dimension of the second branch feature map to the same specific dimension, and then fuse the first branch feature map and the second branch feature map with the specific dimension to obtain the output feature map.
[0072] In this embodiment, through orthogonal fusion branching, the first dimension of the first branch feature map and the second branch feature map can be combined, reducing the image dimensions of the first and second branch feature maps to the same specific dimension, such as 1024 dimensions. By fusing the first and second branch feature maps, an output feature map of a specific dimension is obtained, which can then be input into the subsequent logistic regression branch.
[0073] Step S150: Based on the output feature map, determine whether the image to be detected is an artificial intelligence-generated image.
[0074] In some embodiments, the image detection model further includes a logistic regression branch; step S150 may include the following steps S610 and S620:
[0075] Step S610: Input the output feature map into the logistic regression branch to obtain the logistic decision.
[0076] Step S630: Determine whether the image to be detected is an artificial intelligence-generated image based on the image label reflected by the logical judgment operator.
[0077] In this embodiment, the logistic regression branch may include a fully connected layer and a logistic regression layer. Here, the logistic regression layer may have 1000 outputs but only 2 outputs, namely, outputting a logical condition "1" or "0". When the output is "1", the image label is a fake image, indicating that the image to be detected is an AI-generated image. When the output is "0", the image label is a real image, indicating that the image to be detected is not an AI-generated image.
[0078] In some embodiments, prior to step S110, the method further includes the following steps S210 and S220:
[0079] Step S210: Obtain training samples; wherein, the training samples include a first image frame with a first set number of frames and a second image frame with a second set number of frames; the first image frame is obtained by extracting a first video file with a real human face through a preset multi-task cascaded convolutional network, and the second image frame is obtained by extracting a second video file with a generated human face through a multi-task cascaded convolutional network.
[0080] Step S220: Using training samples, train the pre-set efficient feature extraction model and composite scaling processing model to obtain the trained efficient feature extraction model and composite scaling processing model.
[0081] In this embodiment, the training samples can be image samples from the FaceShifter image dataset, which includes full-image scenes containing environmental information (such as background and clothing) and facial information, as well as face-only scenes containing only facial information. The first set number of frames for the first image frame of a real face is, for example, 32,000, and the second set number of frames for the second image frame of a generated face is, for example, 32,000. Correspondingly, the total number of training samples is 64,000. The full-image scene dataset is processed using OpenCV, extracting 32 frames from each of 1000 real face videos and 1000 FaceShifter fake face videos, to obtain face images containing both environmental and facial information. This yields the first set number of image frames and the second set number of image frames. The Multi-task Cascaded Convolutional Networks (MTCNN) here can perform face detection and extraction on the full-image scene images, obtaining face images containing only facial information after filtering out environmental information. By setting the training samples as described above, the comprehensiveness of the training samples used for training the image detection model can be improved, thereby enhancing the accuracy of the image detection model.
[0082] <Equipment Example 1>
[0083] Figure 3 This is a schematic diagram of a detection device for artificial intelligence-generated images according to one embodiment. Figure 3 As shown, the detection device 300 for AI-generated images may include:
[0084] The acquisition module 310 is used to acquire the image to be detected;
[0085] The first obtaining module 320 is used to obtain the first branch feature map of the image to be detected through the efficient feature extraction branch in the preset image detection model;
[0086] The second obtaining module 330 is used to obtain the second branch feature map of the image to be detected through the composite scaling processing branch in the image detection model;
[0087] The third module 340 is used to fuse the first branch feature map and the second branch feature map to obtain the output feature map.
[0088] The determination module 350 is used to determine whether the image to be detected is an artificial intelligence-generated image based on the output feature map.
[0089] Optionally, the detection device 300 for AI-generated images further includes a training module for acquiring training samples; wherein the training samples include a first image frame with a first set number of frames and a second image frame with a second set number of frames; the first image frame is obtained by extracting a first video file with a real human face through a pre-set multi-task cascaded convolutional network, and the second image frame is obtained by extracting a second video file with a generated human face through a multi-task cascaded convolutional network; through the training samples, the pre-set efficient feature extraction model and composite scaling processing model are trained to obtain the trained efficient feature extraction model and composite scaling processing model.
[0090] Optionally, the first obtaining module 320 is further configured to extract low-level details of the image to be detected through the first feature extraction activation group of the input node to obtain a low-level feature map of the image to be detected; perform deep fusion processing on the low-level feature map and convert it into a high-level semantic feature map through the second feature extraction activation group of the intermediate node; and perform feature dimensionality reduction processing on the semantic feature map through the third feature extraction activation group of the output node to obtain a first branch feature map.
[0091] Optionally, the second obtaining module 330 is further configured to extract features from the image to be detected through the input convolutional layer of the second input node to obtain an initial feature map; to perform compression excitation processing on the initial features through the intermediate convolutional layer and self-attention layer of the second intermediate node to obtain an enhanced key feature map; and to perform dimensionality reduction processing on the enhanced key features through the output convolutional layer of the second output node to obtain a second branch feature map.
[0092] Optionally, the third obtaining module 340 is further configured to, through orthogonal fusion branches, first set the first dimension of the first branch feature map and the second dimension of the second branch feature map to the same specific dimension, and then fuse the first branch feature map and the second branch feature map with the specific dimension to obtain the output feature map.
[0093] Optionally, the determination module 350 is also used to input the output feature map into the logistic regression branch to obtain a logical delimiter; and to determine whether the image to be detected is an artificial intelligence-generated image based on the image label reflected by the logical delimiter.
[0094] <Equipment Example 2>
[0095] Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to another embodiment.
[0096] like Figure 4 As shown, the electronic device 400 includes a processor 410 and a memory 420, the memory 420 for storing an executable computer program, and the processor 410 for executing methods as described in any of the above method embodiments under the control of the computer program.
[0097] Each module of the AI-generated image detection device 300 described above can be implemented by the processor 410 executing the computer program stored in the memory 420 in this embodiment, or it can be implemented by other structures, which are not limited here.
[0098] This invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.
[0099] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0100] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0101] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages. Programming languages include object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" or similar languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from computer-readable program instructions. These electronic circuits can execute computer-readable program instructions to implement various aspects of the present invention.
[0102] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0103] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0104] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0106] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.
Claims
1. A method for detecting an artificial intelligence generated image, the method comprising: receiving an image; and determining whether the image is an artificial intelligence generated image based on a feature of the image. The method comprises: acquiring an image to be detected; obtaining a first branch feature map of the image to be detected through a high-efficiency feature extraction branch in a preset image detection model; obtaining a second branch feature map of the image to be detected through a composite scaling processing branch in the image detection model; fusing and processing the first branch feature map and the second branch feature map to obtain an output feature map; determining whether the image to be detected is an artificial intelligence generated image according to the output feature map.
2. The method of claim 1, wherein, Before the image to be detected is acquired, the method further comprises: acquiring training samples; wherein the training samples comprise a first image frame of a first set frame number and a second image frame of a second set frame number; the first image frame is obtained by extracting a first video file with a real face through a preset multi-task cascading convolutional network, and the second image frame is obtained by extracting a second video file with a generated face through the multi-task cascading convolutional network; training the preset high-efficiency feature extraction model and the composite scaling processing model through the training samples to obtain the trained high-efficiency feature extraction model and the composite scaling processing model.
3. The method of claim 1, wherein, The high-efficiency feature extraction branch comprises a first feature extraction activation group of a first input node, a second feature extraction activation group of a first intermediate node, and a third feature extraction activation group of a first output node; obtaining the first branch feature map of the image to be detected through the high-efficiency feature extraction branch in the preset image detection model comprises: extracting low-level details of the image to be detected through the first feature extraction activation group of the input node to obtain a low-level feature map of the image to be detected; performing depth fusion processing on the low-level feature map through the second feature extraction activation group of the intermediate node and converting the low-level feature map into a high-level semantic feature map; performing feature dimension reduction processing on the semantic feature map through the third feature extraction activation group of the output node to obtain the first branch feature map.
4. The method of claim 3, wherein, Each of the first feature extraction activation groups of the first input node except the first one, each of the second feature extraction activation groups of the first intermediate node, and each of the third feature extraction activation groups of the first output node except the last one is provided with a linear jump connection.
5. The method of claim 1, wherein, The composite scaling processing branch comprises an input convolutional layer of a second input node, an intermediate convolutional layer of a second intermediate node, and an output convolutional layer of a second output node, and a self-attention layer is arranged between adjacent target convolutional layers in the intermediate convolutional layer; obtaining the second branch feature map of the image to be detected through the composite scaling processing branch in the image detection model comprises: performing feature extraction on the image to be detected through the input convolutional layer of the second input node to obtain an initial feature map; performing squeezing and excitation processing on the initial feature through the intermediate convolutional layer and the self-attention layer of the second intermediate node to obtain an enhanced key feature map; The enhanced key features are dimensionally reduced by an output convolutional layer of a second output node to obtain a second branch feature map.
6. The method of claim 1, wherein, The image detection model further comprises an orthogonal fusion branch; the fusion of the first branch feature map and the second branch feature map to obtain an output feature map comprises: The first dimension of the first branch feature map and the second dimension of the second branch feature map are set to a specific dimension by the orthogonal fusion branch, and then the first branch feature map and the second branch feature map with the specific dimension are fused to obtain an output feature map.
7. The method of claim 1, wherein, The image detection model further comprises a logistic regression branch; the determination of whether the to-be-detected image is an artificial intelligence generated image according to the output feature map comprises: The output feature map is input into the logistic regression branch to obtain a logistic judgment symbol; Whether the to-be-detected image is an artificial intelligence generated image is determined according to the image label reflected by the logistic judgment symbol.
8. An apparatus for detecting an artificial intelligence generated image, comprising: The device comprises: An acquisition module is configured to acquire a to-be-detected image; A first obtaining module is configured to obtain a first branch feature map of the to-be-detected image by an efficient feature extraction branch in a preset image detection model; A second obtaining module is configured to obtain a second branch feature map of the to-be-detected image by a composite scaling processing branch in the image detection model; A third obtaining module is configured to fuse the first branch feature map and the second branch feature map to obtain an output feature map; A determination module is configured to determine whether the to-be-detected image is an artificial intelligence generated image according to the output feature map.
9. An electronic device, comprising: The memory is configured to store a computer program; and the processor is configured to execute the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.