Counterfeit face detection method based on improved YOLOv5 and multi-branch Xception

By improving the Neck module of YOLOv5 into a combination of a three-layer BiFPN structure and a multi-branch Xception network, the problem of low accuracy in face forgery detection is solved, and high-precision and robust detection is achieved in complex scenarios.

CN120808455AActive Publication Date: 2025-10-17JIANGXI POLICE COLLEGE
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511308793.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-10-17
Estimated Expiration
2045-09-15

AI Technical Summary

Technical Problem

Existing face forgery detection methods based on image classification have low detection accuracy, especially poor robustness in complex scenarios.

Method used

The Neck module in the improved YOLOv5 detection network is replaced with a three-layer BiFPN structure, and the target face image is input into the multi-branch Xception network to generate the forgery probability. The feature extraction is enhanced by the multi-branch convolution module and the Mish activation function, and the detection accuracy is improved by combining the hybrid pooling strategy.

Benefits of technology

It improves the accuracy and robustness of face forgery detection in complex scenarios, enhances the ability to capture forgery features, and improves the accuracy and stability of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808455A_ABST
    Figure CN120808455A_ABST
Patent Text Reader

Abstract

The invention discloses a forged face detection method based on improved YOLOv5 and multi-branch Xception, and belongs to the field of image target detection. The method comprises the following steps: determining a target face image; the target face image is obtained by cutting an original input image based on a target detection frame provided by a YOLOv5 detection network; a PAN + FPN structure of a Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; inputting the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network comprises a plurality of convolution branches; and based on the forgery probability, determining a detection result of face forgery detection. The method can improve the detection precision.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of image target detection, and particularly relates to a fake face detection method based on improved YOLOv5 and multi-branch Xception. BACKGROUND

[0002] With the rapid development of deep learning technology, face image forgery technology based on generative adversarial networks (GAN) is increasingly mature, and its representative application such as DeepFake tool can generate high-fidelity face image or video content. Such deep forgery technology is widely used in film and television entertainment, virtual reality and other fields, but also causes serious concerns about public safety, public opinion manipulation, identity fraud and other aspects.

[0003] In related technologies, the main technical route of the face forgery detection method includes image classification, frequency domain analysis, physiological signal capture and image residual modeling. Among them, the face forgery detection method based on image classification is widely used because of its strong universality and simple implementation. Such method usually takes the whole image as input, uses a convolutional neural network (CNN) model for feature extraction and binary classification judgment, such as using Visual Geometry Group (VGG), ResNet, Xception architecture research has achieved certain results.

[0004] However, since the whole image is taken as input, the detection accuracy of such method is often not high. SUMMARY

[0005] The purpose of the embodiments of the application is to provide a fake face detection method based on improved YOLOv5 and multi-branch Xception, which can solve the problem of how to improve the detection accuracy of the face forgery detection method.

[0006] In order to solve the above technical problems, the application is implemented as follows: In a first aspect, the embodiments of the application provide a fake face detection method based on improved YOLOv5 and multi-branch Xception, which comprises: determining a target face image; the target face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; and a PAN+FPN structure of a Neck module in the YOLOv5 detection network is replaced with a three-layer BiFPN structure; input the target face image into the multi-branch Xception network to generate a forgery probability; the multi-branch Xception network comprises a plurality of convolution branches; Based on the forgery probability, a detection result of face forgery detection is determined.

[0007] Optionally, in the training phase, the input of the YOLOv5 detection network is obtained, comprising: Obtain a plurality of training images; Perform pixel normalization processing on the training images to obtain a plurality of normalized images; Scale and splice the normalized images to obtain the input of the YOLOv5 detection network.

[0008] Optionally, the target face image is determined, comprising: Determine the original input image; Input the original input image into the YOLOv5 detection network to obtain a plurality of candidate detection boxes; Based on non-maximum suppression, remove redundant parts in the candidate detection boxes to obtain a target detection box; Based on the target detection box, the target face image is obtained by cropping from the original input image.

[0009] Optionally, the multi-branch Xception network comprises at least a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module comprises a plurality of parallel deep separable convolution branches; the input of the target face image into the multi-branch Xception network to generate a forgery probability comprises: Based on the Stem layer, input features are extracted from the target face image; Input the input features into the a plurality of parallel deep separable convolution branches to obtain intermediate features corresponding to each parallel deep separable convolution branch; Channel splicing is performed on intermediate features, and convolution compression is performed on the spliced features to obtain target output features; Based on the target output features, a forgery probability is generated.

[0010] Optionally, the activation function in the parallel deep separable convolution branch is Mish, and the function of the Mish is as follows: wherein, is the output of the convolution layer or the full connection layer, is the base of the natural logarithm, represents the natural logarithm function, represents a hyperbolic tangent function.

[0011] Optionally, the generating the forgery probability based on the target output feature comprises: performing a global average pooling operation and a global maximum pooling operation on the target output feature to obtain a pooled feature; inputting the pooled feature into a fully connected layer to generate the forgery probability.

[0012] Optionally, the determining the detection result of the face forgery detection based on the forgery probability comprises: performing weighted summation on the confidence provided by the YOLOv5 detection network and the forgery probability to obtain a comprehensive forgery probability; determining the detection result of the face forgery detection based on the comprehensive forgery probability.

[0013] In a second aspect, an embodiment of the present application provides a face forgery detection device, which comprises: an image processing module configured to determine a target face image; the target face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; a PAN+FPN structure of a Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; a forgery identification module configured to input the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network comprises a plurality of convolution branches; a forgery judgment module configured to determine a detection result of face forgery detection based on the forgery probability.

[0014] In a third aspect, an embodiment of the present application provides a computer device, which comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and the program or instruction is executed by the processor to implement the steps of the method according to the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a program or instruction, and the program or instruction is executed by a processor to implement the steps of the method according to the first aspect.

[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the method according to the first aspect.

[0017] In the embodiment of the present application, a method for detecting fake faces based on improved YOLOv5 and multi-branch Xception is proposed, which comprises: determining a target face image; the target face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; the PAN+FPN structure of the Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; inputting the target face image into a multi-branch Xception network to generate a fake probability; the multi-branch Xception network comprises multiple convolution branches; and determining a detection result of face forgery detection based on the fake probability. The method improves the detection accuracy of the face forgery detection method by cropping the image and then inputting the cropped target face image into the multi-branch Xception network for face forgery detection instead of directly inputting the target face image into the multi-branch Xception network for face forgery detection. The reason is that the fake area often only appears in a small part of the image, and the whole image classification may cover up the fake features, resulting in a decrease in detection accuracy. Classification based on the cropped target face image can avoid covering up the fake features, making the detection method sensitive to the regional information of the image, and thus improving the detection accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 is a flowchart of the method for detecting fake faces based on improved YOLOv5 and multi-branch Xception provided by some embodiments of the present application; Figure 2 is an improved YOLOv5 network structure diagram provided by some embodiments of the present application; Figure 3 is a BiFPN multi-scale feature fusion structure diagram provided by some embodiments of the present application; Figure 4 is a multi-branch Xception network structure diagram provided by some embodiments of the present application; Figure 5 is a structure block diagram of a fake face detection device provided by some embodiments of the present application; Figure 6 is an internal structure diagram of a computer device provided by some embodiments of the present application. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0020] In the specification and claims of the present application, "and / or" means at least one of the connected objects, and the character " / " generally means that the front and rear associated objects are in an "or" relationship.

[0021] In an exemplary embodiment, as shown in Figure 1 , a fake face detection method based on improved YOLOv5 and multi-branch Xception is provided, which includes the following steps 102 to 106. Among them: Step 102, determining a target face image; the target face image is obtained by cropping the original input image based on the target detection frame provided by the YOLOv5 detection network; the PAN+FPN structure of the Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure.

[0022] As shown in Figure 2 , the YOLOv5 detection network includes a backbone network Backbone, a Neck module and a Head module. Among them, the backbone network Backbone is used to extract semantic features and spatial features; the Neck module is used for feature fusion; the Head module is used to output feature maps.

[0023] For the input of the YOLOv5 detection network, that is, the original input image , the feature map is first extracted by the backbone network Backbone, which can be extracted by the following formula 1.

[0024] (1) Wherein, the backbone network Backbone is composed of Focus, CBS and CSP modules, which can effectively extract deep features in the original input image.

[0025] Wherein, the original input image can be obtained through any channel, such as social media, user input, etc.

[0026] It should be noted that in the original YOLOv5 network structure, the Neck module adopts PAN + FPN structure. In order to further improve the multi-scale information fusion ability, in this embodiment, the PAN+FPN structure is replaced by a three-layer BiFPN structure.

[0027] The three-layer BiFPN structure fuses the feature maps (including P3, P4 and P5) from different scales through a bidirectional information flow and a learnable weight mechanism, enhancing the detection accuracy and semantic expression ability and realizing efficient upper and lower layer feature fusion.

[0028] Among them, the three-layer feature maps are: .

[0029] Specifically, if Figure 3 As shown in Figure 2, the three-layer BiFPN structure uses learnable fusion weights and bidirectional paths to perform a weighted combination of the three-layer feature maps, improving the joint expression capability of shallow positioning and deep semantics. The weighted bidirectional fusion method in the three-layer BiFPN structure can be expressed by the following formulas 2, 3, and 4: (2) (3) (4) Among them, the Head module outputs a multi-scale candidate detection box feature map .

[0030] in, The number of anchors for each grid point; is the number of categories. In this embodiment (human face).

[0031] The output of each candidate detection box can be expressed by the following formula 5: (5) in, is the relative coordinate offset of the center point of the bounding box, are the predicted parameters of the width and height of the bounding box, is the confidence that the candidate box contains the target, is the probability distribution of the category to which the candidate box belongs.

[0032] Will Decoded into real coordinate form: , .

[0033] The final score of each candidate detection frame can be calculated using the following formula 6: (6) It should be noted that the YOLOv5 detection network outputs multi-scale candidate detection boxes in the Head module. Each candidate detection box contains information such as center coordinates, width and height, target confidence, and category probability.

[0034] After obtaining multiple candidate detection frames, non-maximum suppression is performed on these candidate detection frames. Redundant detection frames are removed based on their scores and intersection-over-union ratio, retaining only the optimal target detection frame. The original input image is then cropped based on the retained target detection frames to extract several standard-sized face subimages, or target face images, which serve as input for the subsequent recognition model. For example, the standard size is 224×224.

[0035] wherein, for performing Non-Maximum Suppression (NMS) on all candidate bounding boxes to remove redundant parts in the candidate bounding boxes, a target bounding box is obtained. Specifically, it includes: Suppose the intersection over union (IoU) of two candidate bounding boxes (respectively and ) is as follows Formula 7: (7) When (such as 0.5), and , remove ; finally only the optimal target bounding box is retained.

[0036] It should be noted that in the model training stage, first receive the input of the training image, and normalize the RGB three channel pixel value, scale it to the interval [0, 1], and standardize the input feature space. Subsequently, the Mosaic data enhancement strategy is introduced, four images are selected for scaling, cropping and splicing to generate new training images, which effectively improves the diversity of training samples and the generalization ability of the model. All preprocessed images are uniformly adjusted to 640x640 size for subsequent network processing.

[0037] Specifically, first obtain a plurality of training images , and perform pixel normalization on the training images by Formula 8 to obtain a plurality of normalized images.

[0038] (8) Subsequently, four different normalized images are scaled and spliced into an input image , thereby enhancing sample diversity.

[0039] After inputting the input image into the YOLOv5 detection network, a plurality of candidate bounding boxes can be obtained, and by removing redundant parts in the candidate bounding boxes, the target bounding box corresponding to each input image can be obtained. Wherein, the target bounding box set is denoted as , and according to this, each input image is cropped into a corresponding face region image .

[0040] Step 104, input the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network includes a plurality of convolution branches.

[0041] The multi-branch Xception network is structurally optimized on the basis of the original Xception, specifically:​ The multi-branch Xception network includes at least a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module includes parallel depth-separable convolution branches; inputting the target face image into the multi-branch Xception network to generate a forgery probability, including: extracting input features from the target face image based on the Stem layer; inputting the input features into the parallel depth-wise separable convolution branches, and obtain the intermediate features corresponding to each parallel depth-wise separable convolution branch; The intermediate features are spliced ​​together and the spliced ​​features are Convolution compression is performed to obtain target output features; and a forgery probability is generated based on the target output features.

[0042] It should be noted that during the intermediate feature extraction phase, multiple parallel convolutional branches are introduced, each with a different number of convolutional unit layers, to cover multi-scale feature information, from local details to global contours. The outputs (intermediate features) of each branch are combined in the fusion phase through channel concatenation and convolution compression to form a unified feature representation.

[0043] For the Stem layer, the target face image is extracted to obtain input features using the following formula 9. This includes standard convolution, batch normalization, and nonlinear activation.

[0044] (9) For the multi-branch convolution module, i.e., the multi-branch convolution structure, in the intermediate feature extraction stage, set parallel depth-wise separable convolution branches. The branch contains Unit, which refers to catch . Its recursion is: (10) (11) In summary, the branch output is recorded as . Then after channel splicing Convolution compression is used to fuse The intermediate features are spliced ​​together and the spliced ​​features are Convolution compression, this fusion process is implemented based on formula 12.

[0045] (12) in, Indicates the The branch in its the feature map output by the layer, concatenating the feature maps from branches in the channel dimension, applying a convolution operation to the concatenated feature maps for compressing the number of channels and enhancing the feature fusion effect, to the fused multi-branch feature map, and respectively represent the spatial height and width of the output feature map, representing the number of output feature map channels obtained after the convolution operation.

[0046] Thus, the uniform number of channels and the required feature representation for subsequent classification can be obtained, i.e., the target output feature is obtained.

[0047] It can be understood that, through the above design, different branches cover different receptive fields and depths, enhancing the ability of Xception to capture multi-scale and fine-grained fake clues.

[0048] In an embodiment, as shown in Figure 4 , in the convolution unit of the multi-branch convolution module, i.e., in the parallel depth separable convolution branch, the traditional ReLU activation function is replaced by a smoother Mish activation function to preserve negative value features and obtain more stable gradient propagation. Among them, the function of Mish is as shown in formula 13: wherein, is the output of the convolution layer or the fully connected layer, is the base of the natural logarithm, represents the natural logarithm function, represents the hyperbolic tangent function.

[0049] It can be understood that, compared with ReLU, Mish can provide smoother gradients while preserving negative value information, which is beneficial to the continuous expression and stable training of subtle fake textures.

[0050] After obtaining the target output feature, the target output feature can be processed through a hybrid pooling strategy, and then a fake probability is generated through a fully connected layer.

[0051] That is, before classification output, a weighted fusion strategy of global average pooling and global maximum pooling is adopted to take into account both overall statistical information and local peak response, thereby reducing the loss of fake detail features in the pooling stage. Finally, the fused feature vector is input into the fully connected layer, and the fake probability is output through the Sigmoid function, which is used to determine whether the face image is fake.

[0052] Specifically, before classification output, the target output feature First, global average pooling (GAP) and global max pooling (GMP) are performed, and then the features are fused according to learnable coefficients The fused features are obtained according to the following formula 14.

[0053] (14) wherein, .

[0054] wherein, and The channel is calculated in the spatial dimension, which can retain the overall statistics and local peak response at the same time, thereby reducing the loss of fake clues in the convergence stage.

[0055] Then, is input into the full connection layer and the sigmoid activation function to obtain the fake probability, and the process is as shown in formula 15.

[0056] (15) Step 106, determining the detection result of the face fake detection based on the fake probability.

[0057] Specifically, the preliminary classification is performed according to the fake probability, and 0.5 is usually used as the judgment threshold: when the fake probability is higher than the threshold, it is marked as fake, otherwise it is marked as real. That is, the detection result can be a classification label, and the detection result can be determined by formula 16.

[0058] (16) In addition, the detection result can also include the target detection frame position , prediction confidence, etc.

[0059] In the embodiment of the present application, a method for detecting fake human faces based on improved YOLOv5 and multi-branch Xception is proposed, which comprises the following steps: determining a target human face image; the target human face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; a PAN+FPN structure of a Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; the target human face image is input into a multi-branch Xception network to generate a fake probability; the multi-branch Xception network comprises multiple convolution branches; and a detection result of human face fake detection is determined based on the fake probability. The method improves the detection accuracy of the human face fake detection method by cropping the image and then inputting the cropped target human face image into the multi-branch Xception network for human face fake detection instead of directly inputting the target human face image into the multi-branch Xception network for human face fake detection. The reason is that the fake area often only appears in a small part of the image, and the whole image classification may cover up the fake features, thereby reducing the detection accuracy. However, the classification based on the cropped target human face image can avoid covering up the fake features, thereby making the detection method sensitive to the regional information of the image and improving the detection accuracy.

[0060] In an embodiment, the detection result can be superimposed on the original input image for further decision-making processing by the user or the system. For example, the annotation information (detection result) is intuitively presented in the image, which facilitates the user to quickly understand the detection result. The detection result can be used as an input basis for subsequent application systems such as security audit, image tracing, and automatic alarm, and has good practicality and engineering integration capability.

[0061] In an embodiment, to further improve the stability and robustness of identification, the embodiment can enable a dual-model collaborative discrimination mechanism based on YOLOv5-Cls detection network and multi-branch Xception network. That is, the confidence values output by the two sub-models are weighted and fused, for example, the weight coefficients of 0.9 and 0.85 can be used to calculate the comprehensive fake probability.

[0062] The final determination result outputs a label according to the fusion value, which effectively enhances the discrimination ability for fuzzy samples and boundary samples. The process of weighting and fusing the confidence values output by the two sub-models can be realized by formula 17.

[0063] (17) If , it is marked as fake, otherwise it is real.

[0064] In summary, the embodiment of the present application combines the high-efficiency detection capability of YOLOv5 and the deep-level forgery discrimination capability of Xception to construct a face forgery detection method with high accuracy, fast response speed, and flexible structure, which can be implemented in combination with existing deep learning frameworks (such as PyTorch and TensorFlow).

[0065] In summary, for the face forgery detection method based on image classification in the related art, there is still the problem of poor robustness to complex scenes, for example, the accuracy of the whole-image classification model decreases significantly after the image is compressed, occluded, blurred, etc.

[0066] The applicant found that the reason for the poor robustness to complex scenes is that: In the related art, the Xception type classification network adopts a single convolution branch structure, which limits the parallel extraction capability of multi-scale features; the activation function is mostly ReLU, which easily causes the loss of negative value information; and the final feature convergence usually only adopts global average pooling, which is difficult to simultaneously retain the overall features and local peak features. These limitations will lead to the difficulty of fully capturing the forgery details, reducing the robustness of the model in multi-source data and complex distortion scenes.

[0067] Therefore, the embodiment of the present application introduces a multi-branch convolution structure in the intermediate feature extraction stage, adopts an improved Mish activation function, and utilizes a hybrid pooling strategy in the classification output stage to enhance the capture capability of fine-grained forgery features and the adaptability of the model, thereby improving the robustness of the model in multi-source data and complex distortion scenes.

[0068] It should be understood that although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0069] Based on the same inventive concept, the application also provides a fake face detection device for implementing the above-mentioned fake face detection method based on the improved YOLOv5 and multi-branch Xception. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more fake face detection device embodiments provided below can be referred to the limitations of the fake face detection method based on the improved YOLOv5 and multi-branch Xception in the above, which will not be repeated here.

[0070] In one exemplary embodiment, as shown in Figure 5 A fake face detection device is provided, comprising: an image processing module 100, a fake identification module 200, and a fake judgment module 300, wherein: The image processing module 100 is configured to determine a target face image, wherein the target face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; and a PAN+FPN structure of a Neck module in the YOLOv5 detection network is replaced with a three-layer BiFPN structure. The fake identification module 200 is configured to input the target face image into a multi-branch Xception network to generate a fake probability, wherein the multi-branch Xception network comprises a plurality of convolution branches. The fake judgment module 300 is configured to determine a detection result of the fake face detection based on the fake probability.

[0071] In one embodiment, the fake face detection device further comprises: An acquisition module configured to acquire a plurality of training images. A normalization module configured to perform pixel normalization processing on the training images to obtain a plurality of normalized images. A scaling and splicing module configured to scale and splice the normalized images to obtain an input of the YOLOv5 detection network.

[0072] In one embodiment, the image processing module 100 is specifically configured to: Determine an original input image. Input the original input image into the YOLOv5 detection network to obtain a plurality of candidate detection frames. Remove redundant parts in the candidate detection frames based on non-maximum suppression to obtain a target detection frame. Crop a target face image from the original input image based on the target detection frame.

[0073] In one embodiment, the multi-branch Xception network comprises at least a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module comprises Parallel depth-wise separable convolution branches; the counterfeit identification module 200 is specifically used to: Extracting input features from the target face image based on the Stem layer; Input the input features into the parallel depth-wise separable convolution branches to obtain the intermediate features corresponding to each parallel depth-wise separable convolution branch; right The intermediate features are spliced ​​together and the spliced ​​features are Convolution compression to obtain target output features; A forgery probability is generated based on the target output feature.

[0074] In one embodiment, the activation function in the parallel depthwise separable convolution branch is Mish, and the function of Mish is expressed as follows: in, is the output of the convolutional layer or the fully connected layer, is the base of natural logarithms, represents the natural logarithm function, represents the hyperbolic tangent function.

[0075] In one embodiment, the counterfeit identification module 200 is further configured to: Perform global average pooling and global maximum pooling operations on the target output features to obtain pooled features; The pooled features are input to the fully connected layer to generate the forgery probability.

[0076] In one embodiment, the forgery determination module 300 is specifically configured to: Performing a weighted summation on the confidence provided by the YOLOv5 detection network and the forgery probability to obtain a comprehensive forgery probability; Based on the comprehensive forgery probability, a detection result of face forgery detection is determined.

[0077] Each module in the aforementioned forged face detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor within a computer device in hardware form, or stored in a computer device memory in software form, allowing the processor to call and execute the corresponding operations of each module.

[0078] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to implement a kind of based on the improved YOLOv5 and multi-branch Xception fake face detection method.

[0079] Those skilled in the art can understand that, Figure 6 The skilled in the art can understand that,

[0080] In one exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the following steps: determining a target face image; the target face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; the PAN+FPN structure of the Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; inputting the target face image into a multi-branch Xception network to generate a fake probability; the multi-branch Xception network includes multiple convolution branches; determining a detection result of face fake detection based on the fake probability.

[0081] In one embodiment, the processor executes the computer program to further implement the following steps: obtaining a plurality of training images; performing pixel normalization processing on the training images to obtain a plurality of normalized images; scaling and splicing the normalized images to obtain the input of the YOLOv5 detection network.

[0082] In one embodiment, the processor executes the computer program to further implement the following steps: determining an original input image; inputting the original input image into the YOLOv5 detection network to obtain a plurality of candidate bounding boxes; based on non-maximum suppression, removing redundant parts in the candidate bounding boxes to obtain target bounding boxes; based on the target bounding boxes, cropping a target face image from the original input image.

[0083] In one embodiment, the processor executing the computer program also implements the following steps: The multi-branch Xception network at least includes a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module includes a plurality of parallel depth separable convolution branches; based on the Stem layer, extracting input features from the target face image; inputting the input features into the a plurality of parallel depth separable convolution branches to obtain intermediate features corresponding to each parallel depth separable convolution branch; performing channel splicing on the intermediate features, and performing convolution compression on the spliced features to obtain target output features; based on the target output features, generating a forgery probability.

[0084] In one embodiment, the activation function in the parallel depth separable convolution branch is Mish, and the function of Mish is as follows: wherein, is the output of the convolution layer or the fully connected layer, is the base of the natural logarithm, represents the natural logarithm function, represents the hyperbolic tangent function.

[0085] In one embodiment, the processor executing the computer program also implements the following steps: performing global average pooling and global maximum pooling operations on the target output features to obtain pooled features; inputting the pooled features into a fully connected layer to generate a forgery probability.

[0086] In one embodiment, the processor executing the computer program also implements the following steps: weighting and summing the confidence provided by the YOLOv5 detection network and the forgery probability to obtain a comprehensive forgery probability; based on the comprehensive forgery probability, determining a detection result of face forgery detection.

[0087] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the following steps: determining a target face image; the target face image is obtained by cropping the original input image based on a target detection frame provided by a YOLOv5 detection network; a PAN+FPN structure of a Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; inputting the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network includes multiple convolution branches; based on the forgery probability, determining a detection result of face forgery detection.

[0088] In one embodiment, the processor further implements the following steps when executing the computer program: obtaining multiple training images; performing pixel normalization processing on the training images to obtain multiple normalized images; scaling and splicing the normalized images to obtain the input of the YOLOv5 detection network.

[0089] In one embodiment, the processor further implements the following steps when executing the computer program: determining an original input image; inputting the original input image into the YOLOv5 detection network to obtain multiple candidate detection frames; based on non-maximum suppression, removing redundant parts in the candidate detection frames to obtain a target detection frame; based on the target detection frame, cropping a target face image from the original input image.

[0090] In one embodiment, the processor further implements the following steps when executing the computer program: The multi-branch Xception network at least includes a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module includes a plurality of parallel deep separable convolution branches; based on the Stem layer, extracting an input feature from the target face image; inputting the input feature into the a plurality of parallel deep separable convolution branches to obtain an intermediate feature corresponding to each parallel deep separable convolution branch; channel splicing is performed on the convolution compression is performed on the spliced feature to obtain a target output feature; ​generate a forgery probability based on the target output feature.

[0091] In one embodiment, the activation function in the parallel deep separable convolution branch is Mish, and a function representation of the Mish is as follows: wherein, is an output of a convolutional layer or a fully connected layer, is a base of a natural logarithm, represents a natural logarithm function, represents a hyperbolic tangent function.

[0092] In one embodiment, the processor, when executing the computer program, further implements the following steps: performing a global average pooling operation and a global maximum pooling operation on the target output feature to obtain a pooled feature; inputting the pooled feature into a fully connected layer to generate a forgery probability.

[0093] In one embodiment, the processor, when executing the computer program, further implements the following steps: performing a global average pooling operation and a global maximum pooling operation on the target output feature to obtain a pooled feature; determining a detection result of the face forgery detection based on the comprehensive forgery probability.

[0094] In one embodiment, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the following steps: determining a target face image; the target face image is obtained by cropping an original input image based on a target detection frame provided by a YOLOv5 detection network; a PAN+FPN structure of a Neck module in the YOLOv5 detection network is replaced by a three-layer BiFPN structure; inputting the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network comprises a plurality of convolution branches; determining a detection result of the face forgery detection based on the forgery probability.

[0095] In one embodiment, the processor, when executing the computer program, further implements the following steps: obtaining a plurality of training images; performing pixel normalization processing on the training images to obtain a plurality of normalized images; scaling and splicing the normalized images to obtain an input of the YOLOv5 detection network.

[0096] In one embodiment, the processor, when executing the computer program, also implements the following steps: determining an original input image; inputting the original input image into the YOLOv5 detection network to obtain a plurality of candidate detection boxes; based on the non-maximum suppression, removing redundant parts in the candidate detection boxes to obtain target detection boxes; based on the target detection boxes, cropping a target face image from the original input image.

[0097] In one embodiment, the processor, when executing the computer program, also implements the following steps: The multi-branch Xception network at least includes a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module includes a plurality of parallel depth separable convolution branches; based on the Stem layer, extracting input features from the target face image; inputting the input features into the a plurality of parallel depth separable convolution branches to obtain intermediate features corresponding to each parallel depth separable convolution branch; concatenating the intermediate features, and performing convolution compression on the concatenated features to obtain target output features; based on the target output features, generating a forgery probability.

[0098] In one embodiment, the activation function in the parallel depth separable convolution branch is Mish, and the function of Mish is as follows: wherein, is the output of the convolution layer or the fully connected layer, is the base of the natural logarithm, represents the natural logarithm function, represents the hyperbolic tangent function.

[0099] In one embodiment, the processor, when executing the computer program, also implements the following steps: performing global average pooling and global maximum pooling operations on the target output features to obtain pooled features; inputting the pooled features into a fully connected layer to generate a forgery probability.

[0100] In one embodiment, the processor, when executing the computer program, also implements the following steps: weighting and summing the confidence provided by the YOLOv5 detection network and the forgery probability to obtain a comprehensive forgery probability; Based on the comprehensive forgery probability, a detection result of face forgery detection is determined.

[0101] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. In the embodiments of the present application, any reference to memory, database or other medium 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 storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive 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. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments of the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments of the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0102] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0103] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A fake face detection method based on improved YOLOv5 and multi-branch Xception, characterized in that: The method comprises: Determine a target face image; the target face image is obtained by cropping the original input image based on the target detection frame provided by the YOLOv5 detection network; the PAN+FPN structure of the Neck module in the YOLOv5 detection network is replaced with a three-layer BiFPN structure; Inputting the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network includes multiple convolution branches; Based on the forgery probability, a detection result of face forgery detection is determined.

2. The forged face detection method based on improved YOLOv5 and multi-branch Xception according to claim 1 is characterized in that During the training phase, the input of the YOLOv5 detection network is obtained, including: Get multiple training images; Performing pixel normalization processing on the training image to obtain a plurality of normalized images; The normalized images are scaled and concatenated to obtain the input of the YOLOv5 detection network.

3. The forged face detection method based on improved YOLOv5 and multi-branch Xception according to claim 1 is characterized in that Determining the target facial image includes: Determine the original input image; Input the original input image into the YOLOv5 detection network to obtain multiple candidate detection frames; Based on non-maximum suppression, redundant parts of the candidate detection frame are eliminated to obtain the target detection frame; A target face image is obtained by cropping the original input image based on the target detection frame.

4. The forged face detection method based on improved YOLOv5 and multi-branch Xception according to claim 3 is characterized in that The multi-branch Xception network includes at least a multi-branch convolution module and a Stem layer, wherein the multi-branch convolution module includes parallel depth-wise separable convolution branches; inputting the target face image into a multi-branch Xception network to generate a forgery probability, including: Extracting input features from the target face image based on the Stem layer; Input the input features into the Parallel depth-wise separable convolution branches are constructed to obtain the intermediate features corresponding to each parallel depth-wise separable convolution branch; right The intermediate features are spliced ​​together and the spliced ​​features are Convolution compression to obtain target output features; A forgery probability is generated based on the target output feature.

5. The forged face detection method based on improved YOLOv5 and multi-branch Xception according to claim 4 is characterized in that, The activation function in the parallel depth-wise separable convolution branch is Mish, and the function of Mish is expressed as follows: in, is the output of the convolutional layer or the fully connected layer, is the base of natural logarithms, represents the natural logarithm function, represents the hyperbolic tangent function.

6. The forged face detection method based on improved YOLOv5 and multi-branch Xception according to claim 5, characterized in that: Generating a forgery probability based on the target output feature includes: Perform global average pooling and global maximum pooling operations on the target output features to obtain pooled features; The pooled features are input into the fully connected layer to generate the forgery probability.

7. The forged face detection method based on improved YOLOv5 and multi-branch Xception according to claim 5, characterized in that: The determining of a detection result of face forgery detection based on the forgery probability includes: Performing a weighted summation on the confidence provided by the YOLOv5 detection network and the forgery probability to obtain a comprehensive forgery probability; Based on the comprehensive forgery probability, a detection result of face forgery detection is determined.

8. A forged face detection device, characterized in that: The device comprises: An image processing module is configured to determine a target face image; the target face image is obtained by cropping the original input image based on a target detection frame provided by a YOLOv5 detection network; and the PAN+FPN structure of the Neck module in the YOLOv5 detection network is replaced with a three-layer BiFPN structure. a forgery identification module, configured to input the target face image into a multi-branch Xception network to generate a forgery probability; the multi-branch Xception network includes multiple convolution branches; The forgery judgment module is used to determine the detection result of face forgery detection based on the forgery probability.

9. A computer device, characterized in that: The invention comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the forged face detection method based on improved YOLOv5 and multi-branch Xception are implemented as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the forged face detection method based on improved YOLOv5 and multi-branch Xception are implemented as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Face forgery detection method based on image block disruption

    CN113269167A

  • Small target detection method based on adaptive feature fusion redundancy optimization

    CN114078230A

  • Living body detection method and living body detection device

    CN115331315A

  • Face forgery detection system and method based on convolutional neural network

    CN116824708A

  • Face attribute recognition method and system based on multistage multi-scale feature fusion

    CN119380388A