Face detection method, device and storage medium

By acquiring face image samples of multiple scales to train the face detection model, the model structure is simplified, which solves the problem of slow face detection speed in the existing technology and achieves efficient face detection without adjusting the image scale.

CN109376674BActive Publication Date: 2024-09-06BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN201811289493.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-10-31
Publication Date
2024-09-06
Estimated Expiration
2038-10-31

AI Technical Summary

Technical Problem

Existing face detection models need to consider multiple scales, resulting in complex model structures, large amounts of calculations, and slow detection speeds, making them unsuitable for terminal use.

Method used

By obtaining face image samples of multiple scales, the face detection model is trained, so that the model can perform face detection without adjusting the image scale, simplifying the model structure, using feature extraction network, detection network and classification regression network, only The last convolutional layer needs to be connected to the detection network to generate a target window that meets the preset aspect ratio.

Benefits of technology

The face detection speed is improved and the model structure is simplified, making the face detection model more suitable for terminal use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109376674B
    Figure CN109376674B
Patent Text Reader

Abstract

The present disclosure provides a face detection method, device and storage medium, which belong to the field of image processing. The method includes: obtaining multiple sample face images, wherein the multiple sample face images include face images of multiple scales; performing model training based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale; performing face detection on the target image to be identified based on the face detection model to obtain the face area in the target image. The present disclosure simulates multi-scale by collecting sample face images of multiple scales, and performs model training based on sample face images of multiple scales. It can remove the process of performing face detection by adjusting the image scale in the face detection model, simplify the model structure of the face detection model, improve the face detection speed, and make the face detection model more suitable for terminal use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of image technology, face detection has become a common image processing method. When performing face detection, a face detection model is usually trained to detect the face area in the face image based on the face detection model.

[0003] A common face detection model needs to consider face images of multiple scales. Therefore, the face detection model generally includes multiple convolutional layers. For the target image input to the face detection model, the target image is processed through multiple convolutional layers to obtain feature maps of multiple scales of the target image, thereby performing face detection based on the feature maps of multiple scales, resulting in a slow face detection speed and is not suitable for terminal use. Summary of the invention

[0004] The present disclosure provides a face detection method, device and storage medium, which can overcome the problems existing in the related art.

[0005] According to a first aspect of an embodiment of the present disclosure, a face detection method is provided, the method comprising:

[0006] Acquire a plurality of sample face images, wherein the plurality of sample face images include face images of multiple scales;

[0007] Performing model training based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale;

[0008] Based on the face detection model, face detection is performed on the target image to be identified to obtain the face region in the target image.

[0009] In a possible implementation, the obtaining of a plurality of sample face images includes:

[0010] For each sample face among the multiple sample faces, facial images of multiple scales of the sample face are respectively captured according to different shooting angles or different lighting conditions, and the captured facial images are all used as sample facial images.

[0011] In another possible implementation, the face detection model includes a feature extraction network, a detection network, and a classification regression network, the feature extraction network includes a plurality of convolutional layers, and the last convolutional layer in the feature extraction network is connected to the detection network, and the detection network is connected to the classification regression network;

[0012] The feature extraction network is used to extract features from the target image, and output a feature map of the target image through the last convolutional layer;

[0013] The detection network is used to generate a target window that meets a preset aspect ratio at the center position of each point in the feature map;

[0014] The classification regression network is used to output the classification category and location information of the detected area according to the multiple target windows.

[0015] In another possible implementation, the method further includes:

[0016] The configuration file of the face detection model is called, and the preset aspect ratio used by the detection network in the configuration file is set to 1:1.

[0017] In another possible implementation, the classification regression network is further used to adjust the scale of the feature map used and the preset aspect ratio used by the detection network.

[0018] In another possible implementation, performing face detection on the target image to be identified based on the face detection model includes:

[0019] Inputting the target image into the first convolutional layer of the feature extraction network;

[0020] For each convolutional layer in the feature extraction network, convolution processing is performed according to the feature map output by the previous layer, and the feature map obtained after processing is input into the next layer until the last convolutional layer of the feature extraction network outputs the feature map of the target image.

[0021] In another possible implementation, the performing model training based on the multiple sample face images to obtain a face detection model includes:

[0022] Create an initial face detection model;

[0023] For each sample face image among the multiple sample face images, input the sample face image into the face detection model, and obtain a detection result of the sample face image based on the face detection model;

[0024] According to each sample face image and the corresponding detection result, the face detection model is trained using a stochastic gradient descent algorithm until the loss function of the face detection model converges.

[0025] According to a second aspect of an embodiment of the present disclosure, a face detection device is provided, the device comprising:

[0026] A sample acquisition module is configured to acquire a plurality of sample face images, wherein the plurality of sample face images include face images of multiple scales;

[0027] A training module is configured to perform model training based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale;

[0028] The detection module is configured to perform face detection on the target image to be identified based on the face detection model to obtain the face area in the target image.

[0029] In a possible implementation, the sample acquisition module includes:

[0030] The shooting submodule is configured to shoot facial images of multiple scales of each sample face among the multiple sample faces according to different shooting angles or different lighting conditions, and use the captured facial images as sample facial images.

[0031] In another possible implementation, the face detection model includes a feature extraction network, a detection network, and a classification regression network, the feature extraction network includes a plurality of convolutional layers, and the last convolutional layer in the feature extraction network is connected to the detection network, and the detection network is connected to the classification regression network;

[0032] The feature extraction network is used to extract features from the target image, and output a feature map of the target image through the last convolutional layer;

[0033] The detection network is used to generate a target window that meets a preset aspect ratio at the center position of each point in the feature map;

[0034] The classification regression network is used to output the classification category and location information of the detected area according to the multiple target windows.

[0035] In another possible implementation, the device further includes:

[0036] The aspect ratio setting module is configured to call the configuration file of the face detection model and set the preset aspect ratio used by the detection network in the configuration file to 1:1.

[0037] In another possible implementation, the classification regression network is further used to adjust the scale of the feature map used and the preset aspect ratio used by the detection network.

[0038] In another possible implementation, the detection module includes:

[0039] An input unit, configured to input the target image into the first convolutional layer of the feature extraction network;

[0040] The feature extraction unit is configured to perform convolution processing on each convolution layer in the feature extraction network according to the feature map output by the previous layer, and input the feature map obtained after processing into the next layer until the last convolution layer of the feature extraction network outputs the feature map of the target image.

[0041] In another possible implementation, the training module includes:

[0042] A creation unit, configured to create an initial face detection model;

[0043] a detection unit configured to, for each sample face image among the plurality of sample face images, input the sample face image into the face detection model, and obtain a detection result of the sample face image based on the face detection model;

[0044] The training unit is configured to train the face detection model using a stochastic gradient descent algorithm according to each sample face image and the corresponding detection result until the loss function of the face detection model converges.

[0045] According to a third aspect of an embodiment of the present disclosure, a face detection device is provided, the device comprising:

[0046] processor;

[0047] a memory for storing instructions executable by a processor;

[0048] Wherein, the processor is configured to:

[0049] Acquire a plurality of sample face images, wherein the plurality of sample face images include face images of multiple scales;

[0050] Performing model training based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale;

[0051] Based on the face detection model, face detection is performed on the target image to be identified to obtain the face region in the target image.

[0052] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0053] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0055] Figure 1 The figure is a flow chart of a face detection method according to an exemplary embodiment.

[0056] Figure 2 The figure is a flow chart of a face detection method according to an exemplary embodiment.

[0057] Figure 3 The figure is a schematic diagram of the structure of a face detection model according to an exemplary embodiment.

[0058] Figure 4 The figure is a block diagram of a face detection device according to an exemplary embodiment.

[0059] Figure 5 The figure is a block diagram of a face detection device according to an exemplary embodiment.

[0060] Figure 6 The figure is a block diagram of a face detection device according to an exemplary embodiment. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.

[0062] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0063] Figure 1 is a flow chart of a face detection method according to an exemplary embodiment. Figure 1 As shown, the face detection method is used in a face detection device, comprising the following steps:

[0064] In step 101, a plurality of sample face images are obtained, wherein the plurality of sample face images include face images of multiple scales.

[0065] In step 102, model training is performed based on a plurality of sample face images to obtain a face detection model, where the face detection model is used to perform face detection on an image without adjusting the image scale.

[0066] In step 103, based on the face detection model, face detection is performed on the target image to be identified to obtain the face region in the target image.

[0067] The method provided by the embodiment of the present disclosure simulates multi-scale by collecting sample face images of multiple scales, and performs model training based on the sample face images of multiple scales. This can remove the process of performing face detection by adjusting the image scale in the face detection model, simplify the model structure of the face detection model, improve the face detection speed, and make the face detection model more suitable for terminal use.

[0068] In a possible implementation, a plurality of sample face images are obtained, including:

[0069] For each sample face among the multiple sample faces, facial images of multiple scales of the sample face are respectively photographed according to different shooting angles or different lighting conditions, and the photographed facial images are all used as sample facial images.

[0070] In another possible implementation, the face detection model includes a feature extraction network, a detection network, and a classification regression network, the feature extraction network includes a plurality of convolutional layers, and the last convolutional layer in the feature extraction network is connected to the detection network, and the detection network is connected to the classification regression network;

[0071] The feature extraction network is used to extract features from the target image and output the feature map of the target image through the last convolutional layer;

[0072] The detection network is used to generate a target window that meets the preset aspect ratio at the center position of each point in the feature map;

[0073] The classification regression network is used to output the classification category and location information of the detected area based on multiple target windows.

[0074] In another possible implementation, the method further includes:

[0075] Call the configuration file of the face detection model and set the preset aspect ratio used by the detection network in the configuration file to 1:1.

[0076] In another possible implementation, the classification regression network is also used to adjust the scale of the feature map used and the preset aspect ratio used by the detection network.

[0077] In another possible implementation, based on the face detection model, face detection is performed on the target image to be identified, including:

[0078] Input the target image into the first convolutional layer of the feature extraction network;

[0079] For each convolutional layer in the feature extraction network, convolution processing is performed according to the feature map output by the previous layer, and the feature map obtained after processing is input into the next layer until the last convolutional layer of the feature extraction network outputs the feature map of the target image.

[0080] In another possible implementation, model training is performed based on multiple sample face images to obtain a face detection model, including:

[0081] Create an initial face detection model;

[0082] For each sample face image among the multiple sample face images, input the sample face image into a face detection model, and obtain a detection result of the sample face image based on the face detection model;

[0083] According to each sample face image and the corresponding detection result, the face detection model is trained using the stochastic gradient descent algorithm until the loss function of the face detection model converges.

[0084] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0085] Figure 2 is a flow chart of a face detection method according to an exemplary embodiment. Figure 2 As shown, the face detection method is used in a face detection device, comprising the following steps:

[0086] In step 201, for each sample face among a plurality of sample faces, facial images of a plurality of scales of the sample face are photographed respectively according to different shooting angles or different lighting conditions, and the photographed facial images are all used as sample facial images.

[0087] In the related art, the face detection model includes a feature extraction network, a detection network and a classification regression network. The feature extraction network is connected to the detection network, and the detection network is connected to the classification regression network. In order to enable the face detection model to learn more scale information, the feature extraction network contains multiple convolutional layers, and each convolutional layer is connected to the detection network. Therefore, the image can be input into the first convolutional layer of the face detection model, and each convolutional layer extracts features from the image to obtain a feature map of the image. Each convolutional layer in the feature extraction network is connected to the detection network, and the obtained feature map is input into the detection network. The detection network receives the feature map output by each convolutional layer and performs calculations based on the feature maps of the multiple layers.

[0088] However, the above face detection model has a complex model structure and requires a lot of calculations, which is computationally intensive.

[0089] In the disclosed embodiment, in order to enable a non-multi-scale face detection model to learn more scale information without adjusting the image scale, face images of multiple scales are obtained as sample face images when training the face detection model, so as to perform model training based on the multiple sample face images.

[0090] When obtaining sample facial images, faces of multiple users can be selected as sample faces. For each sample face, facial images of multiple scales of the sample face can be captured according to different shooting angles or different lighting conditions. The captured facial images are all used as sample facial images, thereby obtaining multiple sample facial images, and the multiple sample facial images include facial images of multiple scales of the sample face.

[0091] In step 202, model training is performed based on a plurality of sample face images to obtain a face detection model.

[0092] The face detection device can use a preset training algorithm to perform model training based on the multiple sample face images. The preset training algorithm can be an SSD (Single Shot MultiBox Detector) algorithm, a convolutional neural network algorithm, a recurrent neural network algorithm, etc. For the convolutional neural network algorithm, it can include ResNet, GoogLenet, DenseNet, etc. And the trained face detection model can perform face detection on the image without adjusting the image scale.

[0093] For example, see Figure 3 In the face detection model, the feature extraction network, detection network, and classification regression network are connected. The feature extraction network is connected to the detection network, and the detection network is connected to the classification regression network. Since the face detection model does not need to adjust the image scale or learn different scale information, only the last convolutional layer in the feature extraction network needs to be connected to the detection network, while other convolutional layers in the feature extraction network do not need to be connected to the detection network, but only need to be connected to the next convolutional layer.

[0094] Accordingly, the feature extraction network may include multiple convolutional layers, or in order to simplify the model structure, the feature extraction network may include only one convolutional layer.

[0095] In this face detection model, the feature extraction network is used to extract features from the image and output the feature map of the image through the last convolutional layer. The detection network is used to generate a target window that meets the preset aspect ratio at the center position of each point in the feature map. The classification and regression network is used to output the classification category and position information of the detected area based on multiple target windows.

[0096] Therefore, during the training process, an initial face detection model is first created, and then for each sample face image, the sample face image is input into the feature extraction network, and the feature extraction network is used to extract features of the sample face image to obtain a feature map of the sample face image, which is then input into the detection network. The detection network generates a target window that satisfies a preset aspect ratio at the center position of each point in the feature map, thereby obtaining multiple target windows, so that the features of the regions within the multiple target windows can be input into the classification regression network. The classification regression network is used to perform classification regression operations based on the multiple target windows generated by the detection network, thereby detecting regions for the multiple target windows, and outputting the classification category and position information of the region, which is the detection result of the sample face image. Repeating the above steps for multiple sample face images can obtain the detection results corresponding to the multiple sample face images.

[0097] According to each sample face image and the corresponding detection result, the face detection model is trained using a stochastic gradient descent algorithm until the loss function of the face detection model converges. It can be considered that the face detection model training is completed, the model parameters in the face detection model have learned information at multiple scales, the accuracy has met the requirements, and it can be used for face detection. Among them, the loss function can be set by a preset training algorithm.

[0098] Among them, the classification category indicates the category to which the detected area belongs. In the face detection scenario of the embodiment of the present disclosure, the classification category includes two types: the detected area belongs to the face category, or the detected area does not belong to the face category. The position information indicates the position of the detected area in the input image. Therefore, after obtaining the classification category and position information of multiple areas, the face area can be determined from the multiple areas, as well as the position of the face area in the sample face image.

[0099] Among them, the preset aspect ratio is used to determine the ratio of the width to the height of the target window, and then determine the ratio of the width to the height of the face area detected subsequently. The preset aspect ratio can be determined by the face detection device according to the configuration file. That is, the face detection model is provided with a configuration file, and various parameters of the face detection model are configured in the configuration file. During the training process, the face detection model can call the configuration file of the face detection model to obtain the preset aspect ratio used by the detection network in the configuration file.

[0100] In one possible implementation, in order to reduce the number of target windows and simplify the detection process, the configuration file of the face detection model can be called, and the preset aspect ratio used by the detection network in the configuration file can be set to 1:1, so that the detection network uses the preset aspect ratio of 1:1 to generate the target window, and then detect the face area with an aspect ratio of 1:1.

[0101] In a possible implementation, the classification regression network is also used to adjust the scale of the feature map used and the preset aspect ratio used by the detection network. Therefore, a first adjustment parameter and a second adjustment parameter can be set in the classification regression network, the first adjustment parameter is used to adjust the scale, and the second adjustment parameter is used to adjust the aspect ratio. Therefore, when a region is detected according to the target window, the scale of the region can be adjusted according to the first adjustment parameter, the aspect ratio of the region can be adjusted according to the second adjustment parameter, and the region can be detected according to the adjusted scale and aspect ratio. In the subsequent training process based on the sample face image, the first adjustment parameter and the second adjustment parameter can also be trained to improve the accuracy.

[0102] In step 203, based on the face detection model, face detection is performed on the target image to be identified to obtain the face region in the target image.

[0103] When face detection is to be performed on a target image, the target image is input into the face detection model, that is, into the first convolutional layer of the feature extraction network. Each convolutional layer in the feature extraction network performs convolution processing according to the feature map output by the previous layer, and the feature map obtained after processing is input into the next layer. The feature map of the target image is output through the last convolutional layer to achieve feature extraction of the target image. The detection network receives the feature map output by the last convolutional layer of the feature extraction network, and generates a target window that meets the preset aspect ratio at the center position of each point in the feature map, thereby obtaining multiple target windows. The classification and regression network outputs the classification category and position information of the detected area based on the multiple target windows, so that the face area and the position of the face area in the target image can be determined from the multiple detected areas. At this time, face detection is completed.

[0104] The method provided by the embodiment of the present disclosure simulates multi-scale by collecting sample face images of multiple scales, and performs model training based on the sample face images of multiple scales. This can remove the process of performing face detection by adjusting the image scale in the face detection model, simplify the model structure of the face detection model, improve the face detection speed, and make the face detection model more suitable for terminal use.

[0105] Figure 4 is a block diagram of a face detection device according to an exemplary embodiment. Figure 4The device includes a sample acquisition module 401, a training module 403 and a detection module 403.

[0106] The sample acquisition module 401 is configured to acquire a plurality of sample face images, wherein the plurality of sample face images include face images of multiple scales;

[0107] A training module 402 is configured to perform model training based on a plurality of sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on an image without adjusting the image scale;

[0108] The detection module 403 is configured to perform face detection on the target image to be identified based on the face detection model to obtain the face region in the target image.

[0109] The device provided by the embodiment of the present disclosure simulates multi-scale by collecting sample face images of multiple scales, and performs model training based on the sample face images of multiple scales. It can remove the process of performing face detection by adjusting the image scale in the face detection model, simplify the model structure of the face detection model, improve the face detection speed, and make the face detection model more suitable for terminal use.

[0110] In a possible implementation, the sample acquisition module 401 includes:

[0111] The shooting submodule is configured to shoot facial images of multiple scales of each sample face among the multiple sample faces according to different shooting angles or different lighting conditions, and use the captured facial images as sample facial images.

[0112] In another possible implementation, the face detection model includes a feature extraction network, a detection network, and a classification regression network, the feature extraction network includes a plurality of convolutional layers, and the last convolutional layer in the feature extraction network is connected to the detection network, and the detection network is connected to the classification regression network;

[0113] The feature extraction network is used to extract features from the target image and output the feature map of the target image through the last convolutional layer;

[0114] The detection network is used to generate a target window that meets the preset aspect ratio at the center position of each point in the feature map;

[0115] The classification regression network is used to output the classification category and location information of the detected area based on multiple target windows.

[0116] In another possible implementation, the device further includes:

[0117] The aspect ratio setting module is configured to call the configuration file of the face detection model and set the preset aspect ratio used by the detection network in the configuration file to 1:1.

[0118] In another possible implementation, the classification regression network is also used to adjust the scale of the feature map used and the preset aspect ratio used by the detection network.

[0119] In another possible implementation, the detection module 403 includes:

[0120] An input unit, configured to input the target image into the first convolutional layer of the feature extraction network;

[0121] The feature extraction unit is configured to perform convolution processing on each convolution layer in the feature extraction network according to the feature map output by the previous layer, and input the feature map obtained after processing into the next layer until the last convolution layer of the feature extraction network outputs the feature map of the target image.

[0122] In another possible implementation, the training module 402 includes:

[0123] A creation unit, configured to create an initial face detection model;

[0124] a detection unit configured to, for each sample face image among the plurality of sample face images, input the sample face image into a face detection model, and obtain a detection result of the sample face image based on the face detection model;

[0125] The training unit is configured to train the face detection model using a stochastic gradient descent algorithm according to each sample face image and the corresponding detection result until the loss function of the face detection model converges.

[0126] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0127] Figure 5 is a block diagram of a face detection device 500 according to an exemplary embodiment. For example, the device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0128] Reference Figure 5 , the device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0129] The processing component 502 generally controls the overall operation of the device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0130] The memory 504 is configured to store various types of data to support operations on the device 500. Examples of such data include instructions for any application or method operating on the device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0131] The power supply component 506 provides power to the various components of the device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 500.

[0132] The multimedia component 508 includes a screen that provides an output interface between the device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0133] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the device 500 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0134] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0135] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 can detect the open / closed state of the device 500, the relative positioning of components, such as the display and keypad of the device 500, and the sensor assembly 514 can also detect the position change of the device 500 or a component of the device 500, the presence or absence of user contact with the device 500, the orientation or acceleration / deceleration of the device 500, and the temperature change of the device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0136] The communication component 516 is configured to facilitate wired or wireless communication between the device 500 and other devices. The device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0137] In an exemplary embodiment, the apparatus 500 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.

[0138] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by the processor 520 of the device 500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0139] Figure 6 FIG. 6 is a block diagram of a face detection device 600 according to an exemplary embodiment. For example, the device 600 may be provided as a server. Figure 6 The apparatus 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632 for storing instructions executable by the processing component 622, such as an application. The application stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the above-mentioned face detection method.

[0140] The device 600 may also include a power supply component 626 configured to perform power management of the device 600, a wired or wireless network interface 650 configured to connect the device 600 to a network, and an input / output (I / O) interface 658. The device 600 may operate based on an operating system stored in the memory 632, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0141] In an exemplary embodiment, a computer-readable storage medium storing a computer program is further provided, such as a memory storing a computer program. When the computer program is executed by a processor, the face detection method in the above embodiment is implemented.

[0142] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A face detection method, It is characterized in that The method comprises: For each sample face among the multiple sample faces, photograph facial images of multiple scales of the sample face according to different shooting angles or different lighting conditions, and use the photographed facial images as sample facial images, wherein the multiple sample facial images include facial images of multiple scales; Model training is performed based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale; the face detection model includes a feature extraction network, a detection network and a classification regression network, and the detection network is connected to the classification regression network; and the last convolution layer in the feature extraction network is connected to the detection network, and the other convolution layers in the feature extraction network except the last convolution layer are not connected to the detection network, and the classification regression network is provided with a first adjustment parameter and a second adjustment parameter, wherein the first adjustment parameter is used to adjust the scale of the adopted feature map, and the second adjustment parameter is used to adjust the preset aspect ratio adopted by the detection network; The target image to be identified is input into the first convolution layer of the feature extraction network; for each convolution layer in the feature extraction network, convolution processing is performed according to the feature map output by the previous layer, and the feature map obtained after processing is input into the next layer, until the last convolution layer of the feature extraction network outputs the feature map of the target image; the detection network is used to generate a target window that meets the preset aspect ratio at the center position of each point in the feature map; the classification regression network is used to output the classification category and position information of the detected area according to multiple target windows to obtain the face area in the target image.

2. The method according to claim 1, It is characterized in that The method further comprises: The configuration file of the face detection model is called, and the preset aspect ratio used by the detection network in the configuration file is set to 1:

1.

3. The method according to claim 1, It is characterized in that The performing model training based on the multiple sample face images to obtain a face detection model includes: Create an initial face detection model; For each sample face image among the multiple sample face images, input the sample face image into the face detection model, and obtain a detection result of the sample face image based on the face detection model; According to each sample face image and the corresponding detection result, the face detection model is trained using a stochastic gradient descent algorithm until the loss function of the face detection model converges.

4. A face detection device, It is characterized in that The device comprises: A sample acquisition module, the sample acquisition module comprising: a shooting submodule, the shooting submodule being configured to shoot, for each sample face among a plurality of sample faces, facial images of a plurality of scales of the sample face according to different shooting angles or different lighting conditions, and use the facial images obtained by shooting as sample facial images, wherein the plurality of sample facial images include facial images of a plurality of scales; A training module is configured to perform model training based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale; the face detection model includes a feature extraction network, a detection network and a classification regression network, and the detection network is connected to the classification regression network; and the last convolution layer in the feature extraction network is connected to the detection network, and the other convolution layers in the feature extraction network except the last convolution layer are not connected to the detection network, and the classification regression network is provided with a first adjustment parameter and a second adjustment parameter, wherein the first adjustment parameter is used to adjust the scale of the adopted feature map, and the second adjustment parameter is used to adjust the preset aspect ratio adopted by the detection network; The detection module is configured to input the target image to be identified into the first convolution layer of the feature extraction network; for each convolution layer in the feature extraction network, convolution processing is performed according to the feature map output by the previous layer, and the feature map obtained after processing is input into the next layer, until the last convolution layer of the feature extraction network outputs the feature map of the target image; the detection network is used to generate a target window that meets a preset aspect ratio at the center position of each point in the feature map; the classification and regression network is used to output the classification category and position information of the detected area according to the multiple target windows; and the face area in the target image is obtained.

5. The device according to claim 4, It is characterized in that The device also includes: The aspect ratio setting module is configured to call the configuration file of the face detection model and set the preset aspect ratio used by the detection network in the configuration file to 1:

1.

6. The device according to claim 4, It is characterized in that The training module comprises: A creation unit, configured to create an initial face detection model; a detection unit configured to, for each sample face image among the plurality of sample face images, input the sample face image into the face detection model, and obtain a detection result of the sample face image based on the face detection model; The training unit is configured to train the face detection model using a stochastic gradient descent algorithm according to each sample face image and the corresponding detection result until the loss function of the face detection model converges.

7. A face detection device, It is characterized in that The device comprises: processor; a memory for storing instructions executable by a processor; Wherein, the processor is configured to: For each sample face among the multiple sample faces, photograph facial images of multiple scales of the sample face according to different shooting angles or different lighting conditions, and use the photographed facial images as sample facial images, wherein the multiple sample facial images include facial images of multiple scales; Model training is performed based on the multiple sample face images to obtain a face detection model, wherein the face detection model is used to perform face detection on the image without adjusting the image scale; the face detection model includes a feature extraction network, a detection network and a classification regression network; the detection network is connected to the classification regression network; and the last convolution layer in the feature extraction network is connected to the detection network, and the other convolution layers in the feature extraction network except the last convolution layer are not connected to the detection network, and the classification regression network is provided with a first adjustment parameter and a second adjustment parameter, wherein the first adjustment parameter is used to adjust the scale of the feature map used, and the second adjustment parameter is used to adjust the preset aspect ratio used by the detection network; The target image to be identified is input into the first convolutional layer of the feature extraction network; for each convolutional layer in the feature extraction network, convolution processing is performed according to the feature map output by the previous layer, and the feature map obtained after processing is input into the next layer, until the last convolutional layer of the feature extraction network outputs the feature map of the target image; the detection network is used to generate a target window that meets the preset aspect ratio at the center position of each point in the feature map; the classification regression network is used to output the classification category and position information of the detected area according to the multiple target windows; and the face area in the target image is obtained.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Convolutional neural network face recognition method based on multi-scale pooling

    CN105975931A

  • Human face key point positioning method and device

    CN106339680A

  • Road traffic sign detection and identification method

    CN106372571A

  • Target detection and recognition method based on deep learning

    CN107229904A

  • Facial image generation method and device, storage medium and computer equipment

    CN108229381A