Imitation image detection method and device, and storage medium

Through the image reconstruction model, the image reconstruction image is reconstructed and image differences are detected, which solves the problem of how to accurately detect miscellaneous images, and achieves accurate identification of miscellaneous images and reduces security threats.

CN120198973APending Publication Date: 2025-06-24HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311775992.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

How to accurately detect miscellaneous images and solve the security risks caused by image miscellaneous technology to face recognition and identity authentication.

Method used

The image to be detected is reconstructed through the image reconstruction model, the image features are enlarged, and whether it is a mimicked image is detected based on the difference between the image to be detected and the reconstructed image is detected.

Benefits of technology

Accurate detection of mimicked images is achieved, reducing the threat to security by image imitation technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198973A_ABST
    Figure CN120198973A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a counterfeit image detection method and device and a storage medium, and the method comprises the steps: carrying out the image reconstruction of a to-be-detected image through an image reconstruction model, obtaining a reconstructed image, and detecting whether the to-be-detected image is a counterfeit image or not according to the image difference between the to-be-detected image and the reconstructed image; according to the method and the device, the image reconstruction is performed on the to-be-detected image through the image reconstruction model to obtain the reconstructed real image and / or the reconstructed counterfeit image, so that the image features of the to-be-detected image can be amplified to enlarge the image difference between the to-be-detected image and the reconstructed image so as to perform counterfeit image detection; and whether the to-be-detected image is the counterfeit image or not is detected by comparing the to-be-detected image with the reconstructed real image and / or the reconstructed counterfeit image, so that the counterfeit image can be accurately detected, and security threats caused by an image counterfeit technology can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a counterfeit image detection method, device and storage medium. Background Art

[0002] At present, image counterfeiting technology (such as face counterfeiting technology) is developing rapidly. It can produce realistic counterfeit images through synthesis, modification, etc., which poses a great security risk to applications such as face recognition and identity authentication. Therefore, how to accurately detect counterfeit images is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of the present application is to provide a counterfeit image detection method, device and storage medium, aiming to solve the technical problem of how to accurately detect counterfeit images.

[0004] To achieve the above-mentioned purpose, the present application provides a counterfeit image detection method, which comprises:

[0005] Reconstruct the image to be detected by using an image reconstruction model to obtain a reconstructed image, wherein the image reconstruction model is used to amplify the image features of the image to be detected by image reconstruction, the image reconstruction model includes a real image reconstruction model and / or a simulated image reconstruction model, and the reconstructed image includes a reconstructed real image and / or a reconstructed simulated image;

[0006] Whether the image to be detected is a forged image is detected according to an image difference between the image to be detected and the reconstructed image.

[0007] Optionally, reconstructing the image to be detected by using an image reconstruction model to obtain a reconstructed image includes:

[0008] Acquire reconstruction guidance information, where the reconstruction guidance information is used to guide the image reconstruction process and to directionally amplify the real image features and / or the simulated image features of the image to be detected;

[0009] Based on the reconstruction guidance information, the image to be detected is reconstructed by using an image reconstruction model to obtain a reconstructed image.

[0010] Optionally, the image reconstruction model includes an encoder and a decoder, and the image reconstruction model is used to reconstruct the image to be detected based on the reconstruction guidance information to obtain the reconstructed image, including:

[0011] Mapping the image to be detected from a low-dimensional space to a high-dimensional space through the encoder to obtain a high-dimensional feature vector;

[0012] The high-dimensional feature vector is decoded by the decoder based on the reconstruction guidance information to obtain a reconstructed image.

[0013] Optionally, the image reconstruction model includes a real image reconstruction model and a forged image reconstruction model, the reconstruction guidance information includes real reconstruction guidance information and forged reconstruction guidance information, the real reconstruction guidance information is used to guide the image reconstruction process of the real image reconstruction model, and directionally amplify the real image features of the image to be detected, and the forged reconstruction guidance information is used to guide the image reconstruction process of the forged image reconstruction model, and directionally amplify the forged image features of the image to be detected;

[0014] Performing image reconstruction on the image to be detected through the image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image, including:

[0015] Performing image reconstruction on the image to be detected through the real image reconstruction model based on the real reconstruction guidance information to obtain a reconstructed real image, and performing image reconstruction on the image to be detected through the forged image reconstruction model based on the forged reconstruction guidance information to obtain a reconstructed forged image.

[0016] Optionally, the real image reconstruction model includes: a first encoder and a first decoder, and the forged image reconstruction model includes: a second encoder and a second decoder; performing image reconstruction on the image to be detected through the real image reconstruction model based on the real reconstruction guidance information to obtain a reconstructed real image, and performing image reconstruction on the image to be detected through the forged image reconstruction model based on the forged reconstruction guidance information to obtain a reconstructed forged image, including:

[0017] Mapping the image to be detected from a low-dimensional space to a high-dimensional space through the first encoder to obtain a first high-dimensional feature vector, and mapping the image to be detected from a low-dimensional space to a high-dimensional space through the second encoder to obtain a second high-dimensional feature vector;

[0018] Decoding the first high-dimensional feature vector through the first decoder based on the real reconstruction guidance information to obtain a reconstructed real image, and decoding the second high-dimensional feature vector through the second decoder based on the forged reconstruction guidance information to obtain a reconstructed forged image.

[0019] Optionally, detecting whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image, including:

[0020] Calculating a first residual between the image to be detected and the reconstructed real image, and calculating a second residual between the image to be detected and the reconstructed forged image;

[0021] Detect whether the image to be detected is a forged image according to the first residual and the second residual.

[0022] Optionally, the detecting whether the image to be detected is a forged image according to the first residual and the second residual includes:

[0023] Concatenate the first residual and the second residual to obtain a comprehensive residual;

[0024] Detect whether the image to be detected is a forged image according to the comprehensive residual.

[0025] Optionally, before obtaining the reconstructed image by reconstructing the image to be detected through the image reconstruction model, it further includes:

[0026] Train the initial real image reconstruction model based on real image samples, and train the initial forged image reconstruction model based on forged image samples;

[0027] Jointly train the trained real image reconstruction model and the trained forged image reconstruction model to obtain the real image reconstruction model and the forged image reconstruction model.

[0028] In addition, to achieve the above object, the present application also proposes a forged image detection device, where the forged image detection device includes a memory, a processor, and a forged image detection program stored on the memory and executable on the processor, and the forged image detection program is configured to implement the forged image detection method as described above.

[0029] In addition, to achieve the above object, the present application also proposes a storage medium, where a forged image detection program is stored on the storage medium, and when the forged image detection program is executed by a processor, it implements the forged image detection method as described above.

[0030] In this application, it is disclosed that an image reconstruction model is used to perform image reconstruction on an image to be detected to obtain a reconstructed image. The image reconstruction model is used to amplify the image features of the image to be detected through image reconstruction. The image reconstruction model is a real image reconstruction model and / or a forged image reconstruction model, and the reconstructed image is a reconstructed real image and / or a reconstructed forged image. Whether the image to be detected is a forged image is detected according to the image difference between the image to be detected and the reconstructed image. Since this application performs image reconstruction on the image to be detected through the image reconstruction model to obtain a reconstructed real image and / or a reconstructed forged image, it is possible to amplify the image features of the image to be detected, so as to enlarge the image difference between the image to be detected and the reconstructed image for forged image detection, and detect whether the image to be detected is a forged image by comparing the image to be detected with the reconstructed real image and / or the reconstructed forged image, thereby being able to accurately detect forged images and further reduce the security threats caused by image forgery technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a schematic structural diagram of a forged image detection device in the hardware operating environment related to the solution of the embodiment of this application;

[0032] Figure 2 is a schematic flowchart of the first embodiment of the forged image detection method of this application;

[0033] Figure 3 is a schematic flowchart of the second embodiment of the forged image detection method of this application;

[0034] Figure 4 is a schematic flowchart of the third embodiment of the forged image detection method of this application;

[0035] Figure 5 is a specific schematic diagram of an embodiment of the forged image detection method of this application

[0036] Figure 6 is a schematic flowchart of the fourth embodiment of the forged image detection method of this application;

[0037] Figure 7 is a schematic diagram of the training of the real image reconstruction model in an embodiment of the forged image detection method of this application;

[0038] Figure 8 is a schematic diagram of the training of the forged image reconstruction model in an embodiment of the forged image detection method of this application.

[0039] The realization, functional features and advantages of the purpose of this application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] It should be understood that the specific embodiments described herein are merely for explaining the present application and are not used to limit the present application.

[0041] Referring to Figure 1 , Figure 1 FIG. is a schematic structural diagram of a forged image detection device for the hardware operating environment involved in the solution of the embodiment of the present application.

[0042] As Figure 1 shown, the forged image detection device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. For the wired interface of the user interface 1003, it may be a USB interface in the present application. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless-fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) memory or a stable memory (Non-volatile Memory, NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0043] Those skilled in the art can understand that Figure 1 the structure shown in

[0044] does not constitute a limitation on the forged image detection device, and may include more or fewer components than shown, or combine some components, or have different component arrangements. Figure 1 As

[0045] shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and a forged image detection program. Figure 1

[0046] In the forged image detection device shown in , the network interface 1004 is mainly used to connect to the background server and communicate with the background server for data; the user interface 1003 is mainly used to connect to the user device; the forged image detection device calls the forged image detection program stored in the memory 1005 through the processor 1001 and executes the forged image detection method provided by the embodiment of the present application.

[0047] Reference Figure 2 , Figure 2 which is a schematic flowchart of the first embodiment of the forgery image detection method of the present application, and the first embodiment of the forgery image detection method of the present application is proposed.

[0048] In the first embodiment, the forgery image detection method includes the following steps:

[0049] Step S10: Perform image reconstruction on the image to be detected through an image reconstruction model to obtain a reconstructed image. The image reconstruction model is used to amplify the image features of the image to be detected through image reconstruction. The image reconstruction model includes a real image reconstruction model and / or a forgery image reconstruction model, and the reconstructed image includes a reconstructed real image and / or a reconstructed forgery image.

[0050] It should be understood that the execution subject of the method in this embodiment can be a forgery image detection device with functions of data processing, network communication, and program running, such as a computer and other terminal devices, or other electronic devices that can achieve the same or similar functions. This embodiment does not limit this.

[0051] It should be noted that the image to be detected can be an image that needs to be detected for forgery. In this embodiment, the image to be detected is taken as an example of a face image to be detected. Of course, the image to be detected can also be set to other types of images according to actual needs, such as natural images, etc. This embodiment does not limit this.

[0052] The image to be detected can be input by the user. For example, when receiving a forgery image detection request from the user, the image to be detected is obtained according to the forgery image detection request; it can also be automatically obtained by the forgery image detection device. This embodiment does not limit this.

[0053] It can be understood that the high-dimensional space features of real images and forgery images are different. Therefore, in this embodiment, the image to be detected is reconstructed through an image reconstruction model to obtain a reconstructed image, so as to amplify the features of the image to be detected in the high-dimensional space, and then expand the image difference between the image to be detected and the reconstructed image for forgery image detection. Among them, the image reconstruction model can include an encoder and a decoder. Reconstructing the image to be detected through the image reconstruction model to obtain a reconstructed image to amplify the features of the image to be detected in the high-dimensional space can be to map the image to be detected from the low-dimensional space to the high-dimensional space through the encoder to obtain a high-dimensional feature vector, and decode the high-dimensional feature vector through the decoder to obtain a reconstructed image to amplify the features of the image to be detected in the high-dimensional space.

[0054] In a specific implementation, the encoder can be a deep learning model. For example, deep learning models such as Convolutional Neural Networks (CNN), Recurrent Neural Networks (RNN), and Deep Belief Networks (DBN). The encoder is used to map an image from the pixel space (low-dimensional space) to the feature space (high-dimensional space). The specific steps can be to input the image to be detected into the encoder. The encoder converts the low-level features (such as edges, corners, etc.) of the image to be detected into high-level features (such as shapes, textures, etc.) through a series of convolution, activation, and pooling operations, so as to map the image to be detected from the pixel space (low-dimensional space) to the feature space (high-dimensional space) and obtain a high-dimensional feature vector.

[0055] The decoder can be another deep learning model corresponding to the encoder, such as CNN, RNN, and DBN deep learning models, which are used to restore the image from the feature space (high-dimensional space) to the pixel space (low-dimensional space). And since the image reconstruction model can be a model trained based on real image samples or fake image samples, therefore, when the decoder restores the image from the high-dimensional space to the low-dimensional space, it can also amplify the real image features or fake image features of the image. The specific steps can be that the decoder uses the high-dimensional feature vector extracted from the encoder, combines upsampling and deconvolution operations, gradually restores and amplifies the real image features or fake image features of the image, and finally generates a reconstructed image that is similar to the image to be detected but with more obvious real image features or fake image features.

[0056] For ease of understanding, the following is an example, but it does not limit the present invention. In one example, the high-dimensional space features of a real face image and a forged face image are different. The high-dimensional space features include, but are not limited to, at least one of texture details, lighting and shadows, depth and shape structure, and expression and dynamic information. Among them, the texture details in a real face image usually include natural skin texture, wrinkles, freckles, etc. However, due to limitations in synthesis algorithms or generation techniques, a forged face image may not be able to fully capture the details of real texture. Therefore, the high-dimensional space features can include texture details; affected by lighting conditions, a real face image will produce shadows and lighting changes, and these lighting and shadow information can be reflected in the high-dimensional feature space. However, due to differences in the synthesis process, a forged face image may not be able to accurately reproduce the changes in real lighting and shadows. Therefore, the high-dimensional space features can also include lighting and shadows; the depth and shape structure in a real face image usually conform to the anatomical features of the human face, such as the positions, sizes, and proportional relationships of the nose, eyes, mouth, etc. However, due to limitations in the generation algorithm, a forged face image may not be able to accurately simulate the depth and shape structure of a real face. Therefore, the high-dimensional space features can also include depth and shape structure; the expression and dynamic information in a real face image can be manifested through the movement of facial muscles, and these expression and dynamic information may be manifested as specific patterns or dynamic sequences in the high-dimensional feature space. However, a forged face image may not be able to accurately capture the expression and dynamic information of a real face. Therefore, the high-dimensional space features can also include expression and dynamic information.

[0057] It should be understood that the image reconstruction model can be a real image reconstruction model and / or a forged image reconstruction model. Among them, the real image reconstruction model is a model trained based on real image samples. Since the real image samples used in the training of the real image reconstruction model are all real images, the training process of the real image reconstruction model can be to adjust the model parameters based on the distribution law of the high-dimensional space features of real images, so that the real image reconstruction model can be used to reconstruct real images; similarly, the forged image reconstruction model is a model trained based on forged image samples. Since the forged image samples used in the training of the forged image reconstruction model are all forged images, the training process of the forged image reconstruction model can be to adjust the model parameters based on the distribution law of the high-dimensional space features of forged images, so that the forged image reconstruction model can be used to reconstruct forged images.

[0058] Step S20: Detect whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image.

[0059] It can be understood that, in order to accurately detect forged images, in this embodiment, by comparing the image to be detected with the reconstructed image, it is detected whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image.

[0060] It should be understood that since the real image reconstruction model is a model trained based on the distribution law of the high-dimensional space features of real images, therefore, when the image to be detected is a real image, a reconstructed real image with a feature distribution similar to that of the image to be detected can be generated; when the image to be detected is a forged image, a reconstructed forged image with a feature distribution similar to that of the image to be detected cannot be generated. Therefore, in this embodiment, when the image reconstruction model is a real image reconstruction model, the specific steps for detecting whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image can be to calculate the feature distribution similarity between the image to be detected and the reconstructed real image, and detect whether the image to be detected is a forged image according to the feature distribution similarity. Specifically, when the feature distribution similarity is greater than the preset similarity threshold, it indicates that the feature distribution of the image to be detected is similar to that of the reconstructed real image. Therefore, it can be determined that the image to be detected is a real image; when the feature distribution similarity is less than or equal to the preset similarity threshold, it indicates that the feature distribution of the image to be detected is not similar to that of the reconstructed real image. Therefore, it can be determined that the image to be detected is a forged image, where the preset similarity threshold can be set in advance, and this embodiment does not limit this.

[0061] Similarly, it can be known that since the forged image reconstruction model is a model trained based on the distribution law of the high-dimensional space features of forged images, therefore, when the image to be detected is a forged image, a reconstructed forged image with a feature distribution similar to that of the image to be detected can be generated; when the image to be detected is a real image, a reconstructed real image with a feature distribution similar to that of the image to be detected cannot be generated. Therefore, in this embodiment, when the image reconstruction model is a forged image reconstruction model, the specific steps for detecting whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image can be to calculate the feature distribution similarity between the image to be detected and the reconstructed forged image, and detect whether the image to be detected is a forged image according to the feature distribution similarity. Specifically, when the feature distribution similarity is greater than the preset similarity threshold, it indicates that the feature distribution of the image to be detected is similar to that of the reconstructed forged image. Therefore, it can be determined that the image to be detected is a forged image; when the feature distribution similarity is less than or equal to the preset similarity threshold, it indicates that the feature distribution of the image to be detected is not similar to that of the reconstructed forged image. Therefore, it can be determined that the image to be detected is a real image.

[0062] Of course, in order to further improve the accuracy of forged image detection, in this embodiment, the forged image can also be detected jointly by the real image reconstruction model and the forged image reconstruction model, and this embodiment does not limit this.

[0063] In this embodiment, it is disclosed that an image reconstruction model is used to perform image reconstruction on an image to be detected to obtain a reconstructed image. The image reconstruction model is used to magnify the image features of the image to be detected through image reconstruction. The image reconstruction model is a real image reconstruction model and / or a forged image reconstruction model, and the reconstructed image is a reconstructed real image and / or a reconstructed forged image. Whether the image to be detected is a forged image is detected according to the image difference between the image to be detected and the reconstructed image. Since in this embodiment, the image reconstruction model is used to perform image reconstruction on the image to be detected to obtain a reconstructed real image and / or a reconstructed forged image, the image features of the image to be detected can be magnified, so as to enlarge the image difference between the image to be detected and the reconstructed image for forged image detection, and whether the image to be detected is a forged image is detected by comparing the image to be detected with the reconstructed real image and / or the reconstructed forged image, so that forged images can be accurately detected, and further the security threat caused by image forgery technology can be reduced.

[0064] Referring to Figure 3 , Figure 3 FIG. is a schematic flowchart of the second embodiment of the forged image detection method of the present application. Based on the above Figure 2 shown first embodiment, the second embodiment of the forged image detection method of the present application is proposed.

[0065] In the second embodiment, step S10 includes:

[0066] Step S101: Obtain reconstruction guiding information, where the reconstruction guiding information is used to guide the image reconstruction process and directionally magnify the real image features and / or forged image features of the image to be detected.

[0067] It should be understood that in order to enlarge the image difference between the reconstructed real image and the reconstructed forged image to improve the accuracy of forged image detection, in this embodiment, the image reconstruction process can also be guided based on the reconstruction guiding information. The reconstruction guiding information includes real reconstruction guiding information and / or forged reconstruction guiding information. Among them, the real reconstruction guiding information is used to guide the image reconstruction process of the real image reconstruction model and directionally magnify the real image features of the image to be detected; the forged reconstruction guiding information is used to guide the image reconstruction process of the forged image reconstruction model and directionally magnify the forged image features of the image to be detected.

[0068] It should be noted that the reconstruction guidance information may include at least one of text guidance, classification guidance, and distribution guidance. Among them, text guidance can constrain the generation of specific types of images through input descriptions or keywords; classification guidance can associate category label information with the input of the model, enabling the model to better learn the feature changes between different categories; distribution guidance can use existing sample data or prior knowledge to guide the reconstructed information. For example, the previously observed data or knowledge is applied to the current reconstruction task through methods such as statistical analysis and model training to help improve the accuracy and efficiency of the reconstruction. This embodiment does not limit this.

[0069] For ease of understanding, the following is an example, but it does not limit the present invention. In one example, assume that the reconstruction guidance information is the text guidance "reconstruct a real image", then the reconstruction guidance information "reconstruct a real image" is used to guide the image reconstruction process of the real image reconstruction model, and directionally magnify the real image features of the image to be detected.

[0070] Step S102: Perform image reconstruction on the image to be detected through an image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image.

[0071] It can be understood that performing image reconstruction on the image to be detected through an image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image can be a reconstruction process of guiding the image reconstruction model to perform image reconstruction on the image to be detected based on the reconstruction guidance information, so as to directionally magnify the real image features and / or forged image features of the image to be detected and obtain a more real or more forged reconstructed image.

[0072] In this embodiment, the image reconstruction process is guided based on the reconstruction guidance information to directionally magnify the real image features and / or forged image features of the image to be detected, so as to be able to expand the image difference between the reconstructed real image and the reconstructed forged image, and further improve the accuracy of forged image detection.

[0073] Furthermore, the image reconstruction model includes an encoder and a decoder. The performing image reconstruction on the image to be detected through an image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image includes: mapping the image to be detected from a low-dimensional space to a high-dimensional space through the encoder to obtain a high-dimensional feature vector; decoding the high-dimensional feature vector through the decoder based on the reconstruction guidance information to obtain a reconstructed image.

[0074] It should be understood that in this embodiment, in order to improve the guidance efficiency and effect, in this embodiment, the guidance process is set between the encoder and the decoder, that is, first map the image to be detected from a low-dimensional space to a high-dimensional space through the encoder to obtain a high-dimensional feature vector, and then decode the high-dimensional feature vector through the decoder based on the reconstruction guidance information to obtain a reconstructed image.

[0075] In a specific implementation, the encoder can be a deep learning model. For example, deep learning models such as CNN, RNN, and DBN. The encoder is used to map an image from the pixel space (low-dimensional space) to the feature space (high-dimensional space). The specific steps can be to input the image to be detected into the encoder. The encoder converts the low-level features (such as edges, corners, etc.) of the image to be detected into high-level features (such as shapes, textures, etc.) through a series of convolution, activation, and pooling operations, so as to map the image to be detected from the pixel space (low-dimensional space) to the feature space (high-dimensional space) and obtain a high-dimensional feature vector.

[0076] The decoder can be another deep learning model corresponding to the encoder. For example, deep learning models such as CNN, RNN, and DBN. It is used to restore the image from the feature space (high-dimensional space) to the pixel space (low-dimensional space). And since the image reconstruction model can be a model trained based on real image samples or forged image samples, therefore, when the decoder restores the image from the high-dimensional space to the low-dimensional space, it can also amplify the real image features or forged image features of the image. Of course, in this embodiment, the image reconstruction process is also guided by the reconstruction guidance information to further directionally amplify the real image features or forged image features of the image to be detected, expand the image difference between the reconstructed real image and the reconstructed forged image, and improve the accuracy of forged image detection. The specific steps can be to input the high-dimensional feature vector and the reconstruction guidance information into the decoder. Under the guidance of the reconstruction guidance information, the decoder uses the high-dimensional feature vector extracted from the encoder, combines upsampling and deconvolution operations, and gradually restores and amplifies the real image features or forged image features of the image, and finally generates a reconstructed image similar to the image to be detected but with more obvious real image features or forged image features. During the decoding process, the reconstruction guidance information is used to guide the decoding process to ensure that the reconstructed image meets specific requirements or constraints, specifically, it can be to directionally amplify the real image features or forged image features of the image to be detected.

[0077] Refer to Figure 4 , Figure 4 FIG.

[0078] In the third embodiment, the image reconstruction model includes a real image reconstruction model and a forged image reconstruction model, and the reconstruction guidance information includes real reconstruction guidance information and forged reconstruction guidance information. The real reconstruction guidance information is used to guide the image reconstruction process of the real image reconstruction model, and directionally amplify the real image features of the image to be detected. The forged reconstruction guidance information is used to guide the image reconstruction process of the forged image reconstruction model, and directionally amplify the forged image features of the image to be detected. The step S102 includes:

[0079] Step S102': Perform image reconstruction on the image to be detected through the real image reconstruction model based on the real reconstruction guidance information to obtain a reconstructed real image, and perform image reconstruction on the image to be detected through the forged image reconstruction model based on the forged reconstruction guidance information to obtain a reconstructed forged image.

[0080] It should be understood that, in order to further improve the accuracy of forged image detection, in this embodiment, the forged image can also be detected jointly by the real image reconstruction model and the forged image reconstruction model. When jointly detecting the forged image by the real image reconstruction model and the forged image reconstruction model, the reconstruction guidance information includes real reconstruction guidance information and forged reconstruction guidance information. Perform image reconstruction on the image to be detected through the real image reconstruction model based on the real reconstruction guidance information to obtain a reconstructed real image. The real reconstruction guidance information is used to guide the image reconstruction process of the real image reconstruction model and directionally amplify the real image features of the image to be detected; perform image reconstruction on the image to be detected through the forged image reconstruction model based on the forged reconstruction guidance information to obtain a reconstructed forged image. The forged reconstruction guidance information is used to guide the image reconstruction process of the forged image reconstruction model and directionally amplify the forged image features of the image to be detected.

[0081] It can be understood that after obtaining the reconstructed real image and the reconstructed forged image, to detect whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image, it can be to compare the image to be detected with the reconstructed real image to obtain a first image difference, compare the image to be detected with the reconstructed forged image to obtain a second image difference, and detect whether the image to be detected is a forged image according to the first image difference and the second image difference. When the first image difference is less than the second image difference, it indicates that the difference between the image to be detected and the reconstructed real image is less than the difference between the image to be detected and the reconstructed forged image. Therefore, the image to be detected is more likely to be a real image, and it can be determined that the image to be detected is a real image; when the second image difference is less than or equal to the first image difference, it indicates that the difference between the image to be detected and the reconstructed forged image is less than or equal to the difference between the image to be detected and the reconstructed real image. Therefore, the image to be detected is more likely to be a forged image, and it can be determined that the image to be detected is a forged image.

[0082] Further, the real image reconstruction model includes: a first encoder and a first decoder, and the forged image reconstruction model includes: a second encoder and a second decoder; the step S102', includes:

[0083] The first encoder maps the image to be detected from a low-dimensional space to a high-dimensional space to obtain a first high-dimensional feature vector, and the second encoder maps the image to be detected from a low-dimensional space to a high-dimensional space to obtain a second high-dimensional feature vector; based on the real reconstruction guiding information, the first decoder decodes the first high-dimensional feature vector to obtain a reconstructed real image, and based on the forged reconstruction guiding information, the second decoder decodes the second high-dimensional feature vector to obtain a reconstructed forged image.

[0084] It should be understood that in this embodiment, when jointly detecting a forged image through the real image reconstruction model and the forged image reconstruction model, the guiding process is also set between the encoder and the decoder of the image reconstruction model to further improve the guiding efficiency and effect.

[0085] For ease of understanding, reference is made to Figure 5 for illustration, but it does not limit the present application. Figure 5 FIG. is a specific schematic diagram of an embodiment of the forged image detection method of the present application. In the figure, the real image reconstruction model includes: a first encoder and a first decoder, and the forged image reconstruction model includes: a second encoder and a second decoder. The encoder is used to map the image to a high-dimensional feature vector, and the decoder is used to decode the high-dimensional feature vector and reconstruct the high-dimensional feature vector into an image. The encoder and the decoder can form a generator. The guiding process in this embodiment can be specifically implemented by a guiding module, and the guiding module is used to provide reconstruction guiding information before the decoder decodes the high-dimensional feature vector.

[0086] In a specific implementation, the first encoder can be a deep learning model. For example, deep learning models such as CNN, RNN, and DBN. The first encoder is used to map the image from the pixel space (low-dimensional space) to the feature space (high-dimensional space). The specific steps can be to input the image to be detected into the first encoder. The first encoder converts the low-level features (such as edges, corners, etc.) of the image to be detected into high-level features (such as shapes, textures, etc.) through a series of convolution, activation, and pooling operations, so as to map the image to be detected from the pixel space (low-dimensional space) to the feature space (high-dimensional space) to obtain a first high-dimensional feature vector.

[0087] The first decoder can be another deep learning model corresponding to the first encoder. For example, deep learning models such as CNN, RNN, and DBN can be used to restore the image from the feature space (high-dimensional space) to the pixel space (low-dimensional space). Since the real image reconstruction model can be a model trained based on real image samples, when the first decoder restores the image from the high-dimensional space to the low-dimensional space, it can also amplify the real image features of the image. Of course, in this embodiment, the image reconstruction process is also guided by real reconstruction guidance information to further directionally amplify the real image features of the image to be detected, expand the image difference between the reconstructed real image and the reconstructed forged image, and improve the accuracy of forged image detection. The specific steps can be to input the first high-dimensional feature vector and the real reconstruction guidance information into the first decoder. Under the guidance of the real reconstruction guidance information, the first decoder uses the real high-dimensional feature vector extracted from the first encoder, combines upsampling and deconvolution operations, and gradually restores and amplifies the real image features of the image, and finally generates a reconstructed real image that is similar to the image to be detected but has more obvious real image features. During the decoding process, the reconstruction guidance information is used to guide the decoding process to ensure that the reconstructed image meets specific requirements or constraints, specifically, it can be to directionally amplify the real image features of the image to be detected.

[0088] The second encoder can be a deep learning model. For example, deep learning models such as CNN, RNN, and DBN can be used. The second encoder is used to map the image from the pixel space (low-dimensional space) to the feature space (high-dimensional space). The specific steps can be to input the image to be detected into the second encoder. The second encoder converts the low-level features (such as edges, corners, etc.) of the image to be detected into high-level features (such as shapes, textures, etc.) through a series of convolution, activation, and pooling operations, so as to map the image to be detected from the pixel space (low-dimensional space) to the feature space (high-dimensional space) and obtain the second high-dimensional feature vector.

[0089] The second decoder can be another deep learning model corresponding to the second encoder. For example, deep learning models such as CNN, RNN, and DBN are used to restore the image from the feature space (high-dimensional space) to the pixel space (low-dimensional space). Since the forged image reconstruction model can be a model trained based on forged image samples, when the second decoder restores the image from the high-dimensional space to the low-dimensional space, it can also amplify the forged image features of the image. Of course, in this embodiment, the image reconstruction process is also guided by the forged reconstruction guidance information to further directionally amplify the forged image features of the image to be detected, expand the image difference between the reconstructed real image and the reconstructed forged image, and improve the accuracy of forged image detection. The specific steps can be to input the second high-dimensional feature vector and the forged reconstruction guidance information into the second decoder. Under the guidance of the forged reconstruction guidance information, the second decoder uses the forged high-dimensional feature vector extracted from the second encoder, combines upsampling and deconvolution operations, and gradually restores and amplifies the forged image features of the image, and finally generates a reconstructed forged image that is similar to the image to be detected but with more obvious forged image features. During the decoding process, the reconstruction guidance information is used to guide the decoding process to ensure that the reconstructed image meets specific requirements or constraints, specifically, it can be to directionally amplify the forged image features of the image to be detected.

[0090] In the third embodiment, step S20 includes:

[0091] Step S201: Calculate a first residual between the image to be detected and the reconstructed real image, and calculate a second residual between the image to be detected and the reconstructed forged image.

[0092] It should be noted that the residual can be used to represent the difference between images. Therefore, in order to better detect forged images, in this embodiment, whether the image to be detected is a forged image is detected by the first residual between the image to be detected and the reconstructed real image and the second residual between the image to be detected and the reconstructed forged image.

[0093] Step S202: Detect whether the image to be detected is a forged image according to the first residual and the second residual.

[0094] It can be understood that detecting whether the image to be detected is a forged image according to the first residual and the second residual can be that when the first residual is less than the second residual, it means that the difference between the image to be detected and the reconstructed real image is less than the difference between the image to be detected and the reconstructed forged image. Therefore, the image to be detected is more likely to be a real image, and it can be determined that the image to be detected is a real image; when the second residual is less than or equal to the first residual, it means that the difference between the image to be detected and the reconstructed forged image is less than or equal to the difference between the image to be detected and the reconstructed real image. Therefore, the image to be detected is more likely to be a forged image, and it can be determined that the image to be detected is a forged image.

[0095] In this embodiment, whether the image to be detected is a forged image is detected by the first residual between the image to be detected and the reconstructed real image and the second residual between the image to be detected and the reconstructed forged image, so that the difference between images can be better detected, and further the accuracy of forged image detection can be improved.

[0096] Further, the step S202 includes: splicing the first residual and the second residual to obtain a comprehensive residual; and detecting whether the image to be detected is a forged image according to the comprehensive residual.

[0097] It should be understood that considering that there may be a situation where the first residual is similar to the second residual, at this time, the detection result of the forged image may be inaccurate. Therefore, to overcome the above defects and improve the accuracy of forged image detection, in this embodiment, the first residual and the second residual are also spliced to obtain a comprehensive residual, and whether the image to be detected is a forged image is detected according to the comprehensive residual. By splicing the residuals of the two models, the feature information extracted by the two models can be fused. Different models may respectively capture different aspects or details in the image to be detected, and the splicing operation helps to combine this information to provide a more comprehensive and rich feature representation.

[0098] It can be understood that splicing the first residual and the second residual to obtain a comprehensive residual may be splicing the first residual and the second residual in the channel dimension, where the channel dimension may be the RGB color channel dimension.

[0099] For ease of understanding, reference is made to Figure 5 for illustration, but it does not limit this application. Figure 5 FIG. is a specific schematic diagram of the forged image detection method according to an embodiment of the forged image detection method of this application. In the figure, the first residual between the image to be detected and the reconstructed real image is calculated according to the difference between the image to be detected and the reconstructed real image, and the second residual between the image to be detected and the reconstructed forged image is calculated according to the difference between the image to be detected and the reconstructed forged image. Then, the first residual and the second residual are spliced to obtain a comprehensive residual, and the comprehensive residual is classified by a classifier to detect whether the image to be detected is a forged image.

[0100] Refer to Figure 6 Figure 6 FIG. is a schematic flowchart of the fourth embodiment of the forged image detection method of this application. Based on the above embodiments, the fourth embodiment of the forged image detection method of this application is proposed.

[0101] In the fourth embodiment, before the step S10, it includes:

[0102] ​Step S01: Train a real - image reconstruction model based on real - image samples and train a forged - image reconstruction model based on forged - image samples.

[0103] It should be understood that, in order to ensure that the real - image reconstruction model can be used to reconstruct real images and the forged - image reconstruction model can be used to reconstruct forged images, in this embodiment, the real - image reconstruction model is pre - trained based on real - image samples, and the forged - image reconstruction model is pre - trained based on forged - image samples.

[0104] For ease of understanding, reference is made to Figure 7 for illustration, but it does not limit the present application. Figure 7 FIG. is a schematic diagram of training a real - image reconstruction model for an embodiment of the forged - image detection method of the present application. In the figure, the real - image reconstruction model includes: a first encoder and a first decoder. The training sample of the real - image reconstruction model is a real - image sample. After inputting the real - image sample into the real - image reconstruction model, the real - image reconstruction model can adjust the model parameters based on the distribution law of the high - dimensional space features of the real - image sample, so that the real - image reconstruction model can be used to reconstruct real images.

[0105] For ease of understanding, reference is made to Figure 8 for illustration, but it does not limit the present application. Figure 8 FIG. is a schematic diagram of training a forged - image reconstruction model for an embodiment of the forged - image detection method of the present application. In the figure, the forged - image reconstruction model includes: a second encoder and a second decoder. The training sample of the forged - image reconstruction model is a forged - image sample. After inputting the forged - image sample into the forged - image reconstruction model, the forged - image reconstruction model can adjust the model parameters based on the distribution law of the high - dimensional space features of the forged - image sample, so that the forged - image reconstruction model can be used to reconstruct forged images.

[0106] Step S02: Jointly train the real - image reconstruction model and the forged - image reconstruction model.

[0107] It should be understood that, in order to obtain better performance, in this embodiment, the real - image reconstruction model and the forged - image reconstruction model are jointly trained.

[0108] In this embodiment, the real - image reconstruction model is pre - trained based on real - image samples, and the forged - image reconstruction model is pre - trained based on forged - image samples, so as to ensure that the real - image reconstruction model can be used to reconstruct real images and the forged - image reconstruction model can be used to reconstruct forged images.

[0109] In addition, an embodiment of the present application also proposes a storage medium, on which a forged - image detection program is stored. When the forged - image detection program is executed by a processor, the forged - image detection method as described above is implemented.

[0110] It should be noted that in the technical solutions of this specification, the operations on the involved data comply with relevant regulations and do not violate public order and good customs. For example, the operations on the data are all executed on the premise of obtaining user authorization. In this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such a process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.

[0111] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.

[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a Read Only Memory image (ROM) / Random Access Memory (RAM), magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present application.

[0113] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are similarly included in the patent protection scope of the present application.

Claims

1. A method for detecting forged images, characterized in that, The forged image detection method includes: Performing image reconstruction on the image to be detected through an image reconstruction model to obtain a reconstructed image, where the image reconstruction model is used to amplify the image features of the image to be detected through image reconstruction, and the image reconstruction model includes a real image reconstruction model and / or a forged image reconstruction model, and the reconstructed image includes a reconstructed real image and / or a reconstructed forged image; Detecting whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image.

2. The forged image detection method according to claim 1, wherein, The performing image reconstruction on the image to be detected through an image reconstruction model to obtain a reconstructed image includes: Obtaining reconstruction guidance information, where the reconstruction guidance information is used to guide the image reconstruction process and directionally amplify the real image features and / or forged image features of the image to be detected; Performing image reconstruction on the image to be detected through the image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image.

3. The forgery image detection method according to claim 2, characterized in that, The image reconstruction model includes an encoder and a decoder, and the performing image reconstruction on the image to be detected through the image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image includes: Mapping the image to be detected from a low-dimensional space to a high-dimensional space through the encoder to obtain a high-dimensional feature vector; Decoding the high-dimensional feature vector through the decoder based on the reconstruction guidance information to obtain a reconstructed image.

4. The forgery image detection method according to claim 2, wherein The image reconstruction model includes a real image reconstruction model and a forged image reconstruction model, and the reconstruction guidance information includes real reconstruction guidance information and forged reconstruction guidance information. The real reconstruction guidance information is used to guide the image reconstruction process of the real image reconstruction model and directionally amplify the real image features of the image to be detected, and the forged reconstruction guidance information is used to guide the image reconstruction process of the forged image reconstruction model and directionally amplify the forged image features of the image to be detected; The performing image reconstruction on the image to be detected through the image reconstruction model based on the reconstruction guidance information to obtain a reconstructed image includes: Performing image reconstruction on the image to be detected through the real image reconstruction model based on the real reconstruction guidance information to obtain a reconstructed real image, and performing image reconstruction on the image to be detected through the forged image reconstruction model based on the forged reconstruction guidance information to obtain a reconstructed forged image.

5. The forgery image detection method according to claim 4, characterized in that, The real image reconstruction model includes a first encoder and a first decoder, and the forged image reconstruction model includes a second encoder and a second decoder. The performing image reconstruction on the image to be detected through the real image reconstruction model based on the real reconstruction guidance information to obtain a reconstructed real image, and performing image reconstruction on the image to be detected through the forged image reconstruction model based on the forged reconstruction guidance information to obtain a reconstructed forged image includes: Mapping the image to be detected from a low-dimensional space to a high-dimensional space through the first encoder to obtain a first high-dimensional feature vector, and mapping the image to be detected from a low-dimensional space to a high-dimensional space through the second encoder to obtain a second high-dimensional feature vector; Decode the first high-dimensional feature vector through the first decoder based on the real reconstruction guidance information to obtain a reconstructed real image, and decode the second high-dimensional feature vector through the second decoder based on the forged reconstruction guidance information to obtain a reconstructed forged image.

6. The method for detecting forged images according to claim 4, wherein, The method for detecting whether the image to be detected is a forged image according to the image difference between the image to be detected and the reconstructed image includes: Calculate a first residual between the image to be detected and the reconstructed real image, and calculate a second residual between the image to be detected and the reconstructed forged image; Detect whether the image to be detected is a forged image according to the first residual and the second residual.

7. The forgery image detection method according to claim 6, wherein, The method for detecting whether the image to be detected is a forged image according to the first residual and the second residual includes: Concatenate the first residual and the second residual to obtain a comprehensive residual; Detect whether the image to be detected is a forged image according to the comprehensive residual.

8. The forgery image detection method according to any one of claims 1 to 7, characterized in that, Before obtaining the reconstructed image by performing image reconstruction on the image to be detected through the image reconstruction model, it further includes: Train the initial real image reconstruction model based on real image samples, and train the initial forged image reconstruction model based on forged image samples; Jointly train the trained real image reconstruction model and the trained forged image reconstruction model to obtain a real image reconstruction model and a forged image reconstruction model.

9. An imitation image detection device, characterized in that, The forged image detection device includes: a memory, a processor, and a forged image detection program stored on the memory and executable on the processor. When the forged image detection program is executed by the processor, it implements the forged image detection method according to any one of claims 1 to 8.

10. A storage medium, characterized in that, A forged image detection program is stored on the storage medium. When the forged image detection program is executed by a processor, it implements the forged image detection method according to any one of claims 1 to 8.