A face detection method and system based on multi-task cascade convolutional neural network

By using a multi-branch expansion convolutional structure to replace the image pyramid structure in the MTCNN network, the problem of slow running speed during face detection by MTCNN network is solved, and faster detection speed and better real-time performance are achieved.

CN114332989BActive Publication Date: 2025-04-08HUNAN TU LING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111495330.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-04-08
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

During face detection, the MTCNN network has a slow operation speed due to data transfer and multiple input P-net operations caused by the image pyramid structure, and the generated useless suggestion box wastes computing resources and increases detection time consumption.

Method used

Multi-branch expansion convolutional structure is used to replace the image pyramid structure in the MTCNN network, and faces of different sizes are predicted through three branches with weight sharing to reduce useless operations and improve operation speed.

Benefits of technology

The extremely time-consuming image pyramid structure is removed, which reduces data handling and multiple inputs to P-net, improves operation speed, shortens detection time, and maintains the network lightweight and real-time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114332989B_ABST
    Figure CN114332989B_ABST
Patent Text Reader

Abstract

The present invention discloses a face detection method and system of a multi-task cascade convolutional neural network. The method divides an acquired face detection data set into a training set and a test set, adopts a multi-branch dilated convolution structure to improve a P network in an MTCNN network, and respectively trains an O network, an R network and one of the branches of the improved P network using the training set to obtain optimal parameters of the MTCNN network. The trained MTCNN network is generated in this way. The images in the test set are preprocessed, and the preprocessed images are input into the trained MTCNN network for face detection, and the detection results are output. The extremely time-consuming image pyramid structure is removed and replaced by a multi-branch dilated convolution. It is no longer necessary to carry a large amount of data to complete multiple scaling of the image, and it is no longer necessary to repeatedly input the image into the P‑net, thereby reducing useless operations and improving the efficiency of face detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of face detection, and in particular relates to a face detection method and system of a multi-task cascade convolutional neural network. Background Art

[0002] Object detection is a challenging task in the field of computer vision. Given an image, object detection needs to identify the specified object in the image and give its specific location. Face detection is a subdivision of object detection, which focuses more on the detection of multiple objects than general object detection. Face detection is widely used in face recognition, pedestrian detection, intelligent monitoring and other fields, providing valuable information for high-level semantic understanding of images and videos, and plays a very important role and influence in intelligent data collection and processing with images as the main body. Traditional face detection methods mainly detect artificially designed features, with low accuracy and slow speed. In recent years, convolutional neural networks (CNNs) using deep learning have achieved good results in face detection by automatically extracting deeper features.

[0003] Multi-task cascade convolutional neural network (MTCNN) is a high-precision, lightweight face detection network that uses a three-layer cascade structure to extract features and classify. For an input image of any size, it first scales the size by a factor of 0.707 to form a new image with an area 0.5 times the original image. Then the new image is scaled again until the length of the shortest side of the latest generated image is less than 12 pixels, and multiple images of different sizes are generated repeatedly. These images of different sizes together form an image pyramid. Each time a face is detected, the images in the image pyramid need to be sent to P-net (Proposal Network) from small to large. In P-net, after extracting features through a multi-layer convolutional neural network, the features are classified by a classifier to obtain the corresponding face location information. After all images of all sizes are input, a large number of face proposal boxes are generated. These proposal boxes are then non-maximum suppressed to obtain the final output result of P-net. The result includes face binary classification information, face coordinate information, and facial feature positioning. According to the facial coordinate information in P-net, the corresponding position in the original image can be obtained, and then the image of the corresponding position is used as input and input into R-net (Refine Network). In R-net, only the suggestion box output by P-net is detected, and a deeper feature extraction network is used to obtain more accurate results. The output result of R-net is used as the input of O-net (Output Network). After passing through the three-layer cascaded convolutional network, combined with the facial features positioning coordinates, the facial coordinates in the original image are obtained.

[0004] The MTCNN network runs relatively slowly because it uses an image pyramid and a triple cascade network. For the image pyramid, each time an image of a different size is generated, it needs to be scaled, and the scaling operation actually causes the data to be continuously moved between the memory and the video memory, and the time consumed by data movement is even greater than the consumption of neural network logical reasoning. At the same time, each new scaled image needs to be input into the P-net for calculation. The larger the original image, the more images are generated, the more repeated operations of the P-net, and the slower the speed. In addition, for images that are too large, the size of the feature map generated by the P-net after feature extraction is larger, and the more feature points need to be traversed during the final classification, and the more time consumption is more obvious. Summary of the invention

[0005] The technical problem to be solved by the present invention is how to improve the efficiency of the MTCNN network in face detection. The purpose of the present invention is to provide a face detection method and system of a multi-task cascade convolutional neural network, which adopts the MTCNN network as the backbone network and replaces the image pyramid structure of the original MTCNN network with a multi-branch dilated convolution structure, so as to more quickly extract facial features and generate suggestion boxes, overcome various time-consuming problems caused by the image pyramid structure, improve the program running speed, optimize the real-time performance, and thus improve the efficiency of face detection.

[0006] The present invention is achieved through the following technical solutions:

[0007] On the one hand, the present invention provides a face detection method using a multi-task cascade convolutional neural network, comprising the following steps:

[0008] Obtain a face detection dataset and divide it into a training set and a test set;

[0009] Construct an MTCNN network, use a multi-branch dilated convolution structure to improve the P network in the MTCNN network, use the training set to train the O network, the R network and one of the branches of the improved P network respectively, and obtain the optimal parameters of the MTCNN network; thereby generating a trained MTCNN network;

[0010] Preprocess the images in the test set, input the preprocessed images into the trained MTCNN network for face detection, and output the detection results.

[0011] The MTCNN network is often used in existing face detection. However, since the structure of the MTCNN network is like an image pyramid structure, there are problems in the processing process, such as repeated data transfer caused by multiple scaling of the image, and complex inference process caused by multiple inputs to the P network (P-net). The final result is that the network operation speed is reduced, too many invalid suggestion boxes are generated in the network, wasting computing resources, and increasing detection time. Therefore, the present invention improves the MTCNN network, adds preprocessing before the image input process of the MTCNN network, no longer scales the input image to form an image pyramid, replaces the structure of the suggestion box generation network (P network) with a multi-branch dilated convolution structure, and adopts a segmented training method when training with a training set, that is, the three networks P, R, and O are trained separately to ensure their generalization ability. When training the P network, only one branch of it needs to be trained. The improved MTCNN network obtained in this way removes the extremely time-consuming image pyramid structure and replaces it with a multi-branch dilated convolution. It is no longer necessary to carry a large amount of data to complete multiple scaling of the image, and it is no longer necessary to repeatedly input the image into the P-net, reducing useless operations, thereby overcoming the various time-consuming problems of the original MTCNN caused by the use of the image pyramid structure, improving the running speed, and greatly shortening the detection time. At the same time, the multi-task cascade convolutional neural network itself is an extremely lightweight network. The above scheme is adopted to achieve miniaturization while ensuring real-time performance.

[0012] Furthermore, the face detection dataset adopts the COCO dataset, and is cropped and scaled with the geometric center of the real face frame of the picture in the COCO dataset as the center, to obtain real face pictures of three sizes of 24*24, 36*36, and 48*48 respectively, and the IOU values ​​of the real face pictures in each size are calculated to calibrate the positive samples and negative samples, and all the positive samples and negative samples are summarized to obtain the training set;

[0013] In the training set, real face images of size 24*24 are used to train the R network, real face images of size 48*48 are used to train the O network, and real face images of size 36*36 are used to train one of the branches of the improved P network.

[0014] Furthermore, the process of preprocessing the images in the test set includes:

[0015] The shortest side length of the image is uniformly scaled to 300 to obtain the image to be detected;

[0016] The image to be detected is passed through a 3*3 convolution kernel and a pooling layer in turn, and preliminary feature screening and image compression are performed in turn to obtain the preprocessed image.

[0017] Furthermore, the improved P network includes three branches, wherein the first branch is the P network structure before improvement, including two 3*3 convolution kernels;

[0018] In the second branch, the dilated convolution method is used for both 3*3 convolution kernels. A hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate, and the dilation rates used by the two convolution kernels are mutually prime.

[0019] In the third branch, the dilated convolution method is used for both 3*3 convolution kernels. A hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate, and the dilation rates used by the two convolution kernels are mutually prime. The dilation rate used by the third branch is greater than that of the second branch.

[0020] Furthermore, in the final feature map output by the first branch, each feature point represents a 12*12 area of ​​the original image, and the maximum size of the face image used for detection is 16*16;

[0021] In the final feature map output by the second branch, each feature point represents a 36*36 area of ​​the original image, and the maximum size of the face image used for detection is 48*48;

[0022] In the final feature map output by the third branch, each feature point represents a 60*60 area of ​​the original image, and the maximum size of the face image used for detection is 80*80.

[0023] Furthermore, in the second branch, the expansion rate of the first convolution kernel is 2, and the expansion rate of the second convolution kernel is 3;

[0024] In the third branch, the dilation rate of the first convolution kernel is 3, and the dilation rate of the second convolution kernel is 5.

[0025] Furthermore, the specific process of training the improved P network is as follows:

[0026] The training set is used to train the second branch of the improved P network, and the training weights obtained by training the second branch are shared with the other two branches of the improved P network, thereby finally completing the training of the improved P network.

[0027] Furthermore, all convolution kernels use PRelu as the activation function.

[0028] Furthermore, the process of face detection is as follows:

[0029] The preprocessed images are used as original images and input into the three branches of the improved P network respectively, and suggestion boxes of different sizes are output respectively;

[0030] The suggestion boxes output by the three branches are aggregated and non-maximum suppression is performed to filter out a large number of candidate boxes to obtain the first suggestion box;

[0031] Return the first suggestion box to the original image, and obtain the first image of the corresponding area of ​​the original image;

[0032] Scaling the first image, inputting the scaled first image into the R network, and generating a second suggestion box;

[0033] After non-maximum suppression of the second suggestion box, the third suggestion box is obtained, the third suggestion box is returned to the original image, the second image of the corresponding area of ​​the original image is obtained, the second image is scaled, and the scaled second image is input into the O network for prediction. After non-maximum suppression, the detection result is output.

[0034] On the other hand, the present invention provides a face detection system of a multi-task cascade convolutional neural network, comprising:

[0035] A data processing module is used to obtain a face detection data set and divide the face detection data set into a training set and a test set;

[0036] The model training module is used to improve the P network in the MTCNN network by using a multi-branch dilated convolution structure, and use the training set to train the O network, the R network and one of the branches of the improved P network respectively to obtain the optimal parameters of the MTCNN network; and generate a trained MTCNN network;

[0037] The face detection module is used to preprocess the images in the test set, input the preprocessed test set images into the trained MTCNN network for face detection, and output the detection results.

[0038] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0039] The present invention replaces the original image pyramid in the MTCNN network with a multi-branch dilated convolution structure, predicts faces of different sizes in the P network through three weight-sharing branches, and inputs the prediction results as suggestions into the subsequent network for further screening, and finally obtains the prediction of the face coordinates. After using the improved MTCNN network, because the extremely time-consuming image pyramid structure is removed, it is no longer necessary to carry a large amount of data to complete multiple scaling of the image, and it is no longer necessary to repeatedly input the image into the P-net, reducing useless operations, thereby greatly shortening the detection time. At the same time, the multi-task cascade convolutional neural network itself is an extremely lightweight network. The present invention achieves miniaturization while ensuring real-time performance, and has the advantages of small model, fast operation speed, and good real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0041] Figure 1 This is a schematic diagram of the overall process of a face detection method using a multi-task cascade convolutional neural network according to the present invention;

[0042] Figure 2 This is a flow chart of face detection using the improved MTCNN network in the present invention;

[0043] Figure 3 It is a schematic diagram of the structure of the improved P network of the present invention. DETAILED DESCRIPTION

[0044] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0045] Example 1

[0046] like Figure 1 As shown, this embodiment 1 provides a face detection method of a multi-task cascade convolutional neural network, comprising the following steps:

[0047] S1. Obtain a face detection dataset and divide the face detection dataset into a training set and a test set;

[0048] Specifically, the face detection dataset uses the COCO dataset, and other datasets with face frame annotations can also be used. In this embodiment, the geometric center of the real face frame of the picture in the COCO dataset is used as the center for cropping and scaling, and real face pictures of three sizes of 24*24, 36*36, and 48*48 are obtained respectively. The IOU values ​​of the real face pictures in each size are calculated to calibrate the positive samples and negative samples, and all positive samples and negative samples are summarized to obtain the training set;

[0049] In the subsequent training process, the real face images of 24*24 size in the training set are used to train the R network, the real face images of 48*48 size are used to train the O network, and the real face images of 36*36 size are used to train one of the branches of the improved P network.

[0050] S2. Construct an MTCNN network, use a multi-branch dilated convolution structure to improve the P network in the MTCNN network, use the training set to train the O network, the R network and one of the branches of the improved P network respectively, and obtain the optimal parameters of the MTCNN network; thereby generating a trained MTCNN network;

[0051] The improved P network adopts a branch structure and adds dilated convolution to reduce the amount of calculation while maintaining the receptive field of faces of different sizes. By combining the branch structure with the dilated convolution, the feature matching problem caused by not generating an image pyramid is solved, and low-time and high-precision detection is achieved. Specifically, Figure 3 As shown in the figure, the improved P network includes three branches, and among the three branches, except for the different expansion rates, the output weights and the number of convolution kernel layers of the three branches are exactly the same. In this way, during training, only the second branch needs to be trained, and then the training weights trained by the second branch are shared with the other two branches of the improved P network to complete the training, thereby reducing the amount of calculation, and the classifier parameters subsequently connected to the three branches are also the same, further improving the operation speed.

[0052] The first branch is the original P network structure of the MTCNN network before the improvement, using two 3*3 convolution kernels for feature extraction, and its overall receptive field is 12*12; in the final feature map output by the first branch, each feature point represents a 12*12 area of ​​the original image, and the maximum size of the face image used for detection is 16*16;

[0053] The two 3*3 convolution kernels in the second branch are both dilated by the convolution method. A hyperparameter is added to each of the two convolution kernels so that the dot product operation between the convolution kernel and the target area is no longer continuous, so that a larger receptive field is obtained without changing the volume of the convolution kernel, and a larger face is detected. The hyperparameter is the dilation rate. Since the two convolution kernels are continuous, in order to prevent the interference of the chessboard effect, a set of dilation rates used by the two convolution kernels are mutually prime. In the final feature map output by the second branch, each feature point represents an area of ​​36*36 in the original image, and the maximum size of the face image used for detection is 48*48; preferably, in the second branch, the first convolution kernel takes a dilation rate of 2, and its receptive field is 7*7, and the second convolution kernel takes a dilation rate of 3, and its receptive field is 11*11; this is because in the second branch, the image size is smaller than that of the third branch, and the receptive field is small. Therefore, when selecting the dilation rate, considering the receptive field size of the image, the second branch selects the mutually prime dilation rates of 2 and 3.

[0054] The two 3*3 convolution kernels in the third branch are both dilated convolution methods, and a hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate, and the dilation rates used by the two convolution kernels are mutually prime. The dilation rate used by the third branch is greater than that of the second branch. In the final feature map output by the third branch, each feature point represents a 60*60 area of ​​the original image, and the maximum size of the face image used for detection is 80*80. Optionally, in the third branch, the dilation rate of the first convolution kernel is 3, and the receptive field is 11*11. The dilation rate of the second convolution kernel is 5, and its receptive field is 19*19.

[0055] When training the O network, R network and the improved P network, a segmented training method is adopted, that is, the P, R, and O networks are trained separately to ensure their generalization ability. In the R and O networks, the existing MTCNN network training method is unchanged, and the real face images with scaled sizes of 24*24 and 48*48 are used for training. When training the P network, only the second branch is enabled, and the real face images with sizes of 36*36 are used for training. Finally, the training weights are shared with the other two branches, and finally the training of the improved P network is completed.

[0056] S3. Preprocess the images in the test set, input the preprocessed images into the trained MTCNN network for face detection, and output the detection results.

[0057] Specifically, Figure 2 As shown in the figure, the process of face detection is as follows:

[0058] S31, preprocessing the images in the test set: uniformly scaling the shortest side length of the images to 300 to obtain the images to be tested;

[0059] S32, the image to be tested is passed through a 3*3 convolution kernel and a pooling layer in turn, preliminary feature screening is performed in the convolution layer, and then the pooling operation is performed to compress the image information and reduce the size of the feature map to obtain the preprocessed image, and then the features are extracted through the three different branches of the following improved P network. The image to be tested is preprocessed, and the input image is no longer scaled to form an image pyramid, but is uniformly scaled to a new image with a minimum side length of 300. After experimental research and verification, in actual use, most of the faces to be detected are in a smaller size range, so the MTCNN network does not need to accept images of too large size.

[0060] S33, inputting the preprocessed image as the original image into the three branches of the improved P network respectively, and outputting suggestion boxes of different sizes respectively;

[0061] S34, summarizing the suggestion boxes output by the three branches and performing non-maximum suppression to filter out a large number of candidate boxes to obtain a first suggestion box;

[0062] S35, returning the first suggestion box to the original image, and obtaining a first image of the corresponding area of ​​the original image;

[0063] S36, scaling the first image, inputting the scaled first image into the R network, and generating a second suggestion box;

[0064] S37. After performing non-maximum suppression on the second suggestion box, a third suggestion box is obtained, the third suggestion box is returned to the original image, a second image of the corresponding area of ​​the original image is obtained, the second image is scaled, and the scaled second image is input into the O network for prediction. After non-maximum suppression, the detection result is output.

[0065] In step S33, the final feature maps output by the three branches in the P network are formed into a full convolution structure through a 1*1 convolution kernel. Each feature pixel generates 32 features, and then the output features are classified by their respective softmax classifiers to obtain the classification results of face coordinates, frame regression coordinates, and face feature coordinates. Among them, the face coordinates use cross entropy as the loss function, and its formula is:

[0066]

[0067]

[0068] Among them, p i is the probability that the corresponding area is a face, Indicates the true label of the background where the sample is located, 0 represents a negative sample, and 1 represents a positive sample.

[0069] The bounding box regression coordinates use Euclidean distance to calculate the regression loss, and the formula is:

[0070]

[0071]

[0072] in, is the predicted value, is a real value, and y is a four-tuple containing the xy axis coordinates and the horizontal and vertical frame scaling ratios, R 4 Indicates that the spatial dimension is 4;

[0073] The location of facial features is also obtained by calculating the Euclidean distance, and its formula is:

[0074]

[0075]

[0076] in, is the predicted value, is a real value, and y is a 10-tuple containing 5 sets of xy axis coordinates, R 10 It indicates that the dimension of the space is 10.

[0077] When performing face detection, among the suggestion frames output by the first branch of the P network, only suggestion frames smaller than 16*16 are retained, and suggestion frames larger than 16*16 are removed. Among the suggestion frames output by the second branch, only suggestion frames smaller than 48*48 and larger than 16*16 are retained, and suggestion frames smaller than 16*16 and larger than 48*48 are removed. Among the suggestion frames output by the third branch, suggestion frames larger than 48*48 are retained, and suggestion frames smaller than 48*48 are removed. Then, the remaining suggestion frames of the three branches are aggregated and non-maximum suppression is performed to filter out a large number of candidate frames, and then the result is returned to the original image to obtain the image of the corresponding area of ​​the original image. This image is then scaled to a rectangular frame of 24*24 size, as input, and input into the R network. In the R network, classification is performed again through three convolutions and a fully connected layer to generate new suggestion frames. After non-maximum suppression, the new suggestion box returns the result to the original image, obtains the image of the corresponding area of ​​the original image, and then scales the image to 48*48 size, inputs it into the O network for prediction, and finally passes the prediction, and the result is used as the final detection result. Although the convolution depth of R-net and O-net is deeper, it is irrelevant to the image pyramid, and the operation time is shorter, so there is no need for much improvement.

[0078] Optionally, in this embodiment, all of the above convolution kernels use PRelu as the activation function, which has better effects than ordinary Relu.

[0079] Example 2

[0080] This embodiment provides a multi-task cascade convolutional neural network face detection system, including:

[0081] The data processing module is used to obtain a face detection data set and divide the face detection data set into a training set and a test set; the face detection data set can use the COCO data set or other data sets with face frame annotations;

[0082] The model training module is used to improve the P network in the MTCNN network by using a multi-branch dilated convolution structure, and use the training set to train the O network, the R network and one of the branches of the improved P network respectively to obtain the optimal parameters of the MTCNN network; and generate a trained MTCNN network;

[0083] The improved P network adopts a branch structure and adds dilated convolution to reduce the amount of calculation while maintaining the receptive field of faces of different sizes. By combining the branch structure with the dilated convolution, the feature matching problem caused by not generating an image pyramid is solved, and low-time consumption and high-precision detection are achieved. Specifically, the improved P network includes three branches, and among the three branches, except for the different dilation rates, the output weights and the number of convolution kernel layers of the three branches are exactly the same. In this way, during training, only the second branch needs to be trained, and then the training weights trained by the second branch are shared with the other two branches of the improved P network to complete the training, thereby reducing the amount of calculation, and the classifier parameters subsequently connected to the three branches are also the same, further improving the operation speed.

[0084] The face detection module is used to preprocess the images in the test set, input the preprocessed test set images into the trained MTCNN network for face detection, and output the detection results.

[0085] The specific detection method in the face detection module is consistent with the method in Example 1, so it will not be repeated in this Example 2.

[0086] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.

[0087] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0088] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0089] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0090] A person of ordinary skill in the art can understand that all or part of the steps in realizing the above-mentioned facts and methods can be completed by instructing the relevant hardware through a program, and the program involved or the program described can be stored in a computer-readable storage medium. When the program is executed, it includes the following steps: At this time, the corresponding method steps are derived, and the storage medium can be ROM / RAM, a disk, an optical disk, etc.

[0091] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A face detection method using a multi-task cascade convolutional neural network, characterized in that: The following steps are involved: Obtain a face detection dataset and divide it into a training set and a test set; The face detection dataset adopts the COCO dataset, and is cropped and scaled with the geometric center of the real face frame of the image in the COCO dataset as the center to obtain real face images of three sizes: 24*24, 36*36, and 48*48. The IOU values ​​of the real face images in each size are calculated to calibrate the positive samples and negative samples, and all positive samples and negative samples are summarized to obtain the training set; In the training set, 24*24 size real face images are used to train the R network, 48*48 size real face images are used to train the O network, and 36*36 size real face images are used to train one of the branches of the improved P network; The improved P network includes three branches, among which the first branch is the P network structure before improvement, including two 3*3 convolution kernels; In the second branch, the dilated convolution method is used for both 3*3 convolution kernels. A hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate, and the dilation rates used by the two convolution kernels are mutually prime. In the third branch, the dilated convolution method is used for both 3*3 convolution kernels. A hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate. The dilation rates used by the two convolution kernels are mutually prime. The dilation rate used by the third branch is greater than that of the second branch. Construct an MTCNN network, use a multi-branch dilated convolution structure to improve the P network in the MTCNN network, use the training set to train the O network, the R network and one of the branches of the improved P network respectively, and obtain the optimal parameters of the MTCNN network; generate a trained MTCNN network; The specific process of training the improved P network is: The second branch of the improved P network is trained using the training set, and the training weights obtained by training the second branch are shared with the other two branches of the improved P network, thereby finally completing the training of the improved P network; Preprocess the images in the test set, input the preprocessed images into the trained MTCNN network for face detection, and output the detection results.

2. The face detection method of a multi-task cascade convolutional neural network according to claim 1, characterized in that: The process of preprocessing the images in the test set includes: The shortest side length of the image is uniformly scaled to 300 to obtain the image to be detected; The image to be detected is passed through a 3*3 convolution kernel and a pooling layer in turn, and preliminary feature screening and image compression are performed in turn to obtain the preprocessed image.

3. The face detection method of a multi-task cascade convolutional neural network according to claim 1, characterized in that: In the final feature map output by the first branch, each feature point represents a 12*12 area of ​​the original image, and the maximum size of the face image used for detection is 16*16; In the final feature map output by the second branch, each feature point represents a 36*36 area of ​​the original image, and the maximum size of the face image used for detection is 48*48; In the final feature map output by the third branch, each feature point represents a 60*60 area of ​​the original image, and the maximum size of the face image used for detection is 80*80.

4. The face detection method of a multi-task cascade convolutional neural network according to claim 1, characterized in that: In the second branch, the first convolution kernel has a dilation rate of 2, and the second convolution kernel has a dilation rate of 3; In the third branch, the dilation rate of the first convolution kernel is 3, and the dilation rate of the second convolution kernel is 5.

5. The face detection method of a multi-task cascade convolutional neural network according to claim 1, characterized in that: All convolution kernels use PRelu as the activation function.

6. The face detection method of a multi-task cascade convolutional neural network according to claim 1, characterized in that: The specific process of face detection is as follows: The preprocessed images are used as original images and input into the three branches of the improved P network respectively, and suggestion boxes of different sizes are output respectively; The suggestion boxes output by the three branches are aggregated and non-maximum suppression is performed to filter out a large number of candidate boxes to obtain the first suggestion box; Return the first suggestion box to the original image, and obtain the first image of the corresponding area of ​​the original image; Scaling the first image, inputting the scaled first image into the R network, and generating a second suggestion box; After non-maximum suppression of the second suggestion box, the third suggestion box is obtained, the third suggestion box is returned to the original image, the second image of the corresponding area of ​​the original image is obtained, the second image is scaled, and the scaled second image is input into the O network for prediction. After non-maximum suppression, the detection result is output.

7. A multi-task cascade convolutional neural network face detection system, characterized in that: include: A data processing module is used to obtain a face detection data set and divide the face detection data set into a training set and a test set. The face detection data set uses the COCO data set, and is cropped and scaled with the geometric center of the real face frame of the picture in the COCO data set as the center to obtain real face pictures of three sizes: 24*24, 36*36, and 48*48, respectively. The IOU values ​​of the real face pictures in each size are calculated to calibrate the positive samples and negative samples, and all positive samples and negative samples are summarized to obtain the training set; In the training set, 24*24 size real face images are used to train the R network, 48*48 size real face images are used to train the O network, and 36*36 size real face images are used to train one of the branches of the improved P network; The improved P network includes three branches, among which the first branch is the P network structure before improvement, including two 3*3 convolution kernels; In the second branch, the dilated convolution method is used for both 3*3 convolution kernels. A hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate, and the dilation rates used by the two convolution kernels are mutually prime. In the third branch, the dilated convolution method is used for both 3*3 convolution kernels. A hyperparameter is added to each of the two convolution kernels. The hyperparameter is the dilation rate. The dilation rates used by the two convolution kernels are mutually prime. The dilation rate used by the third branch is greater than that of the second branch. The model training module is used to improve the P network in the MTCNN network by using a multi-branch dilated convolution structure, and use the training set to train the O network, the R network and one of the branches of the improved P network respectively to obtain the optimal parameters of the MTCNN network; and generate a trained MTCNN network; The specific process of training the improved P network is: The second branch of the improved P network is trained using the training set, and the training weights obtained by training the second branch are shared with the other two branches of the improved P network, thereby finally completing the training of the improved P network; The face detection module is used to preprocess the images in the test set, input the preprocessed test set images into the trained MTCNN network for face detection, and output the detection results.