Face detection method and device, electronic equipment and storage medium

By introducing face boundary detection into face detection and verifying the face detection box information, the problem of fluctuation in the size of the detection box is solved, and the stability and accuracy of face detection are improved.

CN114694202BActive Publication Date: 2025-11-21SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011639397.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2025-11-21
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

In existing face detection technologies, fluctuations in the size of the detection bounding box lead to low accuracy in face detection, affecting the accuracy of face tracking and recognition.

Method used

By adding face boundary detection, the face boundary information is used to verify the face detection box information, and a stable output face box information is determined.

Benefits of technology

It improves the stability of face detection results, avoids fluctuations in the size of the detection box, and enhances the accuracy of face detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114694202B_ABST
    Figure CN114694202B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a face detection method, the method comprises: acquiring an image to be detected, the image to be detected comprises a target face; extracting face public features of the image to be detected through a preset public convolutional network, to obtain face public features of the target face; performing face detection on the face public features through a preset face detection network, to obtain face frame information of the target face; and performing face boundary detection on the face public features through a preset face boundary detection network, to obtain face boundary information of the target face; and determining output face frame information of the target face according to the face boundary information and the face frame information. The face boundary information obtained through face boundary detection is used to verify the face detection frame information, so that more stable face frame information is obtained for output, which can effectively avoid the fluctuation of the face detection frame information and improve the stability of the face detection result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, and in particular to a face detection method and device, electronic equipment and a storage medium. BACKGROUND

[0002] With the development of artificial intelligence, technologies based on artificial intelligence have been applied in various fields, such as face recognition-based access control, face payment, and pedestrian recognition. Target detection mainly predicts the center point and detection frame offset of a target, and the obtained target information can be used for subsequent processing, such as recognition and classification. However, when target detection is performed, the size of the detection frame often fluctuates, that is, the detection frame may be large or small. In face tracking and face recognition technologies, face detection is first performed. However, the fluctuation of the face detection frame affects the accuracy of face detection, such as missing features due to a too small detected face, or increased noise due to too much background of the detected face, or even mis-detection of two or more faces in the same face detection frame, which directly affects the accuracy of face tracking and face recognition. Therefore, the stability of the face detection result is not high in current face detection technologies. SUMMARY

[0003] The embodiments of the present application provide a face detection method, which verifies the face detection frame information by increasing the face boundary information obtained by face boundary detection, so as to obtain more stable face frame information for output, thereby improving the stability of the face detection result.

[0004] In a first aspect, the embodiments of the present application provide a face detection method, which comprises:

[0005] obtaining a to-be-detected image, wherein the to-be-detected image comprises a target face;

[0006] extracting face public features of the target face from the to-be-detected image by using a preset public convolutional network;

[0007] detecting the target face by using a preset face detection network based on the face public features, to obtain face frame information of the target face; and

[0008] detecting a face boundary of the target face by using a preset face boundary detection network based on the face public features, to obtain face boundary information of the target face;

[0009] determining output face frame information of the target face based on the face boundary information and the face frame information.

[0010] Optionally, the face frame information comprises a target face frame, and the face boundary information comprises a target face contour boundary; and the determining of the output face frame information of the target face according to the face boundary information and the face frame information comprises:

[0011] determining the output face frame information of the target face according to boundary points of the target face frame and the target face contour boundary.

[0012] Optionally, the determining of the output face frame information of the target face according to boundary points of the target face frame and the target face contour boundary comprises:

[0013] respectively acquiring first, second, third and fourth boundary points of the target face contour boundary and edges of the target face frame, wherein the edges of the target face frame are a top edge, a left edge, a right edge and a bottom edge, the first boundary point corresponds to the top edge, the second boundary point corresponds to the left edge, the third boundary point corresponds to the right edge, and the fourth boundary point corresponds to the bottom edge;

[0014] judging whether the first, second, third and fourth boundary points and the target face frame satisfy a preset constraint condition;

[0015] if the first, second, third and fourth boundary points and the target face frame satisfy the preset constraint condition, determining that target face frame information corresponding to the target face frame is the output face frame information of the target face.

[0016] Optionally, the face frame information further comprises a target face frame center point, and the determining of the target face frame information corresponding to the target face frame as the output face frame information of the target face if the first, second, third and fourth boundary points and the target face frame satisfy the preset constraint condition comprises:

[0017] calculating a boundary point center point of the first, second, third and fourth boundary points;

[0018] calculating a distance between the target face frame center point and the boundary point center point, and judging whether the distance satisfies a preset distance constraint condition;

[0019] if the distance satisfies the preset distance constraint condition, determining that the target face frame information corresponding to the target face frame is the output face frame information of the target face.

[0020] Optionally, the determining of the output face frame information of the target face according to boundary points of the target face frame and the target face contour boundary further comprises:

[0021] obtain the boundary points of the target face contour and each side of the target face frame respectively, and determine the number of the boundary points of each side;

[0022] If there is a side with the number of boundary points greater than 1, match a unique boundary point to the side with the number of boundary points greater than 1.

[0023] Optionally, the face boundary detection network comprises a convolution layer, the convolution layer comprises weight parameters and weight coefficients, and the weight coefficients are used to adjust the weight parameters so that the weight parameters focus on the boundary information of a preset region.

[0024] Optionally, the preset region is a forehead region of a front face and an outer cheek region of a side face.

[0025] In a second aspect, an embodiment of the present application further provides a face detection device, the device comprising:

[0026] an obtaining module, configured to obtain a to-be-detected image, the to-be-detected image comprising a target face;

[0027] a feature extraction module, configured to perform face public feature extraction on the to-be-detected image by using a preset public convolution network, to obtain face public features of the target face;

[0028] a first extraction module, configured to perform face detection on the face public features by using a preset face detection network, to obtain face frame information of the target face; and

[0029] a second extraction module, configured to perform face boundary detection on the face public features by using a preset face boundary detection network, to obtain face boundary information of the target face;

[0030] a determining module, configured to determine output face frame information of the target face according to the face boundary information and the face frame information.

[0031] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the face detection method provided by the embodiment of the present application when executing the computer program.

[0032] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, wherein the computer program is executable on a processor to implement the steps in the face detection method provided by the embodiment of the present application.

[0033] In the embodiment of the present application, an image to be detected is acquired, and the image to be detected includes a target face; a preset public convolutional network is used to perform face public feature extraction on the image to be detected, and the face public feature of the target face is obtained; a preset face detection network is used to perform face detection on the face public feature, and the face frame information of the target face is obtained; and a preset face boundary detection network is used to perform face boundary detection on the face public feature, and the face boundary information of the target face is obtained; and the output face frame information of the target face is determined according to the face boundary information and the face frame information. The face boundary information obtained through face boundary detection is used to verify the face detection frame information, so that more stable face frame information is obtained for output, which can effectively avoid the fluctuation of the face detection frame information and improve the stability of the face detection result. BRIEF DESCRIPTION OF DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0035] Figure 1 is a flowchart of a face detection method provided by the embodiment of the present application;

[0036] Figure 2 is a schematic diagram of a face boundary point provided by the embodiment of the present application;

[0037] Figure 3 is a structural schematic diagram of another face boundary detection network provided by the embodiment of the present application;

[0038] Figure 4 is a structural schematic diagram of a face detection device provided by the embodiment of the present application;

[0039] Figure 5 is a structural schematic diagram of a determination module provided by the embodiment of the present application;

[0040] Figure 6 is a structural schematic diagram of a determination unit provided by the embodiment of the present application;

[0041] Figure 7 is a structural schematic diagram of another determination module provided by the embodiment of the present application;

[0042] Figure 8 is a structural schematic diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0043] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of the present application.

[0044] Please refer to Figure 1 , Figure 1 is a flow chart of a face detection method provided by an embodiment of the present application, as shown in Figure 1 , the face detection method comprises the following steps:

[0045] 101, obtaining a to-be-detected image.

[0046] In the embodiment of the present application, the to-be-detected image comprises a target face. The to-be-detected image can be an image captured by a camera at a regular time or in real time, and can be a video image, such as a video image of a specific monitoring scene captured in real time by a camera installed in the specific monitoring scene. Further, the camera can be arranged at a certain height of the specific monitoring scene to capture the target in the specific monitoring scene in real time. The image uploaded by the user can be one or more images, or the image uploaded by the user can also be a video image.

[0047] It should be noted that in the face tracking scenario, the to-be-detected image can be a video image, and in the face recognition scenario, the to-be-detected image can be one or more images.

[0048] The target face described above can be understood as the face of a target person in the to-be-detected image. The to-be-detected image can comprise one or more target faces, that is, the number of target persons in the to-be-detected image can be one or more.

[0049] 102, extracting a face public feature of the target face by a preset public convolutional network.

[0050] In the embodiment of the present application, the to-be-detected image can be detected by a preset face detection model, and further, the preset face detection model can comprise a public convolutional network, a face detection network and a face boundary detection network. The public convolutional network is used to preliminarily extract features of the to-be-detected image, and extract face public features required by the face detection network and the face boundary detection network. After the public convolutional network is calculated, the output face public features are respectively input into the face detection network and the face boundary detection network.

[0051] 103. The face public feature is detected by a preset face detection network to obtain face frame information of the target face.

[0052] In the embodiment of the present application, the face detection network can be a face detection network constructed based on an MTCNN (Multi-task Cascaded Convolutional Networks) network, a YOLOv (You Only Look Once) network, a Centernet network, or the like.

[0053] The face detection network can regress the face region information hidden in the face public feature to obtain the face frame information of the target face. The face frame information can include a face frame and a confidence. The face frame can be represented by (x, y, w, h), where x and y are the coordinates of the center point of the face frame, and w and h are the width and height of the face frame, respectively. The confidence is used to represent the credibility of the image in the face frame as the target face. The higher the confidence, the higher the credibility of the image in the face frame as the target face. The lower the confidence, the lower the credibility of the image in the face frame as the target face.

[0054] 104. The face public feature is detected by a preset face boundary detection network to obtain face boundary information of the target face.

[0055] In the embodiment of the present application, the face boundary detection network can detect face key points to obtain the boundary of the face. The face key points can be face contour key points, nose contour key points, chin contour key points, forehead contour key points, or the like. The detected key points can form the face boundary. The face boundary detection network can be constructed based on a DAN (Deep Alignment Networks) network, a DCNN (Deep Convolutional Network), an MTCNN network, or the like.

[0056] In a possible embodiment, the common convolutional network can also be constructed based on an MTCNN network, a YOLOv network, a Centernet network, or the like. For example, the structure of the common convolutional network can be constructed based on a feature extraction part in the MTCNN network, the face detection network can be constructed based on a feature regression part in the MTCNN network, and the face boundary detection network can be constructed based on a key point regression part in any one of the DAN, DCNN, and MTCNN networks. Similarly, the structure of the common convolutional network can be constructed based on a feature extraction part in the YOLOv network, the face detection network can be constructed based on a feature regression part in the YOLOv network, and the face boundary detection network can be constructed based on a key point regression part in any one of the DAN, DCNN, and MTCNN networks. Similarly, the structure of the common convolutional network can be constructed based on a feature extraction part in the Centernet network, the face detection network can be constructed based on a feature regression part in the Centernet network, and the face boundary detection network can be constructed based on a key point regression part in any one of the DAN, DCNN, and MTCNN networks.

[0057] After the face detection model composed of the common convolutional network, the face detection network, and the face boundary detection network is constructed, the face detection model is adjusted and trained by using a face data set, to obtain a trained face detection model, that is, the preset common convolutional network, face detection network, and face boundary detection network.

[0058] 105. Determine the output face frame information of the target face according to the face boundary information and the face frame information.

[0059] In the embodiments of the present application, the face boundary information can be used as verification information of the face frame information to constrain the face frame information, so as to obtain stable face frame information for output. It can be understood that the face boundary information is prior information of the face frame information, and the face frame information conforms to the prior information, which indicates that the face accuracy is high and stable.

[0060] Optionally, the face frame information includes a target face frame, and the face boundary information includes a target face contour boundary. The output face frame information of the target face can be determined according to the boundary points corresponding to the target face frame and the target face contour boundary. The boundary points can be understood as points on the target face contour boundary where the coordinates have extreme values, such as points on the contour of (x min , y), (x max , y), (x, y min ), (x, y max ), and the like. The (x min(x, y) can be understood as the left boundary of the target face contour, and the above (x) max (x, y) can be understood as the right boundary of the target face contour. min (x, y) can be understood as the bottom boundary of the target face contour. max This can be understood as the top boundary of the target face contour.

[0061] Specifically, it can be determined whether each side of the target face bounding box has a boundary point with the boundary of the target face contour. If each side of the target face bounding box has a boundary point with the boundary of the target face contour, it means that the size of the target face bounding box is appropriate for the size of the target face contour. The face bounding box information corresponding to the target face bounding box can be determined as the output face bounding box information of the target face, and the output face bounding box information can be output.

[0062] Understandably, when the target face bounding box becomes larger or smaller, it is difficult to find boundary points on its sides. Therefore, the appropriate size of the target face bounding box can be determined by the boundary points between its sides and the outline of the target face. Furthermore, if the target face bounding box is not appropriate, it can be anchored based on these boundary points.

[0063] Optionally, the first, second, third, and fourth boundary points of the target face outline and each side of the target face bounding box can be obtained separately. The sides of the target face bounding box are the top, left, right, and bottom edges, respectively. The first boundary point (x... i y max ) can correspond to the top edge, the second boundary point (x) min y j ) can correspond to the left side, the third boundary point (x) max y k ) can correspond to the right side, the fourth boundary point (x) h y min This can correspond to the bottom edge; further, it can be determined whether the first, second, third, and fourth boundary points and the target face bounding box satisfy preset constraints; if the first, second, third, and fourth boundary points and the target face bounding box satisfy the preset constraints, then the target face bounding box information corresponding to the target face bounding box is determined to be the output face bounding box information of the target face. If the first, second, third, and fourth boundary points and the target face bounding box do not satisfy the preset constraints, then the target face bounding box information corresponding to the target face bounding box is determined to be unstable target face bounding box information.

[0064] In one possible embodiment, the target facial contour boundary includes region boundaries, such as the forehead of a frontal face and the outer cheek of a side face, which can be as follows: Figure 2As shown, the forehead of the front face of the female staff is the region boundary, and the outer cheek of the side face of the male staff is the region boundary, the center of the region boundary can be taken, such as taking the center of the forehead as the first boundary point of the female face, and taking the center of the outer cheek as the third boundary point of the male face.

[0065] The preset constraint condition can be that the distance between any two of the first boundary point, the second boundary point, the third boundary point and the fourth boundary point is less than the diagonal length of the target face frame, and the distance between the first boundary point and the fourth boundary point is greater than the length of the left or right side, and the distance between the second boundary point and the third boundary point is greater than the length of the top or bottom side.

[0066] Specifically, in the case where multiple target faces exist, assuming that there are n target faces, n target face frames, n first boundary points, n second boundary points, n third boundary points and n fourth boundary points can be obtained according to the face detection network, and the center points of the first boundary points, the second boundary points, the third boundary points and the fourth boundary points can be calculated. The distance between the center point of the target face frame and the center point of the boundary point is calculated, and it is judged whether the distance satisfies the preset distance constraint condition. If the distance satisfies the preset distance constraint condition, the target face frame information corresponding to the target face frame is determined as the output face frame information of the target face. The distance constraint condition is that the distance between the center point of the target face frame and the center point of the boundary point is less than a preset distance threshold. If the distance between the center point of the target face frame and the center point of the boundary point is less than the distance threshold, it can be considered that the size of the target face frame is basically consistent with the size of the face, the corresponding target face frame information is stable, and the target face frame information can be determined as the output face frame information of the target face. In this way, the distance constraint condition of four boundary points and one center point can be used to find the target face frame most suitable for the current target face. When the distance between the center point of the target face frame and the center point of the boundary point is greater than the distance threshold, it can be considered that the size of the target face frame is greatly different from the size of the face, and the size of the target face frame is not matched with the size of the face. There can be a case that the target face frame is large and the actual face is small, or a case that the target face frame is small and the actual face is large, or a case that the target face frame is large and multiple faces exist in the target face frame.

[0067] In a possible embodiment, when the target face contour boundary and the boundary point of one side of the target face frame are multiple, screening is needed. The boundary points of each side of the target face contour boundary and the target face frame can be obtained respectively, and the number of the boundary points of each side is judged. If there is a side with the number of boundary points greater than 1, a unique boundary point is matched for the side with the number of boundary points greater than 1. For example, taking the first boundary point, assuming that a section of the face contour boundary is (x, y max ), which is the top boundary of a face contour boundary, if the boundary point (x i , ymax If m is the number of the first boundary points, then the average x coordinate x m of the m first boundary points can be calculated as follows: m max and a boundary point (x i , y i ) is obtained as the first boundary point.

[0068] Optionally, if there is an edge with less than 1 boundary point, it indicates that the size of the target face frame is not matched with the face, at this time, the target face frame can be stretched or shrunk, and the adjacent two edges of the edge without a boundary point are stretched or shrunk, so that the edge without a boundary point is moved to the corresponding boundary point. In this way, the size of the target face frame can be adjusted to adapt to the size of the face, thereby improving the stability of the face frame size, and further improving the stability of the output face detection information of the target personnel.

[0069] Optionally, the face boundary detection network includes a convolution layer, and the convolution layer includes weight parameters and weight coefficients, and the weight coefficients are used to adjust the weight parameters of the convolution layer, so that the weight parameters focus on the boundary information of the preset region. Specifically, the adjustment of the weight parameters by the weight coefficients can be shown in the following formula:

[0070] output = (λw) * x = ∑λ i w i x i

[0071] wherein λ i is the weight coefficient of the i-th preset region, and w i is the weight parameter for the i-th preset region. In the embodiment of the present application, the weight coefficient is added to the parameter, and is irrelevant to the input image, so that the input image does not need to be processed specifically, the time for image processing can be saved in the forward inference of face boundary detection, and the relationship between the weight coefficient and the weight parameter can be shown as follows: Figure 3

[0072] In the embodiment of the present application, the preset region is the forehead region of the front face and the outer cheek region of the side face. Since the forehead region of the front face and the outer cheek region of the side face are both region type boundaries, there is no accurate boundary point, therefore, the corresponding weight of these region type boundaries can be increased, so that the regression boundary point is more obvious.

[0073] In the embodiment of the present application, a to-be-detected image is acquired, and the to-be-detected image comprises a target face; a preset public convolutional network is used to perform face public feature extraction on the to-be-detected image to obtain face public feature of the target face; a preset face detection network is used to perform face detection on the face public feature to obtain face frame information of the target face; and a preset face boundary detection network is used to perform face boundary detection on the face public feature to obtain face boundary information of the target face; and the output face frame information of the target face is determined according to the face boundary information and the face frame information. The face boundary information obtained through face boundary detection is used to verify the face detection frame information, so that more stable face frame information is obtained for output, which can effectively avoid fluctuation of the face detection frame information and improve the stability of the face detection result.

[0074] It should be noted that the face detection method provided in the embodiment of the present application can be applied to devices such as mobile phones, monitors, computers, servers and the like that can perform face detection.

[0075] Please refer to Figure 4 , Figure 4 is a structural schematic diagram of a face detection device provided in the embodiment of the present application, as Figure 4 shown, the device comprises:

[0076] The acquisition module 401 is configured to acquire a to-be-detected image, and the to-be-detected image comprises a target face.

[0077] The feature extraction module 402 is configured to perform face public feature extraction on the to-be-detected image through a preset public convolutional network to obtain face public feature of the target face.

[0078] The first extraction module 403 is configured to perform face detection on the face public feature through a preset face detection network to obtain face frame information of the target face.

[0079] The second extraction module 404 is configured to perform face boundary detection on the face public feature through a preset face boundary detection network to obtain face boundary information of the target face.

[0080] The determination module 405 is configured to determine output face frame information of the target face according to the face boundary information and the face frame information.

[0081] Optionally, the face frame information comprises a target face frame, the face boundary information comprises a target face contour boundary, and the determination module 405 is further configured to determine the output face frame information of the target face according to boundary points of the target face frame and the target face contour boundary.

[0082] Optionally, asFigure 5 The determination module 405 includes:

[0083] The first obtaining unit 4051 is configured to respectively obtain first boundary points, second boundary points, third boundary points, and fourth boundary points of the target face contour boundary and each side of the target face frame, wherein the each side of the target face frame is a top side, a left side, a right side, and a bottom side, the first boundary points correspond to the top side, the second boundary points correspond to the left side, the third boundary points correspond to the right side, and the fourth boundary points correspond to the bottom side.

[0084] The judging unit 4052 is configured to judge whether the first boundary points, the second boundary points, the third boundary points, and the fourth boundary points and the target face frame satisfy a preset constraint condition.

[0085] The determination unit 4053 is configured to determine that target face frame information corresponding to the target face frame is output face frame information of the target face if the first boundary points, the second boundary points, the third boundary points, and the fourth boundary points and the target face frame satisfy the preset constraint condition.

[0086] Optionally, as shown in Figure 6 The face frame information further includes a target face frame center point, and the determination unit 4053 includes:

[0087] The first calculation sub-unit 40531 is configured to calculate a boundary point center point of the first boundary points, the second boundary points, the third boundary points, and the fourth boundary points.

[0088] The second calculation sub-unit 40532 is configured to calculate a distance between the target face frame center point and the boundary point center point, and judge whether the distance satisfies a preset distance constraint condition.

[0089] The determination sub-unit 40533 is configured to determine that target face frame information corresponding to the target face frame is output face frame information of the target face if the distance satisfies the preset distance constraint condition.

[0090] Optionally, as shown in Figure 7 The determination module 405 further includes:

[0091] The second obtaining unit 4054 is configured to respectively obtain boundary points of the target face contour boundary and each side of the target face frame, and judge a number of the boundary points of the each side.

[0092] The matching unit 4055 is configured to match a unique boundary point to a side with a number of boundary points greater than 1 if the side exists.

[0093] Optionally, the face boundary detection network comprises a convolution layer, the convolution layer comprises weight parameters and weight coefficients, and the weight coefficients are used to adjust the weight parameters so that the weight parameters focus on boundary information of a preset region.

[0094] Optionally, the preset region is a forehead region of a front face and an outer cheek region of a side face.

[0095] It should be noted that the face detection device provided by the embodiment of the present application can be applied to a mobile phone, a monitor, a computer, a server and the like which can perform face detection.

[0096] The face detection device provided by the embodiment of the present application can realize each process of the face detection method in the method embodiment, and can achieve the same beneficial effects. To avoid repetition, details are not repeated here.

[0097] Referring to Figure 8 , Figure 8 is a structural schematic diagram of an electronic device provided by the embodiment of the present application, as Figure 8 shown, comprising a memory 802, a processor 801 and a computer program stored on the memory 802 and executable on the processor 801, wherein:

[0098] The processor 801 is configured to call the computer program stored in the memory 802 to perform the following steps:

[0099] Obtaining a to-be-detected image, the to-be-detected image comprising a target face;

[0100] Extracting face public features of the to-be-detected image through a preset public convolution network to obtain face public features of the target face;

[0101] Detecting the face public features through a preset face detection network to obtain face frame information of the target face; and

[0102] Detecting the face public features through a preset face boundary detection network to obtain face boundary information of the target face;

[0103] Determining output face frame information of the target face according to the face boundary information and the face frame information.

[0104] Optionally, the face frame information comprises a target face frame, the face boundary information comprises a target face contour boundary, and the processor 801 performs the determining of the output face frame information of the target face according to the face boundary information and the face frame information, comprising:

[0105] According to the target face frame and the boundary points of the target face contour boundary, determine the output face frame information of the target face.

[0106] Optionally, the processor 801 executes the determination of the output face frame information of the target face according to the target face frame and the boundary points of the target face contour boundary, comprising:

[0107] Respectively acquire the first boundary point, the second boundary point, the third boundary point and the fourth boundary point of each side of the target face contour boundary and the target face frame, wherein the each side of the target face frame is the top side, the left side, the right side and the bottom side, the first boundary point corresponds to the top side, the second boundary point corresponds to the left side, the third boundary point corresponds to the right side, and the fourth boundary point corresponds to the bottom side;

[0108] Determine whether the first boundary point, the second boundary point, the third boundary point and the fourth boundary point satisfy the preset constraint condition with the target face frame;

[0109] If the first boundary point, the second boundary point, the third boundary point and the fourth boundary point satisfy the preset constraint condition with the target face frame, determine that the target face frame information corresponding to the target face frame is the output face frame information of the target face.

[0110] Optionally, the face frame information further comprises a target face frame center point, and the processor 801 executes the determination of the output face frame information of the target face according to the target face frame and the boundary points of the target face contour boundary, comprising:

[0111] Calculate the boundary point center point of the first boundary point, the second boundary point, the third boundary point and the fourth boundary point;

[0112] Calculate the distance between the target face frame center point and the boundary point center point, and determine whether the distance satisfies the preset distance constraint condition;

[0113] If the distance satisfies the preset distance constraint condition, determine that the target face frame information corresponding to the target face frame is the output face frame information of the target face.

[0114] Optionally, the processor 801 executes the determination of the output face frame information of the target face according to the target face frame and the boundary points of the target face contour boundary, further comprising:

[0115] Respectively acquire the boundary points of each side of the target face contour boundary and the target face frame, and determine the number of the boundary points of each side;

[0116] If the number of boundary points of the edge is greater than 1, a unique boundary point is matched for the edge with the number of boundary points greater than 1.

[0117] Optionally, the face boundary detection network comprises a convolution layer, the convolution layer comprises weight parameters and weight coefficients, and the weight coefficients are used to adjust the weight parameters so that the weight parameters focus on boundary information of a preset region.

[0118] Optionally, the preset region is a forehead region of a front face and an outer cheek region of a side face.

[0119] It should be noted that the electronic device can be a device such as a mobile phone, a monitor, a computer, a server, etc. that can perform face detection.

[0120] The electronic device provided by the embodiment of the present application can realize each process of the face detection method in the method embodiment, and can achieve the same beneficial effects. To avoid repetition, details are not repeated here.

[0121] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, each process of the face detection method provided by the embodiment of the present application is realized, and the same technical effects can be achieved. To avoid repetition, details are not repeated here.

[0122] 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 program can be stored in a computer readable storage medium. When the program is executed, the processes of the above-mentioned embodiments can be included. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM).

[0123] The above only describes the preferred embodiments of the present application, and of course cannot limit the scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.

Claims

1. A face detection method, characterized by, The method comprises the following steps: obtaining a to-be-detected image, wherein the to-be-detected image comprises a target human face; extracting a human face public feature of the to-be-detected image through a preset public convolutional network to obtain a human face public feature of the target human face; detecting the human face public feature through a preset human face detection network to obtain human face frame information of the target human face; and detecting the human face public feature through a preset human face boundary detection network to obtain human face boundary information of the target human face; determining output human face frame information of the target human face according to the human face boundary information and the human face frame information; the human face frame information comprises a target human face frame, the human face boundary information comprises a target human face contour boundary, and the determination of the output human face frame information of the target human face according to the human face boundary information and the human face frame information comprises: obtaining first, second, third and fourth boundary points of the target human face contour boundary and each side of the target human face frame respectively, wherein the each side of the target human face frame is a top side, a left side, a right side and a bottom side, the first boundary point corresponds to the top side, the second boundary point corresponds to the left side, the third boundary point corresponds to the right side, and the fourth boundary point corresponds to the bottom side; judging whether the first, second, third and fourth boundary points and the target human face frame satisfy a preset constraint condition; the constraint condition is that the distance between any two points of the first, second, third and fourth boundary points is less than the diagonal length of the target human face frame, and the distance between the first boundary point and the fourth boundary point is greater than the length of the left side or the right side, and the distance between the second boundary point and the third boundary point is greater than the length of the top side or the bottom side; if the first, second, third and fourth boundary points and the target human face frame satisfy the preset constraint condition, then determining that the target human face frame information corresponding to the target human face frame is the output human face frame information of the target human face; the human face frame information further comprises a target human face frame center point, and if the first, second, third and fourth boundary points and the target human face frame satisfy the preset constraint condition, then determining that the target human face frame information corresponding to the target human face frame is the output human face frame information of the target human face, which comprises: calculating a boundary point center point of the first, second, third and fourth boundary points; calculating the distance between the target human face frame center point and the boundary point center point, and judging whether the distance satisfies a preset distance constraint condition; the distance constraint condition is that the distance between the target human face frame center point and the boundary point center point is less than a preset distance threshold; if the distance satisfies the preset distance constraint condition, then determining that the target human face frame information corresponding to the target human face frame is the output human face frame information of the target human face.

2. The method of claim 1, wherein, the determination of the output human face frame information of the target human face according to the boundary points corresponding to the target human face frame and the target human face contour boundary further comprises: Respectively acquire the target face contour boundary and the boundary points of each side of the target face frame, and determine the number of the boundary points of each side; If there is a side with the number of boundary points greater than 1, match a unique boundary point to the side with the number of boundary points greater than 1.

3. The method of claim 2, wherein, The face boundary detection network comprises a convolution layer, the convolution layer comprises weight parameters and weight coefficients, and the weight coefficients are used to adjust the weight parameters so that the weight parameters focus on the boundary information of the preset region.

4. The method of claim 3, wherein, The preset region is the forehead region of the front face and the outer cheek region of the side face.

5. A face detection apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire a to-be-detected image, wherein the to-be-detected image comprises a target face; A feature extraction module is configured to perform face public feature extraction on the to-be-detected image by using a preset public convolution network to obtain face public features of the target face; A first extraction module is configured to perform face detection on the face public features by using a preset face detection network to obtain face frame information of the target face; and A second extraction module is configured to perform face boundary detection on the face public features by using a preset face boundary detection network to obtain face boundary information of the target face. A determination module is configured to determine output face frame information of the target face according to the face boundary information and the face frame information. The face frame information comprises a target face frame, the face boundary information comprises a target face contour boundary, and the determination module comprises: A first acquisition unit is configured to respectively acquire first boundary points, second boundary points, third boundary points and fourth boundary points of the target face contour boundary and each side of the target face frame, wherein the each side of the target face frame is a top side, a left side, a right side and a bottom side, the first boundary points correspond to the top side, the second boundary points correspond to the left side, the third boundary points correspond to the right side, and the fourth boundary points correspond to the bottom side. A judgment unit is configured to judge whether the first boundary points, the second boundary points, the third boundary points and the fourth boundary points and the target face frame satisfy a preset constraint condition; the constraint condition is that the distance between any two points of the first boundary points, the second boundary points, the third boundary points and the fourth boundary points is less than the diagonal length of the target face frame, the distance between the first boundary points and the fourth boundary points is greater than the length of the left side or the right side, and the distance between the second boundary points and the third boundary points is greater than the length of the top side or the bottom side. A determination unit is configured to determine that the target face frame information corresponding to the target face frame is the output face frame information of the target face if the first boundary points, the second boundary points, the third boundary points and the fourth boundary points and the target face frame satisfy the preset constraint condition. The face frame information further comprises a target face frame center point, and the determination unit comprises: A first calculation subunit is configured to calculate the boundary point center points of the first boundary points, the second boundary points, the third boundary points and the fourth boundary points. The second calculating subunit is configured to calculate a distance between the target face frame center point and the boundary point center point, and determine whether the distance satisfies a preset distance constraint condition; the distance constraint condition is that the distance between the target face frame center point and the boundary point center point is less than a preset distance threshold. The determining subunit is configured to determine that the target face frame information corresponding to the target face frame is output face frame information of the target face if the distance satisfies the preset distance constraint condition.

6. An electronic device, comprising: The method comprises the following steps: The memory, the processor and the computer program stored in the memory and executable on the processor are provided, and the processor implements the steps in the face detection method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the processor implements the steps in the face detection method according to any one of claims 1 to 4 when executing the computer program.

Citation Information

Patent Citations

  • Face detection method and device, electronic equipment and computer readable storage medium

    CN111046792A