Diffusion image authenticity identification method based on directional mask distillation

By using directional mask distillation technology, the key masking regions of diffuse images are determined and the detector model is trained, which solves the problems of insufficient computational overhead and generalization ability of diffuse image detectors, and achieves efficient and accurate identification of the authenticity of diffuse images.

CN122156938APending Publication Date: 2026-06-05CHENGDU UNIV OF INFORMATION TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU UNIV OF INFORMATION TECH
Filing Date
2026-02-26
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing diffusion image detectors are insufficient in terms of computational overhead and generalization ability, making it difficult to effectively distinguish between diffusion-generated images and real images, and they rely on a cumbersome diffusion reconstruction process.

Method used

A method based on directional mask distillation is adopted. By acquiring the DIRE map of the image to be detected, masking is performed to determine the key masking region. The detector model is trained through two-step knowledge distillation, which reduces the computation and storage overhead and improves the detection accuracy and generalization performance.

Benefits of technology

It achieves efficient differentiation between diffusion-generated images and real images without relying on the diffusion reconstruction process, reducing computational and storage overhead, while improving the detector's generalization ability and detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156938A_ABST
    Figure CN122156938A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of image authenticity detection, and particularly relates to a diffusion image authenticity identification method based on directional mask distillation. The method comprises the following steps: obtaining an original image for training and adding noise to the original image to obtain a noise image; performing denoising processing on the noise image to obtain a reconstructed image; generating a DIRE image according to the original image and the reconstructed image; performing shielding processing on the original image and the reconstructed image according to the DIRE image to obtain a final shielding original image; under the guidance of a pre-trained teacher model, training an assistant teacher model by using the final shielding original image to obtain a trained assistant teacher model; inputting the final shielding original image into the trained assistant teacher model, training a detector model by using the original image under the guidance of the trained assistant teacher model to obtain a trained detector model; and performing image detection by using the trained detector model. The application can reduce the calculation cost while ensuring the detection accuracy of the diffusion image, and has a good application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image authenticity detection technology, specifically relating to a method for identifying the authenticity of diffusion images based on directional mask distillation. Background Technology

[0002] Diffusion-based image detection aims to evaluate the realism of visual content generated by diffusion models. With the rapid development of diffusion models, users can now synthesize highly realistic but potentially deceptive images at extremely low cost, greatly exacerbating concerns about visual misinformation. Due to the fundamental differences in the generation mechanisms between images generated by generative adversarial networks (GANs) and diffusion models, detectors developed for GAN-generated images often struggle to perform well when dealing with diffusion-generated images. Furthermore, diffusion image detectors trained on limited or model-specific diffusion datasets typically fail to generalize to images generated by other diffusion architectures; that is, a detector trained on diffusion model A's dataset will show a performance degradation when faced with a dataset generated by diffusion model B.

[0003] Based on these issues, existing researchers have identified selectively extracting features inherent in the diffused generated content as a feasible method to improve detection performance, building upon previous work on image detectors generated by adversarial generative networks. For example, existing techniques include methods that train detectors using features extracted from pre-trained models, methods that extract discriminative cues by reconstructing diffused generated images, and improved versions of methods that extract discriminative cues by reconstructing diffused generated images.

[0004] In the method of extracting discriminative cues from images generated by reconstructing diffusion, the image generated by the diffusion model undergoes the diffusion generation process again, that is, the result after adding noise and then denoising. This result is significantly different from the result after adding noise and then denoising a real-world image. Specifically, since the image generated by the diffusion model is sampled from the latent space of the diffusion model, the reconstruction result after repeating the noise-adding and denoising sampling process will be highly similar to the original image. However, the real image is not sampled from the latent space of the diffusion model, so the reconstruction result obtained after adding noise and denoising a real image will be significantly different from the original image.

[0005] DIRE represents the error between the input image and the version reconstructed by the diffusion model, used to distinguish between the real and generated images. Since diffusion-generated images are easier to reconstruct and more similar to the original image than real images, the DIRE results of real images typically exhibit larger pixel differences. Therefore, the DIRE results of real images appear brighter than diffusion-generated images. This provides a direction for detecting diffusion-generated images. Since all diffusion models are based on noise addition and denoising, this difference after reconstruction is common across diffusion model architectures, and this method has indeed proven its effectiveness. However, it is worth noting that the detector for methods that extract discriminative cues by reconstructing diffusion-generated images essentially processes the dataset into a DIRE dataset, then separates the DIRE of diffusion-generated images and the DIRE of real images into two different labels, and then feeds them into a binary classifier trained by a deep neural network. This leads to the following problems:

[0006] The detector directly uses DIRE as its model input without introducing any additional training guidance. This makes the final detector performance highly dependent on the neural network architecture used during training. This also makes the specific knowledge the model learns from DIRE ambiguous, resulting in limited interpretability. For example, the detector might ultimately learn a threshold parameter and determine the authenticity of an image by analyzing the spatial distribution of pixels in the DIRE whose values ​​exceed that threshold. Alternatively, it might rely on the number of pixels above the threshold as the discrimination criterion. Regardless, the specific decision-making mechanism employed by the detector remains unclear.

[0007] DIREs, constructed through simple difference operations, may overlook pixel-level information inherent in the original image. For example, in a realistic image depicting a dark scene, the overall pixel intensity is already low, resulting in a limited difference that may not appear visually "bright." Furthermore, the image reconstruction process itself is not entirely reliable. Since the reconstructed image is obtained by iteratively adding and removing noise, the DIRE obtained through difference may introduce additional noise from the reconstruction process, which accumulates during diffusion.

[0008] Because the model is trained using DIRE as input, the resulting detector only performs well when DIRE is input. In practical applications, the image to be detected must be converted into DIRE through a computationally intensive diffusion process, which incurs significant computational and storage overhead, thus limiting its practical application.

[0009] In summary, there is an urgent need for a new method for identifying the authenticity of diffusion images, which can reduce computational overhead while ensuring the detection accuracy of diffusion images. Summary of the Invention

[0010] To address the shortcomings of existing technologies, this invention proposes a method for identifying the authenticity of diffusion images based on directional mask distillation. The method includes: acquiring the diffusion image to be detected and inputting it into a trained detector model for processing to obtain the authenticity identification result of the diffusion image.

[0011] The training process of the detector model includes:

[0012] S1: Obtain the original image for training and add noise to it to obtain a noisy image; perform denoising on the noisy image to obtain a reconstructed image;

[0013] S2: Generate a DIRE map based on the original image and the reconstructed image;

[0014] S3: Perform masking processing on the original image and the reconstructed image based on the DIRE map to obtain the final masked original image;

[0015] S4: Train the teacher model using the original image to obtain the pre-trained teacher model; under the guidance of the pre-trained teacher model, train the assistant teacher model using the final masked original image to obtain the trained assistant teacher model.

[0016] S5: Input the final masked original image into the trained assistant teacher model. Under the guidance of the trained assistant teacher model, train the detector model using the original image to obtain the trained detector model.

[0017] Preferably, the process of masking the original image and the reconstructed image based on the DIRE map includes:

[0018] S31: Compare the occlusion factor with the DIRE map pixel by pixel, and take the pixel area with a value greater than the occlusion factor as the occlusion area; the initial value of the occlusion factor is 255;

[0019] S32: Mask the original image and the reconstructed image according to the masking area to obtain the masked original image and the masked reconstructed image;

[0020] S33: Calculate the LPIPS value based on the occluded original image and the occluded reconstructed image, and subtract one from the occlusion factor; return to step S31;

[0021] S34: Take the occlusion factor corresponding to the minimum LPIPS value as the optimal occlusion factor; take the occluded original image under the optimal occlusion factor as the final occluded original image.

[0022] Preferably, the formula for calculating the LPIPS value is:

[0023]

[0024] in, Indicates masking the original image With occlusion reconstruction image The calculated LPIPS value, Indicates the first Spatial height of layer feature maps Indicates the first Spatial width of the layer feature map Indicates the first Weight parameters of the layer feature map, This indicates that the original image is masked at coordinates. The first step through the model Normalized features obtained after layer 1 Indicates the occlusion reconstruction image in coordinates The first step through the model Normalized features obtained after layer 1 This indicates element-wise multiplication. This represents the L2 norm.

[0025] Furthermore, when selecting the occlusion factor corresponding to the minimum LPIPS value, the occlusion ratio of the original image under each occlusion factor is calculated. If the occlusion ratio is greater than a preset threshold, then the occlusion factor is not selected as the best occlusion factor.

[0026] Preferably, under the guidance of the pre-trained teacher model, the loss function for training the assistant teacher model using the final masked original image is a weighted sum of cross-entropy loss, KL divergence loss, and mask generation distillation loss, expressed as:

[0027]

[0028] in, , and These represent the first, second, and third weights, respectively. This represents the first KL divergence loss. This indicates the distillation loss generated by the mask; The first cross-entropy loss is expressed as:

[0029]

[0030] in, Indicates the number of samples. This represents the true label of the i-th image. Let represent the predicted label of the i-th image.

[0031] Furthermore, the first KL divergence loss is expressed as:

[0032]

[0033] in, This represents the KL divergence loss. This indicates the distillation temperature parameter. Represents the given input At that time, the output distribution of the assistant teacher model, Indicates the given input At that time, the output distribution of the teacher model, express Activation function This indicates the calculation of KL divergence.

[0034] Preferably, the mask generation distillation loss is expressed as:

[0035]

[0036] in, This indicates the distillation loss generated by the mask. , and These represent the number of channels, height, and width of the feature map, respectively. This represents the features at the channel number k, height i, and width j of the teacher model output. This represents the features at the channel number k, height i, and width j of the student model output. This represents a generator function that takes the feature output of the student model as input and generates a corresponding representation that approximates the feature of the teacher model.

[0037] Preferably, under the guidance of a trained assistant teacher model, the loss function for training the detector model using the original images is expressed as:

[0038]

[0039] in, This represents the total loss of the trained detector model. This represents the second cross-entropy loss. This represents the second KL divergence loss. Indicates the fourth weight. This indicates the fifth weight.

[0040] The beneficial effects of this invention are as follows:

[0041] This invention establishes a knowledge mechanism for extracting common reconstruction difference features of images generated by a diffusion model: by analyzing the regions that have the greatest impact on the reconstruction difference of images generated by the diffusion model, the model is guided to pay more attention to these regions that best reflect the reconstruction differences.

[0042] This invention simplifies the feature extraction process and improves detection speed and efficiency: by using two-step directional mask knowledge distillation, it eliminates the cumbersome forward / backward diffusion reconstruction process in existing methods, simplifies model parameters, and reduces computational overhead;

[0043] This invention ensures the stability of detection accuracy by improving the generalization performance of the detector across different diffusion constructs through the reconstruction differential knowledge shared by the diffusion model. Attached Figure Description

[0044] Figure 1 This is a flowchart of the diffusion image authenticity identification method based on directional mask distillation in this invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] This invention proposes a method for identifying the authenticity of diffusion images based on directional mask distillation. This invention aims to solve the aforementioned DIRE problem, namely, to achieve the goals of two technical approaches:

[0047] (1) Determine a clear method to guide the model to learn the correct DIRE knowledge while ensuring that no additional diffusion reconstruction noise is introduced.

[0048] (2) Avoid the diffusion reconstruction process required during detection as much as possible to reduce the computational and storage overhead of the detector.

[0049] like Figure 1 As shown, the method includes the following:

[0050] The diffusion image to be detected is acquired and input into the trained detector model for processing to obtain the result of distinguishing between real and fake diffusion images.

[0051] The training process of the detector model includes:

[0052] S1: Obtain the original image for training and add noise to it to obtain a noisy image; perform denoising on the noisy image to obtain a reconstructed image.

[0053] In some preferred embodiments of the present invention, the input image Using the existing DDIM (Denoising Diffusion Implicit Model) method, noise is gradually added to create a noisy image that conforms to a Gaussian distribution. Then, the image is gradually denoised through the corresponding DDIM process to become a reconstructed image. .

[0054] S2: Generate a DIRE map based on the original image and the reconstructed image.

[0055] DIRE is defined by the following formula:

[0056]

[0057] in, Represents absolute value. This represents the DDIM inversion process; The DDIM reconstruction process, also known as the DIRE result of an image, is the difference image obtained by subtracting the original image from the reconstructed image pixel by pixel.

[0058] S3: Perform masking processing on the original image and the reconstructed image based on the DIRE map to obtain the final masked original image.

[0059] The effectiveness of DIRE stems from the differences between the reconstructed and original images (i.e., their respective DIRE maps) of the images generated by the diffusion model and the ground truth images. By masking fixed regions of both the original and reconstructed images, the reconstructed difference maps of both the generated and ground truth images will appear similar due to the masking. This means the model can no longer accurately determine the image's authenticity based solely on the DIRE map. Therefore, the masked region determines the image's realism; it is the key area for judging image authenticity. This invention aims to make the model focus more on such regions. By masking specific regions of the image, the original and reconstructed images will become highly similar at the DIRE scale, rendering them indistinguishable.

[0060] Since generative distillation of masks inherently guides student models to focus more on occluded regions, this aligns with the objectives of this invention. However, traditional generative distillation techniques rely on random masks. While the student model is required to focus on occluded regions, these regions are randomly assigned. This does not meet the requirement of this invention to occlude specific regions that best reflect the differences between the generated and real images. Therefore, a redesigned masking scheme is necessary; specifically:

[0061] S31: Compare the occlusion factor with the DIRE map pixel by pixel, and take the pixel area with a value greater than the occlusion factor as the occlusion area.

[0062] Determine an initial occlusion factor Since the image pixel distribution range is [0, 255], therefore The initial value was set to 255.

[0063] The occlusion factor is compared pixel-by-pixel with the DIRE map. In the difference DIRE map, the pixel value > The area is the shaded area.

[0064] S32: Mask the original image and the reconstructed image according to the masking area to obtain the masked original image and the masked reconstructed image.

[0065] Oriented masks are applied to the original and reconstructed images based on the DIRE results. Specifically, regions in both the original and reconstructed images that correspond to the masked areas in the DIRE map are masked. Because... The initial value is 255, which means that initially no area will be occluded.

[0066] S33: Calculate the LPIPS value based on the occluded original image and the occluded reconstructed image, and subtract one from the occlusion factor; return to step S31.

[0067] The formula for calculating LPIPS is:

[0068]

[0069] in, Indicates masking the original image With occlusion reconstruction image The calculated LPIPS value, Indicates the first Spatial height of layer feature maps Indicates the first Spatial width of the layer feature map Indicates the first Weight parameters of the layer feature map, This indicates that the original image is masked at coordinates. The first step through the model Normalized features obtained after layer 1 Indicates the occlusion reconstruction image in coordinates The first step through the model Normalized features obtained after layer 1 This indicates element-wise multiplication. Describing the L2 norm, and This represents the pixel coordinates used in the calculation results.

[0070] because A decrease in the threshold value means that more areas in the image will be occluded. As a widely accepted metric, LPIPS provides a reliable quantitative method for evaluating the similarity between an occluded reconstructed image and the original occluded image. This quantitative method does not rely on human visual perception but on the model itself to determine the differences between images, thus providing guidance for selecting an appropriate threshold in subsequent work.

[0071] After repeated calculations, the shading factor that minimizes the LPIPS value is selected. The occlusion factor is used as the occlusion factor for the image, and then the occluded image under this occlusion factor is retained as the final occlusion result of the image. This means that the occluded image is no longer distinguishable from the model at the DIRE scale, that is, the occluded area is the key area for distinguishing the realism of the image. At the same time, since the pixel composition of each image is different, the occlusion factor of each image is different. All of these processes are specific to the image itself and thus can dynamically adapt to the image itself.

[0072] S34: Take the occlusion factor corresponding to the minimum LPIPS value as the optimal occlusion factor; take the occluded original image under the optimal occlusion factor as the final occluded original image.

[0073] During the iteration process, this invention also targets the occlusion factor at each step. Calculate the shading ratio That is, the proportion of the total image area that is occluded, the occlusion ratio. > The masking factor will not be selected. This is to prevent the image from being masked by too many areas, thus losing a lot of information. Preferably, the maximum masking ratio is 30%.

[0074] Through the above steps, a masking dataset is obtained, which is obtained by masking specific regions of each image in the original dataset. This satisfies the technical route requirement (1) of the present invention. The image is masked with a defined target. By clearly emphasizing the regions that need attention, it provides guidance for subsequent mask knowledge distillation. And since the masking dataset is generated by simply masking the original image, it does not introduce any diffusion-related noise error.

[0075] Subsequently, this invention guides the model to learn the reconstructed feature knowledge of these specific regions through a two-step directed mask knowledge distillation technique. Specifically, this invention uses an untrained model as a student model. This student model learns from a teacher model trained on a large-scale dataset. Then, this student model serves as an assistant teacher model, guiding the final detector in the subsequent distillation steps. The specific steps of this part are as follows:

[0076] Step 1: Teacher Model Guidance for Assistant Teacher Model Learning:

[0077] S4: Train the teacher model using the original image to obtain the pre-trained teacher model; under the guidance of the pre-trained teacher model, train the assistant teacher model using the final masked original image to obtain the trained assistant teacher model.

[0078] In the first step, the following loss function is optimized to train the assistant teacher model:

[0079]

[0080] in, , and These represent the first, second, and third weights, respectively, and are hyperparameters used to weight the contributions of different loss components; The standard cross-entropy loss used in traditional neural networks is shown below:

[0081]

[0082] in, Indicates the number of samples. This represents the true label of the i-th image. Let represent the predicted label of the i-th image.

[0083] The KL (Kullback-Leibler) divergence loss, commonly used in knowledge distillation, is defined as follows:

[0084]

[0085] in, This represents the KL divergence loss. This indicates the distillation temperature parameter. Represents the given input At that time, the output distribution of the student model, i.e., the assistant teacher model, is... Indicates the given input At that time, the output distribution of the teacher model, express Activation function The formula for calculating KL divergence is as follows:

[0086]

[0087] The last item is denoted as The distillation loss function is generated corresponding to the following mask:

[0088]

[0089] in, This indicates the distillation loss generated by the mask. , and These represent the number of channels, height, and width of the feature map, respectively. This represents the features at the channel number k, height i, and width j of the teacher model output. This represents the features at the channel number k, height i, and width j of the student model output. It is a generating function that takes the feature output of the student model as input and generates a corresponding representation that approximates the features of the teacher model, as shown below:

[0090]

[0091] in, and These are two fully connected layers used to perform linear transformations. ReLU is a standard neural network activation function.

[0092] The pre-trained teacher model is first fed into the unmasked original image, while the assistant teacher model is trained on the corresponding masked image, learning the reconstructed feature knowledge by being guided by the teacher model. After this step, the reconstructed feature knowledge is retained in the assistant teacher model.

[0093] Step 2: The assistant teacher model guides the detector model's learning.

[0094] S5: Input the final masked original image into the trained assistant teacher model. Under the guidance of the trained assistant teacher model, train the detector model using the original image to obtain the trained detector model.

[0095] The assistant teacher model now serves as the teacher model, training the detector model with the masked image as input, while the student model, the final detector, receives the corresponding unmasked original image as input. In this step, the trained assistant teacher model, having already learned the reconstruction features, guides and reinforces the student model in learning these features. The total loss for this step is shown in the following formula, where... and It is a hyperparameter used to weight the contributions of different loss components.

[0096]

[0097] in, This represents the total loss of the trained detector model. This represents the second cross-entropy loss. This represents the second KL divergence loss, and its calculation formula is consistent with the cross-entropy loss and KL divergence loss in S4. Indicates the fourth weight. This indicates the fifth weight.

[0098] Since the student model itself takes the original image as input, this step omits the mask generation distillation loss used in the first step. This also means that the detector only needs the unprocessed original image as input to perform image detection, thus eliminating the need for cumbersome diffusion preprocessing of the test image. This enables the final detector to achieve the technical roadmap goal (2).

[0099] In summary, the core optimization objective of the two-step knowledge distillation is shown in the following formula:

[0100]

[0101] in and These represent the weight parameters of the final detector model and the assistant teacher model, respectively.

[0102] In some preferred embodiments of the present invention, the following test dataset is selected according to common test condition specifications: bedroom generated images from a public dataset.

[0103] Table 1 Dataset Composition

[0104] The network was trained on a GPU with a batch size of 32, an initial learning rate of 0.001, and 100 training epochs. Experiments showed that the loss function tended to stabilize when training approached 100 epochs.

[0105] After two steps of knowledge distillation training, the final detector model can be obtained. Using the trained detector model to detect the diffusion image, the result of distinguishing between real and fake images can be obtained.

[0106] Simulation verification of the present invention:

[0107] To verify the performance of the proposed method, experiments were conducted under common testing conditions. The detection performance of images generated under four diffusion architectures—ADM, DDPM, iDDPM, and PNDM—was selected as the criterion. The model's performance was evaluated primarily by its accuracy, which reflects the reliability of the prediction results.

[0108] To verify the effectiveness of the proposed detection method, the table below shows the detection performance of different existing methods on images generated by different diffusion architectures.

[0109] Table 2. Detection performance analysis of different detectors across diffusion architectures

[0110]

[0111] As can be seen from the table above, the method of this invention achieves comparable performance to existing methods in terms of prediction accuracy and generalization performance across diffusion architectures, which indicates that our idea of ​​extracting and reconstructing feature knowledge is feasible.

[0112] To further verify the performance of the detection method in practical applications, i.e. whether it has achieved a reduction in the computational overhead and storage burden of the detector, a horizontal comparison was made between two existing detection methods that rely on diffusion reconstruction processes. The detector weight parameters and the time consumed to detect a single image are shown in the table below.

[0113] Table 3 Detector Overhead Analysis

[0114]

[0115] DIRE's implementation relies on complete image reconstruction to compute the difference map. This complete diffusion process is very time-consuming; in our experiments, reconstructing a single image and generating its difference map using DIRE took 763.2 seconds. In contrast, LaRE... 2 Relying solely on single-step reconstruction, extracting single-step reconstruction features from a single image still takes 3.3 seconds. The method of this invention requires no additional processing of the image itself and completes detection in just 7.6 seconds. Furthermore, due to DIRE and LaRE... 2 Both rely on an additional reconstruction process, thus requiring the storage of additional weight parameters for reconstruction. As shown in Table 3, compared to DIRE and LaRE... 2 In comparison, this invention requires less storage space for model parameters. Furthermore, LaRE... 2 The detector needs to be trained on a graphics card with more than 30GB of video memory, while the method of this invention can be completed using only a graphics card with 8GB of video memory.

[0116] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for identifying the authenticity of diffusion images based on directional mask distillation, characterized in that, include: The diffusion image to be detected is acquired and input into the trained detector model for processing to obtain the result of distinguishing between real and fake diffusion images. The training process of the detector model includes: S1: Obtain the original image for training and add noise to it to obtain a noisy image; perform denoising on the noisy image to obtain a reconstructed image; S2: Generate a DIRE map based on the original image and the reconstructed image; S3: Perform masking processing on the original image and the reconstructed image based on the DIRE map to obtain the final masked original image; S4: Train the teacher model using the original image to obtain the pre-trained teacher model; under the guidance of the pre-trained teacher model, train the assistant teacher model using the final masked original image to obtain the trained assistant teacher model. S5: Input the final masked original image into the trained assistant teacher model. Under the guidance of the trained assistant teacher model, train the detector model using the original image to obtain the trained detector model.

2. The method for identifying the authenticity of diffusion images based on directional mask distillation according to claim 1, characterized in that, The process of masking the original and reconstructed images based on the DIRE map includes: S31: Compare the occlusion factor with the DIRE map pixel by pixel, and take the pixel area with a value greater than the occlusion factor as the occlusion area; the initial value of the occlusion factor is 255; S32: Mask the original image and the reconstructed image according to the masking area to obtain the masked original image and the masked reconstructed image; S33: Calculate the LPIPS value based on the occluded original image and the occluded reconstructed image, and subtract one from the occlusion factor; return to step S31; S34: Take the occlusion factor corresponding to the minimum LPIPS value as the optimal occlusion factor; take the occluded original image under the optimal occlusion factor as the final occluded original image.

3. The method for identifying the authenticity of diffusion images based on directional mask distillation according to claim 2, characterized in that, The formula for calculating LPIPS is: ; in, Indicates masking the original image With occlusion reconstruction image The calculated LPIPS value, Indicates the first Spatial height of layer feature maps Indicates the first Spatial width of the layer feature map Indicates the first Weight parameters of the layer feature map, This indicates that the original image is masked at coordinates. The first step through the model Normalized features obtained after layer 1 Indicates the occlusion reconstruction image in coordinates The first step through the model Normalized features obtained after layer 1 This indicates element-wise multiplication. This represents the L2 norm.

4. The method for identifying the authenticity of diffusion images based on directional mask distillation according to claim 2, characterized in that, When selecting the occlusion factor corresponding to the minimum LPIPS value, calculate the occlusion ratio of the original image under each occlusion factor. If the occlusion ratio is greater than the preset threshold, then the occlusion factor is not selected as the best occlusion factor.

5. The method for identifying the authenticity of diffusion images based on directional mask distillation according to claim 1, characterized in that, Under the guidance of the pre-trained teacher model, the loss function for training the assistant teacher model using the final masked original image is a weighted sum of cross-entropy loss, KL divergence loss, and mask generation distillation loss, expressed as: ; in, , and These represent the first, second, and third weights, respectively. This represents the first KL divergence loss. This indicates the distillation loss generated by the mask; The first cross-entropy loss is expressed as: ; in, Indicates the number of samples. This represents the true label of the i-th image. Let represent the predicted label of the i-th image.

6. The method for identifying the authenticity of a diffusion image based on directional mask distillation according to claim 5, characterized in that, The first KL divergence loss is expressed as: ; in, This represents the KL divergence loss. This indicates the distillation temperature parameter. Represents the given input At that time, the output distribution of the assistant teacher model, Indicates the given input At that time, the output distribution of the teacher model, express Activation function This indicates the calculation of KL divergence.

7. The method for identifying the authenticity of a diffusion image based on directional mask distillation according to claim 5, characterized in that, The mask generation distillation loss is expressed as: ; in, This indicates the distillation loss generated by the mask. , and These represent the number of channels, height, and width of the feature map, respectively. This represents the features at the channel number k, height i, and width j of the teacher model output. This represents the features at the channel number k, height i, and width j of the student model output. This represents a generator function that takes the feature output of the student model as input and generates a corresponding representation that approximates the feature of the teacher model.

8. The method for identifying the authenticity of diffusion images based on directional mask distillation according to claim 1, characterized in that, Under the guidance of the trained assistant teacher model, the loss function for training the detector model using the original images is expressed as: ; in, This represents the total loss of the trained detector model. This represents the second cross-entropy loss. This represents the second KL divergence loss. Indicates the fourth weight. This indicates the fifth weight.