A multi-task face detection method and device, electronic equipment and storage medium
By improving the YOLO v7 model, combining face region and key point detection, and adopting a multi-task framework and a specific loss function, the accuracy and speed issues of traditional face detection algorithms in complex environments are solved, achieving efficient face detection.
Patent Information
- Application Number
- CN202310250509.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-03-15
AI Technical Summary
Existing traditional face detection algorithms require time-consuming manual feature annotation, and in the context of big data, existing technologies are difficult to adapt to changes in face size and scene diversity, resulting in insufficient detection accuracy and speed.
An improved YOLO v7 model is adopted, which combines a multi-task framework for face region detection and keypoint detection. The least squares method and cross-entropy loss function are used, and a multi-task shared feature space is formed through the SPPCSPC module and PFLD network to improve detection accuracy and speed.
It improves the accuracy and generalization of face detection in complex environments, maintains detection speed, and achieves efficient face detection in indoor and public transportation settings.
Smart Images

Figure CN116189269B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of face detection, in particular to a multi-task face detection method and device, electronic equipment and storage medium. BACKGROUND
[0002] With the continuous improvement of the current social informatization degree and the application of deep learning algorithm, target detection, as one of the important research directions in the field of computer vision, has been widely applied in the interaction between virtual world and real world, unmanned driving, intelligent sensing, robot positioning and other industrial fields. As one of the sub-tasks of target detection, face detection technology has also been increasingly concerned and discussed by scholars.
[0003] Early face detection is to find out whether a given image contains a face, and if so, to determine the distribution position of the face in the image. Face detection originated from face recognition, which is an early step in the face recognition process, and is also an indispensable early step for key point positioning, face attribute, expression recognition and other tasks, which is directly related to whether these problems can be well solved.
[0004] In the existing traditional face detection method and the face detection method combined with deep learning, the traditional face detection method is generally a face detection algorithm based on manual features, such as a face skin color model or a face shape model and template matching. However, this kind of traditional face detection algorithm based on manual features needs to manually label the face features in advance. Although it has high accuracy, manual labeling is too time-consuming and is not suitable for detection of a large number of samples. Especially in the era of big data and informatization, the traditional face detection algorithm based on manual features is obviously not realistic.
[0005] In addition, the form of face may be different in different scenes. When information is collected, such as during security check, it is a large target of a single face, while the image captured by the camera may appear several people and small faces, which requires us to consider the problem of face size change when designing the network and to enhance the generalization of the improved model. SUMMARY
[0006] Therefore, the purpose of the present application is to provide a multi-task face detection method, device, electronic equipment and storage medium, which forms a multi-task framework with face region detection as the main task and face key point detection as the auxiliary task, to improve the face detection accuracy while ensuring the detection speed.
[0007] In the first aspect, the present application provides a multi-task face detection method, comprising the following steps:
[0008] Obtaining an image to be detected, and processing the image to a fixed size;
[0009] The fixed-size image is input into the trained YOLO v7 improved model for processing, the YOLO v7 improved model comprising a sequentially connected backbone network, a neck network, a detection network composed of a parallel face region detection head and a face key point detection head, and a result fusion output network;
[0010] When the image to be detected contains a face, the output result is a face detection candidate frame and labeled face key points.
[0011] Further, in the YOLO v7 improved model, the face region detection head uses the least square method as the loss function, and the face key point detection head uses the cross-entropy loss function.
[0012] Further, the neck network adopts the SPPCSPC module, including a CBS block and four different maxpool branches.
[0013] The CBS block is composed of a convolution layer, a batch normalization layer and an activation function sliu.
[0014] Among them, the CBS block with a convolution kernel k=1 and a step s=1 is used to change the number of channels; the CBS block with a convolution kernel k=3 and a step s=1 is used for feature extraction; and the CBS block with a convolution kernel k=3 and a step s=2 is used for down-sampling.
[0015] Further, the face key point detection head is a PFLD network model, including a main network and an auxiliary network.
[0016] The main network is used to predict the position of the feature point, including a plurality of bottleneck layers using mobilenet v2, three parallel multi-scale convolution layers, and a fully connected layer connecting features of multiple scales.
[0017] The auxiliary network is used to predict the face pose during training.
[0018] Further, the loss function of the YOLO v7 improved model is:
[0019]
[0020] wherein, represents a set of feature vectors in the multi-task shared feature space, and the corresponding label is is a binary attribute, representing the face detection region, represents the two-dimensional coordinates of the 98 key points of the face; the linear function f(x i ; W f )=(W f ) T xi softmax function denotes the jth column of the matrix; penalize large weights W = {W f , W a}; W a denotes the weight of the face key point task; W f is the weight of the main task face region detection.
[0021] Further, the image is processed to a size of 640*640.
[0022] Further, the number of face key points is 98.
[0023] In a second aspect, the present application further provides a multi-task face detection device, comprising:
[0024] An image acquisition module is configured to acquire an image to be detected and process the image to a fixed size;
[0025] A face detection module is configured to input the image of the fixed size into a trained YOLO v7 improved model for processing, wherein the YOLO v7 improved model comprises a backbone network, a neck network, a detection network composed of a face region detection head and a face key point detection head in parallel, and a result fusion output network connected in sequence;
[0026] A result output module is configured to output a face detection candidate frame and labeled face key points as a result when the image to be detected contains a face.
[0027] In a third aspect, the present application further provides an electronic device, comprising:
[0028] at least one memory and at least one processor;
[0029] The memory is configured to store one or more programs;
[0030] When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of the multi-task face detection method according to any one of the first aspect of the present application.
[0031] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the multi-task face detection method according to any one of the first aspect of the present application.
[0032] The application provides a multi-task face detection method and device, electronic equipment and a storage medium, which form a multi-task framework mainly for face region detection and supplemented by face key point detection in the improved YOLOv7 model, improve the face detection accuracy in different environments such as indoor and public transportation places, and further improve the generalization of the model, balance the detection accuracy and speed, and improve the detection accuracy while maintaining the speed advantage.
[0033] For better understanding and implementation, the application is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 A step schematic diagram of a multi-task face detection method provided by the application;
[0035] Figure 2 A YOLO v7 improved network model structure schematic diagram used in a preferred embodiment;
[0036] Figure 3 A structure schematic diagram of the SPPCSPC module;
[0037] Figure 4 A structure schematic diagram of the CBS module;
[0038] Figure 5 A structure schematic diagram of the PFLD network model;
[0039] Figure 6 A structure schematic diagram of the PFLD backbone network part;
[0040] Figure 7 A verification comparison result of the YOLO v7 improved network model and the existing YOLO v7 network model provided by the application using the data set WFLW;
[0041] Figure 8 A structure schematic diagram of a multi-task face detection device provided by the application. DETAILED DESCRIPTION
[0042] To make the purpose, technical scheme and advantages of the application clearer, the application embodiments will be further described in detail below with reference to the drawings.
[0043] It should be clear that the described embodiments are only part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor belong to the protection scope of the application embodiments.
[0044] The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the application and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It also will be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0045] The following description refers to the accompanying drawings. Wherever possible, the same reference numbers in different drawings refer to the same or similar elements. The following exemplary embodiments described are not meant to be limiting of all the possible embodiments of the application. Rather, they are example only as the application is defined by the appended claims. In the description of the application, the terms "first", "second", "third", etc. are used merely as labels, and are not intended to signify relative importance or a chronology. These terms are simply used to distinguish one element from another. The specific meaning of these terms will be apparent from the specific context of usage.
[0046] In addition, in the description of the application, "multiple" means two or more, unless otherwise specified. "And / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship.
[0047] To solve the problems in the background art, the application provides a multi-task face detection method, as shown in Figure 1 The method comprises the following steps:
[0048] S01: Obtain an image to be detected, and process the image to a fixed size.
[0049] In a specific application scenario, the image to be detected is a single image captured by a camera. In other verification, testing, comparison, and other scenarios, it can also be a single image in a data set. For example, when verifying the feasibility of the algorithm in the early stage of the application, the input data is a single image in the WFLW data set.
[0050] The dataset WFLW for face detection contains 10,000 face images, 7,500 of which are used for training and 2,500 for testing, and 98 key points are marked on the face images. The picture size in the WFLW dataset is inconsistent, resulting in input pictures of different sizes. According to the literature consulted, consistent picture size helps improve detection accuracy and speed. Therefore, the patent first processes the picture size to 640*640. The patent uses the PyTorch framework and is completed on the Win10 platform.
[0051] Since there are 10,000 pictures in the WFLW dataset, if manual cropping is performed, a large amount of unnecessary time and effort will be wasted, and the effort will not be worth it. Therefore, Python code is used to realize batch change of picture size to uniform size. The patent uses the Image class in the third-party image processing tool PIL (Python Image Library) in Python to process the image, and uses the os class to modify and save the image.
[0052] S02: input the image of the fixed size into the trained YOLO v7 improved model for processing, wherein the YOLO v7 improved model comprises a backbone network, a neck network, a detection network composed of a face region detection head and a face key point detection head in parallel, and a result fusion output network connected in sequence.
[0053] In one specific embodiment, the structure of the YOLO v7 improved model used by the present application is as follows Figure 2As shown, the improved YOLO v7 network model is still essentially the same as the original YOLO v7 network model without changing the Encoder-Decoder mode. The encoder is composed of a backbone and a neck. YOLO v7 selects ELAN module in the backbone. ELAN module is an efficient network structure. It can make the network learn more features and have stronger robustness by controlling the shortest and longest gradient paths, and support feature propagation and feature reuse, thereby reducing parameters and computational complexity, thus ensuring the ability of real-time detection. In the neck, SPPCSPC module is used to fuse the features generated by the backbone. The role of SPP is to increase the receptive field, so that the algorithm can adapt to different resolution images; the CSP module can reduce the computational complexity, while ensuring the speed and improving the detection accuracy. In the decoder, a face key point detection head is added innovatively, so that the two tasks use two specific decoders. The face region detection head uses the PAN structure, a bottom-up feature pyramid network, which migrates the position features from bottom to top. Then the different scale fusion feature maps of the PAN structure are directly predicted. The face key point detection head uses the idea of hierarchical regression, which gradually refines the key point position from coarse to fine, and the final detection result is the fusion of the three networks.
[0054] S03: When the image to be detected contains a face, output the result as a face detection candidate frame and labeled face key points.
[0055] In the pre-training and verification of the present application, the WFLW data set with 98 key points labeled on the face image is used, therefore, the output result is a face detection candidate frame and 98 face key points are labeled.
[0056] In view of the complexity of the face detection environment, such as occlusion, pose change, light change, etc., to improve the face detection accuracy in different environments, such as indoor, public transportation, etc., in an preferred embodiment, the present application forms a task of face region detection as the main task and face key point detection as the auxiliary task in the improved YOLO v7 model. In multi-task learning, due to the different learning difficulties, if the same loss weight is used, it will lead to the difficulty of learning task convergence, therefore, in the improved YOLO v7 model, the present application adopts the least square method as the loss function for the main task-face region detection, and the cross-entropy loss function for the auxiliary task-face key point detection, as follows:
[0057]
[0058] The SPPCSPC module is adopted at the neck network of the model. The role of the SPP is to increase the receptive field, so that the algorithm can adapt to different resolution images. It obtains different receptive fields through max pooling. Specifically, as shown in Figure 3 Fig. 8, there are four branches of maxpool, which are 5, 9, 13, and 1. The four different maxpools represent that they can process different objects, that is, the four different scale maxpools have four receptive fields, which are used to distinguish large targets and small targets.
[0059] The CSP module first divides the features into two parts, one of which is processed regularly, and the other is processed by the SPP structure. Finally, the two parts are combined together, which can reduce the amount of calculation and improve the detection accuracy while ensuring the speed. Among them, as shown in Figure 4 Fig. 9, the CBS block in the SPPCSPC module is composed of a convolution layer (conv), a batch normalization layer (BN), and an activation function sliu. The activation function sliu is a variant of the swish activation function, and its calculation formula is:
[0060] sliu = x·sigmoid(x)
[0061] The convolution kernel (k) and the step (s) of the CBS blocks of different colors are different, as shown in Figure 4 Fig. 10. They are respectively used to change the channel number (k = 1, s = 1), feature extraction (k = 3, s = 1), and down sampling (k = 3, s = 2).
[0062] In order to improve the accuracy while maintaining the detection speed after adding key point detection, in the face key point detection head part shown in Figure 2 Fig. 11, this paper refers to the PFLD model framework, as shown in Figure 5 Fig. 12. The PFLD model is a lightweight network and has real-time performance and high accuracy, which meets the purpose of the present patent. The face key point detection head adopts the idea of hierarchical regression, gradually accurately locating the key points from coarse to fine. The final detection result is the fusion of three networks. The fusion is as shown in Figure 6 Fig. 13. If the input image size is 640x640x3, it becomes 80x80x16 after passing through the MobileNet v2 module, becomes 40x40x32 after passing through a 3x3 convolution network, and finally becomes 1x1x128 in size after passing through a 20x20 convolution network. The three output data 80x80x16, 40x40x32, and 1x1x128 obtained in turn are input into the full connection layer, and the final output is obtained.
[0063] In the specific model training and improvement process, it is found that the difficulty of multi-task learning is that different tasks have different characteristics and different convergence speeds. In view of the two problems, the tasks-constrained deep model and the task-wise early stopping method proposed by the author of TCNDN are referred to for solving. The tasks-constrained deep model is used to solve the weight distribution problem, and the least square method is used as the loss function for the main task, i.e. face region detection, and the cross entropy loss function is used for the auxiliary task, i.e. face key point detection, as follows:
[0064]
[0065] A set of feature vectors in the multi-task shared feature space is represented, and the corresponding label is is a binary attribute, representing the face detection region, represents the two-dimensional coordinates of the 98 key points of the face. The linear function f(x i ; W f ) = (W f ) T x i ; softmax function represents the jth column of the matrix. The penalty of large weight W = {W f , {W a}}. {W a} represents the set of all auxiliary task weights, and in the present patent, the auxiliary task is only face key point detection, that is, {W a} is the weight of the face key point task. W f is the weight of the main task, i.e. face region detection.
[0066] The task-wise early stopping is to solve the problem that the convergence speeds of different tasks are difficult to unify. When the auxiliary task reaches the best, i.e. it does not help the main task, it is stopped. As shown in the following formula, the former part represents the trend of training error, and the latter part represents the generalization error compared with the training error. If the product of the two exceeds a certain threshold, the task is terminated.
[0067]
[0068] and are the values of the loss function of task a on the validation set and the training set, t represents the current iteration number, k represents the training length, med represents the median, and λ ais the important coefficient of the a-th task error, which can be learned by gradient descent.
[0069] In one specific embodiment, the multi-task face detection method and the improved YOLO v7 model provided by the present application are evaluated in the following manner:
[0070] As a kind of target detection task, face detection usually uses precision (Precision) and recall (Recall) in binary classification as evaluation indicators. Precision represents how many of the predicted positive samples are correct, and in face detection, it generally refers to how many faces are in the detected face bounding box. Recall represents how many of the total positive samples are successfully predicted, and in face detection, it represents the face detection rate, which refers to how many faces are detected in the total faces.
[0071] The values of precision and recall are calculated by TP (True Positive), TN (True Negative), FP (False Positive) and FN (False Negative). TP represents a positive sample that is correctly predicted; TN represents a negative sample that is correctly predicted; FP represents a positive sample that is incorrectly predicted; and FN represents a negative sample that is incorrectly predicted. Details are shown in Table 1:
[0072] Table 1 Sample classification
[0073] True situation Predicted true Predicted false Positive TP (True Positive) FN (False Negative) Negative FP (False Positive) TN (True Negative)
[0074]
[0075]
[0076] AP (Average Precision) is one of the evaluation criteria for face detection algorithms, which is the area enclosed by the curve drawn by precision and recall. mAP (mean Average Precision) is the average value of AP calculated for different classes or different difficulties. Since face detection only distinguishes between face regions and non-face regions, here AP = mAP. The mAP calculation formula can be simplified as follows:
[0077]
[0078] In addition, in the practical application of face detection algorithms, the real-time performance of detection, i.e. detection speed FPS (Frames Per Second), should also be considered.
[0079] Specifically, asFigure 7 As shown, the dataset WFLW, which is detected on a human face and has 98 key points labeled on a human face image, verifies the face detection algorithm proposed in the patent. The improved model has a slight improvement in detection speed time compared with YOLO v7, and is faster than other existing algorithms; and has a certain improvement in detection accuracy compared with existing algorithms. The larger the y-axis, the better the detection accuracy; the smaller the x-axis, the better the detection speed.
[0080] The embodiment of the present application also provides a multi-task face detection device, as shown in the figure. Figure 8 The multi-task face detection device 400 comprises:
[0081] An image acquisition module 401 is configured to acquire an image to be detected and process the image to a fixed size;
[0082] A face detection module 402 is configured to input the image of the fixed size into a trained YOLO v7 improved model for processing, wherein the YOLO v7 improved model comprises a backbone network, a neck network, a detection network composed of a face region detection head and a face key point detection head in parallel, and a result fusion output network connected in sequence;
[0083] A result output module 403 is configured to output a face detection candidate frame and labeled face key points when the image to be detected contains a face.
[0084] Preferably, in the YOLO v7 improved model, the face region detection head adopts a least square method as a loss function, and the face key point detection head uses a cross-entropy loss function.
[0085] Preferably, the neck network adopts an SPPCSPC module, which comprises a CBS block and four different maxpool branches.
[0086] The CBS block comprises a convolution layer, a batch normalization layer and an activation function sliu.
[0087] Among them, the CBS block with a convolution kernel k = 1 and a step s = 1 is used to change the number of channels; the CBS block with a convolution kernel k = 3 and a step s = 1 is used for feature extraction; and the CBS block with a convolution kernel k = 3 and a step s = 2 is used for down-sampling.
[0088] Preferably, the face key point detection head is a PFLD network model, which comprises a main network and an auxiliary network.
[0089] The main network is configured to predict the position of a feature point, and comprises a plurality of bottleneck layers of a mobilenet v2, three parallel multi-scale convolution layers, and a fully connected layer for connecting features of multiple scales.
[0090] The auxiliary network is used to predict the face pose during training.
[0091] Preferably, the loss function of the YOLO v7 improved model is:
[0092]
[0093] wherein, represents a set of feature vectors in the multi-task shared feature space, and the corresponding label is is a binary attribute, representing the face detection area, represents the two-dimensional coordinates of the 98 key points of the face; the linear function f(x i ; W f ) = (W f ) T x i ; the softmax function represents the jth column of the matrix; the penalty large weight W = {W f , {W a}}; {W a} represents the weight of the face key point task; W f is the weight of the main task face area detection.
[0094] Preferably, the image is processed to a size of 640*640.
[0095] Preferably, the number of face key points is 98.
[0096] For the device embodiment, since it basically corresponds to the method embodiment, the related parts can be referred to the part of the method embodiment. The device embodiment described above is only illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units. It can be clearly understood by those skilled in the art that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be described here.
[0097] The embodiments of the present application also provide an electronic device, comprising:
[0098] at least one memory and at least one processor;
[0099] The memory is used to store one or more programs.
[0100] When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of the multi-task face detection method as described above.
[0101] For the device embodiment, since it basically corresponds to the method embodiment, the relevant part is described in the part of the method embodiment. The device embodiment described above is only illustrative, wherein the components described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present disclosure according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0102] The embodiment of the present application also provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the multi-task face detection method as described above.
[0103] The computer readable storage medium includes permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0104] The multi-task face detection method, device, electronic equipment and storage medium provided by the present application form a multi-task framework mainly for face region detection and supplemented by face key point detection in the improved YOLOv7 model, improve the face detection accuracy in different environments such as indoor, public transportation and other places, and further improve the generalization of the model, maintain the detection speed advantage while improving the detection accuracy, and make a corresponding balance between detection accuracy and detection speed.
[0105] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which are within the scope of protection of the present application.
Claims
1. A multi-task face detection method, characterized in that, The method comprises the following steps: acquire an image to be detected, and process the image to a fixed size; input the image of the fixed size into a trained YOLO v7 improved model for processing, the YOLO v7 improved model comprising a backbone network, a neck network, a detection network composed of a face region detection head and a face key point detection head in parallel, and a result fusion output network; in the YOLO v7 improved model, the face region detection head adopts a least square method as a loss function, and the face key point detection head uses a cross-entropy loss function; the neck network adopts an SPPCSPC module, comprising a CBS block and four different maxpool branches; the CBS block is composed of a convolution layer, a batch normalization layer and an activation function sliu; wherein the CBS block with a convolution kernel k=1 and a step length s=1 is used to change the number of channels; the CBS block with a convolution kernel k=3 and a step length s=1 is used for feature extraction; the CBS block with a convolution kernel k=3 and a step length s=2 is used for down-sampling; the face key point detection head is a PFLD network model, comprising a main network and an auxiliary network; the main network is used for predicting the position of feature points, comprising a plurality of bottleneck layers adopting a mobilenet v2, three parallel multi-scale convolution layers, and a full connection layer connecting features of multiple scales; the auxiliary network is used for predicting a face posture during training; when the image to be detected contains a face, the output result is a face detection candidate frame and labeled face key points.
2. The multi-task face detection method of claim 1, wherein, the loss function of the YOLO v7 improved model is: where, represents a set of feature vectors in the multi-task shared feature space, and the corresponding label is ; is a binary attribute representing the face detection region, represents the two-dimensional coordinates of the 98 key points of the face; linear function ; softmax function , represents the jth column of the matrix; penalize large weights ; represents the weight of the face key point task; is the weight of the main task face region detection.
3. The multi-task face detection method according to claim 1, wherein: the image is processed to a size of 640*640.
4. The multi-task face detection method according to claim 1, wherein: the number of face key points is 98.
5. A multi-task face detection apparatus, characterized by comprising: comprise: an image acquisition module, configured to acquire an image to be detected, and process the image to a fixed size; a face detection module, configured to input the image of the fixed size into a trained YOLO v7 improved model for processing, the YOLO v7 improved model comprising a backbone network, a neck network, a detection network composed of a face region detection head and a face key point detection head in parallel, and a result fusion output network; in the YOLO v7 improved model, the face region detection head adopts a least square method as a loss function, and the face key point detection head uses a cross-entropy loss function; the neck network adopts an SPPCSPC module, comprising a CBS block and four different maxpool branches; the CBS block is composed of a convolution layer, a batch normalization layer and an activation function sliu; wherein the CBS block with a convolution kernel k=1 and a step length s=1 is used to change the number of channels; the CBS block with a convolution kernel k=3 and a step length s=1 is used for feature extraction; the CBS block with a convolution kernel k=3 and a step length s=2 is used for down-sampling; the face key point detection head is a PFLD network model, comprising a main network and an auxiliary network; The main network is used for predicting the position of feature points, comprising a plurality of bottleneck layers of mobilenet v2, 3 parallel multi-scale convolution layers, and a full connection layer connecting features of multiple scales; The auxiliary network is used for predicting a face posture during training; An output module is configured to output a result as a face detection candidate frame and a marked face key point when the image to be detected contains a face.
6. An electronic device, comprising: Comprise: At least one memory and at least one processor; The memory is configured to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of the multi-task face detection method according to any one of claims 1-4. 7.A computer readable storage medium, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the multi-task face detection method according to any one of claims 1-4.