Image authenticity detection model training method and image authenticity detection method
By decoupling and mutating the image features, forming a set of mutated image features and reconstructing the image samples, the problems of insufficient generalization ability and robustness of unknown forgery methods in the prior art are solved, and higher accuracy and generalization of image authenticity detection are achieved.
Patent Information
- Application Number
- CN202411805668.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-10
AI Technical Summary
Existing deep learning models require a large amount of labeled data in image authenticity detection, and lack the ability to generalize unknown forgery methods, and lack the robustness to common perturbations such as image compression.
The image features are initially classified through the forged algorithm type classifier and the data authenticity classifier, decoupled into semantic features, unique features of forged algorithms, and general features of forged algorithms, and the iconic features are determined and mutated in the general features, forming a set of mutated image features, and the image samples are decoded and reconstructed, and the training loss is determined to adjust the model parameters.
It improves the accuracy and generalization of image authenticity detection, enhances the recognition ability of unknown forgery methods, and improves the robustness of common perturbations such as image compression.
Smart Images

Figure CN119274024B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an image authenticity detection model training method and an image authenticity detection method. Background Art
[0002] The technical problem of difficulty in identifying the authenticity of data due to the abuse of generative artificial intelligence (GAI) or the injection of malicious traffic data is generally solved by using artificial intelligence technology. For example, image or text recognition models are used to identify the authenticity of images or texts.
[0003] However, such deep learning models usually require a large amount of labeled data for training. In addition, they have high accuracy in identifying data generated by known specific forgery methods, but their generalization ability is insufficient for unknown forgery methods. Moreover, such models are not robust enough to common perturbations such as image compression. Summary of the invention
[0004] The present invention provides an image authenticity detection model training method, an image authenticity detection method, an image authenticity detection model training device, an electronic device and a storage medium, which can solve at least one of the above technical problems.
[0005] According to one aspect of the present invention, a method for training an image authenticity detection model is provided, comprising:
[0006] Using a forgery algorithm type classifier and a data authenticity classifier, respectively, preliminarily classify each image feature in the first image sample to obtain a forgery algorithm type classification result and an authenticity classification result of each image feature;
[0007] Based on the forgery algorithm type classification results and authenticity classification results of each of the image features, each of the image features is decoupled and reclassified to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set;
[0008] Based on the feature differences between the forgery algorithm-specific feature set and the forgery algorithm-general feature set, determining the characteristic features in the forgery algorithm-general feature set;
[0009] Based on the non-significant features in the forgery algorithm universal feature set, mutating the signature features in the forgery algorithm universal feature set to obtain a mutated forgery algorithm universal feature set;
[0010] Determine a mutated image feature set based on the semantic feature set, the forgery algorithm-specific feature set, and the mutated forgery algorithm general feature set;
[0011] Decoding the variant image feature set to obtain a second image sample;
[0012] Determine the current training loss based on the forgery algorithm type classification result and the authenticity classification result of each of the image features, and the difference between the first image sample and the second image sample;
[0013] When the loss of this training meets the preset loss condition, the above training steps are stopped, and a target image authenticity detection model is determined based on the data authenticity classifier.
[0014] According to another aspect of the present invention, there is provided a method for detecting authenticity of an image, comprising:
[0015] In response to an image detection request for a target image, performing image detection on the target image based on a target image authenticity detection model to obtain an image detection result of whether the target image is a real image or a forged image;
[0016] The target image authenticity detection model is a model trained and generated by any of the image authenticity detection model training methods described in the embodiments of the present invention.
[0017] According to another aspect of the present invention, there is provided an image authenticity detection model training device, comprising:
[0018] A preliminary classification module, using a forgery algorithm type classifier and a data authenticity classifier, performs preliminary classification on each image feature in the first image sample, and obtains a forgery algorithm type classification result and an authenticity classification result of each image feature;
[0019] A decoupling classification module, for decoupling and reclassifying each of the image features based on the forgery algorithm type classification results and the authenticity classification results of each of the image features, to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set;
[0020] a signature feature determination module, configured to determine signature features in the forgery algorithm universal feature set based on feature differences between the forgery algorithm-specific feature set and the forgery algorithm universal feature set;
[0021] A feature mutation module, used for mutating the iconic features in the forgery algorithm universal feature set based on the non-iconic features in the forgery algorithm universal feature set to obtain the mutated forgery algorithm universal feature set;
[0022] A variant feature set determination module, used to determine a variant image feature set based on the semantic feature set, the forgery algorithm-specific feature set, and the forgery algorithm universal feature set after the variant;
[0023] A feature decoding module, used for decoding the variant image feature set to obtain a second image sample;
[0024] a training loss determination module, configured to determine the current training loss based on the forgery algorithm type classification result and the authenticity classification result of each of the image features, and the difference between the first image sample and the second image sample;
[0025] The target model determination module is used to stop executing the above training steps when the loss of this training meets the preset loss condition, and determine the target image authenticity detection model based on the data authenticity classifier.
[0026] According to another aspect of the present invention, there is provided an electronic device, comprising:
[0027] at least one processor; and
[0028] a memory communicatively connected to the at least one processor; wherein,
[0029] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any image authenticity detection model training method and image authenticity detection method in the embodiments of the present invention.
[0030] According to another aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any image authenticity detection model training method and image authenticity detection method according to the embodiments of the present invention.
[0031] According to the technical solution of the present invention, each image feature in the first image sample is decoupled into semantic features, forgery algorithm-specific features and forgery algorithm-general features by a forgery algorithm type classifier and a data authenticity classifier. The feature difference between the forgery algorithm-specific features and the forgery algorithm-general features is used to obtain the iconic features in the forgery algorithm-general features, and the iconic features are mutated in the forgery algorithm-general features to obtain the mutated forgery algorithm-general features. The semantic features, the forgery algorithm-specific features and the mutated forgery algorithm-general features are combined to obtain a mutated image feature set, and the mutated image feature set is decoded and reconstructed to obtain a second image sample. The classification result and the reconstruction result are used to determine the loss of this training, so as to adjust the parameters of the two classifiers by using these two losses. In this way, the data authenticity classifier can learn a universal forgery feature between different forgery algorithms, and enhance the learning effect of the universal forgery feature through the above-mentioned mutation process. Finally, the iteratively outputted data authenticity classifier is used as the target image authenticity detection model. Thus, the accuracy and generalization of image authenticity detection can be improved.
[0032] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0034] Figure 1 is a flow chart of an image authenticity detection model training method according to an embodiment of the present invention;
[0035] Figure 2 is a flow chart of an image authenticity detection method according to an embodiment of the present invention;
[0036] Figure 3 is a flow chart of an image authenticity detection model training method according to another embodiment of the present invention;
[0037] Figure 4 It is a structural block diagram of an image authenticity detection model training device according to an embodiment of the present invention;
[0038] Figure 5 is a structural block diagram of an image authenticity detection device according to an embodiment of the present invention;
[0039] Figure 6 The block diagram is a block diagram of an electronic device for implementing the method according to the embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present invention. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0041] Explanation of relevant terms:
[0042] (1) Feature Disentanglement: This is the process of separating different parts of the feature representation so that each part can independently represent different aspects of the data. For example, in an image, color, shape, and texture can be considered different features that can be modified and controlled independently after decoupling.
[0043] (2) Autoencoder: An unsupervised neural network used to learn effective encoding of data. Autoencoders are trained by minimizing the difference between input and output and are usually used for data denoising, feature extraction, or dimensionality reduction. The encoder and decoder are the two main components in an autoencoder. The encoder is responsible for converting the input data into an internal representation, while the decoder reconstructs this internal representation back into the form of the original data.
[0044] (3) Feature Extraction: The process of extracting information from raw data that is helpful for subsequent processing or analysis. In the encoder, the encoder performs this step.
[0045] (4) Clustering: A statistical method for grouping objects in a data set so that objects in the same group are more similar than objects in other groups. The K-means clustering algorithm is a commonly used clustering method that divides data into K clusters by iteratively selecting cluster centers and redistributing data points to the nearest cluster center until a stopping condition is met.
[0046] (5) Data Reconstruction: The process of using a decoder to reconstruct the original data based on feature representation, which is often used to train an encoder.
[0047] (6) Iterative Training: Through continuous iterative optimization process, the model parameters are gradually improved to minimize the loss function.
[0048] Figure 1 It is a flow chart of an image authenticity detection method according to an embodiment of the present invention.
[0049] like Figure 1 As shown, the image authenticity detection method may include:
[0050] S110, using a forgery algorithm type classifier and a data authenticity classifier to preliminarily classify each image feature in the first image sample, and obtain a forgery algorithm type classification result and an authenticity classification result of each image feature;
[0051] S120, based on the forgery algorithm type classification result and the authenticity classification result of each image feature, decoupling and reclassifying each image feature to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set;
[0052] S130, determining a signature feature in the forgery algorithm common feature set based on a feature difference between the forgery algorithm-specific feature set and the forgery algorithm common feature set;
[0053] S140, based on the non-significant features in the forgery algorithm universal feature set, mutate the signature features in the forgery algorithm universal feature set to obtain a mutated forgery algorithm universal feature set;
[0054] S150, determining a mutated image feature set based on the semantic feature set, the forgery algorithm-specific feature set, and the mutated forgery algorithm general feature set;
[0055] S160, decoding the variant image feature set to obtain a second image sample;
[0056] S170, determining the current training loss based on the forgery algorithm type classification result and the authenticity classification result of each image feature, and the difference between the first image sample and the second image sample;
[0057] S180, when the current training loss meets the preset loss condition, stop executing the above training steps, and determine the target image authenticity detection model based on the data authenticity classifier.
[0058] It can be understood that the above-mentioned stopping of executing the training steps in the above training steps includes steps S110 to S170.
[0059] It can be understood that the first image sample is any image sample in the image sample set. The image sample set may include multiple real images and multiple forged images. Among them, different forged images can be generated using the same or different forging algorithms.
[0060] Exemplarily, the forged images in the image sample set may be images generated by generative artificial intelligence. Thus, the target image authenticity detection model generated by training can detect the forged images generated by generative artificial intelligence.
[0061] It can be understood that the image samples in the image sample set are all images obtained after standardization and normalization processing.
[0062] Exemplarily, a plurality of real images and a plurality of forged images are obtained, wherein the forged images are images generated by generative artificial intelligence; each real image and each forged image is normalized to obtain a plurality of standardized images; and an image sample set is determined based on the plurality of standardized images.
[0063] Exemplarily, the normalization process may include normalizing the size, resolution, etc. of the image to eliminate the influence of different dimensions of different images.
[0064] Exemplarily, when determining the current training loss, the difference between the two classification results of the first image sample and the annotation information can be determined in combination with the annotation information of the first image sample, so as to determine the current training loss in combination with the difference.
[0065] Exemplarily, the annotation information of the first image sample may include information on whether the first image sample is a real image, and when the first image sample is a forged image, the forgery algorithm corresponding to the first image sample. These annotation information may be represented by corresponding numerical values. For example, 1 represents a real image, 0 represents a forged image, 01 represents that the first image sample is a forged image and its corresponding forgery algorithm is forgery algorithm 1, and 02 represents that the first image sample is a forged image and its corresponding forgery algorithm is forgery algorithm 2.
[0066] Exemplarily, in the above step S110, an encoder is used to encode the first image sample to obtain multiple image features of the first image sample, the multiple image features are clustered to obtain multiple feature clusters, and a forgery algorithm type classifier and a data authenticity classifier are used to preliminarily classify each image feature cluster to obtain a forgery algorithm type classification result and an authenticity classification result of each image feature cluster. In the above step S120, based on the forgery algorithm type classification result and the authenticity classification result of each image feature cluster, each image feature cluster is decoupled and reclassified to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set. The method of clustering and then classifying can improve the classification speed without having to classify each feature one by one.
[0067] Exemplarily, the encoder may include a convolution layer, a pooling layer, and an activation function. After the first image sample passes through the convolution layer, the activation function, and the pooling layer of the encoder, a feature representation of the first image sample, namely, the above-mentioned multiple image features, may be extracted.
[0068] Exemplarily, a K-means clustering algorithm is used to cluster multiple image features to obtain multiple image feature clusters.
[0069] Specifically, the number of clusters K is determined, and K image features are selected from multiple image features as initial cluster centers; the similarity between each image feature in the multiple image features and each initial cluster center is calculated, and each image feature is assigned to its most similar cluster center based on the similarity, thereby forming K image feature clusters. According to the distribution of the K image feature clusters, the cluster center of each image feature cluster is recalculated, and the similarity is recalculated. According to the similarity, it is detected whether the features in each image feature cluster still belong to the cluster. If not, the feature is assigned to the cluster corresponding to its most similar cluster center. In this way, the calculation is repeated until the feature allocation no longer changes, and K image feature clusters are output as the clustering result. Wherein, K is a positive integer.
[0070] For example, after clustering, multiple image feature clusters are obtained, each of which may include one or more image features. At this point, the feature categories of each cluster are unknown, so it is necessary to use a forgery algorithm type classifier and a data authenticity classifier to identify these feature clusters, and use the identification results to decouple and classify these feature clusters to obtain the feature categories corresponding to each feature cluster.
[0071] It can be understood that the forgery algorithm type classifier is used to identify which forgery algorithm the input image feature is generated by, that is, the output result is the forgery algorithm type corresponding to the image feature, or the forgery algorithm type corresponding to the image feature cannot be identified. For example, a numerical value can be used to represent the forgery algorithm type and the forgery algorithm type corresponding to the image feature cannot be identified. For example, a null value is used to represent the forgery algorithm type corresponding to the image feature cannot be identified.
[0072] It can be understood that the data authenticity classifier is used to identify whether the input image feature is a real feature or a forged feature, or to identify whether the image corresponding to the input image feature is a real image or a forged image. For example, a numerical value can be used to represent the output result of the data authenticity classifier. For example, 1 represents a real feature and 0 represents a forged feature.
[0073] Exemplarily, the forgery algorithm type classification result and the authenticity classification result may be characterized by probability distribution, for example, a softmax formula may be used.
[0074] Exemplarily, the feature categories may include semantic features, forgery algorithm-specific features, and forgery algorithm common features.
[0075] It can be understood that the semantic feature is used to describe the features of the first image sample.
[0076] It can be understood that the forgery algorithm-specific feature is a trace feature of forgery of the first image sample by a specific forgery algorithm, and the forgery algorithm-general feature is a trace feature of forgery of the first image sample by any forgery algorithm.
[0077] Exemplarily, the semantic features, the forgery algorithm-specific features, and the forgery algorithm-general features are randomly recombined to obtain the recombined features. Alternatively, the semantic features, the forgery algorithm-specific features, and the forgery algorithm-general features are randomly recombined according to a preset recombining algorithm to obtain the recombined features. Alternatively, the semantic features, the forgery algorithm-specific features, and the forgery algorithm-general features are randomly recombined to obtain the recombined features, wherein the recombined features include the recombined semantic features, the recombined forgery algorithm-specific features, and the recombined forgery algorithm-general features.
[0078] For example, at least one feature in the feature combination of semantic features, forgery algorithm-specific features, and forgery algorithm-general features is randomly reorganized or replaced to obtain a new feature combination. The new feature combination also still includes the three categories of features: semantic features, forgery algorithm-specific features, and forgery algorithm-general features. Some features in the new feature combination may be the same as the features in the feature combination before processing.
[0079] Exemplarily, a decoder is used to decode the recombinant features or the above-mentioned variant image feature set to obtain a reconstructed image, that is, the above-mentioned second image sample.
[0080] Exemplarily, the decoder may include a convolution layer, a pooling layer, and an activation function. The reconstructed features or the above-mentioned variant image feature set are input into the decoder, and the reconstructed image is obtained by processing the convolution layer, the activation function, and the pooling layer in sequence. Alternatively, the reconstructed image is characterized by using a corresponding feature representation.
[0081] Exemplarily, the training loss is used to adjust parameters of the encoder, the forgery algorithm type classifier, the data authenticity classifier, and the decoder.
[0082] Exemplarily, when the current training loss does not meet the preset loss condition, the parameters of the encoder, forgery algorithm type classifier, data authenticity classifier and decoder are adjusted, and the process returns to continue executing steps S110 to S180 until the current training loss meets the preset loss condition, then the iteration is stopped, and the data authenticity classifier is used as the target image authenticity detection model.
[0083] According to the above embodiment, each image feature in the first image sample is decoupled into semantic features, forgery algorithm-specific features and forgery algorithm-general features by a forgery algorithm type classifier and a data authenticity classifier. The feature difference between the forgery algorithm-specific features and the forgery algorithm-general features is used to identify the signature features in the forgery algorithm-general features, and the signature features are mutated in the forgery algorithm-general features to obtain the mutated forgery algorithm-general features, and the semantic features, the forgery algorithm-specific features and the mutated forgery algorithm-general features are combined to obtain a mutated image feature set, and the mutated image feature set is decoded and reconstructed to obtain a second image sample. The classification result and the reconstruction result are used to determine the loss of this training so as to use these two losses to adjust the parameters of the encoder, the two classifiers and the decoder. In this way, the data authenticity classifier can learn a general forgery feature between different forgery algorithms, and enhance the learning effect of the general forgery feature through the above-mentioned mutation process. Finally, the iteratively outputted data authenticity classifier is used as the target image authenticity detection model. Thus, the accuracy and generalization of image authenticity detection can be improved.
[0084] In one embodiment, the first model includes an encoder, a forgery algorithm type classifier, a data authenticity classifier, and a decoder, the encoder is used to encode the first image sample to obtain various image features, and the decoder is used to decode the variant image feature set. The method also includes:
[0085] When the current training loss does not meet the loss condition, the encoder, the forgery algorithm type classifier, the data authenticity classifier, and the decoder in the first model are adjusted based on the current training loss, and the first image sample is updated based on the image training sample set;
[0086] Based on the encoder, forgery algorithm type classifier, data authenticity classifier and decoder in the first model after parameter adjustment, and the updated first image sample, return to perform the training step.
[0087] It can be understood that the training step refers to the above steps S110 to S180, as well as the step of adjusting parameters of the encoder, forgery algorithm type classifier, data authenticity classifier and decoder based on the training loss, and updating the first image sample based on the image training sample set.
[0088] It can be understood that the encoder and the decoder are included in an autoencoder.
[0089] According to the above implementation, the parameters of the encoder, two classifiers and decoder are adjusted by using the training loss. In this way, the data authenticity classifier can learn a common forgery feature between different forgery algorithms, and iteratively output the data authenticity classifier as the target image authenticity detection model. Thus, the accuracy and generalization of image authenticity detection can be improved.
[0090] In one embodiment, based on the forgery algorithm type classification results and authenticity classification results of each image feature, each image feature is decoupled and reclassified to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set, including:
[0091] When the forgery algorithm type classification result of the image feature is any forgery algorithm type, and the authenticity classification result of the image feature is forged data, the image feature is decoupled into forgery algorithm-specific features, and the image feature is added to the forgery algorithm-specific feature set;
[0092] When the forgery algorithm type classification result of the image feature is that the forgery algorithm type cannot be identified, and the authenticity classification result of the image feature is forged data, the image feature is decoupled into a forgery algorithm general feature, and the image feature is added to the forgery algorithm general feature set;
[0093] When the forgery algorithm type classification result of the image feature is that the forgery algorithm type cannot be identified, and the authenticity classification result of the image feature is real data, the image feature is decoupled into semantic features, and the image feature is added to the semantic feature set.
[0094] It can be understood that the above image features are clustered and then decoupled and classified.
[0095] It can be understood that each image feature cluster obtained after aggregation is input into the forgery algorithm type classifier and the data authenticity classifier respectively to obtain the corresponding forgery algorithm type classification results and authenticity classification results. Thus, the two classification results are used to decouple and classify each image feature cluster to obtain the semantic feature set, the forgery algorithm-specific feature set and the forgery algorithm general feature set.
[0096] Exemplarily, the forged algorithm type classification result is a forged algorithm type or a forged algorithm type cannot be identified. The result can be represented by a numerical value, and different forged algorithm types correspond to different numerical values. The forged algorithm type cannot be identified can also correspond to a numerical value, or can be represented by null.
[0097] Exemplarily, the authenticity classification result is real data or forged data. The result can be represented by a numerical value. For example, 1 represents real data and 0 represents forged data.
[0098] It can be understood that, according to the output results of the two classifiers, the image features or image feature clusters are decoupled to obtain the categories of these image features or image feature clusters. That is, the classification results of the forged algorithm by the forged algorithm type classifier are decoupled to obtain the unique features of the forged algorithm; the classification results of the feature authenticity by the data authenticity classification are decoupled to obtain the common features of the forged data.
[0099] According to the above implementation, the forgery algorithm type classification result and the authenticity classification result are used to decouple each image feature to obtain semantic features, forgery algorithm-specific features, and forgery algorithm-general features. Thus, the forgery algorithm type classifier can identify and classify features generated by different forgery algorithms to distinguish the specific features in the forged image, and the data authenticity classifier can learn general forgery features.
[0100] In one embodiment, based on the feature differences between the forgery algorithm-specific feature set and the forgery algorithm-general feature set, determining the signature features in the forgery algorithm-general feature set includes: clustering the forgery algorithm-specific feature set to obtain the feature clustering center; based on the feature distance between the feature clustering center and each feature in the forgery algorithm-general feature set, determining, in the forgery algorithm-general feature set, the forgery algorithm-general features whose feature distances meet a preset feature distance range; and determining the signature features based on the forgery algorithm-general features whose feature distances meet a preset feature distance range.
[0101] Exemplarily, a K-means clustering algorithm may be used to forge a unique feature set of the algorithm for clustering to obtain a feature clustering center.
[0102] Exemplarily, the Euclidean distance or the cosine distance may be used to calculate the feature distance between the feature cluster center and each universal feature in the universal feature set of the forgery algorithm.
[0103] Exemplarily, the larger the feature distance is, the greater the possibility of it being selected as a signature feature.
[0104] Exemplarily, the feature distance range can be: the upper quartile value is determined between the maximum distance and the minimum distance between the feature cluster center obtained in the last training and each feature in the general feature set of the forgery algorithm, and the interval between the upper quartile value and the maximum distance is the feature distance range.
[0105] Exemplarily, the common features of the counterfeit algorithm whose feature distance falls within the interval are used as the signature features.
[0106] It will be appreciated that a signature feature may be one or more features.
[0107] According to the above implementation, a universal feature that is far away from a specific feature can be accurately selected to mutate the universal feature, thereby enhancing the learning effect of the data authenticity classifier on the universal feature of the forgery algorithm and improving the recognition accuracy and generalization of the data authenticity classifier.
[0108] In one embodiment, based on non-signature features in a common feature set of a forgery algorithm, a signature feature in the common feature set of a forgery algorithm is mutated to obtain a mutated common feature set of a forgery algorithm, including: calculating the degree of similarity between the signature feature and the non-signature feature in the common feature set of a forgery algorithm; based on the degree of similarity, determining the degree of variation of the signature feature; based on the degree of variation of the signature feature, mutating the signature feature in the common feature set of a forgery algorithm to obtain a mutated common feature set of a forgery algorithm.
[0109] For example, KL divergence can be used to calculate the similarity between the iconic features and the non-iconic features in the common feature set of the forgery algorithm. The larger the divergence, the lower the similarity. The smaller the divergence, the higher the similarity.
[0110] It can be understood that the higher the similarity, the lower the degree of variation of the characteristic feature, and the characteristic feature needs to be enhanced. The lower the similarity, the higher the degree of variation of the characteristic feature, and the characteristic feature needs to be generally mutated, without enhanced variation.
[0111] According to the above implementation, the variation degree of the iconic feature is determined based on the similarity between the iconic feature and the non-iconic feature in the common feature set of the forgery algorithm; based on the variation degree of the iconic feature, the iconic feature in the common feature set of the forgery algorithm is mutated. In this way, the mutated iconic feature can be greatly different from the non-iconic feature, thereby enhancing the learning effect of the data authenticity classifier on the common features of the forgery algorithm and improving the recognition accuracy and generalization of the data authenticity classifier.
[0112] In one implementation, based on the forgery algorithm type classification result and the authenticity classification result of each image feature, and the difference between the first image sample and the second image sample, determining the current training loss includes:
[0113] Determine a classification loss based on the forgery algorithm type classification result of each image feature and the difference between the true and false classification result and the annotation information of the first image sample;
[0114] determining a reconstruction loss based on pixel differences between the first image sample and the second image sample;
[0115] Based on the classification loss and reconstruction loss, the training loss is determined.
[0116] Exemplarily, based on the difference between the forgery algorithm type classification results of each image feature and the annotation information of the first image sample, the forgery algorithm type classification loss is determined, and based on the difference between the authenticity classification results of each image feature and the annotation information of the first image sample, the authenticity classification loss is determined.
[0117] It can be understood that if the above-mentioned image features are clustered, the classification loss is determined based on the difference between the forgery algorithm type classification results of each image feature cluster and the true and false classification results and the annotation information of the first image sample.
[0118] Exemplarily, the cross entropy loss function is used to calculate the annotation information of the first image sample and the forgery algorithm type classification results of each image feature or image feature cluster to obtain the forgery algorithm type classification loss; the cross entropy loss function is used to calculate the annotation information of the first image sample and the authenticity classification results of each image feature or image feature cluster to obtain the data authenticity classification loss.
[0119] For example, the cross entropy loss function can be expressed as follows:
[0120]
[0121] Among them, y2 is the predicted value, is the true value, and m is the total number of image feature clusters.
[0122] Among them, taking the forgery algorithm type classification loss as an example, y2 is the forgery algorithm type classification result of the image feature or image feature cluster (that is, the predicted forgery algorithm type), is the forgery algorithm type in the annotation information of the first image sample.
[0123] Among them, taking the data authenticity classification loss as an example, y2 is the authenticity classification result of the image feature or image feature cluster (that is, the predicted real or fake label information), is the real or forged labeling information in the labeling information of the first image sample.
[0124] According to the above implementation, a cross entropy loss function can be used to determine the forgery algorithm type classification loss and the authenticity classification loss at each iteration, so as to facilitate the subsequent use of these two losses to adjust the model parameters of the forgery algorithm type classifier and the data authenticity classifier. Thus, the forgery algorithm type classifier can identify and classify the features generated by different forgery algorithms to distinguish the unique features in the forged image, and the data authenticity classifier can learn the universal forgery features.
[0125] Exemplarily, based on each pixel point in the first image sample and each pixel point in the second image sample, the reconstruction loss is determined, including: using a reconstruction loss function to calculate the difference between the pixel value of each pixel point in the first image sample and the pixel value of each pixel point in the second image sample to obtain the reconstruction loss.
[0126] Exemplarily, the reconstruction loss function can be expressed as follows:
[0127]
[0128] in, is the pixel value of the pixel point corresponding to the i-th horizontal coordinate position and the j-th vertical coordinate position in the second image sample, is the pixel value of the pixel point corresponding to the i-th horizontal coordinate position and the j-th vertical coordinate position in the first image sample. m represents the number of horizontal coordinate positions, and n represents the number of vertical coordinate positions. It should be noted that the first image sample is the original image, and the second image sample is the reconstructed image.
[0129] According to the above implementation, a reconstruction loss function can be used to determine the loss of the decoder in each iteration, so as to facilitate the subsequent use of this loss to adjust the model parameters of the decoder, thereby improving the ability of the decoder to understand the semantic features of the image.
[0130] Exemplarily, based on the weights of the classification loss and the reconstruction loss, the forgery algorithm type classification loss, the data authenticity classification loss and the reconstruction loss are weightedly summed to obtain the current training loss, that is, the comprehensive loss.
[0131] Exemplarily, a gradient descent algorithm is used to adjust parameters of an encoder, a forgery algorithm type classifier, a data authenticity classifier, and a decoder based on a comprehensive loss.
[0132] According to the above implementation, the comprehensive loss is determined by utilizing the forgery algorithm type classification loss, the data authenticity classification loss, and the reconstruction loss. Thus, the comprehensive loss is utilized to adjust the parameters of the encoder, the forgery algorithm type classifier, the data authenticity classifier, and the decoder. This can improve the encoder's and decoder's ability to understand image features and image semantic features, and at the same time, improve the accuracy of the forgery algorithm type classifier in distinguishing the forgery algorithm type, and improve the accuracy and generalization of the data authenticity classifier in recognizing common features.
[0133] Figure 2 It is a flow chart of an image authenticity detection method according to an embodiment of the present invention.
[0134] like Figure 2 As shown, the method may include:
[0135] S210, receiving an image detection request for a target image;
[0136] S220, performing image detection on the target image based on the target image authenticity detection model to obtain an image detection result of whether the target image is a real image or a forged image;
[0137] The target image authenticity detection model is a model trained and generated by any image authenticity detection model training method according to the embodiments of the present invention.
[0138] According to the embodiment of the present invention, since the adopted model has high accuracy and high generalization, the accuracy and generalization of image detection can also be improved.
[0139] Figure 3It is a flowchart of an image authenticity detection model training method according to another embodiment of the present invention.
[0140] like Figure 3 As shown, the method comprises the following steps:
[0141] (1) Data processing
[0142] Input: Receive a set of real data and fake data.
[0143] Operation and output: Standardize and normalize the input data to eliminate the impact of different dimensions, and output the processed standardized data.
[0144] (2) Feature extraction
[0145] Input: Receives normalized data from data processing output.
[0146] Operation and output: Extract the feature representation of the standardized data through the encoder and output the extracted feature representation.
[0147] (3) Feature classification
[0148] Input: extracted feature representation;
[0149] Operation and output: Use K-means clustering algorithm to classify feature representations, distinguish semantic features, common features and unique features, and output classified features.
[0150] (4) Feature decoupling
[0151] Input: features for classification.
[0152] Operation and output: Input the classification features into the forgery algorithm type classifier Cs, output the classification results of the forgery algorithm, input the classification features into the data authenticity detection classifier Cc, and output the authenticity label of the features. Here, the classification result is a list of probability distributions, generally using the softmax formula.
[0153] (5) Feature Recombination
[0154] Input: Output of classifiers Cs and Cc.
[0155] Operation and output: Decouple the features according to the output of the classifier. That is, decouple the unique features of the forged algorithm from the classification results of the forged algorithm through Cs, and decouple the common features of the forged data from the classification results of the authenticity of the features through Cc. Then, randomly reorganize or mutate the decoupled features and output the reorganized or mutated features.
[0156] (6) Data reconstruction
[0157] Input: Characteristics after recombination or mutation.
[0158] Operation and output: Use the decoder to reconstruct the data based on the reorganized or mutated features, and output the results of data reconstruction.
[0159] (7) Classifier output
[0160] Input: Output of feature disentanglement and data reassembly.
[0161] Operation and output: Based on the output of the classifier and the output of data reorganization, define a comprehensive loss function, and then optimize the Cc classifier and other model parameters through iterative training, minimize the loss function, and output the trained classifier Cc.
[0162] The embodiments of the present invention can solve the problem that it is difficult to identify the authenticity of images due to the abuse of generative artificial intelligence or malicious data injection. It can not only detect images generated by generative artificial intelligence, but also enhance the generalization and robustness of image authenticity detection algorithms on unknown data. The following explains how the embodiments of the present invention solve the above technical problems from the principle and generalization level:
[0163] (1) Through the encoder structure, the image is input into the encoder to extract the corresponding feature representation. Then, the features are classified using the clustering method to obtain multiple feature clusters.
[0164] (2) The core of the technical solution of the present invention lies in the idea of feature decoupling. Through the decoupling operation, feature clusters are divided into three categories: semantic features (features directly related to data content), unique features (features generated by specific forgery algorithms), and common features (forgery trace features that are generally applicable to different forgery algorithms). Among them, the forgery algorithm type classifier Cs is used to classify the feature clusters by forgery algorithm type to distinguish the unique features generated by different forgery algorithms. The data authenticity detection classifier Cc is used to further classify the feature clusters into authenticity and learn the common features between different forgery algorithms.
[0165] (3) The three types of decoupled features are reorganized or mutated, and the reorganized features are input into the decoder for data reconstruction to obtain a new image. This step helps the classifier to further decouple semantic features and forgery trace features, that is, the unique features and common features mentioned above.
[0166] (4) By defining a comprehensive loss function, including data reconstruction loss, forgery algorithm type classification loss and data authenticity classification loss, the encoder, Cc classifier, Cs classifier and decoder are iteratively trained to optimize their performance.
[0167] (5) Finally, the optimized Cc classifier is used as an image authenticity detection model in the field of image authenticity detection, which effectively solves the problem of forged image detection in an open world environment.
[0168] Through the above technical solution, the technical solution of the present invention not only solves the problem of generalization of data within and outside the domain, but also improves the robustness and accuracy of the detection algorithm when facing unknown counterfeit algorithms.
[0169] Figure 4 It is a structural block diagram of an image authenticity detection model training device according to an embodiment of the present invention.
[0170] like Figure 4 As shown, the image authenticity detection model training device may include:
[0171] A preliminary classification module 410 uses a forgery algorithm type classifier and a data authenticity classifier to perform preliminary classification on each image feature in the first image sample, and obtains a forgery algorithm type classification result and an authenticity classification result of each image feature;
[0172] A decoupling classification module 420 is used to decouple and reclassify each of the image features based on the forgery algorithm type classification result and the authenticity classification result of each of the image features to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set;
[0173] A signature feature determination module 430, configured to determine signature features in the forgery algorithm universal feature set based on feature differences between the forgery algorithm specific feature set and the forgery algorithm universal feature set;
[0174] A feature mutation module 440 is used to mutate the iconic features in the forgery algorithm universal feature set based on the non-iconic features in the forgery algorithm universal feature set to obtain the mutated forgery algorithm universal feature set;
[0175] A variant feature set determination module 450, configured to determine a variant image feature set based on the semantic feature set, the forgery algorithm-specific feature set, and the forgery algorithm universal feature set after the variant;
[0176] A feature decoding module 460 is used to decode the variant image feature set to obtain a second image sample;
[0177] A training loss determination module 470, configured to determine the current training loss based on the forgery algorithm type classification result and the authenticity classification result of each of the image features, and the difference between the first image sample and the second image sample;
[0178] The target model determination module 480 is used to stop executing the above training steps when the current training loss meets the preset loss condition, and determine the target image authenticity detection model based on the data authenticity classifier.
[0179] In one embodiment, the first model includes an encoder, the forgery algorithm type classifier, the data authenticity classifier and a decoder, the encoder is used to encode the first image sample to obtain each of the image features, the decoder is used to decode the variant image feature set, and the device also includes:
[0180] a model parameter adjustment module, configured to adjust parameters of the encoder, the forgery algorithm type classifier, the data authenticity classifier, and the decoder in the first model based on the current training loss when the current training loss does not meet the loss condition, and update the first image sample based on the image training sample set;
[0181] A loop training module is used to return to execute the training step based on the encoder, the forgery algorithm type classifier, the data authenticity classifier and the decoder in the first model after parameter adjustment, and the updated first image sample.
[0182] In one implementation, the decoupling classification module 420 includes:
[0183] a first decoupling unit, configured to decouple the image feature into a forgery algorithm-specific feature and add the image feature to the forgery algorithm-specific feature set when the forgery algorithm type classification result of the image feature is any forgery algorithm type and the authenticity classification result of the image feature is forged data;
[0184] a second decoupling unit, configured to decouple the image feature into a common feature of the forgery algorithm, and add the image feature to the common feature set of the forgery algorithm, when the forgery algorithm type classification result of the image feature is that the forgery algorithm type cannot be identified and the authenticity classification result of the image feature is forged data;
[0185] The third decoupling unit is used to decouple the image feature into a semantic feature and add the image feature to the semantic feature set when the forgery algorithm type classification result of the image feature is that the forgery algorithm type cannot be identified and the authenticity classification result of the image feature is real data.
[0186] In one implementation, the marker feature determination module 430 includes:
[0187] A cluster center determination unit, used for clustering the forgery algorithm-specific feature set to obtain a feature cluster center;
[0188] A feature screening unit, configured to determine, based on a feature distance between the feature cluster center and each feature in the forgery algorithm universal feature set, a forgery algorithm universal feature whose feature distance meets a preset feature distance range in the forgery algorithm universal feature set;
[0189] The hallmark feature determination unit is used to determine the hallmark feature based on the common features of the counterfeit algorithm that the feature distance meets the preset feature distance range.
[0190] In one implementation, the feature variation module 440 includes:
[0191] A similarity calculation unit, used to calculate the similarity between the iconic feature and the non-iconic feature in the common feature set of the forgery algorithm;
[0192] a variation degree determination unit, configured to determine the variation degree of the signature feature based on the similarity degree;
[0193] The feature mutation unit is used to mutate the iconic feature in the forgery algorithm universal feature set based on the degree of mutation of the iconic feature to obtain the mutated universal feature set of the forgery algorithm.
[0194] In one implementation, the training loss determination module 470 includes:
[0195] a classification loss determining unit, configured to determine the classification loss based on the forgery algorithm type classification result of each of the image features and the difference between the true and false classification result and the annotation information of the first image sample;
[0196] a reconstruction loss determining unit, configured to determine a reconstruction loss based on a pixel difference between the first image sample and the second image sample;
[0197] The comprehensive loss determination unit is used to determine the current training loss based on the classification loss and the reconstruction loss.
[0198] Figure 5 It is a structural block diagram of an image authenticity detection device according to an embodiment of the present invention.
[0199] like Figure 5 As shown, the image authenticity detection device may include:
[0200] An image detection request module 510 is used to receive an image detection request for a target image;
[0201] An image detection module 520 is used to perform image detection on the target image based on a target image authenticity detection model to obtain an image detection result indicating whether the target image is a real image or a forged image;
[0202] The target image authenticity detection model is a model trained and generated by the image authenticity detection model training method according to any one of the embodiments of the present invention.
[0203] For the description of specific functions and examples of each module and submodule of the module in the embodiment of the present invention, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0204] In the technical solution of the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0205] According to an embodiment of the present invention, the present invention also provides an electronic device and a readable storage medium.
[0206] Figure 6 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0207] like Figure 6 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0208] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0209] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as an image authenticity detection model training method or an image authenticity detection method. For example, in some embodiments, the image authenticity detection model training method and the image authenticity detection method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the image authenticity detection model training method and the image authenticity detection method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the image authenticity detection model training method and the image authenticity detection method in any other appropriate manner (for example, by means of firmware).
[0210] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0211] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0212] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0213] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0214] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0215] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0216] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0217] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for training an image authenticity detection model, characterized in that: include: Using a forgery algorithm type classifier and a data authenticity classifier, respectively, preliminarily classify each image feature in the first image sample to obtain a forgery algorithm type classification result and an authenticity classification result of each image feature; Based on the forgery algorithm type classification results and authenticity classification results of each of the image features, each of the image features is decoupled and reclassified to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set; Based on the feature difference between the forgery algorithm-specific feature set and the forgery algorithm-general feature set, determining the iconic features in the forgery algorithm-general feature set, including: clustering the forgery algorithm-specific feature set to obtain a feature cluster center; based on the feature distance between the feature cluster center and each feature in the forgery algorithm-general feature set, determining, in the forgery algorithm-general feature set, a forgery algorithm-general feature whose feature distance meets a preset feature distance range; determining the iconic features based on a forgery algorithm-general feature whose feature distance meets a preset feature distance range; Based on the non-significant features in the forgery algorithm universal feature set, mutating the signature features in the forgery algorithm universal feature set to obtain a mutated forgery algorithm universal feature set; Determine a mutated image feature set based on the semantic feature set, the forgery algorithm-specific feature set, and the mutated forgery algorithm general feature set; Decoding the variant image feature set to obtain a second image sample; Determine the current training loss based on the forgery algorithm type classification result and the authenticity classification result of each of the image features, and the difference between the first image sample and the second image sample; When the loss of this training meets the preset loss condition, the above training steps are stopped, and a target image authenticity detection model is determined based on the data authenticity classifier.
2. The method according to claim 1, characterized in that The first model includes an encoder, the counterfeit algorithm type classifier, the data authenticity classifier and a decoder, the encoder is used to encode the first image sample to obtain each of the image features, and the decoder is used to decode the variant image feature set. The method also includes: When the current training loss does not meet the loss condition, adjusting parameters of the encoder, the forgery algorithm type classifier, the data authenticity classifier, and the decoder in the first model based on the current training loss, and updating the first image sample based on the image training sample set; Based on the encoder, the forgery algorithm type classifier, the data authenticity classifier and the decoder in the first model after parameter adjustment, and the updated first image sample, the training step is returned to be executed.
3. The method according to claim 1, characterized in that Based on the forgery algorithm type classification results and authenticity classification results of each of the image features, each of the image features is decoupled and reclassified to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set, including: When the forgery algorithm type classification result of the image feature is any forgery algorithm type, and the authenticity classification result of the image feature is forged data, decoupling the image feature into a forgery algorithm-specific feature, and adding the image feature to the forgery algorithm-specific feature set; When the forgery algorithm type classification result of the image feature is that the forgery algorithm type cannot be identified, and the authenticity classification result of the image feature is forged data, decoupling the image feature into a forgery algorithm universal feature, and adding the image feature to the forgery algorithm universal feature set; When the forgery algorithm type classification result of the image feature is that the forgery algorithm type cannot be identified, and the authenticity classification result of the image feature is real data, the image feature is decoupled into semantic features, and the image feature is added to the semantic feature set.
4. The method according to claim 1, characterized in that: The non-significant features in the forgery algorithm universal feature set are based on the non-significant features in the forgery algorithm universal feature set, and the signature features are mutated in the forgery algorithm universal feature set to obtain the mutated forgery algorithm universal feature set, including: Calculating the similarity between the iconic feature and the non-iconic features in the common feature set of the forgery algorithm; Based on the degree of similarity, determining the degree of variation of the signature feature; Based on the variation degree of the iconic feature, the iconic feature is mutated in the common feature set of the forgery algorithm to obtain the mutated common feature set of the forgery algorithm.
5. The method according to claim 1, characterized in that The forgery algorithm type classification result and the authenticity classification result based on each of the image features, and the difference between the first image sample and the second image sample, determine the current training loss, including: Determining a classification loss based on a forgery algorithm type classification result of each of the image features and a difference between a true and false classification result and the annotation information of the first image sample; determining a reconstruction loss based on a pixel difference between the first image sample and the second image sample; The current training loss is determined based on the classification loss and the reconstruction loss.
6. A method for detecting authenticity of an image, characterized in that: include: receiving an image detection request for a target image; Based on the target image authenticity detection model, performing image detection on the target image to obtain an image detection result of whether the target image is a real image or a forged image; The target image authenticity detection model is a model generated by training according to the image authenticity detection model training method according to any one of claims 1 to 5.
7. An image authenticity detection model training device, characterized in that: include: A preliminary classification module, using a forgery algorithm type classifier and a data authenticity classifier, performs preliminary classification on each image feature in the first image sample, and obtains a forgery algorithm type classification result and an authenticity classification result of each image feature; A decoupling classification module, for decoupling and reclassifying each of the image features based on the forgery algorithm type classification results and the authenticity classification results of each of the image features, to obtain a semantic feature set, a forgery algorithm-specific feature set, and a forgery algorithm general feature set; a signature feature determination module, configured to determine signature features in the forgery algorithm universal feature set based on feature differences between the forgery algorithm-specific feature set and the forgery algorithm universal feature set; A feature mutation module, used for mutating the iconic features in the forgery algorithm universal feature set based on the non-iconic features in the forgery algorithm universal feature set to obtain the mutated forgery algorithm universal feature set; A variant feature set determination module, used to determine a variant image feature set based on the semantic feature set, the forgery algorithm-specific feature set, and the forgery algorithm universal feature set after the variant; A feature decoding module, used for decoding the variant image feature set to obtain a second image sample; a training loss determination module, configured to determine the current training loss based on the forgery algorithm type classification result and the authenticity classification result of each of the image features, and the difference between the first image sample and the second image sample; A target model determination module, used to stop executing the above training steps when the current training loss meets the preset loss condition, and determine the target image authenticity detection model based on the data authenticity classifier; Wherein, the marker feature determination module includes: A cluster center determination unit, used for clustering the forgery algorithm-specific feature set to obtain a feature cluster center; A feature screening unit, configured to determine, based on a feature distance between the feature cluster center and each feature in the forgery algorithm universal feature set, a forgery algorithm universal feature whose feature distance meets a preset feature distance range in the forgery algorithm universal feature set; The hallmark feature determination unit is used to determine the hallmark feature based on the common features of the counterfeit algorithm that the feature distance meets the preset feature distance range.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
Citation Information
Patent Citations
Image detection model training method and device, equipment and storage medium
CN116958637A