Recognition method for a machine-generated image, apparatus, electronic device, computer-readable storage medium and computer program product

By obtaining the description information of the image to be recognized, using multiple image generation methods to generate machine-generated images, and performing comparative recognition, the problem of poor recognition accuracy of machine-generated images in the existing technology is solved, and the recognition accuracy is improved.

WO2024217134A1PCT designated stage expired Publication Date: 2024-10-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
PCT/CN2024/077381
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-17
Filing Date
2024-02-18
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

In the existing technology, the recognition accuracy of machine-generated images is poor, and it is difficult to effectively distinguish between machine-generated images and non-machine-generated images.

Method used

By obtaining the description information of the image to be recognized, multiple image generation methods are used to generate machine-generated images, and the image to be recognized is compared with these generated images, and the probability value of each generation method is calculated. If a certain probability value is not less than the threshold, then OK for machine-generated images.

Benefits of technology

The recognition accuracy of machine-generated images is improved. By comparing and identifying the reversely generated machine-generated images and the images to be recognized, it is determined whether they are machine-generated images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077381_24102024_PF_FP_ABST
    Figure CN2024077381_24102024_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the technical field of image recognition. Provided are a recognition method for a machine-generated image, an apparatus, an electronic device, a computer-readable storage medium and a computer program product,. The method comprises: acquiring description information of an image to be recognized, the description information of said image being information used for describing said image; on the basis of the description information of said image, respectively performing image generation by means of N image generation modes, so as to obtain N machine-generated images, N being a positive integer; separately comparing said image with the N machine-generated images, so as to obtain first probability values respectively corresponding to the N image generation modes, the first probability values being used for indicating the probability of said image being generated by a corresponding image generation mode; and when the first probability value corresponding to any image generation mode is not smaller than a first threshold, determining said image being a machine-generated image.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device, computer-readable storage medium, and computer program product for recognizing machine-generated images

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 202310432891.7 and application date April 17, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The embodiments of the present application relate to the field of image recognition technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for recognizing machine-generated images. Background Art

[0004] Artificial Intelligence Generated Content (AIGC) is a currently highly anticipated development direction in artificial intelligence (AI). For example, certain image generation methods can be used to generate machine-generated images that simulate photographs or real-life paintings. However, because the difference between machine-generated images and non-machine-generated images is sometimes not very obvious, other methods are needed to distinguish between machine-generated images and non-machine-generated images.

[0005] In related technologies, a binary classification model is trained on a dataset of images that have been manually labeled as machine-generated images, and then the trained binary classification model is used to determine whether the image to be identified is a machine-generated image.

[0006] In the above-mentioned related technologies, the above-mentioned binary classification model has poor recognition accuracy for machine-generated images.

[0007] Summary of the Invention

[0008] The embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for recognizing machine-generated images, which can improve the accuracy of recognizing machine-generated images.

[0009] The technical solution of the embodiment of the present application is implemented as follows:

[0010] An embodiment of the present application provides a method for recognizing machine-generated images, the method being performed by an electronic device and comprising:

[0011] Obtaining description information of the image to be identified, where the description information of the image to be identified is information used to describe the image to be identified;

[0012] Based on the description information of the image to be identified, generate images using N image generation methods to obtain N machine-generated images, where N is a positive integer;

[0013] Comparing the image to be identified with the N machine-generated images respectively to obtain first probability values ​​corresponding to the N image generation methods, wherein the first probability values ​​are used to indicate the probability that the image to be identified is generated by the corresponding image generation method;

[0014] When the first probability value corresponding to any of the image generation methods is not less than a first threshold, it is determined that the image to be identified is the machine-generated image.

[0015] An embodiment of the present application provides a model training method, which is performed by an electronic device and includes:

[0016] Acquire at least one non-machine-generated image and description information of the non-machine-generated image, where the description information of the non-machine-generated image is information used to describe the non-machine-generated image;

[0017] Based on the description information of the non-machine-generated image, perform image generation processing using N image generation methods respectively to obtain a machine-generated image, where N is a positive integer;

[0018] Constructing a comparative learning dataset based on the non-machine-generated images and the machine-generated images, the comparative learning dataset comprising at least one positive sample pair and at least one negative sample pair, each positive sample pair comprising two machine-generated images generated by the same image generation method based on the description information of the same non-machine-generated image, and each negative sample pair comprising two machine-generated images generated by different image generation methods based on the description information of the same non-machine-generated image;

[0019] The comparative recognition model is trained using the comparative learning data set to obtain a trained comparative recognition model; wherein the trained comparative recognition model is used to compare the image to be recognized with N machine-generated images respectively, to obtain a first probability value that the image to be recognized and any one of the N machine-generated images are generated by the same image generation method, wherein the N machine-generated images are based on the description information of the image to be recognized and are generated by the N image generation methods respectively. An embodiment of the present application provides a device for recognizing machine-generated images, the device comprising:

[0020] An information acquisition module is configured to acquire description information of the image to be identified, wherein the description information of the image to be identified is information used to describe the content of the image to be identified;

[0021] An image acquisition module is configured to generate images using N image generation methods based on the description information of the image to be identified, thereby obtaining N machine-generated images, where N is a positive integer;

[0022] a score determination module configured to compare the image to be identified with the N machine-generated images, respectively, to obtain first probability values ​​corresponding to the N image generation methods, each of which indicates a probability that the image to be identified was generated by the corresponding image generation method;

[0023] The image recognition module is configured to determine that the image to be recognized is the machine-generated image when a first probability value corresponding to any of the image generation methods is not less than a first threshold.

[0024] The present invention provides a model training device, comprising:

[0025] an image acquisition module configured to acquire at least one non-machine-generated image and description information of the non-machine-generated image, wherein the description information of the non-machine-generated image is information used to describe the content of the non-machine-generated image;

[0026] An image generation module is configured to perform image generation processing using N image generation methods based on the description information of the non-machine-generated image to obtain a machine-generated image, where N is a positive integer;

[0027] a dataset construction module configured to construct a comparative learning dataset based on the non-machine-generated images and the machine-generated images, the comparative learning dataset comprising at least one positive sample pair and at least one negative sample pair, each positive sample pair comprising two machine-generated images generated by the same image generation method based on the description information of the same non-machine-generated image, and each negative sample pair comprising two machine-generated images generated by different image generation methods based on the description information of the same non-machine-generated image;

[0028] The model training module is configured to use the comparative learning data set to train the comparative recognition model to obtain a trained comparative recognition model; wherein, the trained comparative recognition model is used to compare the image to be recognized with N machine-generated images respectively, to obtain a first probability value that the image to be recognized and any one of the N machine-generated images are generated by the same image generation method, wherein, the N machine-generated images are based on the description information of the image to be recognized and are generated respectively by the N image generation methods.

[0029] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the above-mentioned method for recognizing machine-generated images, or to implement the above-mentioned model training method.

[0030] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned method for recognizing machine-generated images, or to implement the above-mentioned model training method.

[0031] An embodiment of the present application provides a computer program product, comprising a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the aforementioned method for recognizing machine-generated images or the aforementioned model training method.

[0032] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:

[0033] By using the descriptive information of the image to be identified to generate a machine-generated image, and then comparing and identifying the image to be identified with machine-generated images generated by certain image generation methods, the probability that the image to be identified is a machine-generated image generated by these image generation methods is determined, so that it can be determined whether the image to be identified is a machine-generated image or not. Since machine-generated images generated by the same image generation method have similarities, by comparing and identifying the reversely generated machine-generated image with the image to be identified, it can be better determined whether the image to be identified is a machine-generated image, thereby improving the recognition accuracy of machine-generated images.

[0034] 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

[0035] FIG1 is a schematic diagram of a method for recognizing machine-generated images provided in an embodiment of the present application;

[0036] FIG2 is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0037] FIG3 is a flow chart of a method for recognizing machine-generated images provided in an embodiment of the present application;

[0038] FIG4 is a flow chart of a model training method provided in an embodiment of the present application;

[0039] FIG5 is a schematic diagram of a classification model provided in an embodiment of the present application;

[0040] FIG6 is a flow chart of a method for recognizing machine-generated images and a model training method provided in an embodiment of the present application;

[0041] FIG7 is a block diagram of a device for recognizing machine-generated images according to an embodiment of the present application;

[0042] FIG8 is a block diagram of a model training device provided in an embodiment of the present application;

[0043] FIG9 is a block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numbers in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present application. Rather, they are merely examples of methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0045] The embodiments of the present application use computer vision and machine learning technology to train the contrast recognition model, so that the contrast recognition model can identify whether the image to be identified is a machine-generated image or not. Computer vision technology (CV) is a science that studies how to make machines "see". More specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further performs graphic processing so that the computer processing becomes an image that is more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D (3 Dimension) technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies.

[0046] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning through demonstration.

[0047] Please refer to Figure 1, which shows a schematic diagram of a method for recognizing machine-generated images provided in an embodiment of the present application. As shown in Figure 1, the method includes the following steps:

[0048] 1. Use the description information generation model 11 to generate description information of the image to be identified 12.

[0049] 2. Using multiple image generation methods, generate machine-generated images corresponding to N image generation methods based on the description information of the image to be identified 12, where N is a positive integer.

[0050] 3. Using the comparative recognition model 13, the image to be recognized 12 is compared with the machine-generated images corresponding to the N image generation methods generated based on the description information of the image to be recognized 12, and the probabilities of the image to be recognized 12 being generated by each image generation method are obtained.

[0051] 4. When the maximum probability among the probabilities corresponding to various image generation methods is greater than or equal to a threshold, it is determined that the image 12 to be identified is a machine-generated image; when the maximum probability among the probabilities corresponding to various image generation methods is less than a threshold, it is determined that the image 12 to be identified is not a machine-generated image.

[0052] Specifically, the description information generation model 11 includes a visual transformer (ViT model), an image block embedding layer and a language architecture model. After the image 12 to be identified passes through the visual transformer and the image block embedding layer, the features of the image 12 to be identified are obtained; the language architecture model generates description information of the image 12 to be identified based on the features of the image 12 to be identified. Among them, when the input of the description information generation model 11 is a picture and the output is text information (i.e., description information in text form), the description information generation model 11 can be called a picture-to-text generation model. In some embodiments, the language architecture model can be an autoregressive language model, which uses deep learning to generate text similar to human language. In layman's terms, a language architecture model is a computer program that will continuously learn and complete text-related tasks on its own, and no external personnel are required to operate during the learning process. The language architecture model can refer to a neural network model similar to a generative pre-trained language model, which can generate corresponding text information based on input information (such as a picture to be identified).

[0053] Then use the image generation model 1 to generate an image based on the description information, use the image generation model 2 to generate an image based on the description information, and use the image generation model 3 to generate an image based on the description information.

[0054] Next, the images generated by multiple image generation models and the image to be identified 12 are input into the visual transformer model in the comparative recognition model 13. The output of the visual transformer model of the image to be identified can be input into the image patch embedding layer (image Patch Embedding), the transformer encoder (Transformer Encoder), and the maximum pooling layer (Max Pooling) to obtain the feature map of the image to be identified. The output of the visual transformer model of the generated image can be input into the image patch embedding layer (image Patch Embedding), the transformer encoder (Transformer Encoder), and the maximum pooling layer (Max Pooling) to obtain the feature map of the generated image. Afterwards, the feature map of the image to be identified and the feature maps of the machine-generated images generated by the image generation methods are spliced, and comparative recognition is performed based on their respective feature maps, so as to obtain the first probability values ​​corresponding to the multiple image generation models.

[0055] Please refer to Figure 2, which shows a schematic diagram of an implementation environment provided by an embodiment of the present application, which can be implemented as a machine-generated image recognition system. As shown in Figure 2, the system 200 may include: a model training device 210 and a model use device 220.

[0056] In some embodiments, the model training device 210 is a terminal device. A terminal device is an electronic device with data calculation, processing and storage capabilities. The terminal device can be a personal computer, tablet computer, smart phone, wearable device, intelligent robot, intelligent voice interaction device, smart home appliance, vehicle-mounted terminal, aircraft, medical equipment and other terminal devices, or it can be a server, which is not limited in this application. The model training device 210 is used to train the contrast recognition model 13. In an embodiment of the present application, the contrast recognition model 13 is a neural network model used to determine whether the image to be identified is a machine-generated image or not. The model training device 210 can use machine learning to train the contrast recognition model 13 so that it has better performance.

[0057] The trained comparative recognition model 13 can be deployed in a model-using device 220 to provide a recognition result of a machine-generated image (i.e., whether the image to be recognized is a machine-generated image). The model-using device 220 can be a terminal device such as a PC, tablet computer, smartphone, wearable device, intelligent robot, intelligent voice interaction device, smart home appliance, vehicle-mounted terminal, aircraft, medical equipment, etc., or a server, and this application does not limit this.

[0058] In the machine-generated image recognition method provided in the embodiment of the present application, the execution entity of each step can be the model usage device 220; in the model training method provided in the embodiment of the present application, the execution entity of each step can be the model training device 210.

[0059] The embodiments of this application can be applied to various scenarios. For example, for images posted by users on social or video platforms, it can be used to identify whether they are machine-generated images, thereby improving the platform's operational efficiency. In some embodiments, a prompt message can be added to identified machine-generated images to avoid misleading other users of the platform after viewing machine-generated images, thereby maintaining the platform's interactive atmosphere for images.

[0060] The technical solution of this application is introduced and explained through several embodiments below.

[0061] Please refer to Figure 3, which shows a flow chart of a method for recognizing machine-generated images provided in an embodiment of the present application. In this embodiment, the method is applied to the model-using device described above as an example. The method may include the following steps (310-340):

[0062] Step 310: Obtain description information of the image to be identified. The description information of the image to be identified is information used to describe the image to be identified.

[0063] In some embodiments, the image to be identified needs to be determined to be a machine-generated image.

[0064] In some embodiments, a non-machine-generated image refers to an image captured by a camera or a human-drawn image. In some embodiments, a human-drawn image can refer to a physical painting created by a person using real-world painting tools such as a brush or paintbrush on a painting medium such as paper, cloth, wood, a wall, leather goods, or a container. It can also refer to a digital painting created by a person using an electronic device such as a personal computer, tablet, mobile phone, digital tablet, digital display, or virtual reality device. It can also refer to an image manually modified using a computer program based on a non-machine-generated image, such as an image manually edited using a photo editing application.

[0065] In some embodiments, the machine-generated image is neither directly captured by a photographic device nor drawn by a person, but is instead generated by the electronic device itself.

[0066] In some embodiments, machine-generated images include AI images generated by an AI image generation model, and each AI image generation model is a method of image generation. In some embodiments, an AI image generation model refers to a neural network model that can automatically generate images based on input information. In some embodiments, the AI ​​image generation model can be an existing AI image generation model, such as a diffusion model, Dream by WOMBO, Fotor AI Image Generator, Craiyon, Deep Dream Generator, and other models.

[0067] In some embodiments, machine-generated images include images automatically generated by an application according to set image generation rules. For example, the set image generation rules of a certain application are to perform deformation processing to simulate concave mirror imaging on each input image, change the shape of the image elements in the original image, and make the image elements in the original image look like the imaging of a normal object in a concave mirror.

[0068] In some embodiments, the descriptive information of the image to be identified is used to describe the image parameters, image style, image content, visual angle, etc. of the image to be identified. In some embodiments, the image parameters may include the image size, pixels, shape, format, shooting angle (such as overhead, overhead, wide-angle, close-up, macro, microscopic photography), etc. In some embodiments, the image style includes photographs (such as documentary (news) photography, documentary photography, scientific photography, life photography, nature photography, portrait photography, etc.), paintings (such as sketches, oil paintings, Chinese paintings, watercolors, gouache paintings, ink paintings, electronic paintings, etc.), etc. In some embodiments, the image style can also be categorized as fresh, literary, private, fashionable, black and white, etc. In some embodiments, the image content includes the elements displayed in the image to be identified, such as grassland, blue sky, white clouds, little girl, flowers, lawn, villa, lake, car, knitting, playing, playing, playing football, shooting, etc. In some embodiments, the visual angle may include looking down, sideways, looking up, looking straight, wide-angle, close-up, etc. In some embodiments, the description information of the image to be identified can be in plain text form, the description information can also be red, yellow and blue three-channel values ​​(such as the red, yellow and blue three-channel values ​​based on one or more main colors in the image to be identified), the description information can also be information in the form of an image, the description information can also be sound (such as music with a style matching the image content and artistic conception of the image to be identified) or other forms of information. The embodiments of the present application do not impose specific restrictions on this.

[0069] In some embodiments, a description information generation model is used to generate description information for the image to be identified. The description information generation model is a machine learning model built based on a neural network and used to generate description information for the image. When the image to be identified is input into the description information generation model, the description information generation model generates and outputs a description of the image to be identified.

[0070] In some embodiments, as shown in FIG1 , the description information generation model 11 includes a visual transformer (ViT model), an image block embedding layer, and a speech architecture model. After the image 12 to be identified passes through the visual transformer and the image block embedding layer, the features of the image 12 to be identified are obtained; and the GPT-like architecture model generates description information for the image 12 to be identified based on the features of the image 12 to be identified. In particular, when the input of the description information generation model 11 is an image and the output is text information (i.e., description information in text form), the description information generation model 11 can be referred to as an image-to-text generation model. In some embodiments, the speech architecture model is an autoregressive language model that uses deep learning to generate text similar to human language. In layman's terms, a speech architecture model is a computer program that continuously learns and completes text-related tasks on its own, without the need for external human intervention during the learning process. A GPT-like architecture model can refer to a neural network model similar to GPT that can generate corresponding text information based on input information (such as the image to be identified).

[0071] In step 320 , based on the description information of the image to be identified, N image generation methods are used to generate images respectively, to obtain N machine-generated images, where N is a positive integer.

[0072] In some embodiments, the descriptive information of the image to be identified is input into N different image generation methods. Each image generation method generates one or more machine-generated images based on the descriptive information of the image to be identified, thereby obtaining machine-generated images that are identical or similar to the image to be identified in one or more aspects. For example, if the image to be identified includes elements such as blue sky, white clouds, and grassland, the descriptive information of the image to be identified may be "blue sky + white clouds + grassland". Each image generation method can generate a machine-generated image based on the descriptive information of "blue sky + white clouds + grassland", and the machine-generated images generated by each image generation method also include elements such as blue sky, white clouds, and grassland.

[0073] In some embodiments, based on the description information of the image to be identified, an image generation method can generate one or more corresponding machine-generated images.

[0074] In some embodiments, in step 320, N machine-generated images are generated using N image generation methods based on the descriptive information of the image to be identified. This can be achieved by the following technical solution: based on the descriptive information of the image to be identified, N machine-generated images are generated using N image generation models; wherein any two of the N image generation models meet at least one of the following conditions: the model structures of the two image generation models are different; the training data sets of the two image generation models are different; and the model parameters of the two image generation models are different. This embodiment of the present application can cover machine-generated images generated by N image generation models, thereby avoiding subsequent missed recognitions and improving recognition accuracy.

[0075] As an example, the N kinds of image generation methods here are actually N kinds of image generation models, namely the AI ​​models described in this application. These N kinds of image generation models differ at least in model structure, model parameters and training data sets. In view of the different model structures, the image generation model here can be a diffusion model, and the image generation model can also be an adversarial generative network, that is, the two image generation models can have different model structures; or the image generation model A and the image generation model B are both diffusion models, but due to the difference in the number of iterative training, the parameters of each layer of the model structure are different, so it is a case of different model parameters; or the image generation model A and the image generation model B are both diffusion models, but due to the difference in the training data sets, this is a case where the training data sets of the two image generation models are different.

[0076] Step 330 : Compare the image to be identified with the N machine-generated images respectively to obtain first probability values ​​corresponding to the N image generation methods.

[0077] The first probability value is used to indicate the probability that the image to be identified is generated by the corresponding image generation method.

[0078] In some embodiments, referring to Figure 1, after the picture to be identified and the machine-generated pictures generated by N picture generation methods are input into the contrast recognition model, after passing through the vision transformer model (the structure is the same as the vision transformer model in the related art, and the parameters are determined based on the training process of the contrast recognition model involved in the embodiment of the present application), the image patch embedding layer (the structure is the same as the image patch embedding layer in the related art, and the parameters are determined based on the training process of the contrast recognition model involved in the embodiment of the present application), the transformer encoder (the structure is the same as the transformer encoder in the related art, and the parameters are determined based on the training process of the contrast recognition model involved in the embodiment of the present application), and the maximum pooling layer (Max Pooling) (the structure is the same as the maximum pooling layer in the related art, and the parameters are determined based on the training process of the contrast recognition model involved in the embodiment of the present application), the feature map of the picture to be identified and the feature map of the machine-generated pictures generated by N picture generation methods are obtained. Afterwards, the feature map of the image to be identified and the feature map of the machine-generated image are spliced ​​together, and the spliced ​​feature map is mapped (implemented by a fully connected layer) to obtain the first probability values ​​corresponding to the N types of image generation methods. In some embodiments, the comparative recognition model is a machine learning model built based on a neural network, which is used to determine whether two images are generated by the same image generation method. After the two images are input into the comparative recognition model, the comparative recognition model will output the probability that the two images were generated by the same image generation method.

[0079] In some embodiments, the first probability value corresponding to the target image generation method is positively correlated with the probability that the image to be identified was generated by the target image generation method. That is, the higher the probability that the image to be identified was generated by the target image generation method, the higher the first probability value; the lower the probability that the image to be identified was generated by the target image generation method, the lower the first probability value. In some embodiments, the first probability value corresponding to the target image generation method is the value of the probability that the image to be identified was generated by the target image generation method. The first probability value ranges from 0 to 1. The target image generation method here is any one of the N image generation methods described above.

[0080] In some embodiments, the first probability value can also indicate the probability that the image to be identified is not generated by the corresponding image generation method, that is, the first probability value corresponding to the target image generation method can also be used to indicate the probability that the image to be identified is not generated by the target image generation method. The first probability value corresponding to the target image generation method is negatively correlated with the probability that the image to be identified is generated by the target image generation method. That is, the higher the probability that the image to be identified is generated by the target image generation method, the lower the first probability value; the lower the probability that the image to be identified is generated by the target image generation method, the higher the first probability value. In some embodiments, the first probability value corresponding to the target image generation method is the inverse value of the probability that the image to be identified is generated by the target image generation method. The first probability value is a positive number, and the target image generation method here is any one of the N image generation methods mentioned above.

[0081] Step 340: If the first probability value corresponding to any of the image generation methods is not less than a first threshold, determine that the image to be identified is the machine-generated image.

[0082] Since the first probability value corresponding to the target image generation method can reflect the probability that the image to be identified is generated by the target image generation method, it is possible to determine whether the image to be identified is a machine-generated image based on the first probability value. The target image generation method here is any one of the above-mentioned N image generation methods.

[0083] In some embodiments, if the first probability value corresponding to the target image generation method is positively correlated with the probability that the image to be identified is generated by the target image generation method, then when the first probability value is greater than or equal to the first threshold, it is determined that the image to be identified is a machine-generated image; when the first probability value is less than the first threshold, it is determined that the image to be identified is not a machine-generated image, and the target image generation method here is any one of the above-mentioned N image generation methods.

[0084] In some embodiments, the first probability value can also indicate the probability that the picture to be identified is not generated by the corresponding picture generation method, that is, the first probability value corresponding to the target picture generation method can also be used to indicate the probability that the picture to be identified is not generated by the target picture generation method. The first probability value corresponding to the target picture generation method is negatively correlated with the probability that the picture to be identified is generated by the target picture generation method. If the first probability value corresponding to the target picture generation method is negatively correlated with the probability that the picture to be identified is generated by the target picture generation method, then when the first probability value is less than or equal to the second threshold (that is, when the first condition is met), it is determined that the picture to be identified is a machine-generated picture; when the first probability value is not less than the second threshold (that is, when the first condition is not met), it is determined that the picture to be identified is not a machine-generated picture. The target picture generation method here is any one of the above-mentioned N picture generation methods.

[0085] The specific values ​​of the first threshold and the second threshold can be set by relevant technical personnel according to actual conditions, and the embodiments of the present application do not make specific limitations on this.

[0086] To sum up, the technical solution provided by the embodiment of the present application generates a machine-generated picture based on the description information of the picture to be identified through a picture generation method, and then compares and identifies the picture to be identified with these machine-generated pictures generated by the picture generation method, and determines the probability that the picture to be identified is a machine-generated picture generated by these picture generation methods, so as to determine whether the picture to be identified is a machine-generated picture or not. Since machine-generated pictures generated by the same picture generation method have similarities, by comparing and identifying the reversely generated machine-generated pictures, it is possible to better determine whether the picture to be identified is a machine-generated picture, thereby improving the recognition accuracy of machine-generated pictures.

[0087] In some possible implementations, the aforementioned step 330 of comparing the image to be identified with the N machine-generated images to obtain first probability values ​​corresponding to the N image generation methods can be implemented by the following technical solution: performing the following processing for each image generation method: performing the following processing using a comparative recognition model: determining the first probability value corresponding to the image generation method based on the image to be identified and the machine-generated image generated using the image generation method. By using the comparative recognition model to complete the aforementioned comparative processing in the embodiments of the present application, artificial intelligence model technology can be applied to comparative recognition to improve recognition accuracy.

[0088] As an example, first probability values ​​corresponding to various image generation methods are determined by comparing the recognition model. For example, the recognition model compares and identifies the image to be identified and a machine-generated image generated by a target image generation method to determine a first probability value corresponding to the target image generation method, where the target image generation method is any one of the N image generation methods.

[0089] In some embodiments, the aforementioned process of performing the following processing using a comparative recognition model: determining a first probability value corresponding to the image generation method based on the image to be recognized and a machine-generated image generated using the image generation method, can be achieved through the following technical solution: using the image to be recognized and a machine-generated image generated using the image generation method as inputs to the comparative recognition model, outputting a first probability value through the comparative recognition model, and determining the first probability value as the first probability value corresponding to the image generation method. This allows the first probability value to intuitively and accurately represent the likelihood that the image to be recognized was generated using the target image generation method, eliminating the need for computational integration of the comparative recognition model outputs, thereby improving computing resource utilization.

[0090] In some embodiments, the above-mentioned comparative recognition model performs the following processing: determining the first probability value corresponding to the picture generation method based on the picture to be recognized and the machine-generated picture generated by the picture generation method, which can be achieved through the following technical solution: using multiple picture pairs as the comparative recognition model, outputting the second probability values ​​corresponding to the multiple picture pairs respectively through the comparative recognition model, and determining the first probability value corresponding to the picture generation method based on the second probability values ​​corresponding to the multiple picture pairs respectively; wherein the number of machine-generated pictures generated by the picture generation method is multiple, and each of the picture pairs includes the picture to be recognized and a machine-generated picture generated by the picture generation method.

[0091] As an example, when the number of machine-generated images generated by the target image generation method is multiple, the multiple machine-generated images generated by the target image generation method are compared and identified with the image to be identified through the comparative recognition model to obtain second probability values ​​corresponding to the multiple image pairs; the mean, maximum value, or median value of the second probability values ​​corresponding to the multiple image pairs is determined as the first probability value corresponding to the target image generation method, and the target image generation method is any one of the N image generation methods. For a certain image generation method, multiple second probability values ​​are obtained by generating multiple machine-generated images and comparing them with the image to be identified, and the first probability value corresponding to the image generation method is obtained based on the multiple second probability values. This can reduce the error of the first probability value corresponding to the image generation method, improve the precision of the first probability value, and thus improve the recognition accuracy of the comparative recognition model.

[0092] In the above implementation, the first probability values ​​corresponding to various image generation methods are determined by a comparative recognition model, and the first probability value can intuitively and accurately represent the possibility that the image to be identified is generated by the target image generation method, thereby improving the recognition accuracy of the comparative recognition model; and, by adopting one image generation method to generate multiple machine-generated images and taking the average of the first probability values ​​corresponding to the multiple machine-generated images, the accuracy of the first probability value corresponding to the obtained image generation method is improved, thereby further improving the recognition accuracy of the comparative recognition model.

[0093] In some embodiments, after executing step 302, the image to be identified is classified using a classification model to obtain a third probability value for the image to be identified; wherein the third probability value is used to indicate the probability that the image to be identified is the machine-generated image; and when the third probability value and the first probability values ​​corresponding to the N image generation methods respectively meet a second condition, the image to be identified is determined to be the machine-generated image. Through embodiments of the present application, the classification result and the recognition result can be combined to jointly determine whether the image to be identified is a machine-generated image, thereby improving the accuracy of the determination of the image to be identified.

[0094] For example, a classification model is a model built based on a neural network. The classification model is used to classify and identify whether the image to be identified is a machine-generated image or not, or whether the image to be identified was generated by various AI image generation models. When the image to be identified is input into the classification model, the classification model will output the probability that the image is machine-generated. Alternatively, the classification model will output the probability that the image was generated by various image generation methods and the probability that the image is not machine-generated.

[0095] As an example, the classification model is a two-classification model, that is, a model that can only obtain two classification results. For example, the classification result of the classification model in the embodiment of the present application can only output two classification results: the picture to be identified is a machine-generated picture, and the picture to be identified is not a machine-generated picture. Among them, the third probability value can be used to represent the probability or possibility that the picture to be identified is a machine-generated picture. In some embodiments, if the third probability value is greater than or equal to the third threshold, the classification result of the classification model is that the picture to be identified is a machine-generated picture; if the third probability value is less than the third threshold, the classification result of the classification model is that the picture to be identified is not a machine-generated picture. In some embodiments, when the first probability value is the probability value that the picture to be identified is a machine-generated picture, the third threshold is greater than or equal to 0.5, such as 0.5, 0.55, 0.6, 0.7, 0.8, etc. The specific value of the third threshold can be set by relevant technical personnel according to actual conditions, and the embodiment of the present application does not make specific limitations on this.

[0096] In some embodiments, the above-mentioned classification processing of the image to be identified by the classification model to obtain the third probability value of the image to be identified can be achieved by the following technical solution: the image to be identified is classified by the classification model to obtain N fourth probability values, and the N fourth probability values ​​are used to indicate the probability that the image to be identified is generated by the N image generation methods; the N fourth probability values ​​are summed to obtain the sum of the N fourth probability values; and the third probability value is determined based on the sum of the N fourth probability values. Through the embodiment of the present application, N fourth probability values ​​corresponding to N image generation methods can be obtained from the perspective of classification. Unlike the previous embodiment in which both the image to be identified and the machine-generated image are input into the comparative recognition model, it directly determines whether the image to be identified is generated based on the above-mentioned N image generation methods, that is, the relationship between the image to be identified and the image generation method is judged from different angles to improve the judgment accuracy. Then, the N fourth probability values ​​corresponding to the N image generation methods are fused, and the third probability value of the image to be identified as a machine-generated image can be obtained as a whole, thereby improving the judgment accuracy.

[0097] As an example, the picture to be identified is input into the classification model, and the classification model can output N+1 fourth probability values; among them, the first N fourth probability values ​​of the N+1 fourth probability values ​​are used to indicate the probabilities that the picture to be identified is generated by N picture generation methods respectively; the N+1th probability value of the N+1 fourth probability values ​​is used to indicate the probability that the picture to be identified is not a machine-generated picture.

[0098] As an example, N represents the number of AI image generation models involved in recognition, where N is an integer greater than or equal to 2. The classification model is a multi-classification model, meaning that the number of classification results of the classification model (i.e., N+1) is greater than 2. The first N fourth probability values ​​of the N+1 second probability values ​​are summed, and the resulting third probability value (which can be expressed as P_cls_sum) can be used to indicate the probability that the image to be recognized, obtained by the classification model, is a machine-generated image.

[0099] In some embodiments, by combining the third probability value obtained by the multi-classification model and the first probability values ​​corresponding to the N types of image generation methods obtained by the comparative recognition model, it can be comprehensively determined whether the image to be identified is a machine-generated image or not.

[0100] In some embodiments, when the third probability value and the first probability values ​​corresponding to the N types of image generation methods respectively meet the second condition, determining that the image to be identified is the machine-generated image can be achieved through the following technical solution: obtaining the maximum value of the first probability values ​​corresponding to the N types of image generation methods respectively, wherein the maximum value is the maximum value or the minimum value; determining a comprehensive probability value based on the maximum value and the third probability value; and determining that the image to be identified is the machine-generated image when the comprehensive probability value is greater than or equal to a threshold.

[0101] As an example, the second condition is that the comprehensive probability value is greater than or equal to a threshold, and the threshold can be set according to the requirement of recognition accuracy.

[0102] As an example, when the first probability value corresponding to the picture generation method is positively correlated with the probability that the picture to be identified is generated by the picture generation method, the above-mentioned maximum value refers to the maximum value (which can be expressed as P_sam_max) among the first probability values ​​corresponding to the N picture generation methods respectively. When the first probability value corresponding to the picture generation method is negatively correlated with the probability that the picture to be identified is generated by the picture generation method, the above-mentioned maximum value refers to the minimum value among the first probability values ​​corresponding to the N picture generation methods respectively.

[0103] As an example, if the above-mentioned maximum value refers to the maximum value, the comprehensive probability value can be obtained by directly summing or weighted summing the third probability value and the maximum value. In some embodiments, the comprehensive probability value can be expressed as P_AI, see formula (1): P_AI = Weight_1*P_cls_sum+Weight_2*P_sam_max (1);

[0104] Wherein, Weight_1 is the weight of the third probability value, and Weight_2 is the weight of the maximum value. In some embodiments, Weight_1 + Weight_2 = 1, and Weight_2 is greater than Weight_1. For example, Weight_1 = 0.2, Weight_2 = 0.8. Of course, the specific values ​​of Weight_1 and Weight_2 can be set by relevant technicians according to actual conditions, and the embodiments of this application do not specifically limit this.

[0105] In the above implementation, a comprehensive probability value is obtained by combining the maximum and third probability values ​​of the first probability values ​​corresponding to N types of image generation methods, thereby combining the recognition results of the comparative recognition model and the classification model for comprehensive consideration. Based on this, the final determination result of whether the image to be identified is a machine-generated image is more accurate, thereby improving the recognition accuracy of machine-generated images.

[0106] Please refer to Figure 4, which shows a flow chart of the model training method provided in an embodiment of the present application. In this embodiment, the method is applied to the model training device introduced above as an example. The method may include the following steps (410-440):

[0107] Step 410: Obtain at least one non-machine-generated image and description information of the non-machine-generated image. The description information of the non-machine-generated image is information used to describe the non-machine-generated image.

[0108] In some embodiments, a non-machine-generated image refers to an image that is naturally generated rather than generated by an image generation method, such as an image captured by a photographic device or an image drawn by a person.

[0109] For the description information of the non-machine-generated image, reference may be made to the content of step 310 in the embodiment of FIG. 3 , which will not be described in detail here.

[0110] In some embodiments, a description information generation model is used to generate description information for non-machine-generated images. In some embodiments, the description information generation model is pre-trained using sample images that are manually annotated with description information.

[0111] Step 420 , based on the description information of the non-machine-generated image, perform image generation processing using N image generation methods to obtain a machine-generated image, where N is a positive integer.

[0112] Step 430: construct a comparative learning dataset based on the non-machine-generated images and the machine-generated images.

[0113] In some embodiments, the comparative learning dataset includes at least one positive sample pair and at least one negative sample pair, each positive sample pair includes two machine-generated images generated by the same image generation method based on the description information of the same non-machine-generated image, and each negative sample pair includes two machine-generated images generated by different image generation methods based on the description information of the same non-machine-generated image.

[0114] As an example, based on the non-machine-generated picture Img.1, the following machine-generated pictures can be generated: Picture Img_1_M1_1: Picture 1 randomly generated by picture generation method 1 based on the description information of Img_1; Picture Img_1_M1_2: Picture 2 randomly generated by picture generation method 1 based on the description information of Img_1; Picture Img_1_M2_1: Picture 1 randomly generated by picture generation method 2 based on the description information of Img_1; Picture Img_1_M2_2: Picture 2 randomly generated by picture generation method 2 based on the description information of Img_1; and so on, which can be expressed as: Picture Img_1_Mk_1: Picture 1 randomly generated by picture generation method k based on the description information of Img_1; Picture Img_1_Mk_2: Picture 2 randomly generated by picture generation method k based on the description information of Img_1.

[0115] As an example, the positive sample pairs in the comparative learning dataset may include: Picture Img_1_M1_1: Picture 1 randomly generated by picture generation method 1 based on the description information of Img_1; Picture Img_1_M1_2: Picture 2 randomly generated by picture generation method 1 based on the description information of Img_1.

[0116] As an example, the negative sample pairs in the contrastive learning dataset may include: Picture Img_1_M1_1: Picture 1 randomly generated by picture generation method 1 based on the description information of Img_1; Picture Img_1_M2_1: Picture 1 randomly generated by picture generation method 2 based on the description information of Img_1.

[0117] Step 440 : Use the contrastive learning data set to train the contrastive recognition model to obtain a trained contrastive recognition model.

[0118] In some embodiments, during the training process, the comparative recognition model is used to perform comparative recognition on two images in an input sample pair to determine whether the two images in the sample pair are generated by the same image generation method, and adjust the parameters of the comparative recognition model based on the determination result.

[0119] In some embodiments, two images in a sample pair of input contrast recognition models are calculated, and the loss of the contrast recognition model is constructed by comparing the pre-distance between the features generated in the contrast recognition model. The loss of contrast recognition is positively correlated with the pre-distance, and the parameters of the contrast recognition model are adjusted based on the loss.

[0120] As an example, the trained comparative recognition model is used to compare the picture to be recognized with N machine-generated pictures respectively to obtain a first probability value that the picture to be recognized and any one of the N machine-generated pictures are generated by the same picture generation method, wherein the N machine-generated pictures are based on the description information of the picture to be recognized and are generated respectively by the N picture generation methods.

[0121] To sum up, in the technical solution provided in the embodiments of the present application, a machine-generated image is generated based on the description information of a non-machine-generated image through an image generation method, and then these machine-generated images are determined by which image generation method each is generated to construct a comparative learning data set, and a comparative recognition model is trained based on the comparative learning data set, so that the trained comparative recognition model can determine whether the image to be identified is a machine-generated image or not by comparing the input images (the image to be identified and the machine-generated image generated by a certain image generation method), thereby improving the recognition accuracy of machine-generated images.

[0122] In some embodiments, a classification dataset is constructed based on non-machine-generated images and sample machine-generated images. The classification dataset includes at least one training sample, each training sample being a non-machine-generated image or a sample machine-generated image. The classification dataset is used to train a classification model to obtain a trained classification model; wherein the trained classification model is used to output a third probability value indicating that the image to be identified is the machine-generated image, and the third probability value is used in combination with the first probability value to determine whether the image to be identified is the machine-generated image. By using the classification dataset to train the classification model in the embodiments of the present application, the classification model has a certain ability to determine whether the image to be identified is a machine-generated image or not.

[0123] In some embodiments, the aforementioned use of a classification dataset to train a classification model to obtain a trained classification model can be achieved through the following technical solution: performing a first phase of training on the classification model using the classification dataset to obtain a trained classification model. Performing a second phase of training on the classification model using machine-generated images to obtain a trained classification model.

[0124] In some embodiments, the classification model is used to predict the probability that the input image is generated by each image generation method, and the probability that the input image is not a machine-generated image.

[0125] As an example, during the first phase of training of the classification model, the images in the classification data set used can be obtained by screenshots from movies, TV shows, and short videos in a compliant and legal manner, or obtained from encyclopedia pages, or taken by yourself, or randomly generated based on existing non-machine-generated images using an image generation method. In the embodiment of the present application, during the first phase of training of the classification model, the source and acquisition method of the images in the classification data set used are not specifically limited. After the first phase of training is completed, the classification model has initially acquired a certain ability to recognize machine-generated images.

[0126] As an example, in the case where the classification model is a multi-classification model (i.e., the classification model that can output N+1 second probability values ​​as described above), after the classification model completes the first stage of training, the classification model is trained in the second stage using the N machine-generated images described above for machine-generated images generated by the classification model based on the descriptive information of the non-machine-generated images. Because the machine-generated images used in the second stage of training all have clear sources, that is, the image generation methods corresponding to the machine-generated images used in the second stage of training are all known and determined, the classification model can learn the characteristics of machine-generated images generated by various image generation methods.

[0127] As an example, as shown in FIG5 , the classification model 51 may include a visual transformer model, an image block embedding layer, a transformer encoder, a maximum pooling layer, an efficiency network (EfficientNet), and a feature splicing layer. The features of the image to be identified obtained through the visual transformer model, the image block embedding layer, the transformer encoder, and the maximum pooling layer are combined with the features of the image to be identified through the efficiency network. Feature splicing is then performed in the feature splicing layer to determine the probability that the image to be identified was generated by various image generation methods, as well as the probability that the image to be identified is not a machine-generated image.

[0128] In the above implementation method, by performing multi-stage training on the classification model, the classification model has initially acquired a certain ability to recognize machine-generated images before the second stage of training, thereby saving the number of samples and / or training time required for the second stage of training and improving the training efficiency of the classification model.

[0129] In some embodiments, as shown in FIG6 , taking the case where the machine-generated image is an AI-generated image and the image generation method is an AI image generation model as an example, the machine-generated image recognition method and model training method may include the following steps ( 601 - 608 ):

[0130] Step 601: Obtain description information of non-AI generated images, and based on the description information of the non-AI generated images, use AI image generation models in the AI ​​image generation model library to generate AI images corresponding to the respective AI image generation models;

[0131] Step 602, constructing a multi-classification dataset;

[0132] Step 603: training the classification model based on the multi-classification dataset to obtain a trained classification model;

[0133] Step 604: construct a comparative learning dataset based on the AI ​​images corresponding to each AI image generation model;

[0134] Step 605: training a contrastive recognition model based on the contrastive learning data set to obtain a trained contrastive recognition model;

[0135] Step 606: Classification result of the image to be identified obtained based on the classification model;

[0136] Step 607: Obtain a comparison result between the image to be identified and the AI ​​images generated by the N AI image generation models based on the comparison recognition model;

[0137] Step 608, combining the classification result of the image to be identified obtained by the classification model, and the comparison result between the image to be identified and the AI ​​images generated by N AI image generation models, generates and outputs a recognition result of whether the image to be identified is an AI-generated image or not.

[0138] In this application, the implementation of the data capture technical solution involved, when the above embodiments of this application are applied to specific products or technologies, the relevant data collection, use and processing processes should comply with the requirements of national laws and regulations, conform to the principles of legality, legitimacy and necessity, do not involve obtaining data types prohibited or restricted by laws and regulations, and will not hinder the normal operation of the target website.

[0139] It is understandable that in the embodiments of the present application, when data related to object resource transfer behavior is involved and is applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0140] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0141] Please refer to Figure 7, which shows a block diagram of a device for identifying machine-generated images provided in an embodiment of the present application. Device 700 may include: an information acquisition module 710, an image acquisition module 720, a score determination module 730, and an image recognition module 740. Information acquisition module 710 is configured to obtain descriptive information of an image to be identified, where the descriptive information of the image to be identified is information describing the image to be identified. Image acquisition module 720 is configured to generate images using N image generation methods based on the descriptive information of the image to be identified, thereby obtaining N machine-generated images, where N is a positive integer. Score determination module 730 is configured to compare the image to be identified with the N machine-generated images, respectively, to obtain first probability values ​​corresponding to each of the N image generation methods. The first probability values ​​indicate the probability that the image to be identified was generated by the corresponding image generation method. Image recognition module 740 is configured to determine that the image to be identified is a machine-generated image if the first probability value corresponding to any of the image generation methods is not less than a first threshold.

[0142] In some embodiments, the image acquisition module 720 is configured to generate images based on the description information of the image to be identified through N types of image generation models to obtain N machine-generated images; wherein, any two of the N types of image generation models meet at least one of the following conditions: the model structures of the two image generation models are different; the training data sets of the two image generation models are different; the model parameters of the two image generation models are different.

[0143] In some embodiments, the score determination module 730 is configured to perform the following processing for each of the image generation methods: perform the following processing by comparing the recognition model: determine the first probability value corresponding to the image generation method based on the image to be identified and the machine-generated image generated by the image generation method.

[0144] In some embodiments, the score determination module 730 is configured to: use the picture to be identified and a machine-generated picture generated by the picture generation method as inputs of the comparative recognition model, output a first probability value through the comparative recognition model, and determine the first probability value as the first probability value corresponding to the picture generation method; or use multiple picture pairs as the comparative recognition model, output second probability values ​​corresponding to the multiple picture pairs respectively through the comparative recognition model, and determine the first probability value corresponding to the picture generation method based on the second probability values ​​corresponding to the multiple picture pairs respectively; wherein the number of machine-generated pictures generated by the picture generation method is multiple, and each of the picture pairs includes the picture to be identified and a machine-generated picture generated by the picture generation method.

[0145] In some embodiments, the score determination module 730 is further configured to: classify the picture to be identified through a classification model to obtain a third probability value of the picture to be identified; wherein the third probability value is used to indicate the probability that the picture to be identified is the machine-generated picture; when the third probability value and the first probability values ​​corresponding to the N picture generation methods respectively meet the second condition, determine that the picture to be identified is the machine-generated picture.

[0146] In some embodiments, the score determination module 730 is configured to: classify the image to be identified through a classification model to obtain N fourth probability values, where the N fourth probability values ​​are used to indicate the probability that the image to be identified is generated by the N image generation methods respectively; sum the N fourth probability values ​​to obtain the sum of the N fourth probability values; and determine the third probability value based on the sum of the N fourth probability values.

[0147] In some embodiments, the score determination module 730 is configured to: obtain the maximum value of the first probability values ​​corresponding to the N types of image generation methods, wherein the maximum value is the maximum value or the minimum value; determine the comprehensive probability value based on the maximum value and the third probability value; when the comprehensive probability value is greater than or equal to a threshold, determine that the image to be identified is the machine-generated image; when the comprehensive probability value is less than the threshold, determine that the image to be identified is not the machine-generated image.

[0148] To sum up, the technical solution provided by the embodiment of the present application generates a machine-generated picture based on the description information of the picture to be identified through a picture generation method, and then compares and identifies the picture to be identified with these machine-generated pictures generated by the picture generation method, and determines the probability that the picture to be identified is a machine-generated picture generated by these picture generation methods, so as to determine whether the picture to be identified is a machine-generated picture or not. Since machine-generated pictures generated by the same picture generation method have similarities, by comparing and identifying the reversely generated machine-generated pictures, it is possible to better determine whether the picture to be identified is a machine-generated picture, thereby improving the recognition accuracy of machine-generated pictures.

[0149] Please refer to Figure 8, which shows a block diagram of a model training device provided in an embodiment of the present application. Device 800 may include: an image acquisition module 810, an image generation module 820, a dataset construction module 830, and a model training module 840. The image acquisition module 810 is configured to acquire at least one non-machine-generated image and description information of the non-machine-generated image, where the description information of the non-machine-generated image is information used to describe the non-machine-generated image. The image generation module 820 is configured to perform image generation processing using N image generation methods based on the description information of the non-machine-generated image to obtain machine-generated images, where N is a positive integer. The dataset construction module 830 is configured to construct a comparative learning dataset based on the non-machine-generated image and the machine-generated image. The comparative learning dataset includes at least one positive sample pair and at least one negative sample pair. Each positive sample pair includes two machine-generated images generated using the same image generation method based on the description information of the same non-machine-generated image, and each negative sample pair includes two machine-generated images generated using different image generation methods based on the description information of the same non-machine-generated image. The model training module 840 is configured to use the comparative learning data set to train the comparative recognition model to obtain a trained comparative recognition model; wherein, the trained comparative recognition model is used to compare the image to be recognized with N machine-generated images respectively, to obtain a first probability value that the image to be recognized and any one of the N machine-generated images are generated by the same image generation method, wherein, the N machine-generated images are based on the description information of the image to be recognized and are generated respectively by the N image generation methods.

[0150] In some embodiments, the dataset construction module 830 is further configured to: construct a classification dataset based on the non-machine-generated pictures and the sample machine-generated pictures, the classification dataset including at least one training sample, each training sample being one of the non-machine-generated pictures or one of the sample machine-generated pictures; use the classification dataset to train a classification model to obtain a trained classification model; wherein the trained classification model is used to output a third probability value indicating that the picture to be identified is the machine-generated picture, and the third probability value is used in combination with the first probability value to determine whether the picture to be identified is the machine-generated picture or not.

[0151] In some embodiments, the data set construction module 830 is configured to: use the classification data set to perform the first stage training on the classification model to obtain the trained classification model; use the machine-generated images to perform the second stage training on the classification model to obtain the trained classification model.

[0152] In some embodiments, the classification model is used to predict the probability that the input image is generated by each image generation method, and the probability that the input image is not the machine-generated image.

[0153] To sum up, in the technical solution provided in the embodiment of the present application, a machine-generated image is generated based on the description information of the non-machine-generated image through an image generation method, and then these machine-generated images that determine which image generation method each is generated by are used to construct a comparative learning data set, and a comparative recognition model is trained based on the comparative learning data set, so that the trained comparative recognition model can determine whether the image to be identified is a machine-generated image or not by comparing the input image, thereby improving the recognition accuracy of whether the image to be identified is a machine-generated image.

[0154] It should be noted that the apparatus provided in the above embodiments, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0155] Please refer to Figure 9, which shows a block diagram of an electronic device provided in an embodiment of the present application. The electronic device can be the model-using device described above, used to implement the machine-generated image recognition method provided in the above embodiment. Alternatively, the electronic device can be the model training device described above, used to implement the model training method provided in the above embodiment.

[0156] Typically, the electronic device 900 includes a processor 901 and a memory 902 .

[0157] The processor 901 may include one or more processing cores, such as a quad-core processor, a hexa-core processor, etc. The processor 901 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state.

[0158] In some embodiments, the processor 901 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI processor, which is used to process computing operations related to machine learning. The memory 902 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 stores a computer program, which is loaded and executed by the processor 901 to implement the machine-generated image recognition method provided in the above-mentioned method embodiments, or to implement the model training method provided in the above-mentioned method embodiments.

[0159] In an exemplary embodiment, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is executed by a processor, it implements the above-mentioned method for recognizing machine-generated images or the above-mentioned model training method.

[0160] Optionally, the computer-readable storage medium may include: a read-only memory (ROM), a random-access memory (RAM), a solid-state drive (SSD), or an optical disk. The random-access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM).

[0161] The present application also provides a computer program product, comprising a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the aforementioned method for recognizing machine-generated images or the aforementioned model training method.

[0162] It should be noted that before collecting the user's relevant data and during the process of collecting the user's relevant data, this application can display a prompt interface, pop-up window or output voice prompt information. The prompt interface, pop-up window or voice prompt information is used to remind the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining the user's relevant data after obtaining the user's confirmation operation on the prompt interface or pop-up window. Otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the user's relevant data are terminated, that is, the user's relevant data is not obtained. In other words, all user data collected by this application are collected with the user's consent and authorization, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0163] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.

[0164] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for recognizing a machine-generated image, the method being performed by an electronic device, the method comprising: Acquire description information of the image to be identified, where the description information of the image to be identified is information used to describe the image to be identified; Based on the description information of the image to be identified, generate images using N image generation methods to obtain N machine-generated images, where N is a positive integer; Comparing the image to be identified with the N machine-generated images respectively, to obtain first probability values ​​corresponding to the N image generation methods respectively, the first probability values ​​being used to indicate the probability that the image to be identified is generated by the corresponding image generation method; When the first probability value corresponding to any of the image generation methods is not less than a first threshold, it is determined that the image to be identified is the machine-generated image.

2. The method according to claim 1, wherein: The method of generating images by using N image generation methods based on the description information of the image to be identified to obtain N machine-generated images includes: Based on the description information of the image to be identified, N image generation models are used to generate images respectively to obtain N machine-generated images; Among them, any two of the N image generation models satisfy at least one of the following conditions: The model structures of the two image generation models are different from each other; The training data sets of the two image generation models are different from each other; The model parameters of the two image generation models are different from each other.

3. The method according to claim 1 or 2, wherein: The step of comparing the image to be identified with the N machine-generated images to obtain first probability values ​​corresponding to the N image generation methods respectively includes: The following processing is performed for each of the image generation methods: The following processing is performed by comparing the recognition model: according to the image to be recognized and the machine-generated image generated by the image generation method, a first probability value corresponding to the image generation method is determined.

4. The method according to claim 3, wherein: The performing of the following processing by comparing the recognition model: determining a first probability value corresponding to the image generation method according to the image to be recognized and the machine-generated image generated by the image generation method, including: Taking the image to be identified and a machine-generated image generated by the image generation method as inputs of the comparison recognition model, and outputting a first probability value corresponding to the image generation method through the comparison recognition model; or, Using multiple picture pairs as the comparative recognition model, outputting second probability values ​​respectively corresponding to the multiple picture pairs through the comparative recognition model, and determining the first probability value corresponding to the picture generation method according to the second probability values ​​respectively corresponding to the multiple picture pairs; wherein the number of machine-generated pictures generated by the picture generation method is multiple, and each of the picture pairs includes the picture to be identified and a machine-generated picture generated by the picture generation method.

5. The method according to any one of claims 1 to 4, wherein: The method further comprises: Classifying the image to be identified by using a classification model to obtain a third probability value of the image to be identified; wherein the third probability value is used to indicate the probability that the image to be identified is the machine-generated image; When the third probability value and the first probability values ​​respectively corresponding to the N image generation methods satisfy the second condition, it is determined that the image to be identified is the machine-generated image.

6. The method according to claim 5, wherein: The classifying the image to be identified by using a classification model to obtain a third probability value of the image to be identified includes: Classify the image to be identified by using a classification model to obtain N fourth probability values, where the N fourth probability values ​​are used to indicate the probabilities that the image to be identified is generated by the N image generation methods respectively; Performing a summing process on the N fourth probability values ​​to obtain a summing result of the N fourth probability values; The third probability value is determined according to the sum of the N fourth probability values.

7. The method according to claim 5, wherein: The determining that the to-be-recognized image is the machine-generated image when the third probability value and the first probability values ​​respectively corresponding to the N image generation modes satisfy the second condition comprises: Obtaining the maximum value of the first probability values ​​respectively corresponding to the N picture generation modes, wherein the maximum value is a maximum value or a minimum value; Determining a comprehensive probability value according to the maximum value and the third probability value; When the comprehensive probability value is greater than or equal to a threshold, it is determined that the image to be identified is the machine-generated image.

8. A model training method, the method being performed by an electronic device, the method comprising: Acquire at least one non-machine-generated picture and description information of the non-machine-generated picture, where the description information of the non-machine-generated picture is information used to describe the non-machine-generated picture; Based on the description information of the non-machine-generated image, perform image generation processing respectively through N image generation methods to obtain a machine-generated image, where N is a positive integer; Based on the non-machine-generated pictures and the machine-generated pictures, a comparative learning dataset is constructed, wherein the comparative learning dataset includes at least a positive sample pair and at least one negative sample pair, each positive sample pair including two machine-generated images generated by the same image generation method based on the description information of the same non-machine-generated image, and each negative sample pair including two machine-generated images generated by different image generation methods based on the description information of the same non-machine-generated image; The contrast recognition model is trained using the contrast learning data set to obtain a trained contrast recognition model; wherein the trained contrast recognition model is used to compare the image to be recognized with N machine-generated images respectively, to obtain a first probability value that the image to be recognized and any one of the N machine-generated images are generated by the same image generation method, wherein the N machine-generated images are based on the description information of the image to be recognized and are generated by the N image generation methods respectively.

9. The method according to claim 8, wherein: The method further comprises: Based on the non-machine-generated pictures and the sample machine-generated pictures, construct a classification data set, wherein the classification data set includes at least one training sample, and each training sample is one of the non-machine-generated pictures or one of the sample machine-generated pictures; The classification data set is used to train the classification model to obtain a classification model that has completed the training; wherein the classification model that has completed the training is used to output a third probability value indicating that the image to be identified is the machine-generated image, and the third probability value is used in combination with the first probability value to determine whether the image to be identified is or is not the machine-generated image.

10. The method according to claim 9, wherein: The step of training the classification model using the classification data set to obtain a trained classification model includes: Using the classification data set to perform a first-stage training on the classification model to obtain a trained classification model; The classification model is trained in the second stage using the machine-generated images to obtain the trained classification model.

11. A device for recognizing machine-generated images, the device comprising: An information acquisition module, configured to acquire description information of the image to be identified, wherein the description information of the image to be identified is information used to describe the content of the image to be identified; The image acquisition module is configured to generate images using N image generation methods based on the description information of the image to be identified, thereby obtaining N machine-generated images, where N is a positive integer; A score determination module is configured to compare the image to be identified with the N machine-generated images respectively, and obtain first probability values ​​corresponding to the N image generation methods respectively, wherein the first probability values ​​are used to indicate the probability that the image to be identified is generated by the corresponding image generation method; The image recognition module is configured to determine that the image to be recognized is the machine-generated image when a first probability value corresponding to any of the image generation methods is not less than a first threshold.

12. A model training device, comprising: A picture acquisition module, configured to acquire at least one non-machine-generated picture and description information of the non-machine-generated picture, wherein the description information of the non-machine-generated picture is information used to describe the content of the non-machine-generated picture; A picture generation module is configured to perform picture generation processing respectively in N picture generation modes based on the description information of the non-machine-generated picture to obtain a machine-generated picture, where N is a positive integer; A data set construction module is configured to construct a comparative learning data set based on the non-machine-generated pictures and the machine-generated pictures, wherein the comparative learning data set includes at least one positive sample pair and at least one negative sample pair, each positive sample pair includes two machine-generated pictures generated by the same picture generation method based on the description information of the same non-machine-generated picture, and each negative sample pair includes two machine-generated pictures generated by different picture generation methods based on the description information of the same non-machine-generated picture; The model training module is configured to use the comparative learning data set to train the comparative recognition model to obtain a trained comparative recognition model; wherein the trained comparative recognition model is used to compare the image to be recognized with N machine-generated images respectively, to obtain a first probability value that the image to be recognized and any one of the N machine-generated images are generated by the same image generation method, wherein the N machine-generated images are based on the description information of the image to be recognized and are generated respectively by the N image generation methods.

13. An electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the method for recognizing machine-generated images as described in any one of claims 1 to 7, or to implement the model training method as described in any one of claims 8 to 10.

14. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is loaded and executed by a processor to implement the method for recognizing machine-generated images as described in any one of claims 1 to 7, or to implement the model training method as described in any one of claims 8 to 10.

15. A computer program product, comprising a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the method for recognizing machine-generated images as described in any one of claims 1 to 7, or implement the model training method as described in any one of claims 8 to 10 above.

Citation Information

Patent Citations

  • Comparison system based on pixel difference analysis

    CN107679568A

  • Identification of Neural-Network-Generated Fake Images

    US20200160502A1

  • Detecting digital image manipulations

    US20210209415A1

  • Computer-Implemented Method for Distributional Detection of Machine-Generated Text

    US20230109734A1

Cited By

  • Training method of multimedia resource generation model and multimedia resource generation method

    CN120494016A