Image anti-cheating detection method and system, electronic equipment and storage medium
By inputting the image to be detected into the image generation model, a new image with better image quality than the image to be detected, and the image authenticity is judged based on the degree of difference, the problem of low detection accuracy in the prior art is solved, and efficient and automated image anti-cheating detection is achieved.
Patent Information
- Application Number
- CN202510107684.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-23
AI Technical Summary
The prior art is difficult to effectively detect cheat images, and the detection accuracy is low.
By acquiring the image to be detected and inputting it into a preset image generation model, image generation is performed to obtain a new image whose image quality is better than that of the image to be detected, and then the image is determined to be true or cheat based on the degree of difference between the image to be detected and the new image.
It realizes efficient and automated authenticity judgment of the detected images, and recognizes real or cheating images, with high accuracy and low cost.
Smart Images

Figure CN120031830A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an image anti-cheating detection method, system, electronic device and storage medium. Background Art
[0002] With the continuous development of digital image technology, image acquisition and processing have become more and more convenient, which has also provided opportunities for criminals, and image cheating has increased. Image cheating includes image reshooting, tampering, and synthesis. By using image editing software or deep fake technology, cheating images (fake images) are generated. These behaviors not only damage the interests of the original creators, but also cause serious threats to the authenticity and reliability of the images.
[0003] Traditional image anti-cheating methods, such as pixel-level detection (which detects the pixel values of an image to find unnatural features or signs of forgery in the image), often have low detection accuracy and insufficient detection capabilities when faced with complex cheating images, making it difficult to effectively detect cheating images. Summary of the invention
[0004] The present invention provides an image anti-cheating detection method, system, electronic device and storage medium to solve the technical problems in the prior art that cheating images are difficult to detect effectively and the detection accuracy is low.
[0005] The present invention provides an image anti-cheating detection method, the method comprising: obtaining an image to be detected;
[0006] Inputting the image to be detected into a preset image generation model to generate an image, thereby obtaining a generated new image, wherein the image quality of the new image is better than that of the image to be detected;
[0007] According to the difference between the image to be detected and the new image, it is determined whether the image to be detected is a real image or a cheating image.
[0008] In some embodiments of the present invention, the training step of the image generation model includes:
[0009] Acquire an image anti-cheating dataset, wherein the image anti-cheating dataset includes a plurality of original images and target images, wherein the original images correspond to the target images one by one, and the image quality of the target images is better than that of the corresponding original images;
[0010] Inputting the original image into the image generation model to generate an image and obtain a predicted image;
[0011] Based on the gap between the predicted image and the corresponding target image, the image generation model is iteratively trained until the model converges.
[0012] In some embodiments of the present invention, the image generation model includes: a feature extraction network, a forward diffusion network for adding noise to an input image, and a reverse diffusion network for gradually restoring the image after the noise is added to a clear image;
[0013] Inputting the original image into the image generation model to generate an image to obtain a predicted image includes:
[0014] Inputting the original image into the feature extraction network to extract features and obtain original image features;
[0015] Inputting the original image into the forward expansion network to gradually add noise to the original image to obtain a noisy image;
[0016] The original image features and the noise image are input into the back diffusion network to perform image denoising to obtain the predicted image.
[0017] In some embodiments of the present invention, the back diffusion network includes a plurality of back diffusion layers; inputting the original image features and the noise image into the back diffusion network to perform image denoising to obtain the predicted image includes:
[0018] When the noise image is input into the first back diffusion layer, or the denoised image outputted by the back diffusion layer is inputted into the next back diffusion layer, the original image feature is added to the original input, wherein the original input refers to the noise image, or the denoised image outputted by the previous back diffusion layer;
[0019] The denoised image output by the last back diffusion layer is determined as the predicted image.
[0020] In some embodiments of the present invention, obtaining an image anti-cheating dataset includes:
[0021] Acquiring a plurality of first image groups, wherein the first image groups include original images and target images corresponding to the original images;
[0022] Preprocessing the first image group to obtain a preprocessed second image group, wherein the preprocessing includes removing duplicate images and blurred images;
[0023] A plurality of third image groups are obtained by performing data enhancement on the second image group, wherein the data enhancement includes: image rotation, flipping, cropping, and scaling;
[0024] Based on the third image group, the image anti-cheating data set is obtained.
[0025] In some embodiments of the present invention, the verification step of the image generation model includes:
[0026] Acquire a verification image set, the verification image set comprising: a plurality of original verification images, and target verification images corresponding one-to-one to the original verification images;
[0027] Inputting the original verification image into the image generation model to generate an image, thereby obtaining an image to be compared output by the image generation model;
[0028] The image to be compared is subjected to a consistency check with the corresponding target verification image to complete the verification of the image generation model, wherein the consistency check includes: image local consistency check and / or image global consistency check.
[0029] In some embodiments of the present invention, determining whether the image to be detected is a real image or a cheating image according to the degree of difference between the image to be detected and the new image includes:
[0030] If the difference between the image to be detected and the new image is greater than or equal to a preset difference threshold, determining that the image to be detected is a cheating image;
[0031] If the difference between the image to be detected and the new image is less than the difference threshold, it is determined that the image to be detected is a real image.
[0032] The present invention also provides an image anti-cheating detection system, the system comprising: an image acquisition module to be detected, used to acquire the image to be detected;
[0033] An image generation module is used to input the image to be detected into a preset image generation model to generate an image to obtain a generated new image, wherein the image quality of the new image is better than that of the image to be detected;
[0034] The determination module is used to determine whether the image to be detected is a real image or a cheating image according to the difference between the image to be detected and the new image.
[0035] The present invention also provides an electronic device, comprising a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the image anti-cheating detection method provided in any one of the above embodiments.
[0036] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is used to enable a computer to execute the image anti-cheating detection method provided in any one of the above embodiments.
[0037] Beneficial effects of the present invention: The image anti-cheating detection method, system, electronic device and storage medium provided by the present invention obtain an image to be detected; input the image to be detected into a preset image generation model to generate an image, and obtain a generated new image, the image quality of the new image is better than that of the image to be detected; according to the degree of difference between the image to be detected and the new image, determine whether the image to be detected is a real image or a cheating image. The method can perform efficient and automatic authenticity judgment on the image to be detected, thereby identifying a real image or a cheating image, with high accuracy and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a flow chart of an image anti-cheating detection method provided by an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of a process of training an image generation model in an image anti-cheating detection method provided in an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the structure of an image anti-cheating detection system provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0044] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0045] In order to facilitate understanding of the image anti-cheating detection method, system, electronic device and storage medium provided by the present invention, some professional technologies involved in the present invention are explained below.
[0046] Image classification: Image classification is an important task in the field of computer vision, which mainly involves classifying a given image into predefined category labels. In the present invention, the predefined category label is whether it is a cheating image.
[0047] Image generation: Image generation refers to the generation of new images using existing data or specific rules through computer programs and mathematical models.
[0048] Combine the following Figures 1 to 4 , the image anti-cheating detection method, system, electronic device and storage medium provided by the present invention are explained.
[0049] See also Figure 1 , Figure 1 A flowchart of an image anti-cheating detection method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0050] S110: Acquire an image to be detected.
[0051] It should be noted that the image to be detected refers to the image that needs to be tested for anti-cheating. It is subsequently necessary to determine whether it is a real image or a cheating image. It can be understood that a cheating image refers to a forged image generated by image reshooting, tampering, and synthesis, which is different from a real image.
[0052] S120: Inputting the image to be detected into a preset image generation model to generate an image to obtain a generated new image, wherein the image quality of the new image is better than that of the image to be detected.
[0053] It should be noted that the new image generated in step S120 is an image close to the real image output by the image generation model. The new image can be an image similar to but not identical to the image to be detected. It can be understood that the image generation step in the above step S120 is equivalent to the image reasoning step, and its purpose is to perform image reasoning based on the image to be detected, so as to obtain a new image close to the real image, so as to facilitate the subsequent anti-cheating detection of the image to be detected based on the inferred new image.
[0054] It should also be noted that since the cheating image itself may have unnatural features such as lighting, texture, and edge sharpness, by inputting the image to be detected into the image generation model to generate a new image with higher image quality, it is convenient to subsequently compare the new image with the image to be detected, thereby realizing image anti-cheating detection.
[0055] S130: Determine whether the image to be detected is a real image or a cheating image according to the degree of difference between the image to be detected and the new image.
[0056] In some examples of this embodiment, by comparing the image to be detected with the generated new image, the degree of difference between the image to be detected and the new image can be obtained. The greater the degree of difference, the higher the possibility that the image to be detected is a cheating (forged) image. The smaller the degree of difference, the smaller the possibility that the image to be detected is a cheating image.
[0057] It can be understood that through the above steps, the anti-cheating detection of the image to be detected can be completed well, with high accuracy, high detection efficiency, high degree of automation, low cost, and high feasibility.
[0058] The accuracy of image anti-cheating detection in the present invention largely depends on the accuracy of the image generation model. In order to improve the accuracy of the image generation model, the present invention adopts the following technical means to perform model training.
[0059] Please refer to Figure 2 In some embodiments, the step of training the image generation model includes:
[0060] S210: Acquire an image anti-cheating dataset, where the image anti-cheating dataset includes a plurality of original images and target images, where the original images correspond to the target images one by one, and the image quality of the target images is better than that of the corresponding original images.
[0061] In some examples of this embodiment, original images and target images of multiple scenes can be collected, and these scenes can cover various aspects such as natural scenery, urban landscapes, portraits, animal world, and indoor scenes, so as to ensure the diversity and comprehensiveness of the image anti-cheating data set. The image acquisition channel can be a public image database, an Internet search engine, and a professional photography website.
[0062] S220: Input the original image into the image generation model to generate an image to obtain a predicted image.
[0063] S230: Based on the gap between the predicted image and the corresponding target image, iteratively train the image generation model until the model converges.
[0064] It is understandable that, based on the gap between the predicted image and the corresponding target image, the image generation model is iterated through back propagation and updating until the model converges or reaches a preset threshold of iterations. In addition, a preset loss function can be used to minimize the loss function to perform model iteration and parameter optimization to improve the accuracy of the model, such as a cross entropy loss function. In some examples of this embodiment, a gradient descent algorithm or its variants can be used to update and optimize parameters.
[0065] By executing the above steps S210 to S230, the training of the image generation model can be better realized, the accuracy of the image generation model can be effectively improved, and the feasibility is strong.
[0066] In some embodiments, the image generation model includes: a feature extraction network, a forward diffusion network for adding noise to an input image, and a backward diffusion network for gradually restoring the image to which noise has been added to a clear image.
[0067] It should be noted that by setting the above network structure in the image generation model, it is possible to easily generate new images with higher accuracy that are close to real images.
[0068] In some embodiments, the original image is input into the image generation model to generate an image to obtain a predicted image, including:
[0069] 1. Input the original image into the feature extraction network to extract features and obtain the original image features.
[0070] In some examples of this embodiment, the original image features are used to guide subsequent image generation, that is, to provide guidance or instruction for the back diffusion network when generating new images.
[0071] In some examples of this embodiment, the feature extraction network may be a convolutional neural network (CNN) or other deep learning neural networks.
[0072] 2. Inputting the original image into the forward expansion network to gradually add noise to the original image to obtain a noisy image.
[0073] It should be noted that the noisy image can be obtained by gradually adding random noise to the original image.
[0074] 3. Inputting the original image features and the noise image into the back diffusion network to perform image denoising to obtain the predicted image.
[0075] It should be noted that by using the original image features and the noise image as the input of the back diffusion network, it can help to retain the details and structural information of the original image in the image generation process (denoising process), ensure that the generated image is closer to the real structure of the original image, and avoid the generated image from losing important structural information. In addition, by combining the original image features and the noise image as the input of the back diffusion network, it can also help to improve the quality and authenticity of the predicted image. In addition, by setting the above input, it can also help to increase the diversity of the image generation model in the image generation process. It can be understood that by inputting the original image features, the generated new image can be richer in details and textures, avoiding the generation of images that are too single and lack of changes.
[0076] In some embodiments, the back diffusion network includes a plurality of back diffusion layers; inputting the original image features and the noise image into the back diffusion network to perform image denoising to obtain the predicted image includes:
[0077] 1. When the noisy image is input into the first back diffusion layer, or the denoised image output by the back diffusion layer is input into the next back diffusion layer, the original image feature is added to the original input, where the original input refers to the noisy image, or the denoised image output by the previous back diffusion layer.
[0078] It should be noted that by inputting the original image features during each image generation (image denoising) process, it can be more helpful to retain the structure and detail information of the original image during the image generation process, and improve the quality and authenticity of the generated predicted image. In addition, by combining the original image features with the intermediate state in the back diffusion process (the denoised image output by the previous back diffusion layer), the conditional input (guiding signal) of the next back diffusion layer can be formed to guide the denoising process of the next back diffusion layer, that is, to guide the next back diffusion layer to more accurately restore details and local structures. Especially when processing complex or delicate images, the original image features can be used as prior knowledge to guide the image generation process, thereby improving the accuracy of the generated predicted image and improving the efficiency of image generation.
[0079] Second, the denoised image output by the last back diffusion layer is determined as the predicted image.
[0080] In some embodiments, obtaining an image anti-cheating dataset includes:
[0081] 1. Collect multiple first image groups, where the first image groups include original images and target images corresponding to the original images.
[0082] It can be understood that each first image group includes an original image and a target image corresponding to the original image.
[0083] 2. Preprocessing the first image group to obtain a preprocessed second image group, wherein the preprocessing includes removing duplicate images and blurred images.
[0084] In some examples of this embodiment, the preprocessing also includes: removing low-quality images, etc.
[0085] By preprocessing the first image group, a second image group with higher quality and definition can be obtained after preprocessing.
[0086] In addition, in order to facilitate subsequent model training and data analysis, the images in the second image group can also be annotated, and the annotation content includes information such as the scene type, shooting time, and shooting location of the image, so as to facilitate subsequent model training and data analysis.
[0087] 3. Obtain multiple third image groups by performing data enhancement on the second image group, wherein the data enhancement includes: image rotation, flipping, cropping, and scaling.
[0088] It is understandable that by performing the above data enhancement operation on any second image group, multiple third image groups can be obtained. Through the above method, the entire data set can be expanded, the scale and diversity of the image anti-cheating data set can be enhanced, and the generalization ability of the image generation model can be improved.
[0089] 4. Based on the third image group, obtain the image anti-cheating dataset.
[0090] It should be mentioned that by using the above-mentioned large-scale image anti-cheating dataset for model training and guiding the back diffusion based on the original image features during the model training process, the generalization ability of the image generation model can be effectively improved, so that it can better adapt to different application scenarios and better detect different cheating methods.
[0091] In some examples of this embodiment, the entire third image group may be determined as the image anti-cheating data set.
[0092] In some embodiments, the verification step of the image generation model includes:
[0093] 1. Obtain a verification image set, the verification image set comprising: a plurality of original verification images, and target verification images corresponding one-to-one to the original verification images.
[0094] 2. Input the original verification image into the image generation model to generate an image, thereby obtaining the image to be compared output by the image generation model.
[0095] 3. Performing a consistency check between the image to be compared and the corresponding target verification image to complete the verification of the image generation model, wherein the consistency check includes: image local consistency check and / or image global consistency check.
[0096] In some examples of this embodiment, a local consistency check can be performed on the image to be compared and the corresponding target verification image to obtain the local similarity between the two. A global consistency check can also be performed on the image to be compared and the corresponding target verification image to obtain the global similarity between the two. Based on the local similarity and / or global similarity, the verification of the image generation model is completed. Through the above method, the model verification can be completed well, which is convenient for subsequent model evaluation and improvement based on the verification result (the verification result includes the above-mentioned local similarity and / or global similarity).
[0097] In some embodiments, determining whether the image to be detected is a real image or a cheating image according to the degree of difference between the image to be detected and the new image includes:
[0098] 1. If the difference between the image to be detected and the new image is greater than or equal to a preset difference threshold, the image to be detected is determined to be a cheating image.
[0099] 2. If the difference between the image to be detected and the new image is less than the difference threshold, the image to be detected is determined to be a real image.
[0100] In some examples of this embodiment, a structural similarity index (SSIM) between the image to be detected and the new image is obtained, and the complement of the structural similarity index is determined as a difference degree parameter between the image to be detected and the new image. If the difference degree parameter is greater than or equal to a preset difference threshold, the image to be detected is determined to be a cheating image.
[0101] In some examples of this embodiment, a peak signal-to-noise ratio (PSNR) between the image to be detected and the new image can also be obtained, and the inverse of the peak signal-to-noise ratio is determined as the difference degree parameter between the image to be detected and the new image. By comparing the threshold value, it is determined whether the image to be detected is a cheating image or a real image.
[0102] The image anti-cheating detection method in the above embodiment is further explained below in conjunction with a specific application scenario.
[0103] For moving companies, when handling each moving task, drivers are usually required to take photos of the on-site moving for sign-in verification. Currently, auditors of moving companies usually conduct authenticity review of the on-site moving photos taken by drivers to prevent drivers from reshooting previous photos and "getting away with it". However, due to the large number of moving tasks, manual review is difficult to meet the large number of review needs, and the accuracy and efficiency of manual review are low, which may lead to misjudgment and other situations.
[0104] Based on the above application scenarios, the above problems can be solved by adopting the image anti-cheating detection method in the above embodiment. Specifically, obtain a live moving photo, input the live moving photo into a trained image generation model, perform image generation, and obtain a generated new image; according to the degree of difference between the live moving photo and the generated new image, determine whether the live moving photo is a real image or a cheating image. The entire detection process is carried out automatically without manual intervention, with high detection efficiency and low cost.
[0105] The image anti-cheating detection method in the above embodiment is further explained below in conjunction with another specific application scenario.
[0106] Taking a moving company as an example, the moving company needs to conduct a uniform review of the stickers of the vehicles within the company to ensure that the stickers on each vehicle body are consistent. This requires the driver to upload a photo of the sticker. Some drivers may retake the previous sticker picture to save trouble and upload the retaken cheating photo. In order to accurately identify the cheating photo, the image anti-cheating detection method in the above embodiment can be used to solve the above problem.
[0107] Specifically, a photo of a car sticker uploaded by a driver is obtained; the photo of the car sticker is input into a trained image generation model to generate an image to obtain a generated new image; and according to the degree of difference between the photo of the car sticker and the generated new image, it is determined whether the on-site moving photo is a real image or a cheating image.
[0108] In addition, the image anti-cheating detection method in the above embodiment can also be applied to many image anti-cheating scenarios without the need for additional model training, greatly reducing the application cost.
[0109] It should be mentioned that, compared with the deep learning method (the method of using a trained image anti-cheating detection model to detect cheating images), the image anti-cheating detection method in the above embodiment has strong adaptability and generalization ability. It is understandable that if an image anti-cheating detection model is used to detect cheating images, a large number of non-repetitive cheating images need to be obtained for model training, which is difficult. However, the present application does not need to obtain a large number of cheating images, but only needs to obtain the original image and target image in different scenes, and the difficulty of obtaining the data set is greatly reduced. In addition, the existing image data changes very quickly. When the image changes, it is difficult for the image anti-cheating detection model to adapt to the image change well, resulting in low detection accuracy. The image anti-cheating detection method in the above embodiment is based on the image to be detected for image generation and subsequent judgment, so it has good adaptability. In addition, the image anti-cheating detection model needs to retrain the model for each task, or needs to develop a new image anti-cheating detection model, so it is poorly adapted to different application scenarios. The image anti-cheating detection method in the above embodiment can better adapt to different application scenarios. In addition, the image anti-cheating detection model is prone to overfitting during the training process of a specific task, resulting in poor generalization of the model. The image anti-cheating detection method in the above embodiment can better avoid this problem.
[0110] The image anti-cheating detection system provided by the present invention is described below. The image anti-cheating detection system described below and the image anti-cheating detection method described above can be referred to each other.
[0111] Please refer to Figure 3 The image anti-cheating detection system provided in this embodiment includes:
[0112] The image acquisition module 310 is used to acquire the image to be detected;
[0113] An image generation module 320 is used to input the image to be detected into a preset image generation model to generate an image to obtain a generated new image, wherein the image quality of the new image is better than that of the image to be detected;
[0114] The determination module 330 is used to determine whether the image to be detected is a real image or a cheating image according to the difference between the image to be detected and the new image. The image acquisition module 310 to be detected, the image generation module 320, and the determination module 330 are connected. The image anti-cheating detection system in this embodiment can accurately and efficiently identify the real image or the cheating image, with a high degree of automation, low cost, and strong feasibility.
[0115] In some embodiments, the system further includes: a model training module, configured to obtain an image anti-cheating dataset, wherein the image anti-cheating dataset includes a plurality of original images and a target image, wherein the original images correspond to the target images one by one, and the image quality of the target images is better than that of the corresponding original images;
[0116] Inputting the original image into the image generation model to generate an image and obtain a predicted image;
[0117] Based on the gap between the predicted image and the corresponding target image, the image generation model is iteratively trained until the model converges.
[0118] In some embodiments, the model training module is specifically used to input the original image into the feature extraction network to extract features and obtain original image features;
[0119] Inputting the original image into the forward expansion network to gradually add noise to the original image to obtain a noisy image;
[0120] The original image features and the noise image are input into the back diffusion network to perform image denoising to obtain the predicted image.
[0121] In some embodiments, the model training module is further specifically used to add the original image features to the original input when the noise image is input into the first back diffusion layer, or the denoised image output by the back diffusion layer is input into the next back diffusion layer, wherein the original input refers to the noise image, or the denoised image output by the previous back diffusion layer;
[0122] The denoised image output by the last back diffusion layer is determined as the predicted image.
[0123] In some embodiments, the model training module is further specifically used to collect a plurality of first image groups, wherein the first image groups include original images and target images corresponding to the original images;
[0124] Preprocessing the first image group to obtain a preprocessed second image group, wherein the preprocessing includes removing duplicate images and blurred images;
[0125] A plurality of third image groups are obtained by performing data enhancement on the second image group, wherein the data enhancement includes: image rotation, flipping, cropping, and scaling;
[0126] Based on the third image group, the image anti-cheating data set is obtained.
[0127] In some embodiments, the system further comprises: a model verification module, configured to obtain a verification image set, wherein the verification image set comprises: a plurality of original verification images, and target verification images corresponding one-to-one to the original verification images;
[0128] Inputting the original verification image into the image generation model to generate an image, thereby obtaining an image to be compared output by the image generation model;
[0129] The image to be compared is subjected to a consistency check with the corresponding target verification image to complete the verification of the image generation model, wherein the consistency check includes: image local consistency check and / or image global consistency check.
[0130] In some embodiments, the determination module 330 is specifically configured to determine that the image to be detected is a cheating image if the difference between the image to be detected and the new image is greater than or equal to a preset difference threshold;
[0131] If the difference between the image to be detected and the new image is less than the difference threshold, it is determined that the image to be detected is a real image.
[0132] In some embodiments, an electronic device is also provided, which may be a server, and its internal structure is shown in FIG. Figure 4 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps on the server side of the above method are implemented.
[0133] In some embodiments, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining an image to be detected; inputting the image to be detected into a preset image generation model to generate an image to obtain a generated new image, wherein the image quality of the new image is better than that of the image to be detected; and determining whether the image to be detected is a real image or a cheating image based on the degree of difference between the image to be detected and the new image.
[0134] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining an image to be detected; inputting the image to be detected into a preset image generation model to generate an image to obtain a generated new image, and the image quality of the new image is better than that of the image to be detected; and determining whether the image to be detected is a real image or a cheating image based on the degree of difference between the image to be detected and the new image.
[0135] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or electronic device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0136] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0137] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. An image anti-cheating detection method, characterized in that: include: Acquire the image to be detected; Inputting the image to be detected into a preset image generation model to generate an image, thereby obtaining a generated new image, wherein the image quality of the new image is better than that of the image to be detected; According to the difference between the image to be detected and the new image, it is determined whether the image to be detected is a real image or a cheating image.
2. The image anti-cheating detection method according to claim 1, characterized in that: The training steps of the image generation model include: Acquire an image anti-cheating dataset, wherein the image anti-cheating dataset includes a plurality of original images and target images, wherein the original images correspond to the target images one by one, and the image quality of the target images is better than that of the corresponding original images; Inputting the original image into the image generation model to generate an image and obtain a predicted image; Based on the gap between the predicted image and the corresponding target image, the image generation model is iteratively trained until the model converges.
3. The image anti-cheating detection method according to claim 2, characterized in that: The image generation model includes: a feature extraction network, a forward diffusion network for adding noise to an input image, and a reverse diffusion network for gradually restoring the image after the noise is added to a clear image; Inputting the original image into the image generation model to generate an image to obtain a predicted image includes: Inputting the original image into the feature extraction network to extract features and obtain original image features; Inputting the original image into the forward expansion network to gradually add noise to the original image to obtain a noisy image; The original image features and the noise image are input into the back diffusion network to perform image denoising to obtain the predicted image.
4. The image anti-cheating detection method according to claim 3, characterized in that: The back diffusion network includes a plurality of back diffusion layers; the original image features and the noise image are input into the back diffusion network to perform image denoising to obtain the predicted image, including: When the noise image is input into the first back diffusion layer, or the denoised image outputted by the back diffusion layer is inputted into the next back diffusion layer, the original image feature is added to the original input, wherein the original input refers to the noise image, or the denoised image outputted by the previous back diffusion layer; The denoised image output by the last back diffusion layer is determined as the predicted image.
5. The image anti-cheating detection method according to claim 2, characterized in that: Obtaining the image anti-cheating dataset includes: Acquiring a plurality of first image groups, wherein the first image groups include original images and target images corresponding to the original images; Preprocessing the first image group to obtain a preprocessed second image group, wherein the preprocessing includes removing duplicate images and blurred images; A plurality of third image groups are obtained by performing data enhancement on the second image group, wherein the data enhancement includes: image rotation, flipping, cropping, and scaling; Based on the third image group, the image anti-cheating data set is obtained.
6. The image anti-cheating detection method according to any one of claims 1 to 5, characterized in that: The verification step of the image generation model includes: Acquire a verification image set, the verification image set comprising: a plurality of original verification images, and target verification images corresponding one-to-one to the original verification images; Inputting the original verification image into the image generation model to generate an image, thereby obtaining an image to be compared output by the image generation model; The image to be compared is subjected to a consistency check with the corresponding target verification image to complete the verification of the image generation model, wherein the consistency check includes: image local consistency check and / or image global consistency check.
7. The image anti-cheating detection method according to any one of claims 1 to 5, characterized in that: Determining whether the image to be detected is a real image or a cheating image according to the difference between the image to be detected and the new image includes: If the difference between the image to be detected and the new image is greater than or equal to a preset difference threshold, determining that the image to be detected is a cheating image; If the difference between the image to be detected and the new image is less than the difference threshold, it is determined that the image to be detected is a real image.
8. An image anti-cheating detection system, characterized in that: include: An image acquisition module to be detected is used to acquire the image to be detected; An image generation module is used to input the image to be detected into a preset image generation model to generate an image to obtain a generated new image, wherein the image quality of the new image is better than that of the image to be detected; The determination module is used to determine whether the image to be detected is a real image or a cheating image according to the difference between the image to be detected and the new image.
9. An electronic device, characterized in that: The invention comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the image anti-cheating detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the image anti-cheating detection method according to any one of claims 1 to 7.