Artificial intelligence generated image detection method and device, storage medium and electronic equipment

By using an object detection model combined with a CLIP model and a fully connected network, combined with the technical means of single-center loss metric learning and post-processing similar characteristics, the problems of insufficient detection capabilities and poor robustness of multiple types of artificial intelligence generated images in the prior art are solved, and higher detection accuracy and generalization are achieved.

CN119741396AActive Publication Date: 2025-04-01NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP

Patent Information

Application Number
CN202510238554.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-04-01
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

The prior art is difficult to detect multiple types of artificial intelligence generated images simultaneously and especially when facing new methods, unseen architectures or images under different conditions, the generalization ability is poor and the compression and blurring of images is insufficient.

Method used

The object detection model is constructed using the image encoder of the CLIP model and the fully connected network. The real image features are aggregated through single-center loss metric learning, and the similar representation of image features before and after post-processing is achieved through metric learning, improving detection accuracy and generalization.

Benefits of technology

The detection ability of unknown generation methods is improved, the robustness in post-processing such as compression and fuzziness is enhanced, and the practical application effect of the detection methods is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741396A_ABST
    Figure CN119741396A_ABST
Patent Text Reader

Abstract

The invention provides an artificial intelligence generated image detection method and device, a storage medium and electronic equipment, and relates to the field of artificial intelligence generated image detection.The method comprises the steps that original images are collected from a typical generated image data set to serve as a basic data set, and the original images comprise generated images and real images; performing post-processing on the original image in the basic data set to generate an image pair; constructing a target detection model based on an image encoder of a CLIP model and a full-connection network; training the target detection model based on the image pair; and detecting a to-be-detected image based on the trained target detection model. According to the technical scheme, the accuracy and generalization of artificial intelligence generated image detection are improved, and the robustness of the detection method during post-processing operations such as compression and blur is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of artificial intelligence generated image detection, and specifically, to an artificial intelligence generated image detection method, device, storage medium and electronic device. Background Art

[0002] AI-generated images refer to image content that is automatically generated or assisted in creation using AI technology. The quality of currently generated images is good enough to be mistaken for real ones, and there are various mature tools on the Internet that can be used flexibly by the public. If these tools or technologies are maliciously applied to individuals, it will not only infringe on personal portrait rights and privacy rights, but may also lead to privacy leaks, reputation damage, or be used to publish false information to mislead public opinion, thereby damaging social trust. If it is maliciously applied to national dignitaries and false images involving national defense and diplomacy are published, it may lead to a serious political crisis. If it is used by fraudsters, it may cause serious economic losses to individuals, companies, etc. Therefore, research on detection technology for AI-generated images has far-reaching significance for maintaining the authenticity of information, combating the abuse of generation technology, and the spread of generated content.

[0003] At present, there are many studies on the detection of AI-generated images, mainly focusing on two major categories of AI-generated image methods, namely, generative models based on generative adversarial networks and generative models based on diffusion. Current AI-generated image detection methods are mainly divided into three categories: (1) detection based on visual artifact features; (2) detection based on frequency domain features; and (3) detection based on data-driven.

[0004] Current AI-generated image detection models can solve in-distribution scenarios with perfectly aligned training and test sets within single-class image generation methods and have good detection performance. However, they still cannot simultaneously detect images generated by multiple classes of generation methods. They have poor generalization capabilities for images generated by new generation methods that the model has not seen before, and are unable to cope with problems such as compression and blurring faced in real scenarios.

[0005] The main problems in current detection research include: First, even if there are multiple categories of generated images in the training set, a single model cannot have a good detection effect on the same multiple categories of generated images at the same time, and the generalization ability of new and unseen generation methods is poor. The test images in real scenes are usually generated by new methods, unseen architectures, or even known architectures retrained under different conditions. Second, AI-generated images spread on social networks face problems such as compression and blurring. The current detection methods are not robust enough to these post-processing operations, resulting in poor practicality. Summary of the invention

[0006] The embodiments of the present application provide an artificial intelligence generated image detection method, device, storage medium and electronic device to solve the technical problems existing in the prior art.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0008] According to a first aspect of an embodiment of the present application, there is provided an artificial intelligence generated image detection method, comprising: Collecting original images from a typical generated image dataset as a basic dataset, wherein the original images include generated images and real images; Post-process the original images in the basic dataset to generate image pairs; Build an object detection model based on the image encoder and fully connected network of the CLIP model; Training the object detection model based on the image pairs; The image to be detected is detected based on the trained target detection model.

[0009] In some embodiments of the present application, based on the above solution, the post-processing of the original images in the basic data set to generate image pairs includes: The original image is subjected to JPEG compression and Gaussian blur to obtain the image pair.

[0010] In some embodiments of the present application, based on the aforementioned scheme, the CLIP model-based image encoder and the fully connected network construct a target detection model, including: Select the image encoder of the CLIP model as the basic feature extraction model; Construct a four-layer fully connected network as a classification network, wherein the last layer of the classification network adopts a Sigmoid function and the remaining layers adopt a RELU activation function; The basic feature extraction model is spliced ​​with the classification network to obtain the target detection model.

[0011] In some embodiments of the present application, based on the aforementioned solution, the training of the target detection model based on the image pair includes: Based on the image pair, extracting image feature coding using the basic feature extraction model; Based on the image feature encoding, using the classification network to calculate the metric loss function and the binary cross entropy loss function of the image; Determining a total loss of the object detection model based on the metric loss function and the binary cross entropy loss function; The parameters of the classification network are trained using a mini-batch gradient descent algorithm until the total loss is minimized.

[0012] In some embodiments of the present application, based on the above scheme, the calculation formula of the binary cross entropy loss function is as follows: (1); in, represents the binary cross entropy loss function, N represents the number of samples, represents the true label of the i-th sample, represents the predicted probability of the i-th sample.

[0013] In some embodiments of the present application, based on the above scheme, calculating the metric loss function of the image includes: The single center loss function of the image is calculated based on formula (2) ; (2); in, represents the average Euclidean distance between the real image and the center point C in a batch, represents the average Euclidean distance between the generated image and the center point C in a batch, The boundary distance between the generated image feature representation and the real image feature representation; Based on formula (3), the loss function representing the difference in image features before and after post-processing is calculated ; (3); Where i and j represent the images before and after the post-processing operation in an image pair, respectively, and M is the number of image pairs in a batch. and They represent the neural network composed of CLIP ViT L / 14 plus the first two fully connected layers to transform the image and images Embedded into a 2048-dimensional vector.

[0014] In some embodiments of the present application, based on the above scheme, the calculation formula of the total loss is as follows: (4); in, represents the total loss, represents the single center loss function of the image, The loss function representing the difference in image features before and after post-processing, and are all hyperparameters.

[0015] According to a second aspect of an embodiment of the present application, there is provided an artificial intelligence generated image detection device, comprising: A collecting unit, used to collect original images from a typical generated image dataset as a basic dataset, wherein the original images include generated images and real images; A processing unit, used for post-processing the original images in the basic data set to generate image pairs; A construction unit for building an object detection model based on the image encoder and fully connected network of the CLIP model; A training unit, configured to train the object detection model based on the image pairs; The detection unit is used to detect the image to be detected based on the trained target detection model.

[0016] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes the method according to the first aspect.

[0017] According to a fourth aspect of the embodiments of the present application, there is provided an electronic device, including: a memory and a processor; The memory is used to store computer instructions; The processor is used to call the computer instructions stored in the memory so that the electronic device executes the method as described in the first aspect.

[0018] The technical solution of the present application adopts the image encoder of the CLIP model with better feature expression ability as the basic feature extraction model, introduces single center loss metric learning to achieve aggregation of real image features and expand the boundary between real images and generated images, and at the same time achieves similar representation of image features before and after post-processing through metric learning, thereby improving the detection accuracy and generalization of unknown generation methods, and improving the robustness of the detection method when facing post-processing problems such as compression and blurring in real scenes.

[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings: Figure 1A schematic diagram of a process of an artificial intelligence generated image detection method according to an embodiment of the present application is shown; Figure 2 A schematic diagram showing the working principle of a classification network according to an embodiment of the present application is shown; Figure 3 A block diagram of an artificial intelligence generated image detection device according to an embodiment of the present application is shown; Figure 4 A block diagram of an electronic device according to an embodiment of the present application is shown; Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0021] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0022] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0023] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0024] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] Some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.

[0027] See also Figure 1 , shows a flow chart of an artificial intelligence generated image detection method according to an embodiment of the present application.

[0028] like Figure 1 As shown, an artificial intelligence generated image detection method is demonstrated, which specifically includes steps S100 to S500.

[0029] refer to Figure 1 , step S100, collecting original images from a typical generated image dataset as a basic dataset, wherein the original images include generated images and real images.

[0030] It should be noted that, in this embodiment, the generated images and real images are generated based on two major methods: generative adversarial networks and diffusion models.

[0031] Exemplarily, the process of obtaining the generated image and the real image is as follows: The generated images based on generative adversarial networks such as ProGAN, StyleGAN, and CycleGAN are obtained from the dataset published in the paper “Wang, Sheng-Yu, et al. “CNN-Generated Images Are SurprisinglyEasy to Spot… for Now.” CVPR, 2020.”; according to the image and text description pairs provided in the LAION dataset, the text descriptions are input into models such as LDM, Glide, and DALL-E to generate generated images based on the diffusion model; the real images are also obtained from the real images in the above two datasets.

[0032] Continue to refer Figure 1 , step S200, post-processing the original images in the basic data set to generate image pairs.

[0033] In some feasible embodiments, based on the above solution, the post-processing of the original images in the basic data set to generate image pairs includes: The original image is subjected to JPEG compression and Gaussian blur to obtain the image pair.

[0034] It can be understood that the original image includes the generated image and the real image, and post-processing the original image means post-processing both the generated image and the real image. Specifically, it means that all images in the basic data set (including the real image and the generated image) are post-processed such as compression and blurring to form an image pair with the original image.

[0035] Continue to refer Figure 1 , step S300, constructing a target detection model based on the image encoder and fully connected network of the CLIP model.

[0036] In some feasible embodiments, based on the above scheme, the CLIP model-based image encoder and the fully connected network construct a target detection model, including: Select the image encoder of the CLIP model as the basic feature extraction model; Construct a four-layer fully connected network as a classification network, wherein the last layer of the classification network adopts a Sigmoid function and the remaining layers adopt a RELU activation function; The basic feature extraction model is spliced ​​with the classification network to obtain the target detection model.

[0037] It should be noted that the CLIP model refers to the visual language model.

[0038] It should be noted that the output of the last layer of the basic feature extraction model is the image feature encoding, which has a total of 768 dimensions. The parameters of the image encoder CLIP ViT L / 14 remain unchanged during the later training process.

[0039] For example, the network structure of the target detection model is as follows Figure 2 As shown in the figure, the image encoder CLIP ViT L / 14 of the pre-trained CLIP model is selected as the basic feature extraction model and spliced ​​at the front end of the classification network; a four-layer fully connected network is constructed as the classification network, the classification network includes 2048, 2048, 500, and 2 nodes, the last layer uses the Sigmoid function, and the remaining layers use the RELU activation function.

[0040] It should be noted that, in this embodiment, the main functions of this classification network are: The image feature encoding extracted by the pre-trained model is mapped to a 2048-dimensional high-dimensional space through the first two layers of fully connected networks, and it is expected that the representation in the high-dimensional space has the following characteristics: first, normal image features are aggregated and the boundary between the real image and the generated image is expanded, so that the detection method can improve the detection accuracy while maintaining the generalization of the detection method to the unknown generation method; second, the difference in feature representation of the image before and after the post-processing operation is minimized, hoping to improve its robustness when facing post-processing problems such as compression and blurring in real scenes. In order to make the image features mapped to the high-dimensional space have these characteristics, it is mainly achieved through metric learning, that is, introducing metric loss in the second fully connected layer to reduce or increase the distance between image features.

[0041] Continue to refer Figure 1 , step S400, training the target detection model based on the image pair.

[0042] In some feasible embodiments, based on the above scheme, the training of the target detection model based on the image pair includes: Based on the image pair, extracting image feature coding using the basic feature extraction model; Based on the image feature encoding, using the classification network to calculate the metric loss function and the binary cross entropy loss function of the image; Determining a total loss of the object detection model based on the metric loss function and the binary cross entropy loss function; The parameters of the classification network are trained using a mini-batch gradient descent algorithm until the total loss is minimized.

[0043] Exemplarily, the specific process of extracting image feature coding is as follows: The image pair is taken as input data and input into the basic feature extraction model to extract image features and obtain image feature encoding.

[0044] In some feasible embodiments, based on the above scheme, the calculation formula of the binary cross entropy loss function is as follows: ; in, represents the binary cross entropy loss function, N represents the number of samples, represents the true label of the i-th sample, represents the predicted probability of the i-th sample.

[0045] It should be noted that in order to make the characteristic distribution of training data easier to classify, the metric loss function consists of two parts: One is a metric loss function used to aggregate normal image features and expand the boundary between the real image and the generated image. Here, a single center loss function is used. The other is a loss function used to minimize the difference in feature representation between images before and after post-processing.

[0046] Exemplary, single center loss function The calculation process is as follows: Assuming that the training set From N samples and its tags The feature dimension formed in the second fully connected layer is 2048, and its feature vector is composed of Assume that the feature center point of the real image is C. For a batch of data, the value of the center point C is the center point of the real image feature in a batch. The single center loss function is: ; in is the average Euclidean distance between the real image and the center point C in a batch, To generate the average Euclidean distance between the image and the center point C in a batch, It is the boundary distance between the generated image feature representation and the real image feature representation.

[0047] and The calculation formula is as follows: ; ; in and Represent the real image and generated image sets respectively.

[0048] The loss function used to minimize the difference in feature representation between the image before and after post-processing is calculated as follows: ; Where i and j represent the images before and after the post-processing operation in an image pair, respectively, and M is the number of image pairs in a batch. and They represent the neural network composed of CLIP ViT L / 14 plus the first two fully connected layers to transform the image and images Embedded into a 2048-dimensional vector.

[0049] In some feasible embodiments, based on the above scheme, the calculation formula of the total loss is as follows: ; in, represents the total loss, represents the single center loss function of the image, The loss function representing the difference in image features before and after post-processing, and are all hyperparameters.

[0050] Continue to refer Figure 1 , step S500, detecting the image to be detected based on the trained target detection model.

[0051] For example, see Figure 2 , input the image to be detected into the trained target detection model, and judge whether the image is a real image or a generated image according to the output result of the softmax function of the last fully connected layer in the target detection model to realize image detection.

[0052] In summary, this method uses the powerful feature representation ability of the image encoder of the CLIP model to extract image features, which is beneficial to improving the generalization of the detection method to unknown generation methods; when mapping image features to high-dimensional space, metric learning is used to aggregate real image features and expand the boundary between real images and generated images, but the feature representation of generated images is not overly constrained, which can not only improve the detection accuracy but also will not lead to overfitting of the generation methods existing in the training data set, and maintain the generalization of the detection method to unknown generation methods; at the same time, metric learning is used to achieve similar representation of image features before and after post-processing, which improves its robustness when facing post-processing problems such as compression and blurring in real scenes.

[0053] The following describes an embodiment of the device of the present application, which can be used to execute an artificial intelligence generated image detection method in the above embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0054] Reference Figure 3 As shown, according to an embodiment of the present application, an artificial intelligence generated image detection device 300 includes: A collecting unit 301 is used to collect original images from a typical generated image dataset as a basic dataset, wherein the original images include generated images and real images; A processing unit 302 is used to post-process the original images in the basic data set to generate image pairs; A construction unit 303 is used to construct a target detection model based on the image encoder and the fully connected network of the CLIP model; A training unit 304, configured to train the object detection model based on the image pair; The detection unit 305 is used to detect the image to be detected based on the trained target detection model.

[0055] like Figure 4 As shown, an embodiment of the present application also provides an electronic device 400, including a memory 410, a processor 420, and a computer program 411 stored in the memory 410 and executable on the processor, and when the processor 420 executes the computer program 411, the steps of the above-mentioned artificial intelligence generated image detection method are implemented.

[0056] Since the electronic device introduced in this embodiment is a device used to implement an artificial intelligence generated image detection device in the embodiment of the present application, based on the method introduced in the embodiment of the present application, technical personnel in this field can understand the specific implementation mode of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present application is not introduced in detail here. As long as the equipment used by technical personnel in this field to implement the method in the embodiment of the present application is within the scope of protection of this application.

[0057] During the specific implementation process, when the computer program 411 is executed by a processor, any implementation method in the embodiments corresponding to the first aspect can be implemented.

[0058] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0059] It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0060] like Figure 5 As shown, the computer system 500 includes a central processing unit 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory 502 or the program loaded from the storage part 508 into the random access memory 503, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the random access memory 503. The central processing unit 501, the read-only memory 502 and the random access memory 503 are connected to each other via a bus 504. The input / output interface 505 is also connected to the bus 504.

[0061] The following components are connected to the input / output interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.

[0062] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 509, and / or installed from a removable medium 511. When the computer program is executed by the central processing unit 501, various functions defined in the system of the present application are executed.

[0063] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0064] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0065] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0066] As another aspect, the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes an artificial intelligence generated image detection method described in the above embodiment.

[0067] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements an artificial intelligence generated image detection method described in the above embodiment.

[0068] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0069] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, 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.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.

[0070] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. It should be understood that the present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. An artificial intelligence generated image detection method, characterized in that: include: Collecting original images from a typical generated image dataset as a basic dataset, wherein the original images include generated images and real images; Post-process the original images in the basic dataset to generate image pairs; Build an object detection model based on the image encoder and fully connected network of the CLIP model; Training the object detection model based on the image pairs; The image to be detected is detected based on the trained target detection model.

2. The method according to claim 1, characterized in that The post-processing of the original images in the basic data set to generate image pairs includes: The original image is subjected to JPEG compression and Gaussian blur to obtain the image pair.

3. The method according to claim 1, characterized in that The CLIP model-based image encoder and fully connected network construct a target detection model, including: Select the image encoder of the CLIP model as the basic feature extraction model; Construct a four-layer fully connected network as a classification network, wherein the last layer of the classification network adopts a Sigmoid function and the remaining layers adopt a RELU activation function; The basic feature extraction model is spliced ​​with the classification network to obtain the target detection model.

4. The method according to claim 3, characterized in that The training of the target detection model based on the image pair includes: Based on the image pair, extracting image feature coding using the basic feature extraction model; Based on the image feature encoding, using the classification network to calculate the metric loss function and the binary cross entropy loss function of the image; Determining a total loss of the object detection model based on the metric loss function and the binary cross entropy loss function; The parameters of the classification network are trained using a mini-batch gradient descent algorithm until the total loss is minimized.

5. The method according to claim 4, characterized in that The calculation formula of the binary cross entropy loss function is as follows: (1); in, represents the binary cross entropy loss function, N represents the number of samples, represents the true label of the i-th sample, represents the predicted probability of the i-th sample.

6. The method according to claim 5, characterized in that Calculate the metric loss function of the image, including: The single center loss function of the image is calculated based on formula (2) ; (2); in, represents the average Euclidean distance between the real image and the center point C in a batch, represents the average Euclidean distance between the generated image and the center point C in a batch, The boundary distance between the generated image feature representation and the real image feature representation; Based on formula (3), the loss function representing the difference in image features before and after post-processing is calculated ; (3); Where i and j represent the images before and after the post-processing operation in an image pair, respectively, and M is the number of image pairs in a batch. and They represent the neural network composed of CLIP ViT L / 14 plus the first two fully connected layers to transform the image and images Embedded into a 2048-dimensional vector.

7. The method according to claim 6, characterized in that The total loss is calculated as follows: (4); in, represents the total loss, represents the single center loss function of the image, The loss function representing the difference in image features before and after post-processing, and are all hyperparameters.

8. An artificial intelligence generated image detection device, characterized in that: include: A collecting unit, used to collect original images from a typical generated image dataset as a basic dataset, wherein the original images include generated images and real images; A processing unit, used for post-processing the original images in the basic data set to generate image pairs; A construction unit for building an object detection model based on the image encoder and fully connected network of the CLIP model; A training unit, configured to train the object detection model based on the image pairs; The detection unit is used to detect the image to be detected based on the trained target detection model.

9. A computer-readable storage medium, characterized in that: The storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer instructions; The processor is used to call the computer instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Image semantic segmentation model, detection method and device, equipment and storage medium

    CN110555437A

  • Label-free vehicle picture classification method based on sample screening

    CN111368886A

  • Illegal image recognition method, system and equipment

    CN114140673A

  • Model training method and device, electronic equipment and storage medium

    CN114722826A

  • Target detection method and device, computer readable medium and electronic equipment

    CN115115906A

Cited By

  • Data set construction method and system, electronic equipment and storage medium

    CN120047958A

  • Dataset construction method, system, electronic device and storage medium

    CN120047958B

  • Intelligent generated image detection method based on multi-granularity artifact feature fusion

    CN121147726A

  • An intelligent generated image detection method based on multi-granularity artifact feature fusion

    CN121147726B

  • Artificial intelligence generated image detection model optimization method, system, equipment and medium

    CN122047322A