Artificial intelligence generated image detection method based on reconstruction error disturbance sensitivity
By calculating the multi-scale reconstruction error perturbation sensitivity vector and generating perturbation samples using the Monte Carlo method, the problem of insufficient detection accuracy and generalization ability in existing technologies is solved, and efficient artificial intelligence-generated image detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-01
AI Technical Summary
Existing AI-generated image detection methods have done little work in utilizing reconstruction errors, resulting in insufficient detection accuracy and generalization ability.
By calculating the multi-scale reconstruction error perturbation sensitivity vector of the image, perturbation samples are generated using the Monte Carlo method, and multilayer perceptron is used for classification training to improve the feature robustness and reliability of the detection.
It improves detection accuracy and generalization ability, reduces computational complexity, and effectively extracts discriminative features of images.
Smart Images

Figure CN121962812A_ABST
Abstract
Description
Artificial Intelligence Generative Image Detection Method Based on Reconstruction Error Perturbation Sensitivity Technical Field
[0001] This invention relates to the technical field of AI-generated image detection, and in particular to an AI-generated image detection method based on reconstruction error perturbation sensitivity. Background Technology
[0002] Artificial intelligence-generated image detection generally involves feature extraction from the image to be detected; building models to enhance and classify these features; and then using these models to detect and classify the image. The challenge lies in the generalization ability of newly emerging AI-generated models. Based on different features, AI-generated image detection methods can be categorized into data augmentation-based methods, pre-trained model-based methods, artifact-based methods, and reconstruction error-based methods. Data augmentation-based methods utilize data augmentation to allow the model to learn deeper features, enhancing its detection capabilities. Pre-trained model-based methods use publicly available large-scale pre-trained models to extract common features, thereby eliminating differences between features and improving the model's generalization ability. Artifact-based methods focus on defects in AI-generated images, such as physical, optical, and spectral distribution errors or generation patterns, constructing discriminative features. Reconstruction error-based methods emphasize the differences in the properties of AI-generated images and real images during reconstruction. They utilize the smaller reconstruction error of AI-generated images compared to the larger reconstruction error of real images as a key to discriminating against AI-generated images, playing a crucial role in improving detection accuracy and generalization ability.
[0003] Significant progress has been made in AI-generated image detection research, but existing methods have limited and incomplete utilization of reconstruction errors. Therefore, this invention designs a reconstruction error perturbation sensitivity extraction process that focuses on the essential features of the image's reconstruction errors themselves. By calculating the reconstruction error perturbation sensitivity of the original samples within multiple divided local neighborhoods, and concatenating these sensitivity values into a vector, a multi-scale reconstruction error perturbation sensitivity vector is obtained, further improving the robustness and reliability of the features. In the generation of perturbation samples, a Monte Carlo sampling method is used, reducing the complexity of perturbation sample generation and improving efficiency. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and provide an artificial intelligence-generated image detection method based on the sensitivity of reconstruction error perturbation. It utilizes Monte Carlo sampling to reduce the training difficulty. At the same time, it can focus on and strengthen the sensitivity information of image reconstruction error perturbation, improve the discriminative ability of the constructed features, and thus improve the generalization ability of detection.
[0005] To achieve the above objectives, the technical solution provided by this invention is: an artificial intelligence-generated image detection method based on reconstruction error perturbation sensitivity, comprising the following steps:
[0006] S1: Adjust the AI-generated image to a uniform resolution, normalize it, and use the processed image as the original sample;
[0007] S2: Input the original sample into the reconstruction model for reconstruction to obtain the reconstructed sample, and calculate the mean square error between the original sample and the reconstructed sample as its reconstruction error;
[0008] S3: For the original sample, a preset range centered on the original sample is regarded as its local neighborhood, and several different local neighborhoods are divided according to different range sizes. In the local neighborhoods of each size of the original sample, multiple perturbation samples are generated by sampling in Monte Carlo method.
[0009] S4: Each perturbation sample obtained by sampling in the local neighborhood of each size of the original sample is input into the reconstruction model for reconstruction, and its reconstructed sample is obtained. The mean square error of each perturbation sample and its reconstructed sample is calculated as its reconstruction error.
[0010] S5: In the local neighborhood of each size of the original sample, the reconstruction error of the original sample calculated in step S2 is used as the benchmark, and the reconstruction error of the perturbation sample sampled in the local neighborhood of the same size calculated in step S4 is used to calculate the root mean square error. Since the calculated root mean square error indicates the overall deviation of the reconstruction error between the perturbation sample generated by all sampling in the local neighborhood of the original sample at that size and the original sample, it reflects the sensitivity of the reconstruction error of the perturbation sample generated after adding perturbation to the original sample to the change of perturbation. Therefore, the calculated root mean square error is used as the perturbation sensitivity of the reconstruction error of the local neighborhood of the original sample at that size.
[0011] S6: The reconstruction error perturbation sensitivity calculated in the local neighborhoods of the original samples at multiple different sizes in step S5 is concatenated to form a vector, and the resulting vector is used as the multi-scale reconstruction error perturbation sensitivity vector.
[0012] S7: Input the multi-scale reconstruction error perturbation sensitivity vector into a multilayer perceptron for classification training of artificial intelligence generated image detection;
[0013] S8: Input the multi-scale reconstruction error perturbation sensitivity vector of the image to be detected into the trained multilayer perceptron to obtain the prediction result of the AI-generated image detection.
[0014] Furthermore, in step S2, a publicly available pre-trained autoencoder is used. As a reconstruction model, for the original samples Refactoring is performed, in which This represents the decoder model of the autoencoder. The encoder model representing the autoencoder, and the reconstruction process are represented as follows:
[0015] ;
[0016] In the formula, Indicates the reconstruction of the original sample The reconstructed sample obtained;
[0017] Obtain the reconstructed image Then, calculate the original sample. With reconstructed image Reconstruction error Use the following formula:
[0018] ;
[0019] In the formula, Represents the original sample Feature dimensions, This represents the squared L2 norm.
[0020] Further, in step S3, in the original sample In the sample space, with the original sample The preset range centered on the center is regarded as its local neighborhood, and different range sizes are used. Divide Local neighborhood of size ,in Indicates the first One size, Represents the original sample by the first Size The local neighborhood is divided;
[0021] In the original sample of the partition Within the local neighborhood at each size, samples are generated using a Monte Carlo method. A perturbation sample, for the original sample The Size Local neighborhood below In the middle, sampling generation The specific steps for handling each perturbation sample are as follows:
[0022] S31: Sample uniformly distributed noise disturbances using the Monte Carlo method. indivual The distribution of this noise is represented as follows:
[0023] ;
[0024] In the formula, Indicates the first A disturbance, The range is Uniformly distributed noise disturbance;
[0025] S32: By processing the original samples separately Add the generated in step S31 A noise disturbance, generating Disturbance samples ,in Indicates in the original sample The Size local neighborhood The first internal sampling The perturbation samples are generated using the following formula:
[0026] .
[0027] Furthermore, in step S4, the original samples will be divided... Each perturbation sample obtained from the local neighborhood at each size is input into the reconstruction model to reconstruct its reconstructed sample, and the mean square error between each perturbation sample and its reconstructed sample is calculated as its reconstruction error.
[0028] For the original sample The Size Perturbation samples generated from local neighborhoods below The specific steps for inputting the data into the reconstruction model for reconstruction and calculating the reconstruction error are as follows:
[0029] S41: Using publicly available pre-trained autoencoders As a reconstruction model, in This represents the decoder model of the autoencoder. This represents the encoder model of the autoencoder, for the original samples in step S3. The Size Sampled from the local neighborhood below Disturbance samples Reconstruct them separately, among which Indicates in the original sample The Size local neighborhood The first sample generated by internal sampling Given a perturbation sample, obtain its reconstructed sample. ,in Indicates the perturbation sample The reconstruction process of the reconstructed sample is as follows:
[0030] ;
[0031] S42: For the original sample The Size Sampled from the local neighborhood below Disturbance samples Calculate the perturbation samples respectively Rather than reconstructing samples Reconstruction error ,in Indicates perturbation sample Rather than reconstructing samples The reconstruction error is calculated using the following formula:
[0032] ;
[0033] In the formula, Indicates perturbation sample Feature dimensions, This represents the squared L2 norm.
[0034] Furthermore, in step S5, for the original samples that have been divided... of Local neighborhood at a size , Represents the original sample by the first Size The local neighborhood is divided, in which each size of the local neighborhood is obtained by using the original sample. Reconstruction error Based on this, sample within a local neighborhood of the same size. The reconstruction error of each perturbed sample is calculated, and the root mean square error is used as its sensitivity to reconstruction error perturbation; for the original sample The Size In the local neighborhood below, its reconstruction error perturbation sensitivity The calculation formula is as follows:
[0035] ;
[0036] In the formula, Indicates in the original sample The Size Sampled from the local neighborhood below A set of perturbation samples , The number of perturbed samples in the corresponding set. Indicates in the original sample The Size local neighborhood The first sample generated by internal sampling One perturbation sample, This represents the reconstructed sample calculated in step S2. Reconstruction error, Indicates in the original sample The Size The first sample generated from the local neighborhood below Disturbance samples Rather than reconstructing samples Reconstruction error;
[0037] In the original sample of Local neighborhood at a size In the middle, the sensitivity of its reconstruction error perturbation is calculated respectively. .
[0038] Furthermore, in step S6, the original samples will be divided... of Size Local neighborhood below The original sample was obtained through internal calculation. of Sensitivity to reconstruction error perturbation The vectors are concatenated to construct a multi-scale reconstruction error perturbation sensitivity vector. ,in Indicates the first The size of a local neighborhood Represents the original sample by the first Size Construct a multi-scale reconstruction error perturbation sensitivity vector from the partitioned local neighborhood. The process is represented as:
[0039] ;
[0040] In the formula, This indicates that step S5 is performed on the original sample. The Size The original sample is calculated in the local neighborhood below. The sensitivity to reconstruction error perturbation This indicates a vector concatenation operation.
[0041] Furthermore, in step S7, a supervised learning approach is used to train a sensitivity vector based on multi-scale reconstruction error perturbation. The input is a multilayer perceptron used for AI-generated image detection;
[0042] In a multilayer perceptron, the sensitivity vector for multi-scale reconstruction error perturbation The input passes through a batch normalization (BN) layer, a fully connected layer, a ReLU activation function, another fully connected layer, another ReLU activation function, and another fully connected layer in sequence, resulting in an output mapped to the classification space of a multilayer perceptron. :
[0043] ;
[0044] In the formula, Represents a fully connected layer. Represents the ReLU activation function. This represents the batch normalization operation of the BN layer;
[0045] The output of the obtained multilayer perceptron classification space The logical output value of AI-generated image detection is obtained by using the Sigmoid function. :
[0046] ;
[0047] In the formula, Represents the Sigmoid function;
[0048] Training loss function of multilayer perceptron Using the binary classification cross-entropy loss function, it can be expressed as follows:
[0049] ;
[0050] In the formula, This represents the number of samples in the publicly available AI-generated image detection dataset used for training. Indicates the sample index. Let represent the label of the t-th sample, indicating whether the sample is an AI-generated image or a real image. This represents the logical output value obtained by inputting the multi-scale reconstruction error perturbation sensitivity of the t-th sample into the multilayer perceptron. This represents the natural logarithm function.
[0051] Furthermore, in step S8, the trained multilayer perceptron is applied to perform artificial intelligence-generated image detection on the image to be detected, and an output judgment indication is obtained. The specific process is as follows:
[0052] First, the image to be detected is reconstructed, and its reconstruction error is calculated. Then, the image is reconstructed using... Local neighborhoods of size are sampled in Monte Carlo manner within each local neighborhood of the image to be detected. Each perturbation sample is processed, and the perturbation sample is reconstructed. The reconstruction error of the perturbation sample is calculated, and then compared with the reconstruction error of the sample to be detected. The root mean square error of the reconstruction error of each perturbed sample is calculated to obtain the perturbation sensitivity of the reconstruction error. The reconstruction error perturbation sensitivity values calculated in the local neighborhood at each size are concatenated to obtain a multi-scale reconstruction error perturbation sensitivity vector. Finally, this multi-scale reconstruction error perturbation sensitivity vector is input into a trained multilayer perceptron to obtain the logical output value of AI-generated image detection. ;
[0053] The logical output value of the obtained AI-generated image detection When the logic output value of the multilayer perceptron Greater than or equal to the preset value At that time, output a decision indicator. A value of 1 indicates that the image is determined to be generated by artificial intelligence; otherwise, a determination indicator is output. A value of 0 indicates that the image is considered real, as shown below:
[0054] ;
[0055] In the formula, It's a 0 / 1 indicator function. It outputs 1 when the condition variable in the 0 / 1 indicator function is true, and outputs 0 otherwise. It is a preset value, set to 0.5 in AI-generated image detection tasks.
[0056] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0057] 1. The method of the present invention can effectively improve detection accuracy and generalization.
[0058] 2. The method of the present invention can effectively extract the discriminative reconstruction error features of the sample by designing and constructing a multi-scale reconstruction error perturbation sensitivity vector, thereby improving the detection accuracy.
[0059] 3. The method of the present invention uses Monte Carlo sampling to generate perturbation samples, which reduces the computational complexity while still maintaining the effectiveness of the constructed multi-scale reconstruction error perturbation sensitivity vector.
[0060] In summary, the method of this invention can detect artificial intelligence-generated images by using a method based on the sensitivity of reconstruction error perturbation. It reduces computational complexity by sampling perturbation samples using the Monte Carlo method. At the same time, it efficiently extracts the sensitivity features of samples by combining multi-scale reconstruction error perturbation sensitivity vectors, which can significantly improve detection accuracy and generalization and ensure the effectiveness of detection. Attached Figure Description
[0061] Figure 1 is a framework diagram of the method of the present invention.
[0062] Figure 2 is a schematic diagram of the calculation of the reconstruction error perturbation sensitivity of the local neighborhood under a given size of the original sample. Detailed Implementation
[0063] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0064] As shown in Figure 1, this embodiment discloses an artificial intelligence-generated image detection method based on reconstruction error perturbation sensitivity. It uses Monte Carlo sampling to generate perturbation samples, employs an autoencoder as the base model for sample reconstruction, and uses a multilayer perceptron as the base model for the detection and classification result output. The method includes the following steps:
[0065] 1) Adjust the AI-generated images to a uniform resolution, normalize them, and use the processed images as the original samples;
[0066] 2) Calculation of original sample reconstruction error:
[0067] As shown in Figure 1, a publicly available pre-trained autoencoder is used. As a reconstruction model, for the original samples Refactoring is performed, in which This represents the decoder model of the autoencoder. The encoder model representing the autoencoder, and the reconstruction process are represented as follows:
[0068] ;
[0069] In the formula, Indicates the reconstruction of the original sample The reconstructed sample obtained.
[0070] Obtain the reconstructed image Then, calculate the original sample. With reconstructed image Reconstruction error Use the following formula:
[0071] ;
[0072] In the formula, Represents the original sample Feature dimensions, This represents the squared L2 norm.
[0073] 3) As shown in Figure 1, in the original sample In the sample space, with the original sample A certain range centered on the center is considered its local neighborhood, and different range sizes are used to define it. , divide Local neighborhood of size ,in Indicates the first One size, Represents the original sample by the first Size The local neighborhood is divided.
[0074] In the original sample of the partition Within the local neighborhood at each size, samples are generated using a Monte Carlo method. A perturbation sample. As shown in Figure 2, for the original sample The Size Local neighborhood below In the middle, sampling generation The specific steps for handling each perturbation sample are as follows:
[0075] 3.1) Using Monte Carlo sampling to sample uniformly distributed noise disturbances indivual The distribution of this noise is represented as follows:
[0076] ;
[0077] In the formula, Indicates the first A disturbance, The range is Uniformly distributed noise disturbance.
[0078] 3.2) By analyzing the original samples separately Add the generated step 3.1) noise disturbance ,generate Disturbance samples ,in Indicates in the original sample The Size local neighborhood The first internal sampling The perturbation samples are generated using the following formula:
[0079] ;
[0080] In the formula, Represents the original sample. Indicates the first A disturbance.
[0081] 4) Calculation of reconstruction error for perturbed samples:
[0082] As shown in Figure 1, the original samples will be divided. Each perturbation sample obtained from the local neighborhood at each size is input into the reconstruction model to reconstruct its reconstructed sample, and the mean square error between each perturbation sample and its reconstructed sample is calculated as its reconstruction error.
[0083] As shown in Figure 2, for the original sample The Size Perturbation samples generated from local neighborhoods below The specific steps for inputting the data into the reconstruction model for reconstruction and calculating the reconstruction error are as follows:
[0084] 4.1) Using publicly available pre-trained autoencoders As a reconstruction model, in This represents the decoder model of the autoencoder. The encoder model represents the autoencoder, in step 3) in the original sample The Size Sampled from the local neighborhood below Disturbance samples Reconstruct them separately, among which Indicates in the original sample The Size local neighborhood The first sample generated by internal sampling Given a perturbation sample, obtain its reconstructed sample. ,in Indicates the perturbation sample The reconstruction process of the reconstructed sample is as follows:
[0085] ;
[0086] 4.2) For the original sample The Size Sampled from the local neighborhood below Disturbance samples Calculate the perturbation samples respectively Rather than reconstructing samples Reconstruction error ,in Indicates perturbation sample Rather than reconstructing samples The reconstruction error is calculated using the following formula:
[0087] ;
[0088] In the formula, Indicates perturbation sample Feature dimensions, This represents the squared L2 norm.
[0089] 5) Calculation of sensitivity to reconstruction error disturbance:
[0090] As shown in Figure 1, for the original samples of the partition... of Local neighborhood at a size In the local neighborhood of each size, by using the original sample Reconstruction error Based on this, sampling within its local neighborhood at this size The reconstruction error of each perturbed sample is calculated, and the root mean square error is used as its reconstruction error perturbation sensitivity.
[0091] In the original sample of Local neighborhood at a size In the middle, the sensitivity of its reconstruction error perturbation is calculated respectively. For the original sample The Size In the local neighborhood below, as shown in Figure 2, the original sample Reconstruction error Based on this, sampling within its local neighborhood at this size The reconstruction error of each perturbed sample is calculated, and the root mean square error is obtained to determine its reconstruction error perturbation sensitivity. The calculation process is as follows:
[0092] ;
[0093] In the formula, Indicates in the original sample The Size Sampled from the local neighborhood below A set of perturbation samples , The number of perturbed samples in the corresponding set. Indicates in the original sample The Size local neighborhood The first sample generated by internal sampling One perturbation sample, This represents the reconstructed sample calculated in step 2). Reconstruction error, Indicates in the original sample The Size The first sample generated from the local neighborhood below Disturbance samples Rather than reconstructing samples The reconstruction error.
[0094] 6) Construct a multi-scale reconstruction error perturbation sensitivity vector:
[0095] As shown in Figure 1, the original samples will be divided. of Size Local neighborhood below The original sample was obtained through internal calculation. of Sensitivity to reconstruction error perturbation By concatenating vectors, a multi-scale reconstruction error perturbation sensitivity vector is constructed. ,in Indicates the first The size of a local neighborhood Represents the original sample by the first Size Construct a multi-scale reconstruction error perturbation sensitivity vector from the partitioned local neighborhood. The process is represented as:
[0096] ;
[0097] In the formula, This indicates that, according to step 5), in the original sample The Size The original sample is calculated in the local neighborhood below. The sensitivity to reconstruction error perturbation This indicates a vector concatenation operation.
[0098] 7) As shown in Figure 1, the obtained multi-scale reconstruction error perturbation sensitivity vector The data is input into a multilayer perceptron for classification training of artificial intelligence-generated image detection.
[0099] In a multilayer perceptron, the sensitivity vector for multi-scale reconstruction error perturbation The input passes through a batch normalization (BN) layer, a fully connected layer, a ReLU activation function, another fully connected layer, yet another ReLU activation function, and another fully connected layer, resulting in an output mapped to the classification space of a multilayer perceptron. :
[0100] ;
[0101] In the formula, Represents a fully connected layer. Represents the ReLU activation function. This represents the batch normalization operation of the BN layer;
[0102] The output of the obtained multilayer perceptron classification space The logical output value of AI-generated image detection is obtained by using the Sigmoid function. :
[0103] ;
[0104] In the formula, Represents the Sigmoid function;
[0105] Training loss function of multilayer perceptron The binary cross-entropy loss function is used, and its formula is expressed as follows:
[0106] ;
[0107] In the formula, This represents the number of samples in the AI-generated image detection dataset used for training. Indicates the sample index. The label for the t-th sample indicates whether it is an AI-generated image or a real image. This represents the logical output value obtained by inputting the multi-scale reconstruction error perturbation sensitivity of the t-th sample into the multilayer perceptron. This represents the natural logarithm function.
[0108] 8) Input the multi-scale reconstruction error perturbation sensitivity vector of the image to be detected into the trained multilayer perceptron to obtain the prediction result of the AI-generated image detection. The specific operation steps are as follows:
[0109] The image to be detected is adjusted to a uniform resolution, normalized, and then used as the sample to be detected. First, treat the test samples. Reconstruction is performed, and the reconstruction error is calculated. Then, the sample to be detected is used. Centered on the target area, the area is divided into different sizes according to the set parameters. A local neighborhood of size, within the local neighborhood of each size, the sample to be detected. Monte Carlo sampling generation Each perturbation sample is analyzed, and the reconstructed sample is calculated to determine the reconstruction error. This is done on the sample to be detected. The local neighborhood at each partition size, through the sample to be detected. Based on the reconstruction error, and compared with the local neighborhood sampled at that size... The root mean square error of the reconstruction error of each perturbed sample is calculated to obtain the error in the sample to be detected. Sensitivity to reconstruction error perturbation in the local neighborhood at this size. This will be assessed within the divided sample to be detected. of The reconstruction error perturbation sensitivity values calculated in the local neighborhood at each size are concatenated to obtain a multi-scale reconstruction error perturbation sensitivity vector. Finally, this multi-scale reconstruction error perturbation sensitivity vector is input into a trained multilayer perceptron to obtain the logical output value of AI-generated image detection. .
[0110] The logical output value of the obtained AI-generated image detection When the logic output value of the multilayer perceptron Greater than or equal to the preset value At that time, output a decision indicator. A value of 1 indicates that the image is determined to be generated by artificial intelligence; otherwise, a determination indicator is output. A value of 0 indicates that the image is considered real, as shown below:
[0111] ;
[0112] In the formula, It's a 0 / 1 indicator function. It outputs 1 when the condition variable in the 0 / 1 indicator function is true, and outputs 0 otherwise. This is a preset value, set to 0.5 in AI-generated image detection tasks;
[0113] The dataset used was GenImage, containing 1,331,167 real images collected from ImageNet and 1,350,000 AI-generated images based on ImageNet. The AI generation models used included ADM, BigGAN, Glide, Midjourney, VQDM, Wukong, Stable Diffusion (SD) v1.4, and v1.5. Dataset details are shown in Table 1. The split between the training and validation datasets remained consistent with the original dataset. In the experiments, only a portion of the real images from ImageNet and images generated using Stable Diffusion v1.4 based on these images were used as training samples. The final training set contained 160,000 real images and 160,000 AI-generated images. For each image, the resolution was adjusted to 256×256 and normalized. The normalization formula is as follows:
[0114] ;
[0115] In the formula, This represents the training samples after resolution adjustment and normalization. This represents the training samples before the normalization operation. This represents the mean of the dataset. This represents the variance of the dataset.
[0116] Table 1 Dataset Details
[0117]
[0118] Accuracy (Accuracy) is a commonly used metric for evaluating the performance of AI-generated image detection methods. This experiment uses accuracy as the evaluation metric. The calculation method is as follows:
[0119] ;
[0120] In the formula, This represents a true example, i.e., an AI-generated image that correctly predicts the outcome. This represents a true counterexample, i.e., a real image that is correctly predicted. This represents a false positive, i.e., a real image that was predicted incorrectly. This indicates a false negative, meaning an image generated by artificial intelligence that makes an incorrect prediction.
[0121] To verify the effectiveness of the method of this invention, Acc was used as the evaluation criterion. On GenImage, a representative AI-generated image detection dataset, images were generated using only real images and one AI generation model, namely Stable Diffusion (SD) v1.4. The method was then trained and validated on other AI generation models. Comparative analysis was conducted with CNNSpot, F3Net, UnivFD, DIRE, AERO, DRCT, and NPR methods. The experimental results are shown in Table 2.
[0122] Table 2
[0123]
[0124] Experimental results fully demonstrate the effectiveness of the proposed method in improving generalization ability and detection. By perturbing the samples to extract the sensitivity of reconstruction error, the differences in reconstruction error among different AI generation models are unified, thereby forming more discriminative AI-generated image detection features. Furthermore, a multi-scale reconstruction error perturbation sensitivity vector is constructed within local neighborhoods of multiple sizes to obtain more comprehensive feature information, reduce the error of sensitivity features, and thus improve the generalization ability of detection, thereby enhancing detection performance. The average detection results under different generation models are superior to the existing methods in comparison.
[0125] Experimental Conclusions: To address the limitations of existing algorithms in generalizing AI-generated image detection and their insufficient robustness and effectiveness due to focusing only on the differences between AI-generated images and real samples in reconstruction error analysis while neglecting the differences between different AI-generated models, this invention proposes an AI-generated image detection method based on the sensitivity to reconstruction error perturbations. Experimental evaluation on a large number of samples from the publicly available and representative AI-generated image detection dataset GenImage shows that the method of this invention improves the average accuracy and generalization ability of detection, outperforming existing methods. Future research will explore more discriminative and efficient AI-generated image detection methods, and how to apply them in real-time scenarios, demonstrating promising application prospects and worthy of promotion.
[0126] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. An AI-generated image detection method based on reconstruction error perturbation sensitivity, characterized in that, Includes the following steps: S1: Adjust the AI-generated image to a uniform resolution, normalize it, and use the processed image as the original sample; S2: Input the original sample into the reconstruction model for reconstruction to obtain the reconstructed sample, and calculate the mean square error between the original sample and the reconstructed sample as its reconstruction error; S3: For the original sample, a preset range centered on the original sample is regarded as its local neighborhood, and several different local neighborhoods are divided according to different range sizes. In the local neighborhood of each size of the original sample, multiple perturbation samples are generated by sampling in Monte Carlo method; S4: Each perturbation sample obtained from the local neighborhood of each size of the original sample is input into the reconstruction model for reconstruction to obtain its reconstructed sample, and the mean square error between each perturbation sample and its reconstructed sample is calculated as its reconstruction error; S5: In the local neighborhood of each size of the original sample, the reconstruction error of the original sample calculated in step S2 is used as the benchmark, and the reconstruction error of the perturbation sample sampled in the local neighborhood of the same size calculated in step S4 is used to calculate the root mean square error. Since the calculated root mean square error indicates the overall deviation of the reconstruction error between the perturbation sample generated by all sampling in the local neighborhood of the original sample at that size and the original sample, it reflects the sensitivity of the reconstruction error of the perturbation sample generated after adding perturbation to the original sample to the change of perturbation. Therefore, the calculated root mean square error is used as the perturbation sensitivity of the reconstruction error of the local neighborhood of the original sample at that size. S6: The reconstruction error perturbation sensitivity calculated in step S5 under multiple different sizes of the original sample is concatenated to form a vector, and the resulting vector is used as the multi-scale reconstruction error perturbation sensitivity vector; S7: The multi-scale reconstruction error perturbation sensitivity vector is input into a multilayer perceptron for classification training of artificial intelligence generated image detection; S8: Input the multi-scale reconstruction error perturbation sensitivity vector of the image to be detected into the trained multilayer perceptron to obtain the prediction result of the AI-generated image detection.
2. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S2, a publicly available pre-trained autoencoder is used. As a reconstruction model, for the original samples Refactoring is performed, in which This represents the decoder model of the autoencoder. The encoder model representing the autoencoder, and the reconstruction process are represented as follows: In the formula, Indicates the reconstruction of the original sample The obtained reconstructed samples; the obtained reconstructed image Then, calculate the original sample. With reconstructed image Reconstruction error Use the following formula: In the formula, Represents the original sample Feature dimensions, This represents the squared L2 norm.
3. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S3, in the original sample In the sample space, with the original sample The preset range centered on the center is regarded as its local neighborhood, and different range sizes are used. Divide Local neighborhood of size ,in Indicates the first One size, Represents the original sample by the first Size The local neighborhood of the partition; in the original sample of the partition. Within the local neighborhood at each size, samples are generated using a Monte Carlo method. A perturbation sample, for the original sample The Size Local neighborhood below In the middle, sampling generation The specific steps for sampling a perturbation sample are as follows: S31: Sample uniformly distributed noise perturbation using the Monte Carlo method. indivual The distribution of this noise is represented as follows: In the formula, Indicates the first A disturbance, The range is Uniformly distributed noise perturbation; S32: By separately processing the original samples Add the generated in step S31 A noise disturbance, generating Disturbance samples ,in Indicates in the original sample The Size local neighborhood The first internal sampling The perturbation samples are generated using the following formula: 。 4. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S4, the original samples will be divided Each perturbation sample obtained from the local neighborhood at each size is input into the reconstruction model to reconstruct its reconstructed sample, and the mean square error between each perturbation sample and its reconstructed sample is calculated as its reconstruction error. For the original sample The Size Perturbation samples generated from local neighborhoods below The specific steps for inputting the data into the reconstruction model for reconstruction and calculating the reconstruction error are as follows: S41: Use a publicly available pre-trained autoencoder. As a reconstruction model, in This represents the decoder model of the autoencoder. This represents the encoder model of the autoencoder, for the original samples in step S3. The Size Sampled from the local neighborhood below Disturbance samples Reconstruct them separately, among which Indicates in the original sample The Size local neighborhood The first sample generated by internal sampling Given a perturbation sample, obtain its reconstructed sample. ,in Indicates the perturbation sample The reconstruction process of the reconstructed sample is as follows: S42: For the original sample The Size Sampled from the local neighborhood below Disturbance samples Calculate the perturbation samples respectively Rather than reconstructing samples Reconstruction error ,in Indicates perturbation sample Rather than reconstructing samples The reconstruction error is calculated using the following formula: In the formula, Indicates perturbation sample Feature dimensions, This represents the squared L2 norm.
5. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S5, for the original samples that have been divided of Local neighborhood at a size , Represents the original sample by the first Size The local neighborhood is divided, in which each size of the local neighborhood is obtained by using the original sample. Reconstruction error Based on this, sample within a local neighborhood of the same size. The reconstruction error of each perturbed sample is calculated, and the root mean square error is used as its sensitivity to reconstruction error perturbation; for the original sample The Size In the local neighborhood below, its reconstruction error perturbation sensitivity The calculation formula is as follows: In the formula, Indicates in the original sample The Size Sampled from the local neighborhood below A set of perturbation samples , The number of perturbed samples in the corresponding set. Indicates in the original sample The Size local neighborhood The first sample generated by internal sampling One perturbation sample, This represents the reconstructed sample calculated in step S2. Reconstruction error, Indicates in the original sample The Size The first sample generated from the local neighborhood below Disturbance samples Rather than reconstructing samples Reconstruction error; in the original sample of Local neighborhood at a size In the middle, the sensitivity of its reconstruction error perturbation is calculated respectively. 。 6. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S6, the original samples will be divided of Size Local neighborhood below The original sample was obtained through internal calculation. of Sensitivity to reconstruction error perturbation The vectors are concatenated to construct a multi-scale reconstruction error perturbation sensitivity vector. ,in Indicates the first The size of a local neighborhood Represents the original sample by the first Size Construct a multi-scale reconstruction error perturbation sensitivity vector from the divided local neighborhood. The process is represented as: In the formula, This indicates that step S5 is performed on the original sample. The Size The original sample is calculated in the local neighborhood below. The sensitivity to reconstruction error perturbation This indicates a vector concatenation operation.
7. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S7, a supervised learning approach is used to train a sensitivity vector based on multi-scale reconstruction error perturbation. The input is a multilayer perceptron used for AI-generated image detection; within the multilayer perceptron, the sensitivity vector to multi-scale reconstruction error perturbations is... The input passes through a batch normalization (BN) layer, a fully connected layer, a ReLU activation function, another fully connected layer, another ReLU activation function, and another fully connected layer in sequence, resulting in an output mapped to the classification space of a multilayer perceptron. : In the formula, Represents a fully connected layer. Represents the ReLU activation function. This represents the batch normalization operation of the BN layer; the output of the resulting multilayer perceptron classification space. The logical output value of AI-generated image detection is obtained by using the Sigmoid function. : In the formula, The Sigmoid function; the training loss function of a multilayer perceptron. Using the binary classification cross-entropy loss function, it can be expressed as follows: In the formula, This represents the number of samples in the publicly available AI-generated image detection dataset used for training. Indicates the sample index. Let represent the label of the t-th sample, indicating whether the sample is an AI-generated image or a real image. This represents the logical output value obtained by inputting the multi-scale reconstruction error perturbation sensitivity of the t-th sample into the multilayer perceptron. This represents the natural logarithm function.
8. The AI-generated image detection method based on reconstruction error perturbation sensitivity according to claim 1, characterized in that, In step S8, the trained multilayer perceptron is applied to perform artificial intelligence-generated image detection on the image to be detected, and an output judgment indication is obtained. The specific process is as follows: First, the image to be detected is reconstructed, and its reconstruction error is calculated. Then, the image is reconstructed using... Local neighborhoods of size are sampled in Monte Carlo manner within each local neighborhood of the image to be detected. Each perturbation sample is processed, and the perturbation sample is reconstructed. The reconstruction error of the perturbation sample is calculated, and then compared with the reconstruction error of the sample to be detected. The root mean square error of the reconstruction error of each perturbed sample is calculated to obtain the perturbation sensitivity of the reconstruction error. The reconstruction error perturbation sensitivity values calculated in the local neighborhood at each size are concatenated to obtain a multi-scale reconstruction error perturbation sensitivity vector. Finally, this multi-scale reconstruction error perturbation sensitivity vector is input into a trained multilayer perceptron to obtain the logical output value of AI-generated image detection. For the obtained logical output value of AI-generated image detection When the logic output value of the multilayer perceptron Greater than or equal to the preset value When, output a decision indicator A value of 1 indicates that the image is determined to be generated by artificial intelligence; otherwise, a determination indicator is output. A value of 0 indicates that the image is considered real, as shown below: In the formula, It is a 0 / 1 indicator function. It outputs 1 when the condition variable in the 0 / 1 indicator function is true, and outputs 0 otherwise.