Face detection method, device, storage medium and equipment

By combining the face detection sub-network and the key point detection sub-network, and using multi-size feature maps for detection, the problem of large model size and complex training in the existing technology is solved, efficient face detection on mobile terminals is achieved, and detection is simplified. The training process of the network.

CN111126358BActive Publication Date: 2024-08-23BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010117409.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-25
Publication Date
2024-08-23
Estimated Expiration
2040-02-25

AI Technical Summary

Technical Problem

The existing technology requires independent training of three separate networks in face detection, resulting in a large model size and difficulty in applying to mobile terminals, and the training process of the detection network is complicated.

Method used

Through the pre-trained detection network model, combined with the face detection sub-network and key point detection sub-network, multi-size feature maps are used for face detection and key point detection, so that only one detection network model can be trained to complete the detection task, and The lightweight MobileNets convolution method is used to perform convolution operations to reduce computational complexity.

Benefits of technology

The training process of the detection network model is simplified, making the model smaller and easier to apply to mobile terminals, while improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111126358B
    Figure CN111126358B
Patent Text Reader

Abstract

The present disclosure provides a face detection method, apparatus, storage medium and device, wherein the face detection method comprises: obtaining an image to be detected through a pre-trained detection network model; performing face detection on the image to be detected through a face detection subnetwork in the detection network model to extract first feature maps of different sizes from the image to be detected, and determining and outputting a face detection result based on the first feature map, wherein the face detection result includes position information of the face in the image to be detected; obtaining at least two first feature maps selected from the first feature maps of different sizes from the face detection subnetwork through a key point detection subnetwork in the detection network model, performing key point detection on the second feature map to extract second feature maps of different sizes from the at least two first feature maps, and determining and outputting a key point detection result based on the second feature map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of face detection technology, and in particular to a face detection method, device, storage medium and equipment. Background Art

[0002] Deep learning is one of the most important breakthroughs in the field of artificial intelligence in the past decade. It has achieved great success in many fields such as speech recognition, natural language processing, computer vision, image and video analysis, multimedia, etc. Face-related image processing technology is a very important research direction in computer vision tasks. Face processing technology has a wide range of applications in identity authentication, human-computer interaction interface, intelligent visual monitoring and other fields. Face processing and analysis include face detection, face tracking and face attribute recognition, among which face detection is the key first step in all face information processing. The target detection process based on deep learning has become more and more streamlined, with higher and higher accuracy and faster speed. The optimized detection network has also achieved remarkable results in face detection. Since face technology is generally used in terminals, face detection has high requirements for model size. The detection of facial key points is used for face alignment, which helps face recognition and face attribute recognition. Usually these two functions are completed by two network models. At present, the general method is to detect the key points of the face after detecting the face. When MTCNN (Multi-Task Convolutional Neural Network) was designed, face detection and key point detection were integrated together, but this method requires independent training of three separate networks. Summary of the invention

[0003] In view of this, the purpose of the present disclosure is to provide a face detection method, device, storage medium and equipment.

[0004] According to a first aspect of the present disclosure, a face detection method is provided, comprising: acquiring an image to be detected through a pre-trained detection network model; performing face detection on the image to be detected through a face detection subnetwork in the detection network model to extract first feature maps of different sizes from the image to be detected, and determining and outputting a face detection result based on the first feature map, wherein the face detection result includes position information of the face in the image to be detected; acquiring at least two first feature maps selected from the first feature maps of different sizes from the face detection subnetwork through a key point detection subnetwork in the detection network model, performing key point detection on the second feature map to extract second feature maps of different sizes from the at least two first feature maps, and determining and outputting a key point detection result based on the second feature map, wherein the key point detection result includes position information of key points in the face in the image to be detected.

[0005] Optionally, the face detection subnetwork includes a first convolution unit, and the key point detection subnetwork includes a second convolution unit. The output end of the first convolution unit is connected to the input end of the second convolution unit. When performing a convolution operation on a feature map, the first convolution unit and the second convolution unit decompose a convolution into a depth convolution and a point convolution.

[0006] Optionally, the first convolution unit includes: a first convolution subunit, a first pooling layer, a second convolution subunit, a second pooling layer, a third convolution subunit, a third pooling layer, a fourth convolution subunit, a fourth pooling layer, a fifth convolution subunit, a fifth pooling layer, and a sixth convolution subunit connected in sequence; the second convolution unit includes: a seventh convolution subunit, an eighth convolution subunit and a ninth convolution subunit, a sixth pooling layer, a seventh pooling layer, an eighth pooling layer and a ninth pooling layer, wherein the input end of the sixth pooling layer is connected to the sixth convolution subunit, the input end of the seventh convolution subunit is connected to the output end of the fifth convolution subunit, the output end of the seventh convolution subunit is connected to the seventh pooling layer, the input end of the eighth convolution subunit is connected to the output end of the fourth convolution subunit, the output end of the eighth convolution subunit is connected to the eighth pooling layer, the input end of the ninth convolution subunit is connected to the output end of the third convolution subunit, and the output end of the ninth convolution subunit is connected to the ninth pooling layer.

[0007] Optionally, the method also includes: determining a first loss term generated by the face detection subnetwork based on the image sample and the face detection result determined by the face detection subnetwork based on the image sample; obtaining a first loss function based on the first loss term; determining a second loss term generated by the key point detection subnetwork based on the image sample and the key point detection result determined by the key point detection subnetwork based on the image sample; obtaining a second loss function based on the second loss term; performing weighted summation of the first loss function and the second loss function according to preset function weights to obtain a third loss function; and adjusting the values ​​of the parameters of the detection network model according to the third loss function.

[0008] Optionally, the key points include: the locations of the five senses of the human body.

[0009] According to a second aspect of the present disclosure, a face detection device is provided, comprising: an acquisition module, used to acquire an image to be detected through a pre-trained detection network model; a first determination module, used to perform face detection on the image to be detected through a face detection subnetwork in the detection network model, so as to extract first feature maps of different sizes from the image to be detected, and determine and output a face detection result based on the first feature map, wherein the face detection result includes position information of the face in the image to be detected; a second determination module, used to acquire at least two first feature maps selected from the first feature maps of different sizes from the face detection subnetwork through a key point detection subnetwork in the detection network model, perform key point detection on the second feature map, so as to extract second feature maps of different sizes from the at least two first feature maps, and determine and output a key point detection result based on the second feature map, wherein the key point detection result includes position information of key points in the face in the image to be detected.

[0010] Optionally, the face detection subnetwork includes a first convolution unit, and the key point detection subnetwork includes a second convolution unit. The output end of the first convolution unit is connected to the input end of the second convolution unit. When performing a convolution operation on a feature map, the first convolution unit and the second convolution unit decompose a convolution into a depth convolution and a point convolution.

[0011] Optionally, the first convolution unit includes: a first convolution subunit, a first pooling layer, a second convolution subunit, a second pooling layer, a third convolution subunit, a third pooling layer, a fourth convolution subunit, a fourth pooling layer, a fifth convolution subunit, a fifth pooling layer, and a sixth convolution subunit connected in sequence; the second convolution unit includes: a seventh convolution subunit, an eighth convolution subunit and a ninth convolution subunit, a sixth pooling layer, a seventh pooling layer, an eighth pooling layer and a ninth pooling layer, wherein the input end of the sixth pooling layer is connected to the sixth convolution subunit, the input end of the seventh convolution subunit is connected to the output end of the fifth convolution subunit, the output end of the seventh convolution subunit is connected to the seventh pooling layer, the input end of the eighth convolution subunit is connected to the output end of the fourth convolution subunit, the output end of the eighth convolution subunit is connected to the eighth pooling layer, the input end of the ninth convolution subunit is connected to the output end of the third convolution subunit, and the output end of the ninth convolution subunit is connected to the ninth pooling layer.

[0012] According to a third aspect of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the face detection methods described in the first aspect of the present disclosure is implemented.

[0013] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable the computer to execute any one of the face detection methods described in the first aspect of the present disclosure.

[0014] From the above description, it can be seen that the face detection method of one or more embodiments of the present disclosure extracts multiple first feature maps of different sizes of the image to be detected through the face detection subnetwork in the pre-trained detection network model, obtains the face detection result based on the multiple first feature maps, and then extracts the second feature map based on at least two first feature maps through the key point detection subnetwork of the detection network model, and obtains the key point detection result based on the second feature map. This achieves that only one detection network model needs to be trained to perform face detection and key point detection on the image to be detected, simplifies the training process of the detection network model, and makes the detection network model smaller, which is convenient for applying the detection network model to a mobile terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0016] Figure 1 is a flow chart of a face detection method according to an exemplary embodiment of the present disclosure;

[0017] Figure 2 is a schematic diagram of a detection network model according to an exemplary embodiment of the present disclosure;

[0018] Figure 3 is a schematic diagram showing generation of candidate frames based on feature maps according to an exemplary embodiment of the present disclosure;

[0019] Figure 4 is a block diagram of a face detection device according to an exemplary embodiment of the present disclosure;

[0020] Figure 5 It is a schematic diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0022] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0023] Figure 1 is a flowchart of a face detection method according to an exemplary embodiment of the present disclosure, the method comprising:

[0024] Step 101: Acquire an image to be detected through a pre-trained detection network model;

[0025] Optionally, the pre-trained detection network model may include a face detection subnetwork for performing face detection on an image to be detected, and a key point detection subnetwork for performing key point detection on a face detected from an image.

[0026] In the above step 101, the image to be detected may be input into a pre-trained detection network model so that the detection network model can acquire the image to be detected.

[0027] Step 102: performing face detection on the image to be detected by using the face detection subnetwork in the detection network model to extract first feature maps of different sizes from the image to be detected, and determining and outputting a face detection result according to the first feature map, wherein the face detection result includes position information of the face in the image to be detected;

[0028] Optionally, the face detection result may include a bounding box for identifying the position of the face in the image, and a category confidence that the image content within the bounding box is classified as a face. The category confidence may be expressed in the form of a percentage, for example.

[0029] Optionally, the face detection subnetwork may include multiple convolutional layers, which can be used to extract first feature maps of different sizes of the image to be detected, and obtain the face detection result based on the first feature map.

[0030] Step 103: Obtain at least two first feature maps selected from first feature maps of different sizes from the face detection subnetwork through the key point detection subnetwork in the detection network model, perform key point detection on the second feature maps to extract second feature maps of different sizes from the at least two first feature maps, and determine and output key point detection results based on the second feature maps, wherein the key point detection results include position information of key points in the face in the image to be detected.

[0031] Optionally, the key point detection subnetwork may include multiple convolutional layers, which can be used to extract second feature maps of different sizes from the first feature map extracted by the convolutional layer of the face detection subnetwork, and obtain key point detection results based on the second feature map.

[0032] The face detection method of one or more embodiments of the present disclosure extracts multiple first feature maps of different sizes of the image to be detected through a face detection subnetwork in a pre-trained detection network model, obtains a face detection result based on the multiple first feature maps, and then extracts a second feature map based on at least two first feature maps through a key point detection subnetwork of the detection network model, and obtains a key point detection result based on the second feature map. This achieves the goal of performing face detection and key point detection on the image to be detected by training only one detection network model, simplifies the training process of the detection network model, and makes the detection network model smaller, which is convenient for applying the detection network model to a mobile terminal.

[0033] In one or more embodiments of the present disclosure, the face detection subnetwork may include a first convolution unit, which may include, for example, a plurality of sequentially connected convolution layers, the key point detection subnetwork includes a second convolution unit, which may include, for example, a plurality of convolution layers, the output end of the first convolution unit is connected to the input end of the second convolution unit, the first convolution unit and the second convolution unit decompose a convolution into a depth convolution and a point convolution when performing a convolution operation on a feature map, wherein the depth convolution applies each convolution kernel to each channel, and the point convolution combines information from different channels. The above-mentioned face detection subnetwork and key point detection subnetwork may be implemented using lightweight MobileNets, for example, MobileNets-v1, which is a lightweight deep neural network that can achieve model compression while ensuring detection accuracy. The network is based on a streamlined architecture that uses depth-separable convolutions to construct a lightweight deep neural network. The network can decompose a standard convolution into a depthwise convolution and a pointwise convolution. For example, when the network is used to process the second feature map, the depthwise convolution is used to filter the feature map of each channel, and the pointwise convolution uses a 1*1 convolution kernel to integrate the information of different channels and adjust the output dimension. The computational complexity is reduced by breaking the connection between the number of output channels and the kernel size. For a convolution kernel of size 3*3, the amount of calculation is reduced by about 7 to 9 times. It can be seen that the network greatly reduces the amount of calculation and the number of parameters. And on the basis of implementing face detection and key point detection in a detection network model, the lightweight MobileNets convolution method is used for convolution operations, which can achieve fast detection while maintaining detection accuracy and improve detection efficiency.

[0034] In one or more embodiments of the present disclosure, the first convolution subunit, the first pooling layer, the second convolution subunit, the second pooling layer, the third convolution subunit, the third pooling layer, the fourth convolution subunit, the fourth pooling layer, the fifth convolution subunit, the fifth pooling layer, and the sixth convolution subunit are sequentially connected;

[0035] The second convolution unit includes: a seventh convolution subunit, an eighth convolution subunit and a ninth convolution subunit, a sixth pooling layer, a seventh pooling layer, an eighth pooling layer and a ninth pooling layer, wherein the input end of the sixth pooling layer is connected to the sixth convolution subunit, the input end of the seventh convolution subunit is connected to the output end of the fifth convolution subunit, the output end of the seventh convolution subunit is connected to the seventh pooling layer, the input end of the eighth convolution subunit is connected to the output end of the fourth convolution subunit, the output end of the eighth convolution subunit is connected to the eighth pooling layer, the input end of the ninth convolution subunit is connected to the output end of the third convolution subunit, and the output end of the ninth convolution subunit is connected to the ninth pooling layer.

[0036] The following Figure 2 Taking the detection network model shown in the figure as an example, the structure of the detection network model in one or more embodiments of the present disclosure is described. The main network structure of the detection network model can adopt a simplified VGG (Visual Geometry Group) network. First, combined with Figure 2 The face detection sub-network in the detection network model is described. The first to ninth convolution sub-units in the detection network model correspond to Figure 2Conv1 to Conv9 shown in . Among them, the Conv1 module may include conv1_1 and conv_2, conv1_1 includes 16 3*3 convolutions with a stride of 2 and a padding of 1, and a relu activation function); conv1_2 includes 16 1*1 convolutions and a relu activation function); Conv1 may be followed by a MaxPooling layer, which is an example of the first pooling layer mentioned above, and its kernel size may be 2*2, and then connected to a Conv2 module, which may include conv2_1 and conv2_2, wherein conv2_1 may include 16 3*3 convolutions with a padding of 1 Convolution and relu activation function, conv2_2 may include 16 1*1 convolutions and relu activation function, Conv2 may be followed by a MaxPooling layer, which is an example of the second pooling layer, and its kernel size may be 2*2, and then a Conv3 module; the Conv3 module may include conv3_1, conv3_2 and conv3_3, wherein conv3_1 may include 32 3*3 convolutions with padding of 1 and relu activation function, conv3_2 may include 32 1*1 convolutions and relu activation function, conv3_3 may include 32 3*3 convolutions with padding of 1 and relu activation function lu activation function, Conv3 can be followed by a MaxPooling layer, which can be an example of the third pooling layer mentioned above, and its kernel size can be 2*2, followed by a Conv4 module; the Conv4 module may include conv4_1, conv4_2, and conv4_3, wherein conv4_1 may include 64 3*3 convolutions with a padding of 1 and a relu activation function, conv4_2 may include 64 1*1 convolutions and a relu activation function, conv4_3 may include 64 3*3 convolutions with a padding of 1 and a relu activation function, followed by a MaxPooling layer, the MaxPooling layer The g layer is an example of the fourth pooling layer, whose kernel size is 2*2, and then connected to the Conv5 module; the Conv5 module may include conv5_1, conv5_2 and conv5_3, wherein conv5_1 may include 128 3*3 convolutions with padding of 1 and relu activation function, conv5_2 may include 128 1*1 convolutions and relu activation function, conv5_3 may include 128 3*3 convolutions with padding of 1 and relu activation function, followed by the MaxPooling layer, which is an example of the fifth pooling layer, whose kernel size may be 2*2, and then connected to the Conv6 module;The Conv6 module may include conv6_1, conv6_2 and conv6_3, wherein conv6_1 may include 128 3*3 convolutions with padding of 1 and a relu activation function, conv6_2 may include 128 1*1 convolutions and a relu activation function, and conv6_3 may include 128 3*3 convolutions with padding of 1 and a relu activation function. ;

[0037] The above face detection subnetwork adopts the detection principle of SSD, and uses feature maps of different sizes such as conv3-3, conv4-3, conv5-3 and conv6-3 respectively. Face classification and position regression are performed on these feature maps at the same time. The number of candidate boxes (priorbox) generated on each feature map and the scale of the candidate box are consistent with the face image. For example, the number of candidate boxes generated by conv4_3 is 2, and the minimum size of each candidate box is 32 and 48 respectively; therefore, the output channel of conv4_3_norm_mbox_loc is 8, and the output channel of conv4_3_norm_mbox_conf is 4.

[0038] The following Figure 3 Taking conv4_3 as an example, the process of generating candidate boxes is briefly described as follows: Figure 3 As shown, the conv4_3 network is divided into three paths, such as Figure 3 Path 1, Path 2 and Path 3 are marked in:

[0039] (1) Figure 3 Path 1 shown in , after batch_norm (such as Figure 3 The conv4_3_norm shown in the figure, where batchnorm is an algorithm used in deep networks to accelerate neural network training and accelerate convergence speed and stability), the generated feature map is used to classify faces and non-faces, where Conv4_3_norm_mbox_conf in path 1 represents the output channel;

[0040] (2) After batch_norm, the generated feature map is used for the regression of the candidate box, that is, the regression of the position, where Conv4_3_norm_mbox_loc in path 2 represents the output channel;

[0041] (3) Generate candidate boxes, that is, Figure 3 Conv4_3_norm_priorbox output through path 3.

[0042] Still Figure 2Taking the detection network model shown in the figure as an example, the key point detection subnetwork in the above detection network model is explained. For example, taking the input image to be detected of 320*320*3 as an example, the size of the feature map output by conv6_3 in Conv6 of the above face detection subnetwork is 5*5*128, and then connected to an average with a kernel size of 5*5 Pooling (average pooling layer), which is an example of the sixth pooling layer mentioned above, with an output dimension of 1*1*128. This pooling layer is connected to a fully connected layer, and the output is 10*1 (corresponding to the coordinates of 5 key points), and the resulting loss (loss function) is loss_key_1; the size of the feature map output by conv5_3 in Conv5 of the above face detection subnetwork is 10*10*128, which is then connected to Conv7. Conv7 includes 128 3*3 convolutions, relu functions, and an average pooling layer with a kernel size of 8*8. This pooling layer is connected to a fully connected layer, and the output is 10*1 (corresponding to the coordinates of 5 key points), and the resulting loss is loss_key_2; the size of the feature map output by conv4_3 in Conv4 of the above face detection subnetwork is 20*20*64, which is then connected to Conv8. Conv8 includes 128 kernels. Convolution of size 5*5, relu function, maximum pooling layer with kernel size 2, 128 convolutions with kernel size 1*1, relu function and average pooling layer with kernel size 8*8, a fully connected layer is connected after Conv8, the output is 10*1 (corresponding to the coordinates of 5 key points), and the loss is loss_key_3; the output size of conv3_3 in Conv3 of the above face detection subnetwork is 40*40*32, and then connected to Conv9, Conv9 includes 64 5*5 convolutions, relu function, maximum pooling layer with kernel size 2, 128 3*3 convolutions, relu function, maximum pooling layer with kernel size 2, 128 convolutions with kernel size 1*1, relu function and average pooling layer with kernel size 8*8, followed by a fully connected layer, the output is 10*1 (corresponding to the coordinates of 5 key points), and the loss is loss_key_4.

[0043] It should be noted that in Figure 2 In the detection network model shown in FIG, the first pooling layer, the second pooling layer, the third pooling layer, the fourth pooling layer and the fifth pooling layer can be considered to be included in Conv1 to Conv5, so Figure 2 The first to fifth pooling layers are not shown in the figure.

[0044] In one or more embodiments of the present disclosure, the above-mentioned face detection method may further include: determining a first loss term generated by the face detection subnetwork according to the image sample and the face detection result determined by the face detection subnetwork based on the image sample; obtaining a first loss function according to the first loss term, wherein the first loss function may use the loss function used in the SSD (Single Shot multibox Detection) network; determining a second loss term generated by the key point detection subnetwork according to the image sample and the key point detection result determined by the key point detection subnetwork based on the image sample; obtaining a second loss function according to the second loss term; performing weighted summation of the first loss function and the second loss function according to preset function weights to obtain a third loss function; and adjusting the values ​​of the parameters of the detection network model according to the third loss function. For example, assuming that when detecting an image to be detected, the loss function generated by the face detection subnetwork is loss_det, and the loss functions generated by each convolutional layer of the key point detection subnetwork listed in the above example are loss_key_1, loss_key_2, loss_key_3 and loss_key_4 respectively, when training or testing the detection network model, the total loss (an example of the third loss function) is:

[0045] loss=loss_det+λ(loss_key_1+loss_key_2+loss_key_3+loss_key_4);

[0046] Here, λ is an example of the above-mentioned preset function weight.

[0047] It should be noted that when testing the above detection network model, the way the face detection subnetwork obtains the face position is consistent with the SSD principle, and the key point detection subnetwork can be obtained from the result of the conv6_3 branch.

[0048] In one or more embodiments of the present disclosure, the key points may include: the positions of the facial features of the human body, for example, the positions of the left and right eyes, the positions of the left and right corners of the mouth, and the position of the nose.

[0049] Figure 4 is a block diagram of a face detection device according to an exemplary embodiment of the present disclosure. Figure 4 As shown, the device 40 includes:

[0050] An acquisition module 41 is used to acquire an image to be detected through a pre-trained detection network model;

[0051] A first determination module 42 is used to perform face detection on the image to be detected through the face detection subnetwork in the detection network model to extract first feature maps of different sizes from the image to be detected, and determine and output a face detection result according to the first feature map, wherein the face detection result includes position information of the face in the image to be detected;

[0052] The second determination module 43 is used to perform face detection on the image to be detected through the face detection subnetwork in the detection network model to extract first feature maps of different sizes from the image to be detected, and determine and output a face detection result based on the first feature map, wherein the face detection result includes position information of the face in the image to be detected.

[0053] In one or more embodiments of the present disclosure, the face detection subnetwork includes a first convolution unit, the key point detection subnetwork includes a second convolution unit, the output end of the first convolution unit is connected to the input end of the second convolution unit, and the first convolution unit and the second convolution unit decompose a convolution into a depth convolution and a point convolution when performing a convolution operation on a feature map.

[0054] In one or more embodiments of the present disclosure, the first convolution unit includes: a first convolution subunit, a first pooling layer, a second convolution subunit, a second pooling layer, a third convolution subunit, a third pooling layer, a fourth convolution subunit, a fourth pooling layer, a fifth convolution subunit, a fifth pooling layer, and a sixth convolution subunit, which are sequentially connected;

[0055] The second convolution unit includes: a seventh convolution subunit, an eighth convolution subunit and a ninth convolution subunit, a sixth pooling layer, a seventh pooling layer, an eighth pooling layer and a ninth pooling layer, wherein the input end of the sixth pooling layer is connected to the sixth convolution subunit, the input end of the seventh convolution subunit is connected to the output end of the fifth convolution subunit, the output end of the seventh convolution subunit is connected to the seventh pooling layer, the input end of the eighth convolution subunit is connected to the output end of the fourth convolution subunit, the output end of the eighth convolution subunit is connected to the eighth pooling layer, the input end of the ninth convolution subunit is connected to the output end of the third convolution subunit, and the output end of the ninth convolution subunit is connected to the ninth pooling layer.

[0056] In one or more embodiments of the present disclosure, the above-mentioned face detection device may further include:

[0057] A third determination module is used to determine a first loss term generated by the face detection subnetwork according to the image sample and the face detection result determined by the face detection subnetwork based on the image sample; and obtain a first loss function according to the first loss term;

[0058] a fourth determination module, configured to determine a second loss term generated by the key point detection subnetwork according to the image sample and the key point detection result determined by the key point detection subnetwork based on the image sample; and obtain a second loss function according to the second loss term;

[0059] A calculation module, used for performing weighted summation on the first loss function and the second loss function according to a preset function weight to obtain a third loss function;

[0060] An adjustment module is used to adjust the values ​​of the parameters of the detection network model according to the third loss function.

[0061] In one or more embodiments of the present disclosure, the key points may include: the locations of the five sense organs of the human body.

[0062] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0063] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0064] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0065] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0066] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0067] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0068] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0069] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0070] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0071] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0072] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0073] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0074] In addition, to simplify the description and discussion, and in order not to obscure the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the devices may be shown in the form of block diagrams to avoid obscuring the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the present disclosure will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0075] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0076] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A face detection method, characterized in that: include: Obtain the image to be detected through the pre-trained detection network model; Performing face detection on the image to be detected by using the face detection subnetwork in the detection network model to extract first feature maps of different sizes from the image to be detected, and determining and outputting a face detection result according to the first feature map, wherein the face detection result includes position information of the face in the image to be detected; The determining and outputting the face detection result according to the first feature map includes: identifying the first feature map to generate a bounding box, performing position regression processing on the bounding box to obtain a position regression result, determining, based on the scale of the bounding box and in combination with the position regression result, a category confidence that the image to be detected within the bounding box is classified as a face, and using the bounding box and the category confidence as the face detection result; Obtaining at least two first feature maps selected from first feature maps of different sizes from the face detection subnetwork through a key point detection subnetwork in the detection network model, performing key point detection on the first feature maps to extract second feature maps of different sizes from the at least two first feature maps, and determining and outputting key point detection results according to the second feature maps, wherein the key point detection results include position information of key points in the face in the image to be detected; The face detection subnetwork includes a first convolution unit, and the key point detection subnetwork includes a second convolution unit, the output end of the first convolution unit is connected to the input end of the second convolution unit, and the first convolution unit and the second convolution unit decompose a convolution into a depth convolution and a point convolution when performing a convolution operation on a feature map; The first convolution unit comprises: The first convolution subunit, the first pooling layer, the second convolution subunit, the second pooling layer, the third convolution subunit, the third pooling layer, the fourth convolution subunit, the fourth pooling layer, the fifth convolution subunit, the fifth pooling layer, and the sixth convolution subunit are connected in sequence; The second convolution unit includes: a seventh convolution subunit, an eighth convolution subunit and a ninth convolution subunit, a sixth pooling layer, a seventh pooling layer, an eighth pooling layer and a ninth pooling layer, wherein the input end of the sixth pooling layer is connected to the sixth convolution subunit, the input end of the seventh convolution subunit is connected to the output end of the fifth convolution subunit, the output end of the seventh convolution subunit is connected to the seventh pooling layer, the input end of the eighth convolution subunit is connected to the output end of the fourth convolution subunit, the output end of the eighth convolution subunit is connected to the eighth pooling layer, the input end of the ninth convolution subunit is connected to the output end of the third convolution subunit, and the output end of the ninth convolution subunit is connected to the ninth pooling layer.

2. The method according to claim 1, characterized in that The method further comprises: Determining a first loss term generated by the face detection subnetwork according to the image sample and a face detection result determined by the face detection subnetwork based on the image sample; According to the first loss term, a first loss function is obtained; Determining a second loss term generated by the key point detection subnetwork according to the image sample and a key point detection result determined by the key point detection subnetwork based on the image sample; According to the second loss term, a second loss function is obtained; According to a preset function weight, performing a weighted summation on the first loss function and the second loss function to obtain a third loss function; The values ​​of the parameters of the detection network model are adjusted according to the third loss function.

3. The method according to any one of claims 1 to 2, characterized in that: The key points include: The location of the five senses of the human body.

4. A face detection device, characterized in that: include: An acquisition module is used to acquire the image to be detected through a pre-trained detection network model; A first determination module is used to perform face detection on the image to be detected through the face detection subnetwork in the detection network model, so as to extract first feature maps of different sizes from the image to be detected, and determine and output a face detection result according to the first feature map, wherein the face detection result includes position information of the face in the image to be detected, and the face detection result is determined and output according to the first feature map, specifically for: identifying the first feature map, generating a bounding box, performing position regression processing on the bounding box, obtaining a position regression result, determining a category confidence that the image to be detected belonging to the bounding box is classified as a face based on the scale of the bounding box and in combination with the position regression result, and using the bounding box and the category confidence as the face detection result; The second determination module is used to obtain at least two first feature maps selected from first feature maps of different sizes from the face detection subnetwork through the key point detection subnetwork in the detection network model, perform key point detection on the first feature map to extract second feature maps of different sizes from the at least two first feature maps, determine and output key point detection results according to the second feature map, wherein the key point detection results include position information of key points in the face in the image to be detected; the face detection subnetwork includes a first convolution unit, the key point detection subnetwork includes a second convolution unit, the output end of the first convolution unit is connected to the input end of the second convolution unit, the first convolution unit and the second convolution unit decompose a convolution into a depth convolution and a point convolution when performing a convolution operation on the feature map; the first convolution unit includes: a first convolution subunit, a first pooling layer, A second convolution subunit, a second pooling layer, a third convolution subunit, a third pooling layer, a fourth convolution subunit, a fourth pooling layer, a fifth convolution subunit, a fifth pooling layer, and a sixth convolution subunit; the second convolution unit includes: a seventh convolution subunit, an eighth convolution subunit and a ninth convolution subunit, a sixth pooling layer, a seventh pooling layer, an eighth pooling layer and a ninth pooling layer, wherein an input end of the sixth pooling layer is connected to the sixth convolution subunit, an input end of the seventh convolution subunit is connected to an output end of the fifth convolution subunit, an output end of the seventh convolution subunit is connected to the seventh pooling layer, an input end of the eighth convolution subunit is connected to an output end of the fourth convolution subunit, an output end of the eighth convolution subunit is connected to the eighth pooling layer, an input end of the ninth convolution subunit is connected to an output end of the third convolution subunit, and an output end of the ninth convolution subunit is connected to the ninth pooling layer.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the face detection method according to any one of claims 1 to 3 is implemented.

6. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the face detection method according to any one of claims 1 to 3.