Student model training method, image forgery detection method and computer equipment
By introducing teaching assistant models and joint training with multiple loss functions, the problem of student models struggling to learn features from multiple teacher models is solved, improving the accuracy and cross-domain adaptability of image forgery detection, and making it suitable for resource-constrained devices.
Patent Information
- Application Number
- CN202511469668.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-10-15
AI Technical Summary
Existing student models struggle to fully absorb knowledge when learning intermediate features from multiple teacher models, resulting in poor image forgery detection performance, especially in cross-domain and cross-forgery type detection.
A teaching assistant model is introduced to fuse and represent the intermediate features output by the teacher model, generating simplified and semantically consistent fused forgery features. The student model is then jointly trained using multiple loss functions, including forgery detection classification, teacher distillation, teaching assistant distillation, domain classification, and real feature consistency loss.
It improves the image forgery detection accuracy of student models, enhances cross-domain generalization ability and robustness, reduces the number of model parameters and computational complexity, and is suitable for resource-constrained devices.
Smart Images

Figure CN120953777A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image detection, specifically relating to a student model training method, an image forgery detection method, and a computer device. Background Technology
[0002] With the rapid development of deep learning technology in the field of image synthesis, deepfake images containing human faces are visually highly realistic, posing serious security risks to scenarios such as social platforms, identity verification, and digital media content.
[0003] Currently, deep learning-based methods for detecting forged images have made some progress. One approach is the distillation framework, which involves first constructing two or more teacher models and training them on a training dataset. Different teacher models correspond to different objectives, specifically the forgery type, i.e., the methods used to forge images. The training dataset can also be called a domain; for example, the training dataset for forged images is the forgery domain, and the training dataset for real images is the real domain. After training the teacher models, student models learn from their knowledge, enabling them to possess capabilities comparable to or even surpassing those of the teacher models. The distillation framework can be divided into output distillation and intermediate feature distillation. Knowledge refers to the way the teacher model extracts features from images, while learning refers to the approximation of features extracted by the student model from images to those extracted by the teacher model.
[0004] However, for intermediate feature distillation, since teacher models are typically deep networks with large parameters, while student models are lightweight networks, the student model struggles to fully reconstruct the complex feature representations of the teacher models when it needs to learn knowledge from more than two teacher models simultaneously. This results in poor image detection performance of the final student model, meaning low accuracy in identifying whether an image is fake. Summary of the Invention
[0005] The purpose of this invention is to provide a student model training method, an image forgery detection method, and a computer device, which can solve the problem of how to improve the image detection performance of the student model, that is, to improve the accuracy of identifying whether an image is a forgery.
[0006] To solve the above-mentioned technical problems, the present invention is implemented as follows: In a first aspect, embodiments of the present invention provide a student model training method, the method comprising: Identify training images from two or more domains; Based on the training images, the corresponding teacher model is invoked to generate intermediate features; Based on all intermediate features, the teaching assistant model is invoked to generate fusion-based forgery features; the fusion-based forgery features refer to the features corresponding to the common information among all intermediate features. The student model is trained based on the fusion forgery features, the training images, and the intermediate features.
[0007] Optionally, the process of generating fused forged features by calling the teaching assistant model based on all intermediate features is represented by the following formula: in, Batch size; The number of fields; The number of channels for fusion-based forgery features. The spatial dimensions of the feature map corresponding to the fusion forgery feature; ,in, 1 1 convolutional projection layer, , in, For reshape operation; To pass A tensor obtained by stacking intermediate features along the dimensions of the domain; For the first One intermediate feature; This represents the number of channels for the intermediate features output by the teacher model; The spatial dimensions of the feature map corresponding to the intermediate features output by the teacher model.
[0008] Optionally, the training of the student model based on the fused forgery features, the training image, and the intermediate features is implemented using the following loss: The losses include falsified detection classification loss, teacher distillation loss, teaching assistant distillation loss, and domain classification loss.
[0009] Optionally, the training of the student model based on the fused forgery features, the training image, and the intermediate features is implemented using the following loss: The loss includes forgery detection classification loss, teacher distillation loss, teaching assistant distillation loss, domain classification loss, and consistency loss of real features.
[0010] Optionally, each loss is assigned a corresponding weight, and the weighted sum of the corresponding losses is used as the total loss during the training process of the student model.
[0011] Secondly, embodiments of the present invention also provide an image forgery detection method, the method comprising: Identify the target image to be detected; Based on the target image, the trained student model is invoked to generate detection results; The student model is trained using fusion-based forgery features, training images, and intermediate features; the training images are provided by two or more domains; the intermediate features are generated by calling the corresponding teacher model based on the training images; the fusion-based forgery features are generated by calling the teaching assistant model based on all intermediate features; the fusion-based forgery features refer to the features corresponding to the common information among all intermediate features.
[0012] Optionally, the process of generating fused forged features by calling the teaching assistant model based on all intermediate features is represented by the following formula: in, Batch size; The number of fields; The number of channels for fusion-based forgery features. The spatial dimensions of the feature map corresponding to the fusion forgery feature; ,in, 1 1 convolutional projection layer, , in, For reshape operation; To pass A tensor obtained by stacking intermediate features along the dimensions of the domain; For the first One intermediate feature; This represents the number of channels for the intermediate features output by the teacher model; The spatial dimensions of the feature map corresponding to the intermediate features output by the teacher model.
[0013] Optionally, a student model is trained based on the fused forgery features, the training image, and the intermediate features, using the following loss: The losses include falsified detection classification loss, teacher distillation loss, teaching assistant distillation loss, and domain classification loss.
[0014] Optionally, a student model is trained based on the fused forgery features, the training image, and the intermediate features, using the following loss: The loss includes forgery detection classification loss, teacher distillation loss, teaching assistant distillation loss, domain classification loss, and consistency loss of real features.
[0015] Thirdly, embodiments of the present invention provide a computer device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the methods described in the first and second aspects.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the methods described in the first and second aspects.
[0017] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods described in the first and second aspects.
[0018] In this embodiment of the invention, a student model training method is proposed. This method sets up a teaching assistant model to perform intermediate fusion and representation guidance on the intermediate features output by the teacher model, thereby providing simplified and semantically consistent feature guidance for the student model to alleviate distribution differences. This facilitates the student model to effectively learn fused forgery features, thereby improving the image detection performance of the student model, that is, improving the accuracy of identifying whether an image is a forgery. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a student model training method provided in some embodiments of the present invention; Figure 2 This is a schematic diagram of the process for generating fusion-based forgery features using a teaching assistant model, provided in some embodiments of the present invention. Figure 3 This is a flowchart illustrating an image forgery detection method provided in some embodiments of the present invention; Figure 4 These are internal structural diagrams of a computer device provided in some embodiments of the present invention. Detailed Implementation
[0020] 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, not all, of the embodiments of the present invention. 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.
[0021] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0022] The student model training method provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0023] As mentioned in the background section, for intermediate feature distillation, teacher models are typically deep networks with large parameters, while student models are lightweight networks. When the student model needs to learn knowledge from more than two teacher models simultaneously, it struggles to fully reconstruct the complex feature representations of the teacher models, resulting in poor image detection performance, specifically low accuracy in identifying whether an image is fake. The core issue is that in traditional techniques, the input to the student model is a simple stack of the outputs of all teacher models, making it difficult for the student model to fully absorb the knowledge from the teacher models.
[0024] The main reason why it is difficult to fully absorb the knowledge of the teacher model is: 1. Teacher models with different forgery types focus on different semantic regions and forgery patterns, resulting in differences in the distribution of their output features in terms of spatial location, semantic context and texture dimension. Without an intermediate coordination mechanism, student models have difficulty aligning multiple targets at the same time, which easily leads to "semantic mismatch".
[0025] 2. Teacher models are usually deep networks with large parameters, while student models are lightweight networks with limited representation capabilities, making it difficult to fully reconstruct the complex feature representations of the teacher model.
[0026] Therefore, the student model struggles to effectively learn fusion-based forgery features, limiting its final detection performance. Specifically: Because different forgery types operate on different principles, the intermediate features learned by each teacher model exhibit significant differences in representation. This is because different forgery types focus on different spatial regions. For example, the Deepfakes dataset focuses on the edges of face fusion; the Face2Face dataset focuses on the synchronization of micro-expressions of the mouth and eyes; the FaceSwap dataset focuses on face masking and edge occlusion areas; and the NeuralTextures dataset captures more skin texture and high-frequency artifacts in the frequency domain.
[0027] This results in a spatial distribution offset in the feature maps generated by each teacher's model in the intermediate layer, meaning that the intermediate features of different teachers exhibit spatial differences. This distributional difference makes it difficult for the student model to effectively learn fused fake features.
[0028] In one exemplary embodiment, such as Figure 1 As shown, a student model training method is provided. This method sets up a teaching assistant model to perform intermediate fusion and representation guidance on the intermediate features output by the teacher model, thereby providing simplified and semantically consistent feature guidance for the student model to alleviate distribution differences. This facilitates the student model to effectively learn fused forgery features, thereby improving the image detection performance of the student model, that is, improving the accuracy of identifying whether an image is a forgery.
[0029] The method includes steps 102 to 108. Wherein: Step 102: Determine training images from two or more domains.
[0030] Step 104: Based on the training images, call the corresponding teacher model to generate intermediate features.
[0031] Step 106: Based on all intermediate features, call the teaching assistant model to generate fusion-based forgery features; the fusion-based forgery features refer to the features corresponding to the common information among all intermediate features.
[0032] Step 108: Train the student model based on the fusion forgery features, the training images, and the intermediate features.
[0033] The aforementioned domains may include both fake and real domains, or both may be fake domains. The real domain is used to improve the robustness of the student model.
[0034] Taking four forged domains and one real domain as an example, the various embodiments of the method steps are described.
[0035] The process of generating intermediate features is as follows: Let the input batch size be B, and the number of fields be N=5, that is, the fields correspond to four types of forgery (Deepfakes, Face2Face, FaceSwap, NeuralTextures) and real images (Real).
[0036] Based on this, the first A network of teacher models Receive input images from the corresponding fake or real domain. Intermediate features are extracted by the encoder in the network: in, This represents the number of channels in the intermediate features output by the teacher model (e.g., 512). Let be the spatial dimensions of the feature map corresponding to the intermediate features; specifically, the intermediate features (real features) extracted by the teacher model corresponding to the real domain are denoted as . .
[0037] Based on this, to ensure consistent calculations in subsequent distillation processes, all intermediate features undergo Global Average Pooling (GAP) before entering the alignment module: This operation ensures that intermediate features are comparable vector representations in the semantic space, thus facilitating cross-domain alignment.
[0038] For the generation of fusion-based forgery features, refer to Figure 2 The process is as follows: To mitigate the differences in spatial location, semantic context, and texture distribution among intermediate features generated by different teacher models, a teaching assistant model is introduced. As an intermediary coordinator, the teaching assistant model is a single network whose weights are shared by all forgery types.
[0039] Therefore, during training, the single network repeatedly receives feature inputs from different forgery types. It must find common information among these features (such as spatial anomalies of forgery traces, edge distortion, high-frequency noise in the frequency domain, etc.), that is, find a general intermediate representation in the semantic space from intermediate features with different distributions, rather than features specific to a certain forgery type, in order to achieve low loss across all forgery types. In other words, it needs to find a fusion forgery feature from all intermediate features.
[0040] The input to this teaching assistant model is intermediate features, which are multi-domain feature sets formed by stacking and rearranging the feature maps (intermediate features) output by all teacher models. The process is as follows: Will The intermediate features are stacked along the dimensions of the domain to obtain a tensor. .
[0041] The reshape operation expands the dimensions of the domain to the dimensions of the batch: To ensure consistency in channel dimensions and feature alignment, a 1×1 convolutional projection layer is introduced. ,get: Then through the teaching assistant model Extract unified forgery guidance features, i.e., fusion forgery features: Finally, the vector representation is obtained after the GAP operation: in, The teaching assistant model is for the first A unified feature map is obtained by fusing multiple teachers' outputs from a single sample. It is the vector obtained after performing global average pooling (GAP).
[0042] It is understandable that the teaching assistant model extracts unified forgery guidance features from intermediate features of different forgery types. In this process, the reshape operation ensures that the input of the teaching assistant model is uniform in format, thereby ensuring that the input is consistent in tensor structure and channel semantics. This avoids the interference of structural differences in the input stage on semantic alignment, and thus ensures that the fused forgery features are semantically consistent.
[0043] Based on this, the student model possesses excellent cross-dataset (cross-domain) generalization ability and compression robustness, and can work stably under various forgery methods, different compression rates, and complex video environments. This method enhances the consistency and discriminativeness of feature representations through collaborative distillation, enabling the student model to have a stronger generalization ability to detect forged images, which is unattainable by traditional Convolutional Neural Networks (CNN) methods or single-teacher distillation structures.
[0044] It should be noted that the distillation loss of the teaching assistant model is defined as: in, For the first The feature vector of the student model for each image sample (which may come from training images in any domain); Dimension alignment mapping.
[0045] It is understandable that this distillation loss can ensure that the student model is aligned with the teaching assistant model in the common subspace, thereby reducing the training instability caused by the above distribution differences and reducing the difficulty for the student model to learn the knowledge of the teacher model.
[0046] During the training of the student model, it can be understood that the teaching assistant model is used to assist the student model in learning the knowledge of all the teacher models. Specifically, the student model and the teaching assistant model are jointly trained.
[0047] It should be noted that during joint training, the student model and the teaching assistant model can update their model parameters through backpropagation combined with the corresponding losses, thereby obtaining a well-trained student model through iterative training. The corresponding losses include forgery detection classification loss, teacher distillation loss, and teaching assistant distillation loss.
[0048] Student Model It is built using a lightweight architecture, including but not limited to the EfficientNet series and MobileNet series. The following uses EfficientNet-B0 as an example to illustrate the definition of the loss function: The EfficientNet-B0 has approximately 5.3M parameters, significantly reducing the number of parameters compared to similar-performing traditional image forgery detection models. This allows for improved inference speed and adaptability. Its goal is to achieve high performance in real / forged binary classification tasks.
[0049] It is understandable that by introducing a compact student model and combining semantic guidance provided by two or more teacher models and teaching assistant models, the detection accuracy of large models can be maintained or even surpassed while significantly reducing the number of parameters and computational complexity. This solves the problem that deepfake detection methods are difficult to deploy on resource-constrained devices (such as edge devices and mobile devices).
[0050] Among them, the input sample image To student model Afterwards, the following characteristics can be obtained: This feature After the GAP operation, the feature vector can be obtained. The feature vector After inputting the classification header, the probability of true or false can be predicted.
[0051] For the classification loss of forgery detection, labels need to be defined first. Where 0 represents a real image and 1 represents a fake image. Its loss function is as follows: in, The probability predicted by the student model; This represents the ground truth value of the sample label for the sample image.
[0052] Specifically, for the teacher distillation loss (used to enable the student model to learn the knowledge of the teacher model), the student model needs to learn semantic representations from the teacher model. To align the features output by the student model with the features extracted by the teacher (including fake and real features), the teacher distillation loss can be expressed as: in, For the first The forged field number of the sample image; The vector representation of the true features of a sample image is denoted as ; Indicates the first The sample at the th Feature vectors extracted from a teacher model of a certain type of forgery; Indicates the first Feature vectors extracted from a sample in a real teacher model.
[0053] Regarding the distillation loss of teaching assistants, please refer to the relevant records on the distillation loss of the teaching assistant model above.
[0054] In one embodiment, to enhance the student model's perception of differences between different forgery types and improve the clarity of classification boundaries, the method also proposes a domain classification loss.
[0055] Specifically, a domain classifier is introduced for the four types of forged domains. After inputting the features of the student model into the domain classifier, it can predict the type of forgery to which the feature belongs: .
[0056] The corresponding domain classification output probability is: Therefore, the domain classification loss can be expressed as: in, For the Kronecker pointer function, if ,but ; Represents the student model for the first The sample belongs to the first The predicted probability of each domain.
[0057] It can be understood that this domain classifier is a type of label selector used to ensure that the cross-entropy (i.e., the forgery detection classification loss) only takes the first label. The predicted probability corresponding to the true domain label of a sample image is used in the calculation, while the predicted probability of other domains is directly ignored in the domain classification loss of the sample image.
[0058] In one embodiment, to narrow the gap between the student model's vector representation of sample images from the real domain and the teacher model's vector representation of sample images from the real domain, thereby reducing the risk of misclassifying real images as forged images, i.e., improving recall / reducing false positives, this method also proposes a real feature consistency loss, which can be expressed as: in, This refers to the number of actual samples in the current batch; This indicates that all real samples in the current batch are traversed. Indicates the first The feature representation of each sample obtained in the student model; Indicates the first The feature representation of a real sample obtained in a real teacher model.
[0059] In one embodiment, to further improve the image detection performance of the student model, i.e., to increase the accuracy in identifying whether an image is forged, this method, based on the aforementioned losses, proposes to obtain the total loss function during the joint training of the student model and the teaching assistant model through a weighted combination. That is, the final optimization objective of this joint training process can be expressed as: in, This is a hyperparameter that can be adjusted according to the importance of the detection task.
[0060] For example , , , , It can be understood that by setting this weight, during joint training, the steady-state alignment of the teaching assistant model is emphasized first. (With higher weights), after the student model converges in the common feature space, the weight of domain refinement for each teacher model will be increased. The weights are gradually increased, thus achieving a progressive distillation strategy of "first steady-state alignment, then refined learning". This strategy reduces gradient oscillations and improves the student model's ability to generalize to various forgery types.
[0061] It should be noted that even if the calculation of the total loss function does not include the true feature consistency loss, the total loss function can still be obtained by the above weighted combination method. That is, the total loss function is obtained by weighted combination of the other four losses that do not include the true feature consistency loss.
[0062] Specifically, for the supervision signals of these loss functions, the supervision of the teaching assistant model's distillation loss acts as a cross-domain soft objective, applied to all samples (real + fake), to first pull the student model into a common subspace. The supervision of the teacher distillation loss acts as a domain-specific hard constraint; real samples use the real teacher model, and fake samples use the fake teacher model of their corresponding domain, to refine the feature patterns of each fake domain. The supervision of the domain classification loss prevents the student model from compressing the features of all fake images into a single cluster. The supervision of the truth consistency loss (a combination of cosine similarity "close to true, far from false") fixes the geometric anchor point of "true," improving generalization stability.
[0063] Based on this, the method can improve the alignment speed between teaching assistants and students in the early stages of training, and the features first fall into a unified semantic space. In the later stages, teacher supervision (supervision of teacher distillation loss) is used to make detailed adjustments on this basis, thereby completing the alignment of domain features. This combination of training method of "soft target foundation + hard constraint refinement" makes even small models both stable and accurate.
[0064] In other words, this multi-constraint joint training enables the teaching assistant model to align not only the features between different fake types, but also the semantic boundaries between fake and real. This makes the features output by the teaching assistant model a low-discrepancy, highly generalizable intermediate semantic representation, allowing the student model to learn the knowledge of the teacher model more stably and converge more easily.
[0065] In one exemplary embodiment, such as Figure 3 As shown, an image forgery detection method is provided, which includes steps 302 and 304. Wherein: Step 302: Determine the target image to be detected.
[0066] Step 304: Based on the target image, call the trained student model to generate detection results.
[0067] The student model is trained using fusion-based forgery features, training images, and intermediate features; the training images are provided by two or more domains; the intermediate features are generated by calling the corresponding teacher model based on the training images; the fusion-based forgery features are generated by calling the teaching assistant model based on all intermediate features; the fusion-based forgery features refer to the features corresponding to the common information among all intermediate features.
[0068] In one embodiment, the process of generating fused forged features by calling teaching assistant model A based on all intermediate features is represented by the following formula: in, Batch size; The number of fields; The number of channels for fusion-based forgery features. The spatial dimensions of the feature map corresponding to the fusion forgery feature; ,in, 1 1 convolutional projection layer, , in, For reshape operation; To pass A tensor obtained by stacking intermediate features along the dimensions of the domain; For the first One intermediate feature; This represents the number of channels for the intermediate features output by the teacher model; The spatial dimensions of the feature map corresponding to the intermediate features output by the teacher model.
[0069] In one embodiment, a student model is trained based on the fused forgery features, the training image, and the intermediate features, using the following loss: The losses include falsified detection classification loss, teacher distillation loss, teaching assistant distillation loss, and domain classification loss.
[0070] In one embodiment, a student model is trained based on the fused forgery features, the training image, and the intermediate features, using the following loss: The loss includes forgery detection classification loss, teacher distillation loss, teaching assistant distillation loss, domain classification loss, and consistency loss of real features.
[0071] The target image to be detected can be a fake image of any type or a real image.
[0072] Specifically, if the target image is a fake image, the detection result is "fake"; if the target image is a real image, the detection result is "real".
[0073] The specific limitations on the training process of the student model in the image forgery detection method can be found in the limitations on the student model training method mentioned above, and will not be repeated here.
[0074] The following is the experimental verification process and results of the image detection performance of the student model provided by this invention: The experimental setup includes: To comprehensively evaluate the accuracy and cross-dataset generalization ability of the image forgery detection method (based on a multi-teacher-assistant collaborative distillation framework) proposed in this invention in deepfake detection tasks, experiments were conducted using several mainstream and authoritative deepfake image datasets.
[0075] The deepfake image dataset specifically includes: FaceForensics++ (FF++), DeepfakeDetection (DFD), Deepfake Detection Challenge (DFDC), DFDC Preview (DFDCP), Celeb-DF (v1), and Celeb-DF (v2).
[0076] FF++ serves as the training set, a large dataset containing over 1.8 million forged images from 1000 original videos. These forged images were generated using the same set of original videos by four face processing algorithms: DeepFakes (DF), Face2Face (F2F), FaceSwap (FS), and NeuralTexture (NT).
[0077] It is worth noting that FF++ offers three versions of image compression: original uncompressed, lightly compressed (c23), and heavily compressed (c40). Consistent with existing research, to enhance the referenceability for real-world deployment environments while ensuring image quality, this experiment uniformly uses the lightly compressed version (c23) for training and evaluation.
[0078] Evaluation metrics for experimental results: In order to evaluate the discriminative performance of the image forgery detection method (a lightweight deep forgery image detection method with multi-teacher-teacher assistant collaborative distillation) proposed in this invention in various forgery image detection tasks, we selected the area under the receiver operating characteristic curve (AUC) as the main evaluation metric.
[0079] It is understandable that AUC can comprehensively reflect the model's ability to classify real and fake images under different discrimination thresholds. Its value ranges between [0,1]. The larger the value, the stronger the overall discrimination ability of the model. It is especially suitable for fake image scenarios with blurred inter-class boundaries and complex data distribution.
[0080] To verify the effectiveness and generalization ability of the proposed image forgery detection method (MTA-B0) in the image forgery detection task, the inventors conducted a series of experiments, and the experimental results are shown in Table 1. During the experiments, all detectors were trained on FF++ (c23) and cross-dataset evaluations of frame-level AUC metrics were performed on other datasets.
[0081] Table 1 As shown in Table 1, the image forgery detection method proposed in this invention achieves excellent detection performance on all five test datasets. On the CDF-v1 dataset, it achieves an AUC of 0.889, significantly higher than Xception (0.779) and SPSL (0.815), indicating good recognition ability for low-quality video forgeries. On CDF-v2, it reaches 0.822, a significant improvement compared to the frequency domain method SRM (0.755), demonstrating excellent discrimination ability against high-fidelity forgeries. The method proposed in this invention achieves an average AUC of 0.827 on five deepfake datasets, outperforming current mainstream detection methods.
[0082] It should be emphasized that although this invention uses the lightweight EfficientNet-B0 as the student model, with a much smaller number of parameters than Xception or EfficientNetB4, it still maintains extremely high detection accuracy and cross-scene generalization ability under the combined effect of multi-teacher distillation and teaching assistant guidance mechanisms.
[0083] To further verify the applicability of the proposed image forgery detection method in resource-constrained environments, the inventors designed a model complexity comparison experiment, comparing the differences in parameter size, computational cost (FLOPs), and inference latency among various mainstream image forgery detection methods. The experimental results are shown in Table 2. Similarly, all detectors were trained on FF++ (c23) and cross-dataset evaluations of frame-level AUC metrics were performed on other datasets.
[0084] Table 2 Table 2 lists a series of representative methods, ranging from lightweight networks (such as MesoNet, MobileNetV2, and ShuffleNetV2) to high-performance detectors (such as Xception, SPSL, and F3Net). Experimental results show that the MTA-B0 method proposed in this invention significantly reduces model complexity while maintaining high detection performance (average AUC of 0.827), requiring only 5.3M parameters and 0.49 GFLOPs, with an inference time of 19.3 ms, far lower than the complexity of other high-precision models. This experimental result demonstrates that MTA-B0 significantly reduces computational overhead while maintaining accuracy, exhibiting good engineering deployability and real-time processing capabilities.
[0085] To verify the contribution of each key structural component in the image forgery detection method proposed in this invention to the overall detection performance, the inventors designed an ablation experiment of the distillation structure, focusing on evaluating the impact of the multi-teacher mechanism, teaching assistant module, and lightweight student model design on the detection effect. The experimental results are shown in Table 3.
[0086] Table 3 Table 3 shows the average AUC comparison results for four different distillation configurations, covering everything from the baseline without distillation to the complete MTA-B0 distillation system.
[0087] In the baseline setup, the traditional EfficientNet-B4 architecture was used for training on forged image classification without introducing any teacher or distillation mechanism, ultimately achieving an average AUC of 0.756.
[0088] Subsequently, a multi-teacher network was introduced to perform traditional knowledge distillation (KD), replacing the student model with the lightweight EfficientNet-B0. Despite significant model compression, the performance was improved to 0.781 thanks to the guidance of fake features provided by the multi-teacher network, demonstrating the effectiveness of the multi-teacher mechanism.
[0089] Furthermore, a teaching assistant module was added to the multi-teacher distillation model, serving as a bridge for intermediate feature alignment and information fusion, helping the student model better receive multi-source forged features. At this point, the average AUC increased to 0.811, validating the significant role of the teaching assistant in mitigating feature distribution differences and improving student learnability.
[0090] Ultimately, under the complete structure integrating the multi-teacher mechanism, teaching assistant module and lightweight student network (i.e. MTA-B0), this method achieved the highest average AUC (0.827), outperforming other comparative schemes, and improved by 7.1% compared to the base model, while maintaining an extremely low number of model parameters.
[0091] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0092] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a student model training method and / or an image forgery detection method.
[0093] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0094] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided by this invention can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided by this invention may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided by this invention may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this invention.
[0096] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A student model training method, characterized in that, The student model training method includes: Identify training images from two or more domains; Based on the training images, the corresponding teacher model is invoked to generate intermediate features; Based on all intermediate features, the teaching assistant model is invoked to generate fusion-based forgery features; the fusion-based forgery features refer to the features corresponding to the common information among all intermediate features. The student model is trained based on the fusion forgery features, the training images, and the intermediate features.
2. The student model training method according to claim 1, characterized in that, The process of generating fused forged features by calling the teaching assistant model based on all intermediate features is represented by the following formula: in, Batch size; The number of fields; The number of channels for fusion-based forgery features. The spatial dimensions of the feature map corresponding to the fusion forgery feature; ,in, 1 1 convolutional projection layer, , in, For reshape operation; To pass A tensor obtained by stacking intermediate features along the dimensions of the domain; For the first One intermediate feature; This represents the number of channels for the intermediate features output by the teacher model; The spatial dimensions of the feature map corresponding to the intermediate features output by the teacher model.
3. The student model training method according to claim 2, characterized in that, The student model is trained based on the fused forgery features, the training images, and the intermediate features, using the following loss: The losses include falsified detection classification loss, teacher distillation loss, teaching assistant distillation loss, and domain classification loss.
4. The student model training method according to claim 2, characterized in that, The student model is trained based on the fused forgery features, the training images, and the intermediate features, using the following loss: The loss includes forgery detection classification loss, teacher distillation loss, teaching assistant distillation loss, domain classification loss, and consistency loss of real features.
5. The student model training method according to claim 3 or 4, characterized in that, Each loss is assigned a corresponding weight, and the weighted sum of the corresponding losses is used as the total loss during the training process of the student model.
6. A method for detecting image forgery, characterized in that, The image forgery detection method includes: Identify the target image to be detected; Based on the target image, the trained student model is invoked to generate detection results; The student model is trained using fusion-based forgery features, training images, and intermediate features; the training images are provided by two or more domains; the intermediate features are generated by calling the corresponding teacher model based on the training images; the fusion-based forgery features are generated by calling the teaching assistant model based on all intermediate features; the fusion-based forgery features refer to the features corresponding to the common information among all intermediate features.
7. The image forgery detection method according to claim 6, characterized in that, The process of generating fused forged features by calling the teaching assistant model based on all intermediate features is represented by the following formula: in, Batch size; The number of fields; The number of channels for fusion-based forgery features. The spatial dimensions of the feature map corresponding to the fusion forgery feature; ,in, 1 1 convolutional projection layer, , in, For reshape operation; To pass A tensor obtained by stacking intermediate features along the dimensions of the domain; For the first One intermediate feature; This represents the number of channels for the intermediate features output by the teacher model; The spatial dimensions of the feature map corresponding to the intermediate features output by the teacher model.
8. The image forgery detection method according to claim 7, characterized in that, A student model is trained based on the fused forgery features, the training image, and the intermediate features, using the following loss: The losses include falsified detection classification loss, teacher distillation loss, teaching assistant distillation loss, and domain classification loss.
9. The image forgery detection method according to claim 7, characterized in that, A student model is trained based on the fused forgery features, the training image, and the intermediate features, using the following loss: The loss includes forgery detection classification loss, teacher distillation loss, teaching assistant distillation loss, domain classification loss, and consistency loss of real features.
10. A computer device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Living body detection method and device, electronic device and computer readable storage medium
CN113052150A
Data-free fine-grained classification model compression system and method based on knowledge distillation
CN114565019A
Knowledge distillation depth forgery detection method and system based on space-frequency feature fusion
CN116895100A
Deep forgery identification method and system based on knowledge back distillation
CN120125879A
Knowledge distillation based neural network training method, device, and storage medium
WO2023212997A1
