Universal generative false image detection method

By adopting the use of real images based on real images based on real image detection methods, use data enhancement and feature optimization technology, combined with predicting cluster optimization and ductification The problem realizes higher detection accuracy and robustness.

CN119360066APending Publication Date: 2025-01-24WUHAN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411118310.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2025-01-24

Smart Images

  • Figure CN119360066A_ABST
    Figure CN119360066A_ABST
Patent Text Reader

Abstract

The invention provides a universal generative false image detection method, which comprises the following steps of: inputting a false image to be detected into a pre-trained classifier, and outputting a detection result; the training method of the classifier comprises the steps of extracting shared features and offset features of a real image, constraining the distance between the shared features and the offset features, and obtaining the shared features of the real image; image feature operators are extracted from the real image and the generative false image, and real image features and generative false image features are obtained; performing prediction clustering optimization on the real image shared features, the real image features and the generative false image features; inputting the real image features and the generative false image features into a classifier for binary classification optimization; according to the prediction clustering optimization loss and the dichotomy optimization loss, the classifier joint optimization loss is minimized through the classifier joint optimization loss function, and a trained classifier is obtained. The problems that an existing false image detection technology is poor in mobility and cannot resist image disturbance and confrontation in image propagation are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a universal generative false image detection method, belonging to the technical field of information security. Background Art

[0002] With the rapid progress of generative models, image generation technology has been widely used in many fields such as product image design, deep fakes, and digital human creation, greatly enriching our daily lives. However, the double-edged sword nature of this technology has also become apparent. The low-cost and high-quality image generation capabilities can easily be exploited by criminals to create pornographic content, spread false information, and even fabricate political rumors against politicians, posing a major potential threat to personal privacy, social stability, and even national security.

[0003] In today's era of information explosion, it is often difficult to distinguish the authenticity of images and video content on the Internet because they may come from a variety of image generation tools. This situation exacerbates the difficulty of identifying true and false information.

[0004] In response to the abuse of image generation technology, the current mainstream defense strategies mostly focus on distinguishing true from false by analyzing the inherent traces of forgery in generated images. However, these methods, whether by amplifying or enhancing forgery traces, have limitations and cannot fully cover all types of generated image artifacts, making it difficult to effectively detect unknown or new generated images. Although some studies have tried to learn new generated image features by continuously training models, they still face the problems of catastrophic forgetting and high costs. What's more serious is that criminals can take countermeasures, such as adding adversarial samples to make detectors invalid, allowing false information to spread more freely on social media.

[0005] After in-depth analysis, it was found that the generalization challenges encountered by existing methods in detecting generated fake images are rooted in the characteristics of the binary classification task: the artifact patterns of generated images are more significant than the natural feature patterns of real images, which can easily lead to the classifier overfitting to the generated image features in the training set, and then over-relying on the presence or absence of specific artifact patterns as a basis for judgment during prediction. This limitation weakens the model's ability to adapt to unknown generation techniques, and new detection strategies are urgently needed to meet this challenge.

[0006] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgement or any form of suggestion that the information constitutes the prior art already known to ordinary technicians in this field. Summary of the invention

[0007] The technical problem to be solved by the present invention is that the existing false image detection technology has poor transferability and cannot resist the image disturbance and confrontation during image propagation.

[0008] To solve the above technical problems, the present invention provides a more robust and versatile generative fake image detection method based on real images, which can achieve excellent detection performance even when facing image disturbances in real scenes or the challenge of artifact disappearance of the generated model after iterative updates. The present invention is implemented by the following technical solution.

[0009] The present invention provides a general generative false image detection method, comprising:

[0010] Acquire an image to be detected;

[0011] Input the acquired image to be detected into the pre-trained real image / generated fake image binary classifier and output the detection result;

[0012] The training method of the real image / generated fake image binary classifier includes:

[0013] Use the real images and the generated fake images to be tested as training sets;

[0014] Perform data enhancement processing on the training set to obtain real images after data enhancement processing and generated fake images after data enhancement processing;

[0015] Extract shared features and bias features of real images after data augmentation processing;

[0016] By jointly optimizing the loss function of the shared feature, the loss function of the biased feature, and the cosine similarity loss function, the distance between the shared feature and the biased feature is constrained to obtain the final real image shared feature;

[0017] Extract image feature operators from the real image after data enhancement processing and the generated fake image after data enhancement processing to obtain real image features and generated fake image features respectively;

[0018] The final real image shared features, real image features, and generated fake image features are input into the classifier for prediction clustering optimization to obtain the prediction clustering optimization loss;

[0019] Input the real image features and the generated fake image features into the classifier for binary classification optimization to obtain the binary classification optimization loss;

[0020] According to the predicted clustering optimization loss and the binary classification optimization loss, a classifier joint optimization loss function is constructed. The classifier joint optimization loss is minimized through the classifier joint optimization loss function to obtain a trained real image / generated fake image binary classifier.

[0021] Furthermore, the real image / generated fake image binary classifier includes:

[0022] The backbone network ResNet50 encoder network is used to extract image feature operators to obtain real image features and generative fake image features;

[0023] The bias feature network layer is used to extract the bias features of the real image, and obtain the shared features of the real image by working together with the shared features of the real image extracted by the shared feature network layer;

[0024] The shared feature network layer is used to extract the shared features of the real image, and obtain the shared features of the real image by working together with the bias features of the real image extracted by the bias feature network layer;

[0025] A clustering network layer for forcing the real image features to cluster with the real image shared features, and forcing the generated fake image features to stay away from the real image shared features;

[0026] The binary classification network layer is used to optimize the real image features and the generated fake image features for binary classification to obtain the detection results.

[0027] Furthermore, the real image / generated fake image binary classifier deletes the bias feature network layer, the shared feature network layer and the clustering network layer after the training process is completed, and only retains the backbone network ResNet50 encoder network and the binary classification network layer;

[0028] The backbone network ResNet50 encoder network is used to extract image features of the image to be detected;

[0029] The binary classification network layer is used to perform binary classification optimization according to the image features of the image to be detected to obtain a detection result.

[0030] Furthermore, the method for performing data enhancement processing on the acquired real image and the generated fake image includes:

[0031] Perform a set of random data augmentations on real images used to extract shared features;

[0032] Two sets of random data augmentation are performed on the real images used to extract bias features.

[0033] Furthermore, by jointly optimizing the loss function of the shared feature, the loss function of the biased feature, and the cosine similarity loss function, the distance between the shared feature and the biased feature is constrained to obtain the final method of the shared feature of the real image, including:

[0034] Calculating the shared feature loss of the real image according to the loss function of the shared feature;

[0035] Calculating the bias feature loss of the real image according to the loss function of the bias feature;

[0036] According to the cosine similarity loss function, calculate the cosine similarity loss of bias features and shared features;

[0037] The shared feature loss, the bias feature loss, and the cosine similarity loss between the bias feature and the shared feature are combined to construct a real image representation loss function, constrain the distance between the shared feature and the bias feature, and obtain the final real image shared feature.

[0038] Furthermore, the loss function of the shared feature is expressed as:

[0039] ;

[0040] In the formula, represents the shared features of real images, represents the shared feature loss, represents maximization, Variable Value represents all images in this batch, Represents the anchor images in this batch, Indicates other images in this batch except the anchor image Any image subscript of represents the isomorphic features of the anchor image of the i-th image, represents the positive example of the isomorphic feature of the anchor image, Represents a modulo arithmetic operation.

[0041] Furthermore, the loss function of the bias feature is expressed as:

[0042] ;

[0043] In the formula, represents the bias feature of the real image, represents the bias feature loss, represents all images in this batch, Represents the anchor images in this batch, represents the heterogeneous features of the anchor image of the i-th image, represents the positive example of heterogeneous features of anchor image, Indicates other images in this batch except anchor images and positive images Any image subscript of represents the negative example of heterogeneous features of anchor images, represents the temperature parameter, Represents an exponential function.

[0044] Furthermore, the real image representation loss function is used to force the real image features to aggregate with the real image shared features, and to force the generated fake image features to move away from the real image shared features, so as to obtain the final real image shared features. The real image representation loss function is expressed as:

[0045] ;

[0046] In the formula, represents the real image representation loss, represents the bias feature loss, represents the shared feature loss, represents the cosine similarity loss of bias features and shared features, is a scaling parameter used to adjust the weight of the joint loss.

[0047] Furthermore, the prediction clustering optimization loss function is expressed as:

[0048] ;

[0049] In the formula, represents the prediction clustering optimization loss, represents all images in this batch, Represents the anchor images in this batch, Represents the anchor images in this batch A positive example, Indicates the anchor image in this batch Positive example Any image subscript of Represents the anchor image The binary classification features of represents the positive example of anchor image, Indicates other images in this batch except anchor images and positive images Any image subscript of represents the negative example of the anchor image, represents the temperature parameter, Represents an exponential function.

[0050] The binary classification optimization loss function is expressed as:

[0051] ;

[0052] In the formula, represents the binary classification optimization loss, Indicates the total number of images in this batch, represents the label value of the image sample, Represents the predicted value of an image sample.

[0053] Furthermore, according to the prediction clustering optimization loss and the binary classification optimization loss, a classifier joint optimization loss function is constructed. The classifier joint optimization loss is minimized through the classifier joint optimization loss function to obtain a trained real image / generated fake image binary classifier. The obtained classifier joint optimization loss function is expressed as:

[0054] ;

[0055] In the formula, represents the classifier joint optimization loss, represents the prediction clustering optimization loss, represents the binary classification optimization loss, is the scaling parameter.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] The universal generative fake image detection method provided by the present invention significantly improves the accuracy and robustness of generative fake image detection through innovative training methods and feature extraction mechanisms, and has universality. The present invention uses data enhancement technology to process real images and generative fake images, effectively expanding the diversity of training samples and enhancing the generalization ability of the real image / generative fake image binary classifier for image transformation. Subsequently, by extracting and optimizing shared features and bias features, not only the essential attributes shared by the two types of images are captured, but also the subtle differences between the two types of images are successfully distinguished, especially by jointly optimizing the loss function of shared features, the loss function of bias features, and the cosine similarity loss function, the reasonable distance between the shared features and the bias features is constrained, and the shared feature representation of the real image is further purified.

[0058] The present invention provides a method for extracting features of enhanced real images and fake images using advanced image feature operators, respectively, in the feature extraction stage, thereby ensuring the comprehensiveness and accuracy of feature extraction. At the same time, through an innovative strategy combining predictive clustering optimization and binary classification optimization, not only is cluster analysis used to improve the ability of the real image / generated fake image binary classifier to understand the intrinsic structure of the image, but the discrimination ability of the classifier is also directly optimized for the detection task through binary classification optimization. This dual optimization mechanism effectively combines the advantages of unsupervised learning and supervised learning, so that the trained real image / generated fake image binary classifier can make more accurate and reliable judgments when facing complex and changeable generative fake images.

[0059] In addition, the present invention also achieves a comprehensive improvement in classifier performance by jointly optimizing the prediction clustering optimization loss function and the binary classification optimization loss function, ensuring that the real image / generated fake image binary classifier obtains the best detection effect in the process of minimizing the classifier joint optimization loss. The detection method of the present invention not only improves the accuracy of fake image detection, but also enhances the adaptability of the real image / generated fake image binary classifier to the new fake image generation technology, which is of great significance for maintaining the authenticity and credibility of image content, and can be widely used in multiple fields such as digital copyright protection and network content supervision. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 FIG. 1 is a flow chart of a general generative false image detection method provided by an embodiment of the present invention;

[0061] Figure 2 Shown is a schematic diagram of the network architecture of a real image / generated fake image binary classifier provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.

[0063] Example 1

[0064] like Figure 1 As shown, this embodiment introduces a general generative fake image detection method, including:

[0065] Acquire an image to be detected;

[0066] Input the acquired image to be detected into the pre-trained real image / generated fake image binary classifier and output the detection result;

[0067] The training method of the real image / generated fake image binary classifier includes:

[0068] Use the real images and the generated fake images to be tested as training sets;

[0069] The training set is subjected to data enhancement processing to obtain real images after data enhancement processing and generated fake images after data enhancement processing; wherein the data enhancement processing method includes performing transformations such as rotation, scaling, cropping, and noise addition on the real images and generated fake images to increase the diversity and complexity of the data. The generalization ability of the real image / generated fake image binary classifier is improved, so that it can recognize fake images that have undergone different transformations.

[0070] The shared features and bias features of the real images after data augmentation are extracted; the shared features represent the common attributes of the real images, and the bias features represent the individual features of a specific real image.

[0071] By jointly optimizing the loss function of shared features, the loss function of biased features and the cosine similarity loss function, the distance between the shared features and the biased features is constrained to obtain the final real image shared features; this ensures that the shared features can accurately reflect the essential attributes of the real image, and obtains purer and more representative real image shared features, which helps to improve the performance of the classifier.

[0072] For the real image after data enhancement processing and the generated fake image after data enhancement processing, image feature operators are extracted respectively to obtain real image features and generated fake image features; image feature operators are extracted to obtain more specific image feature representation.

[0073] The final real image shared features, real image features, and generated fake image features are input into the classifier for prediction clustering optimization to obtain the prediction clustering optimization loss;

[0074] The real image features and the generated fake image features are input into the classifier for binary classification optimization to obtain the binary classification optimization loss; the predictive clustering optimization aims to improve the real image / generated fake image binary classifier's ability to understand the image's intrinsic structure through clustering analysis; the binary classification optimization directly optimizes the classifier's discrimination ability for detection tasks.

[0075] According to the predicted clustering optimization loss and the binary classification optimization loss, a classifier joint optimization loss function is constructed. The classifier joint optimization loss is minimized through the classifier joint optimization loss function to obtain a trained real image / generated fake image binary classifier.

[0076] By jointly optimizing the prediction clustering optimization loss and the binary classification optimization loss, a classifier with better overall performance can be obtained. It not only takes into account the global structural information of the image, but also optimizes for specific tasks. By comprehensively considering multiple optimization objectives, the performance of the real image / generated fake image binary classifier is further improved, making it better able to adapt to complex detection tasks.

[0077] Example 2

[0078] Based on the same inventive concept as Example 1, this example introduces a general generative fake image detection method, including:

[0079] like Figure 2 As shown, the network architecture of the real image / generated fake image binary classifier provided in this embodiment includes:

[0080] The backbone network ResNet50 encoder network is used to extract image feature operators to obtain real image features and generative fake image features;

[0081] The bias feature network layer is used to extract the bias features of the real image, and obtain the shared features of the real image by working together with the shared features of the real image extracted by the shared feature network layer;

[0082] The shared feature network layer is used to extract the shared features of the real image, and obtain the shared features of the real image by working together with the bias features of the real image extracted by the bias feature network layer;

[0083] A clustering network layer for forcing the real image features to cluster with the real image shared features, and forcing the generated fake image features to stay away from the real image shared features;

[0084] The binary classification network layer is used to optimize the real image features and the generated fake image features for binary classification to obtain the detection results.

[0085] The training method of the real image / generated fake image binary classifier comprises:

[0086] (1) The real image and the generated fake image to be detected are used as training sets, and data augmentation processing is performed on the training sets to obtain the real image after data augmentation processing and the generated fake image after data augmentation processing.

[0087] Methods for data augmentation of acquired real images and generated fake images include:

[0088] A set of random data enhancements are performed on the real images used to extract shared features. The method of performing data enhancement on the real images used to extract shared features is expressed as follows:

[0089] ;

[0090] In the formula, Indicates data enhancement operation. Indicates random scaling and cropping of the real image. Indicates random horizontal flipping of the real image. Indicates the rotation of the real image.

[0091] Two sets of random data enhancement are performed on the real images used to extract bias features. The method of data enhancement on the real images for extracting bias features is expressed as follows:

[0092] ;

[0093] In the formula, Indicates grayscale conversion of the real image.

[0094] The method of performing two sets of random data augmentation on the real image for extracting bias features is expressed as:

[0095] ;

[0096] In the formula, represents the anchor image, represents the anchor image enhancement feature, Represents the positive example of the anchor feature.

[0097] (2) Extract shared features and bias features of real images after data augmentation.

[0098] (3) By jointly optimizing the loss function of the shared feature, the loss function of the bias feature, and the cosine similarity loss function, the distance between the shared feature and the bias feature is constrained to obtain the final real image shared feature.

[0099] The method for obtaining the final real image shared features includes:

[0100] Calculating the shared feature loss of the real image according to the loss function of the shared feature;

[0101] Calculating the bias feature loss of the real image according to the loss function of the bias feature;

[0102] According to the cosine similarity loss function, calculate the cosine similarity loss of bias features and shared features;

[0103] The real image representation loss function is constructed by jointly using the shared feature loss, the bias feature loss, and the cosine similarity loss of the bias feature and the shared feature. The real image representation loss function is used to force the real image features to converge with the real image shared features, and to force the generated fake image features to stay away from the real image shared features, so as to obtain the final real image shared features.

[0104] The loss function of the shared feature is expressed as:

[0105] ;

[0106] In the formula, represents the shared features of real images, represents the shared feature loss, represents maximization, Variable Value represents all images in this batch, Represents the anchor images in this batch, Indicates other images in this batch except the anchor image Any image subscript of represents the isomorphic features of the anchor image of the i-th image, represents the positive example of the isomorphic feature of the anchor image, Represents a modulo arithmetic operation.

[0107] The loss function of the bias feature is expressed as:

[0108] ;

[0109] In the formula, represents the bias feature of the real image, represents the bias feature loss, represents all images in this batch, Represents the anchor images in this batch, represents the heterogeneous features of the anchor image of the i-th image, represents the positive example of heterogeneous features of anchor images, Indicates other images in this batch except anchor images and positive images Any image subscript of represents the negative examples of heterogeneous features of anchor images, represents the temperature parameter, Represents an exponential function.

[0110] The cosine similarity loss function is expressed as:

[0111] ;

[0112] ;

[0113] In the formula, represents the cosine similarity loss, represents vector cosine calculation, Indicates that all real images in this batch share features, represents the bias features of all real images in this batch, represents the shared features of the i-th real image, represents the bias feature of the i-th real image, and n represents the number of all real images in this batch.

[0114] The real image representation loss function is used to force the real image features to aggregate with the real image shared features, and to force the generated fake image features to stay away from the real image shared features, so as to obtain the final real image shared features. The real image representation loss function is expressed as:

[0115] ;

[0116] In the formula, represents the real image representation loss, represents the bias feature loss, represents the shared feature loss, represents the cosine similarity loss of bias features and shared features, is a scaling parameter used to adjust the weight of the joint loss.

[0117] Extract image feature operators from the real image after data enhancement processing and the generated fake image after data enhancement processing to obtain real image features and generated fake image features respectively;

[0118] The final real image shared features, real image features, and generated fake image features are input into the classifier for prediction clustering optimization to obtain the prediction clustering optimization loss;

[0119] The prediction clustering optimization loss function is expressed as:

[0120] ;

[0121] In the formula, represents the prediction clustering optimization loss, represents all images in this batch, Represents the anchor images in this batch, Represents the anchor images in this batch A positive example, Indicates the anchor image in this batch Positive example Any image subscript of Represents the anchor image The binary classification features of represents the positive example of anchor image, Indicates other images in this batch except anchor images and positive images Any image subscript of represents the negative example of the anchor image, Represents the temperature parameter.

[0122] Input the real image features and the generated fake image features into the classifier for binary classification optimization to obtain the binary classification optimization loss;

[0123] The binary classification optimization loss function is expressed as:

[0124] ;

[0125] In the formula, represents the binary classification optimization loss, Indicates the total number of images in this batch, represents the label value of the image sample, Represents the predicted value of an image sample.

[0126] According to the prediction clustering optimization loss and the binary classification optimization loss, a classifier joint optimization loss function is constructed. The classifier joint optimization loss is minimized through the classifier joint optimization loss function to obtain a trained real image / generated fake image binary classifier. The obtained classifier joint optimization loss function is expressed as:

[0127] ;

[0128] In the formula, represents the classifier joint optimization loss, represents the prediction clustering optimization loss, represents the binary classification optimization loss, is the scaling parameter.

[0129] After the training process is completed, the real image / generated fake image binary classifier deletes the bias feature network layer, the shared feature network layer and the clustering network layer, and only retains the backbone network ResNet50 encoder network and the binary classification network layer; the backbone network ResNet50 encoder network is used to extract the image features of the image to be detected; the binary classification network layer is used to perform binary classification optimization according to the image features of the image to be detected to obtain the detection result.

[0130] Acquire an image to be detected;

[0131] The acquired image to be detected is input into a pre-trained real image / generated false image binary classifier, and a detection result is output: the generated false image to be detected is a real image or the generated false image to be detected is a false image.

[0132] In summary, the general generative fake image detection method provided by the present invention significantly improves the accuracy and robustness of generative fake image detection through innovative training methods and feature extraction mechanisms, and has universality. The present invention uses data enhancement technology to process real images and generative fake images, effectively expanding the diversity of training samples and enhancing the generalization ability of the real image / generative fake image binary classifier for image transformation. Subsequently, by extracting and optimizing shared features and bias features, not only the essential attributes shared by the two types of images are captured, but also the subtle differences between the two types of images are successfully distinguished. In particular, by jointly optimizing the loss function of shared features, the loss function of bias features, and the cosine similarity loss function, the reasonable distance between the shared features and the bias features is constrained, and the shared feature representation of the real image is further purified.

[0133] The present invention provides a method for extracting features of enhanced real images and fake images using advanced image feature operators, respectively, in the feature extraction stage, thereby ensuring the comprehensiveness and accuracy of feature extraction. At the same time, through an innovative strategy combining predictive clustering optimization and binary classification optimization, not only is cluster analysis used to improve the ability of the real image / generated fake image binary classifier to understand the intrinsic structure of the image, but the discrimination ability of the classifier is also directly optimized for the detection task through binary classification optimization. This dual optimization mechanism effectively combines the advantages of unsupervised learning and supervised learning, so that the trained real image / generated fake image binary classifier can make more accurate and reliable judgments when facing complex and changeable generative fake images.

[0134] In addition, the present invention also achieves a comprehensive improvement in classifier performance by jointly optimizing the prediction clustering optimization loss function and the binary classification optimization loss function, ensuring that the real image / generated fake image binary classifier obtains the best detection effect in the process of minimizing the classifier joint optimization loss. The detection method of the present invention not only improves the accuracy of fake image detection, but also enhances the adaptability of the real image / generated fake image binary classifier to the new fake image generation technology, which is of great significance for maintaining the authenticity and credibility of image content, and can be widely used in multiple fields such as digital copyright protection and network content supervision.

[0135] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0139] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A general generative fake image detection method, characterized in that: include: Acquire an image to be detected; Input the acquired image to be detected into the pre-trained real image / generated fake image binary classifier and output the detection result; The training method of the real image / generated fake image binary classifier includes: Use the real images and the generated fake images to be tested as training sets; Perform data enhancement processing on the training set to obtain real images after data enhancement processing and generated fake images after data enhancement processing; Extract shared features and bias features of real images after data augmentation processing; By jointly optimizing the loss function of the shared feature, the loss function of the biased feature, and the cosine similarity loss function, the distance between the shared feature and the biased feature is constrained to obtain the final real image shared feature; Extract image feature operators from the real image after data enhancement processing and the generated fake image after data enhancement processing to obtain real image features and generated fake image features respectively; The final real image shared features, real image features, and generated fake image features are input into the classifier for prediction clustering optimization to obtain the prediction clustering optimization loss; Input the real image features and the generated fake image features into the classifier for binary classification optimization to obtain the binary classification optimization loss; According to the predicted clustering optimization loss and the binary classification optimization loss, a classifier joint optimization loss function is constructed. The classifier joint optimization loss is minimized through the classifier joint optimization loss function to obtain a trained real image / generated fake image binary classifier.

2. The general generative false image detection method according to claim 1, characterized in that: The real image / generated fake image binary classifier includes: The backbone network ResNet50 encoder network is used to extract image feature operators to obtain real image features and generative fake image features; The bias feature network layer is used to extract the bias features of the real image, and obtain the shared features of the real image by working together with the shared features of the real image extracted by the shared feature network layer; The shared feature network layer is used to extract the shared features of the real image, and obtain the shared features of the real image by working together with the bias features of the real image extracted by the bias feature network layer; A clustering network layer for forcing the real image features to cluster with the real image shared features, and forcing the generated fake image features to stay away from the real image shared features; The binary classification network layer is used to optimize the real image features and the generated fake image features for binary classification to obtain the detection results.

3. The general generative false image detection method according to claim 2, characterized in that: The real image / generated fake image binary classifier deletes the bias feature network layer, the shared feature network layer and the clustering network layer after the training process is completed, and only retains the backbone network ResNet50 encoder network and the binary classification network layer; The backbone network ResNet50 encoder network is used to extract image features of the image to be detected; The binary classification network layer is used to perform binary classification optimization according to the image features of the image to be detected to obtain a detection result.

4. The general generative false image detection method according to claim 1, characterized in that: Methods for data augmentation of acquired real images and generated fake images include: Perform a set of random data augmentations on real images used to extract shared features; Two sets of random data augmentation are performed on the real images used to extract bias features.

5. The general generative false image detection method according to claim 1, characterized in that: The method of obtaining the final real image shared feature by jointly optimizing the loss function of the shared feature, the loss function of the biased feature and the cosine similarity loss function, constraining the distance between the shared feature and the biased feature, comprises: Calculating the shared feature loss of the real image according to the loss function of the shared feature; Calculating the bias feature loss of the real image according to the loss function of the bias feature; According to the cosine similarity loss function, calculate the cosine similarity loss of bias features and shared features; The shared feature loss, bias feature loss, and cosine similarity loss of bias features and shared features are combined to construct the real image representation loss function; The real image representation loss function is used to force the real image features to aggregate with the real image shared features, and to force the generated fake image features to stay away from the real image shared features, so as to obtain the final real image shared features.

6. The general generative false image detection method according to claim 5, characterized in that: The loss function of the shared feature is expressed as: ; In the formula, represents the shared features of real images, represents the shared feature loss, represents maximization, Variable Value represents all images in this batch, Represents the anchor images in this batch, Indicates other images in this batch except the anchor image Any image subscript of represents the isomorphic features of the anchor image of the i-th image, represents the positive example of the isomorphic feature of the anchor image, Represents a modulo arithmetic operation.

7. The general generative false image detection method according to claim 6, characterized in that: The loss function of the bias feature is expressed as: ; In the formula, represents the bias feature of the real image, represents the bias feature loss, represents all images in this batch, Represents the anchor images in this batch, represents the heterogeneous features of the anchor image of the i-th image, represents the positive example of heterogeneous features of anchor image, Indicates other images in this batch except anchor images and positive images Any image subscript of represents the negative examples of heterogeneous features of anchor images, represents the temperature parameter, Represents an exponential function.

8. The general generative fake image detection method according to claim 7, characterized in that: The real image representation loss function is used to force the real image features to aggregate with the real image shared features, and to force the generated fake image features to stay away from the real image shared features, so as to obtain the final real image shared features. The real image representation loss function is expressed as: ; In the formula, represents the real image representation loss, represents the bias feature loss, represents the shared feature loss, represents the cosine similarity loss of bias features and shared features, is the scaling parameter, using the weight of the whole joint loss.

9. The general generative fake image detection method according to claim 1, characterized in that: The prediction clustering optimization loss function is expressed as: ; In the formula, represents the prediction clustering optimization loss, represents all images in this batch, Represents the anchor images in this batch, Represents the anchor images in this batch A positive example, Indicates the anchor image in this batch Positive example Any image subscript of Represents the anchor image The binary classification features of represents the positive example of anchor image, Indicates other images in this batch except anchor images and positive images Any image subscript of represents the negative example of the anchor image, represents the temperature parameter, represents the exponential function; The binary classification optimization loss function is expressed as: ; In the formula, represents the binary classification optimization loss, Indicates the total number of images in this batch, represents the label value of the image sample, Represents the predicted value of an image sample.

10. The general generative fake image detection method according to claim 1, characterized in that: According to the prediction clustering optimization loss and the binary classification optimization loss, a classifier joint optimization loss function is constructed. The classifier joint optimization loss is minimized through the classifier joint optimization loss function to obtain a trained real image / generated fake image binary classifier. The obtained classifier joint optimization loss function is expressed as: ; In the formula, represents the classifier joint optimization loss, represents the prediction clustering optimization loss, represents the binary classification optimization loss, is the scaling parameter.