Forgery image detection method and device, equipment, storage medium and program product
Through the encoder and separator of the forged detection classification network, image features are extracted and distinguished, combined with feature decoupling, reconstruction and cluster loss optimization, the problem of poor generalization of image forgery detection in the prior art is solved, and the identification and identification of new forgery methods is realized.
Patent Information
- Application Number
- CN202510205259.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-07-22
AI Technical Summary
The image forgery detection technology in the prior art is poor in generalization and it is difficult to deal with new forgery methods.
The encoder of the forged detection classification network is used to extract image features, and distinguish content features from formal features through the separator. The forged images are detected using formal features, and the network is optimized through feature decoupling loss, reconstruction loss and cluster loss, and the classifier is trained in combination with cross entropy loss.
It improves the generalization of the forgery detection classification network, can identify new forgery methods, and enhances the ability to identify images authenticity.
Smart Images

Figure CN120356072A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and particularly to a forged image detection method, device, equipment, storage medium and program product. Background Art
[0002] With the development of digital technology, image forgery has become increasingly easy, which poses a serious challenge to information security. As an important means to maintain the authenticity of images, image forgery detection technology has become an important research direction in the field of computer vision. The main purpose of image forgery detection technology is to identify and locate the tampered image areas.
[0003] The existing image forgery detection technologies mainly rely on various traces left during the image forgery process, such as resampling features, JPEG compression traces, illumination inconsistencies, etc. These methods extract these features and establish a mathematical model to determine whether the image has been tampered with.
[0004] However, due to the complexity of the feature extraction process and the need for a large amount of prior knowledge, the detection effect is often limited to specific types of tampering, making it difficult to cope with new forgery methods and having poor generalization. Summary of the Invention
[0005] The present invention provides a forged image detection method, device, equipment, storage medium and program product to solve the problem of poor generalization of the existing image forgery detection technologies.
[0006] The present invention provides a forged image detection method, including: obtaining an image to be processed; extracting a first image feature of the image to be processed through an encoder of a forgery detection classification network, and determining a formal feature of the first image feature through a separator of the forgery detection classification network; inputting the formal feature of the first image feature into a classifier of the forgery detection classification network to determine whether the image to be processed is a forged image; wherein, the separator is used to distinguish the content feature and the formal feature of the image feature, the content feature is used to indicate information related to the display content of the image, and the formal feature is used to indicate the difference information in the original image that is different from the forged image.
[0007] According to a forged image detection method provided by the present invention, before obtaining the image to be processed, the method further includes: obtaining an original image dataset and a forged image dataset; extracting second image features of the images in the original image dataset and the forged image dataset through the encoder, and determining the content feature and the formal feature of the second image features based on the separator; calculating a feature decoupling loss according to the content feature and the formal feature of the second image features, and performing optimization processing on the encoder and the separator based on the feature decoupling loss.
[0008] A method for detecting forged images provided by the present invention. After extracting the second image features of the images in the original image dataset and the forged image dataset through the encoder and determining the content features and formal features of the second image features based on the separator, the method further includes: performing formal feature exchange processing among the original images and performing formal feature exchange processing among the forged images; performing image reconstruction based on the content features and the exchanged formal features to obtain reconstructed images; and optimizing the encoder and the separator according to the image reconstruction loss of the reconstructed images.
[0009] A method for detecting forged images provided by the present invention. After extracting the second image features of the images in the original image dataset and the forged image dataset through the encoder and determining the content features and formal features of the second image features based on the separator, the method further includes: mapping the formal features of the second image features onto a two-dimensional plane in three-dimensional space; determining a feature clustering loss by minimizing the distance from the formal features of the original images to the origin and maximizing the distance from the formal features of the forged images to the origin, and optimizing the encoder and the separator based on the feature clustering loss.
[0010] A method for detecting forged images provided by the present invention. Before obtaining the image to be processed, the method further includes: freezing the encoder and the separator, and training the classifier based on the formal features output by the separator.
[0011] For a method for detecting forged images provided by the present invention, the loss function of the classifier is a cross-entropy loss function.
[0012] The present invention also provides a forged image detection device, including the following modules: an acquisition module and a processing module; the acquisition module is used to acquire the image to be processed; the processing module is used to extract the first image features of the image to be processed through the encoder of the forged detection classification network and determine the formal features of the first image features through the separator of the forged detection classification network; inputting the formal features of the first image features into the classifier of the forged detection classification network to determine whether the image to be processed is a forged image; wherein, the separator is used to distinguish the content features and the formal features of the image features, the content features are used to indicate information related to the display content of the image, and the formal features are used to indicate the differences between the original image and the forged image.
[0013] A forged image detection device provided by the present invention, the acquisition module is further configured to acquire an original image data set and a forged image data set; the processing module is further configured to extract second image features of images in the original image data set and the forged image data set through the encoder, and determine the content features and form features of the second image features based on the separator; calculate a feature decoupling loss according to the content features and form features of the second image features, and perform optimization processing on the encoder and the separator based on the feature decoupling loss.
[0014] A forged image detection device provided by the present invention, the processing module is configured to perform form feature exchange processing between original images and perform form feature exchange processing between forged images; perform image reconstruction based on the content features and the exchanged form features to obtain a reconstructed image; perform optimization processing on the encoder and the separator according to the image reconstruction loss of the reconstructed image.
[0015] A forged image detection device provided by the present invention, the processing module is configured to map the form features of the second image features onto a two-dimensional plane in a three-dimensional space; determine a feature clustering loss by minimizing the distance from the form features of the original images to the origin and maximizing the distance from the form features of the forged images to the origin, and perform optimization processing on the encoder and the separator based on the feature clustering loss.
[0016] A forged image detection device provided by the present invention, the processing module is configured to freeze the encoder and the separator, and train the classifier based on the form features output by the separator.
[0017] For a forged image detection device provided by the present invention, the loss function of the classifier is a cross-entropy loss function.
[0018] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the forged image detection method as described in any one of the above.
[0019] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the forged image detection method as described in any one of the above.
[0020] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the forged image detection method as described in any one of the above.
[0021] The forgery image detection method, device, equipment, storage medium and program product provided by the present invention can separate the form features from the first image features of the image to be processed, and detect whether the image to be processed is a forgery image based on the form features. Since the form features are used to indicate the difference information in the original image that is different from the forgery image, compared with the traditional detection idea of modeling the forgery image features, the present application can focus on the common features of the original image. In this way, even when encountering new forgery methods, they can be recognized, thereby improving the generalization of the forgery detection classification network. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0023] Figure 1 is one of the schematic flowcharts of the forgery image detection method provided by the present invention; Figure 2 is the second schematic flowchart of the forgery image detection method provided by the present invention; Figure 3 is the schematic flowchart of the training process of the forgery detection classification network provided by the present invention; Figure 4 is the schematic structural diagram of the forgery image detection device provided by the present invention; Figure 5 is the schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] To make the objectives, technical solutions and advantages of the present application clearer, the following will clearly and completely describe the technical solutions in the present application with reference to the drawings in the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0025] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0026] It should be noted that in this text, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the presence of additional identical elements in the process, method, article or device including such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0027] For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same functions and roles. Those skilled in the art can understand that the terms "first" and "second" do not limit the quantity and execution order.
[0028] Some exemplary embodiments are described for the purpose of illustration in the embodiments of the present application. It should be understood that the present application can be implemented in other ways not specifically shown in the drawings.
[0029] As Figure 1 shown, the embodiments of the present application provide a forged image detection method, which can be applied to a forged image detection device. The forged image detection method may include S101 - S103: S101. The forged image detection device acquires an image to be processed.
[0030] It should be noted that the above image to be processed is an image that needs to be detected for forgery.
[0031] S102. The forged image detection device extracts first image features of the image to be processed through the encoder of the forgery detection classification network, and determines formal features of the first image features through the separator of the forgery detection classification network.
[0032] Optionally, the forged image detection device may detect a forged image through a forgery detection classification network. The forgery detection classification network includes an encoder, a separator, and a classifier. The encoder is used to extract image features, the separator is used to distinguish the content features and form features of the image features, the content features are used to indicate information related to the display content of the image, and the form features are used to indicate the difference information that distinguishes the original image from the forged image. The classifier is used to identify whether the image is a forged image based on the form features.
[0033] Specifically, as Figure 2 shown, the forged image detection device may extract the first image features of the image to be processed through the encoder of the forgery detection classification network, and determine the content features and form features of the first image features through the separator of the forgery detection classification network.
[0034] S103. The forged image detection device inputs the form features of the first image features into the classifier of the forgery detection classification network to determine whether the image to be processed is a forged image.
[0035] Continuing to refer to Figure 2 , the forged image detection device may input the form features of the first image features into the classifier of the forgery detection classification network to determine whether the image to be processed is a forged image In the embodiments of the present application, the form features can be separated from the first image features of the image to be processed, and whether the image to be processed is a forged image is detected based on the form features. Since the form features are used to indicate the difference information that distinguishes the original image from the forged image, compared with the traditional detection idea of modeling the features of the forged image, the present application can focus on the common features of the original image. In this way, even if a new forgery method is encountered, it can be recognized, thereby improving the generalization of the forgery detection classification network.
[0036] Optionally, before obtaining the image to be processed, the forged image detection device may obtain an original image dataset and a forged image dataset; extract the second image features of the images in the original image dataset and the forged image dataset through the encoder, and determine the content features and form features of the second image features based on the separator; calculate a feature decoupling loss according to the content features and form features of the second image features, and perform optimization processing on the encoder and the separator based on the feature decoupling loss.
[0037] Specifically, as Figure 3As shown in the figure, a feature decoupling and extraction network including an encoder, a separator, and a decoder can be constructed first. Among them, the encoder is used to receive the original image dataset and the forged image dataset. The images in the original image dataset are all original images that have not been forged, and the images in the forged image dataset are all forged images. The encoder can extract the second image features of the images in the original image dataset and the forged image dataset. After the encoder extracts the second image features, the separator comes into play. Its core task is to decouple and separate the obtained second image features. Specifically, the second image features are split into content features and form features irrelevant to the content. Finally, the feature decoupling loss is calculated based on the content features and form features of the second image features, and the encoder and the separator are optimized based on the feature decoupling loss.
[0038] Optionally, the feature decoupling loss of the feature decoupling and extraction network is: ; Among them, represents the content feature, represents the form feature, and the independence of the two can be reflected by the sum of the squares of the two-norms of their product.
[0039] It should be noted that the core purpose of the feature decoupling loss is to ensure the independence of the decoupled content features and form features. In an ideal situation, the content features and form features should be as independent as possible so that the information in different dimensions of the image can be accurately grasped and processed subsequently, avoiding a confusing relationship between the two that affects the effective utilization of the image features by the entire network and subsequent operations such as reconstruction and discrimination.
[0040] Optionally, after extracting the second image features of the images in the original image dataset and the forged image dataset through the encoder and determining the content features and form features of the second image features based on the separator, the forged image detection device can perform form feature exchange processing among the original images and perform form feature exchange processing among the forged images; perform image reconstruction based on the content features and the exchanged form features to obtain a reconstructed image; optimize the encoder and the separator according to the image reconstruction loss of the reconstructed image.
[0041] As Figure 3 shown, after obtaining the content features and form features through the separator, the forged image detection device can implement image reconstruction through the decoder.
[0042] Specifically, for the original images, on the basis of having extracted and decoupled the corresponding features, the formal features between different original images are exchanged with each other. For example, there are original image A and original image B, which originally have corresponding content features and formal features respectively. Now, the formal feature of original image A is exchanged with the formal feature of original image B, and then the new combined features after the exchange (the content feature of original image A + the formal feature of original image B, and the content feature of original image B + the formal feature of original image A) are sent to the decoder for image reconstruction. The forged image detection device can process forged images in the same way. This will not be elaborated here.
[0043] It should be noted that whether it is the original image after feature exchange or the forged image after corresponding feature exchange, ultimately, the information with the new combined features will be input into the decoder. The task of the decoder is to reconstruct the image based on these received features. This reconstruction process is a kind of verification of the effects of all previous operations such as feature extraction, decoupling, and exchange. If the network processes features properly in the previous links, then even after feature exchange and recombination, the decoder should be able to reconstruct a relatively reasonable image that conforms to the nature of the corresponding image according to the new feature combination, thereby proving that the processing ability of the entire network at the feature level is effective and contributing to further optimizing network parameters and improving performance in aspects such as image authenticity identification.
[0044] Optionally, the reconstruction loss of the feature decoupling and extraction network is: ; Among them, represents the input image, represents the reconstructed image obtained using the content feature of the image , represents the number of images.
[0045] The above reconstruction loss can achieve two aspects of effects: one is to ensure the integrity of the extracted features. Because if a lot of key information is lost during the feature extraction process, then the difference between the image reconstructed based on these features and the original input image will be very large. Therefore, by minimizing this loss, it can be promoted that the feature extraction link tries to retain complete image information. The other is to promote better decoupling of content features and formal features. When the image can be reconstructed relatively accurately based on the content features, it indicates that the content features and other features are reasonable and effective after decoupling, which helps to further strengthen the effect of feature decoupling and enables the entire network to better utilize these features for subsequent processing.
[0046] Optionally, after extracting the second image features of the images in the original image dataset and the forged image dataset through the encoder and determining the content features and form features of the second image features based on the separator, the forged image detection device may map the form features of the second image features onto a two-dimensional plane in a three-dimensional space; by minimizing the distance from the form features of the original images to the origin and maximizing the distance from the form features of the forged images to the origin, a feature clustering loss is determined, and the encoder and the separator are optimized based on the feature clustering loss.
[0047] Specifically, for the extracted form features, operations can be performed in a low-dimensional manifold space such that the original images are clustered together, and the forged images are far from the original images and scattered around them. The specific operation is to first map the form features of the second image features into a two-dimensional plane in a three-dimensional space, and then achieve the effects of clustering and scattering by minimizing the distance from the positive class (original images) to the origin and maximizing the distance from the negative class (forged images) to the origin.
[0048] For example, as Figure 3 shown, first add a sphere with a radius of 1 at the origin, then connect the points corresponding to the forged images on the two-dimensional plane to the north pole of the sphere, and the intersection point of this connection line and the spherical surface is the mapped point of the forged image on the spherical surface. Then, by minimizing the distance from this intersection point on the spherical surface to the north pole of the sphere (the topmost point of the sphere), the distance from the forged image on the two-dimensional plane to the origin is maximized. The farther the point on the two-dimensional plane is from the origin, the closer the distance between the intersection point on the spherical surface and the north pole is.
[0049] Optionally, the feature clustering loss of the feature decoupling and extraction network is: ; where is the feature vector of the original image on the two-dimensional plane, is the feature vector of the forged image on the two-dimensional plane, is the intersection point of the connection line between the forged image feature and the north pole on the unit spherical surface, is the north pole on the spherical surface, is the number of original images in the original image dataset, is the number of forged images in the forged image dataset.
[0050] The feature clustering loss mathematically quantifies the ideal distribution state of the original images and the forged images after operations in the low-dimensional manifold space. By optimizing this loss, the original images and the forged images can be made to be distributed in the feature space in the desired manner, facilitating the subsequent accurate identification of the authenticity of the images.
[0051] Optionally, the total loss function of the feature decoupling and extraction network is It comprehensively considers the losses in three aspects: feature decoupling, image reconstruction, and feature distribution in the low-dimensional manifold space. During the model training process, by optimizing this total loss function, the entire network can continuously adjust the model parameters while ensuring reasonable feature decoupling, complete feature extraction, and the expected distribution of real and forged image features in the low-dimensional space, ultimately achieving good image authenticity identification and related image feature processing capabilities.
[0052] Optionally, before obtaining the image to be processed, the forged image detection device can freeze the encoder and the separator, and train the classifier based on the formal features output by the separator. The loss function of the classifier is the cross-entropy loss function.
[0053] Specifically, in the entire training process, the training of the feature decoupling and extraction network is first completed. The encoder and separator in this network have learned how to extract features from the input image and decouple these features into content features and formal features irrelevant to the content during the training process. Freezing them means that in the subsequent stage of training the classifier, the parameters of these two parts will no longer be updated and adjusted.
[0054] After being processed by the feature decoupling and extraction network, the formal features have been obtained. These formal features carry the key information of the image and have been reasonably extracted and decoupled by the previous network. Using these formal features to train the classifier can enable the classifier to focus on learning how to distinguish between original images and forged images based on these high-quality features, making the classifier training more targeted.
[0055] The loss function of the classifier is the cross-entropy loss function. By minimizing the cross-entropy loss function, the classifier can accurately distinguish the feature distributions of original images and forged images, and accurately classify forged images that do not contain the features of original images as forged images.
[0056] The above mainly introduces the solution provided by the embodiments of the present application from the perspective of the method. To implement the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combined with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0057] The forgery image detection method provided by the embodiments of this application may be executed by a forgery image detection device, or a control module for forgery image detection in the forgery image detection device. In the embodiments of this application, taking the forgery image detection device executing the forgery image detection method as an example, the forgery image detection device provided by the embodiments of this application is described.
[0058] It should be noted that the embodiments of this application can divide the forgery image detection device into functional modules according to the above method examples. For example, each functional module can be corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiments of this application is illustrative, only a logical function division, and there can be other division methods in actual implementation.
[0059] As Figure 4 shown, the embodiments of this application provide a forgery image detection device 400. The forgery image detection device 400 includes: an acquisition module 401 and a processing module 402. The acquisition module 401 is used to acquire an image to be processed; the processing module 402 is used to extract the first image feature of the image to be processed through the encoder of the forgery detection classification network, and determine the formal feature of the first image feature through the separator of the forgery detection classification network; input the formal feature of the first image feature into the classifier of the forgery detection classification network to determine whether the image to be processed is a forgery image; wherein, the separator is used to distinguish the content feature and the formal feature of the image feature, the content feature is used to indicate information related to the display content of the image, and the formal feature is used to indicate the difference information that is different from the forgery image in the original image.
[0060] Optionally, the acquisition module 401 is further used to acquire an original image dataset and a forgery image dataset; the processing module 402 is further used to extract the second image features of the images in the original image dataset and the forgery image dataset through the encoder, and determine the content feature and the formal feature of the second image features based on the separator; calculate a feature decoupling loss according to the content feature and the formal feature of the second image features, and perform optimization processing on the encoder and the separator based on the feature decoupling loss.
[0061] Optionally, the processing module 402 is used to perform formal feature exchange processing between original images and perform formal feature exchange processing between forgery images; perform image reconstruction based on the content feature and the exchanged formal feature to obtain a reconstructed image; perform optimization processing on the encoder and the separator according to the image reconstruction loss of the reconstructed image.
[0062] Optionally, the processing module 402 is configured to map the formal features of the second image feature onto a two-dimensional plane in a three-dimensional space; determine a feature clustering loss by minimizing the distance from the formal features of the original image to the origin and maximizing the distance from the formal features of the forged image to the origin, and optimize the encoder and the separator based on the feature clustering loss.
[0063] Optionally, the processing module 402 is configured to freeze the encoder and the separator, and train the classifier based on the formal features output by the separator.
[0064] Optionally, the loss function of the classifier is a cross-entropy loss function.
[0065] In the embodiments of the present application, the formal features can be separated from the first image features of the image to be processed, and whether the image to be processed is a forged image is detected based on the formal features. Since the formal features are used to indicate the difference information in the original image that is different from the forged image, compared with the traditional detection idea of modeling the features of the forged image, the present application can focus on the common features of the original image. In this way, even if a new forgery method is encountered, it can be recognized, thereby improving the generalization of the forgery detection classification network.
[0066] Figure 5 An entity structure diagram of an electronic device is exemplified, as Figure 5 shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete mutual communication through the communication bus 540. The processor 510 can call the logical instructions in the memory 530 to execute a forged image detection method, which includes: obtaining an image to be processed; extracting the first image features of the image to be processed through the encoder of the forged image detection classification network, and determining the formal features of the first image features through the separator of the forged image detection classification network; inputting the formal features of the first image features into the classifier of the forged image detection classification network to determine whether the image to be processed is a forged image; wherein, the separator is used to distinguish the content features and the formal features of the image features, the content features are used to indicate information related to the display content of the image, and the formal features are used to indicate the difference information in the original image that is different from the forged image.
[0067] In addition, when the logical instructions in the above-mentioned memory 530 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0068] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the forgery image detection method provided by the above-mentioned various methods. The method includes: obtaining an image to be processed; extracting a first image feature of the image to be processed through an encoder of a forgery detection classification network, and determining a formal feature of the first image feature through a separator of the forgery detection classification network; inputting the formal feature of the first image feature into a classifier of the forgery detection classification network to determine whether the image to be processed is a forged image; wherein, the separator is used to distinguish the content feature and the formal feature of the image feature, the content feature is used to indicate information related to the display content of the image, and the formal feature is used to indicate the difference information in the original image that is different from the forged image.
[0069] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the forgery image detection method provided by the above-mentioned various methods. The method includes: obtaining an image to be processed; extracting a first image feature of the image to be processed through an encoder of a forgery detection classification network, and determining a formal feature of the first image feature through a separator of the forgery detection classification network; inputting the formal feature of the first image feature into a classifier of the forgery detection classification network to determine whether the image to be processed is a forged image; wherein, the separator is used to distinguish the content feature and the formal feature of the image feature, the content feature is used to indicate information related to the display content of the image, and the formal feature is used to indicate the difference information in the original image that is different from the forged image.
[0070] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative effort.
[0071] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting forged images, characterized in that, including: Obtain an image to be processed; Extract a first image feature of the image to be processed through an encoder of a forgery detection classification network, and determine a formal feature of the first image feature through a separator of the forgery detection classification network; Input the formal feature of the first image feature into a classifier of the forgery detection classification network to determine whether the image to be processed is a forged image; Wherein, the separator is used to distinguish a content feature and a formal feature of an image feature, the content feature is used to indicate information related to the displayed content of the image, and the formal feature is used to indicate difference information that is different from a forged image in the original image.
2. The forged image detection method according to claim 1, wherein Before obtaining the image to be processed, the method further includes: Obtain an original image dataset and a forged image dataset; Extract second image features of images in the original image dataset and the forged image dataset through the encoder, and determine the content feature and the formal feature of the second image feature based on the separator; Calculate a feature decoupling loss according to the content feature and the formal feature of the second image feature, and perform an optimization process on the encoder and the separator based on the feature decoupling loss.
3. The forgery image detection method according to claim 2, wherein After extracting the second image features of images in the original image dataset and the forged image dataset through the encoder, and determining the content feature and the formal feature of the second image feature based on the separator, the method further includes: Perform a formal feature exchange process among the original images, and perform a formal feature exchange process among the forged images; Perform image reconstruction based on the content feature and the exchanged formal feature to obtain a reconstructed image; Perform an optimization process on the encoder and the separator according to an image reconstruction loss of the reconstructed image.
4. The forged image detection method according to claim 2 or 3, characterized in that, After extracting the second image features of images in the original image dataset and the forged image dataset through the encoder, and determining the content feature and the formal feature of the second image feature based on the separator, the method further includes: Map the formal feature of the second image feature to a two-dimensional plane in a three-dimensional space; Determine a feature clustering loss by minimizing the distance from the formal feature of the original image to the origin and maximizing the distance from the formal feature of the forged image to the origin, and perform an optimization process on the encoder and the separator based on the feature clustering loss.
5. The forgery image detection method according to claim 4, characterized in that, Before obtaining the image to be processed, the method further includes: Freeze the encoder and the separator, and train the classifier based on the formal feature output by the separator.
6. The forged image detection method according to claim 5, characterized in that, A loss function of the classifier is a cross-entropy loss function.
7. A forged image detection device, characterized in that, including: An acquisition module and a processing module; The acquisition module is used to obtain an image to be processed; The processing module is used to extract a first image feature of the image to be processed through an encoder of a forgery detection classification network, and determine a formal feature of the first image feature through a separator of the forgery detection classification network; Input the formal feature of the first image feature into a classifier of the forgery detection classification network to determine whether the image to be processed is a forged image; Among them, the separator is used to distinguish the content feature and the form feature of the image feature, the content feature is used to indicate information related to the display content of the image, and the form feature is used to indicate the difference information in the original image that is different from the forged image.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the forged image detection method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the forged image detection method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the forged image detection method according to any one of claims 1 to 6.