WO2020233000A1 - Facial recognition method and apparatus, and computer-readable storage medium - Google Patents

Facial recognition method and apparatus, and computer-readable storage medium Download PDF

Info

Publication number
WO2020233000A1
WO2020233000A1 PCT/CN2019/117342 CN2019117342W WO2020233000A1 WO 2020233000 A1 WO2020233000 A1 WO 2020233000A1 CN 2019117342 W CN2019117342 W CN 2019117342W WO 2020233000 A1 WO2020233000 A1 WO 2020233000A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
gradient
data
training
image
Prior art date
Application number
PCT/CN2019/117342
Other languages
French (fr)
Chinese (zh)
Inventor
刘洋
陈海平
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020233000A1 publication Critical patent/WO2020233000A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a face recognition method, device and computer-readable storage medium that can be used for smart security.
  • the video surveillance system is the representative system of security.
  • the video surveillance system is the representative system of security.
  • the importance of video surveillance systems in the field of national security and urbanization management has become more and more prominent, and the requirements for its functions and performance have also been continuously improved.
  • traffic accidents and social security problems are showing increasingly serious situations.
  • criminal activities such as theft and robbery by breaking doors or breaking windows into experimental and scientific research buildings, office buildings, and residential communities are still very serious.
  • the security monitoring based on face recognition at home and abroad mainly adopts the face alarm system of infrared sensor, but the infrared alarm system is susceptible to interference from various heat sources, light sources, radio frequency radiation, and hot air flow, and it is difficult to achieve efficient face recognition effects.
  • This application provides a face recognition method, device, and computer-readable storage medium, the main purpose of which is to provide a technical solution that can efficiently recognize a face from video or picture data.
  • a face recognition method includes:
  • Step A The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
  • Step B The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
  • Step C The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer;
  • Step D The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method
  • the training set is calculated to obtain a gradient feature set, and the gradient feature set and the face control set are input to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model
  • the training layer exits training;
  • Step E The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the input image, and then inputs it to the model training layer.
  • the model training layer determines whether the captured image contains a person Face, when the captured image does not contain a human face, output the result that the human face is not recognized;
  • Step F When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
  • the present application also provides a face recognition device, which includes a memory and a processor.
  • the memory stores a face recognition program that can run on the processor. The following steps are implemented when the recognition program is executed by the processor:
  • Step A The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
  • Step B The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
  • Step C The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer;
  • Step D The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method Calculate the training set to obtain a gradient feature set, and input the gradient feature set and the face control set to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer Exit training;
  • Step E The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the captured image, and then inputs it to the model training layer.
  • the model training layer determines whether the captured image is Contains a human face, and when the captured image does not contain a human face, output the result that the human face is not recognized;
  • Step F When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
  • the present application also provides a computer-readable storage medium that stores a face recognition program on the computer-readable storage medium, and the face recognition program can be executed by one or more processors to Implement the steps of the face recognition method as described above.
  • the adaptive image denoising filter can reduce the impact of noise on the image, and the improvement algorithm makes good use of weak classifiers for cascading, and the final combination form of strong classifiers has high classification accuracy. Therefore, the face recognition proposed in this application
  • the method, device and computer-readable storage medium can realize accurate face recognition function.
  • FIG. 1 is a schematic flowchart of a face recognition method provided by an embodiment of this application.
  • FIG. 2 is a schematic diagram of the internal structure of a face recognition device provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of modules of a face recognition program in a face recognition device provided by an embodiment of the application.
  • This application provides a face recognition method.
  • FIG. 1 it is a schematic flowchart of a face recognition method provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the face recognition method includes:
  • the data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data set Input to the data processing layer, and input the face comparison set into the database.
  • the preferred embodiment of the present application deploys several video surveillance areas in a preset scene, such as an experimental scientific research building, office building, residential area, etc., and selects images including human faces from the images captured in the several video surveillance areas.
  • a face image set based on different faces in the face image set, collect ID photo pictures corresponding to the different faces, and obtain ID photos from the relevant monitoring department, such as from the public security department
  • the preferred embodiment of the present application selects images that do not include human faces from the captured image sets in the several video surveillance areas, and obtains non-human target data sets from a preset data set, such as the COCO data set , Compose a set of non-face images.
  • the COCO data set is a large-scale image data set specially designed for object detection, segmentation, human key point detection, semantic segmentation and caption generation.
  • the data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessed data set and a non-face preprocessed data Set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer.
  • the gray scale is to convert the data in the original data set from an RGB format to a black and white gray format by using a proportional method.
  • the ratio method is as follows: Obtain the R, G, and B pixel values of each pixel in the original data set, and convert the pixel to a black-and-white gray format according to the following function:
  • the noise reduction processing adopts the following adaptive image noise reduction filtering method:
  • (x, y) represents the coordinates of the image pixels in the original data set
  • f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method
  • ⁇ (x,y) is noise
  • g(x,y) is the original data set
  • L represents the current pixel coordinates.
  • the data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set to obtain a face training set and inputs it to the model training layer.
  • the edge detection and the segmentation process are based on the edge detection to find a pixel set with a large change in the pixel gray level in the face preprocessing data set, and based on the segmentation process.
  • the pixel set is reconnected to segment the human face and the human face background.
  • the larger step change means that the gray-scale derivative has a maximum value or a minimum value.
  • the preferred embodiment of the present application adopts the Canny edge detection method.
  • the Canny edge detection method smooths and filters the face preprocessing data set based on a Gaussian filter, and calculates the smoothed and filtered data set based on the first-order partial derivative finite difference to obtain non-local maximum points and Minimal value point, complete edge detection.
  • the model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, and calculates according to the direction gradient straight method
  • the training set obtains a gradient feature set, and the gradient feature set and the face control set are input to a lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer exits training.
  • the preferred embodiment of the present application calculates the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set, and uses the gradient amplitude as the first component and the gradient direction value as the first component.
  • Two components form a gradient matrix; divide the data in the gradient matrix into multiple small blocks, and add the gradient amplitude and the gradient direction value of each small block to obtain the added value, and the added value is connected in series to form the The gradient feature set.
  • the boosting algorithm includes the AdaBoost algorithm, and the AdaBoost algorithm includes several weak classifiers and strong classifiers;
  • the weak classifier h(x, t, p, ⁇ ) is:
  • t is the classification function including the gradient feature set
  • x is the detection sub-window
  • p is the weighted inequality direction coefficient
  • is the weak classifier threshold.
  • the preferred embodiment of the present application is trained on the basis of the gradient feature set. The weak classifier h(x, t, p, ⁇ ) until the optimal threshold ⁇ is determined to obtain the strong classifier C(x):
  • ⁇ k is the coefficient of the strong classifier C(x)
  • T is the total number of the weak classifiers
  • ⁇ k ⁇ k /(1- ⁇ k )
  • ⁇ k is:
  • w i is the weight of the gradient feature set
  • yi is the face control set
  • the boosting algorithm exits training, and the preset threshold is generally Set to 0.97.
  • S5. Receive a captured image, perform grayscale and noise reduction processing on the captured image, and then input it to the model training layer to determine whether the captured image contains a human face.
  • the captured image uses an image captured by equipment such as an outdoor camera and a mobile phone.
  • the model training layer sequentially determines the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face comparison with the highest similarity Collect pictures to complete face recognition.
  • the Euclidean distance method is:
  • a is the captured image
  • yi is the face comparison set
  • n is the total amount of data in the face comparison set.
  • the invention also provides a face recognition device.
  • FIG. 2 it is a schematic diagram of the internal structure of a face recognition device provided by an embodiment of this application. (Corresponding modification)
  • the face recognition apparatus 1 may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, or a portable computer, or a server.
  • the face recognition device 1 at least includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the face recognition device 1 in some embodiments, such as a hard disk of the face recognition device 1.
  • the memory 11 may also be an external storage device of the face recognition device 1, for example, a plug-in hard disk equipped on the face recognition device 1, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital) Digital, SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the face recognition apparatus 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the face recognition device 1, such as the code of the face recognition program 01, etc., but also to temporarily store data that has been output or will be output.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, and is used to run the program code or processing stored in the memory 11 Data, such as execution of face recognition program 01, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip
  • the communication bus 13 is used to realize the connection and communication between these components.
  • the network interface 14 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the device 1 and other electronic devices.
  • the device 1 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc.
  • the display can also be called a display screen or a display unit as appropriate, for displaying information processed in the face recognition device 1 and for displaying a visualized user interface.
  • FIG. 2 only shows the face recognition device 1 with components 11-14 and the face recognition program 01.
  • FIG. 1 does not constitute a limitation on the face recognition device 1 It may include fewer or more components than shown, or a combination of some components, or a different component arrangement.
  • the memory 11 stores the face recognition program 01; when the processor 12 executes the face recognition program 01 stored in the memory 11, the following steps are implemented:
  • Step 1 Collect a face image set, a non-face image set, and a face comparison set.
  • the face image set and the non-face image set are collectively referred to as the original data set, and the original data set is input to the data processing Layer, input the face comparison set into the database.
  • the preferred embodiment of the present application deploys several video surveillance areas, and transfers the image sets captured in the several video surveillance areas to the database; selects images that include human faces in the image set stored in the database to form human faces Image set; based on the different faces in the face image set, collect ID photos corresponding to the different faces, and obtain ID photos from the relevant monitoring department, such as obtaining criminals at large from the public security department The ID photos and the ID photos of the untrustworthy old Lai, etc. form the face comparison set.
  • the preferred embodiment of this application selects images that do not include human faces in the image set stored in the database, and selects non-human target data sets from a preset data set, such as the COCO data set, to form a non-human face image set.
  • the COCO data set is a large-scale image data set designed for object detection, segmentation, human key point detection, semantic segmentation and caption generation.
  • Step 2 The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, and the preprocessed data set includes a face preprocessed data set and a non-face preprocessed data set,
  • the face preprocessing data set is input to the data cutting layer, and the non-face preprocessing data set is input to the model training layer.
  • the gray scale is to convert the data in the original data set from an RGB format to a black and white gray format by using a proportional method.
  • the ratio method is as follows: Obtain the R, G, and B pixel values of each pixel in the original data set, and convert the pixel to a black-and-white gray format according to the following function:
  • (x, y) represents the coordinates of the image pixels in the original data set
  • f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method
  • ⁇ (x,y) is noise
  • g(x,y) is the original data set
  • L represents the current pixel coordinates.
  • Step 3 The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer.
  • the face training set The non-face preprocessing data set is collectively referred to as a training set.
  • the edge detection and the segmentation process are based on the edge detection to find a pixel set with a large change in the pixel gray level in the face preprocessing data set, and based on the segmentation process.
  • the pixel set is reconnected to segment the human face and the human face background. Further, the step change is large, that is, the gray-scale derivative is a maximum value or a minimum value.
  • the preferred embodiment of the present application adopts the Canny edge detection method.
  • the Canny edge detection method performs smoothing filtering processing on the face preprocessing data set based on a Gaussian filter, and calculating after the smoothing filtering processing based on the first-order partial derivative finite difference Obtain the non-local maximum and minimum points for the data set, and complete the edge detection.
  • Step 4 The model training layer receives the training set and extracts the face control set from the database, calculates the training set according to the directional gradient method to obtain a gradient feature set, and compares the gradient feature set with all
  • the face comparison set is input to the lifting algorithm for training, and training is exited when the training accuracy of the lifting algorithm is greater than a preset threshold.
  • the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set are calculated, and the gradient amplitude is used as the first component, and the gradient direction value is used as The second component forms a gradient matrix; divide the data in the gradient matrix into a plurality of small blocks, and add the gradient amplitude and the gradient direction value of each small block to obtain an added value, and connect the added value in series to form a gradient
  • the feature set is input to the lifting algorithm.
  • the boosting algorithm of the preferred embodiment of the present application includes the AdaBoost algorithm, and the AdaBoost algorithm includes several weak classifiers and strong classifiers;
  • the weak classifier h(x, t, p, ⁇ ) is:
  • t is the classification function including the gradient feature set
  • x is the detection sub-window
  • p is the weighted inequality direction coefficient
  • is the threshold of the weak classifier, and the weak classifier is trained according to the gradient feature set. Weak classifier h(x,t,p, ⁇ ) until the optimal threshold ⁇ is determined;
  • the strong classifier C(x) is:
  • ⁇ k is the coefficient of the strong classifier C(x)
  • T is the total number of the weak classifiers
  • ⁇ k ⁇ k /(1- ⁇ k )
  • ⁇ k is:
  • w i is the weight of the gradient feature set
  • yi is the face control set
  • the boosting algorithm exits training, and the preset threshold is generally Set to 0.97.
  • Step 5 Receive a captured image, perform grayscale and noise reduction processing on the captured image, and input it to the model training layer to determine whether the captured image contains a human face.
  • the captured image uses an image captured by equipment such as an outdoor camera and a mobile phone.
  • Step 6 When the captured image does not contain a human face, output the result that the human face is not recognized.
  • Step 7 When the captured image contains a face, the model training layer sequentially judges the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face with the highest similarity Comparing the pictures in the collection to complete face recognition.
  • the Euclidean distance method is:
  • a is the captured image
  • yi is the face comparison set
  • n is the total amount of data in the face comparison set.
  • the face recognition program can also be divided into one or more modules, and the one or more modules are stored in the memory 11 and run by one or more processors (this embodiment is The processor 12) is executed to complete the application.
  • the module referred to in the application refers to a series of computer program instruction segments capable of completing specific functions, and is used to describe the execution process of the face recognition program in the face recognition device.
  • FIG. 3 it is a schematic diagram of the program modules of the face recognition program in an embodiment of the applicant’s face recognition device.
  • the face recognition program can be divided into a data receiving module 10 and a data
  • the processing module 20, the model training module 30, and the face recognition output module 40 are exemplary:
  • the data receiving module 10 is used to collect a face image set, a non-face image set, and a face comparison set.
  • the face image set and the non-face image set are collectively referred to as an original data set, and the original
  • the data set is input into the data processing layer, and the face comparison set is input into the database.
  • the data processing module 20 is configured to: the data processing layer performs grayscale and noise reduction processing on the original data set to obtain a preprocessed data set, and the preprocessed data set includes a face preprocessed data set and a non-human face
  • the face preprocessing data set is input to the data cutting layer, and the non-face preprocessing data set is input to the model training layer.
  • the data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer.
  • the face training set and the Non-face preprocessing data sets are collectively referred to as training sets.
  • the model training module 30 is configured to: the model training layer receives the training set and extracts the face control set from the database, calculates the training set according to the directional gradient method to obtain a gradient feature set, The gradient feature set and the face control set are input to a lifting algorithm for training, and training is exited when the training accuracy of the lifting algorithm is greater than a preset threshold.
  • the face recognition output module 40 is configured to: receive the captured image, perform grayscale and noise reduction processing on the image captured by the user, and then input it to the model training layer, and the model training layer determines the captured image Whether the captured image contains a human face, when the captured image does not contain a human face, output the result that the human face is not recognized.
  • the model training layer sequentially determines the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face comparison with the highest similarity Collect pictures to complete face recognition.
  • an embodiment of the present application also proposes a computer-readable storage medium that stores a face recognition program on the computer-readable storage medium, and the face recognition program can be executed by one or more processors to implement the following operations :
  • the face image set and the non-face image set are collectively referred to as the original data set.
  • the original data set is input to the data processing layer, and
  • the face comparison set is input into the database.
  • the data processing layer performs grayscale and noise reduction processing on the original data set to obtain a preprocessed data set.
  • the preprocessed data set includes a face preprocessed data set and a non-face preprocessed data set, and the The face preprocessing data set is input to the data cutting layer, and the non-face preprocessing data set is input to the model training layer.
  • the data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer.
  • the face training set and the Non-face preprocessing data sets are collectively referred to as training sets.
  • the model training layer receives the training set and extracts the face control set from the database, calculates the training set according to the directional gradient method to obtain a gradient feature set, and compares the gradient feature set with the face
  • the control set is input to the lifting algorithm for training, and the training is exited when the training accuracy of the lifting algorithm is greater than the preset threshold.
  • the model training layer determines whether the captured image contains a human face. When the captured image is The obtained image does not contain human faces, and the result of unrecognized human faces is output. When the captured image contains a face, the model training layer sequentially determines the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face comparison with the highest similarity Collect pictures to complete face recognition.
  • the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present application.

Abstract

The present application relates to an artificial intelligence technology. Disclosed is a facial recognition method, comprising: collecting an original data set and a facial contrast set, pre-processing same and then inputting same into a model training layer; the model training layer performing calculation according to a histogram of oriented gradients method to obtain a gradient feature set; inputting the gradient feature set and the facial contrast set into a lifting algorithm for training, and exiting the training when the training accuracy of the lifting algorithm is greater than a pre-set threshold value; receiving a captured image, and the model training layer determining whether the captured image contains a face; and when the captured image contains a face, searching for a face with the highest similarity to the facial contrast set to complete facial recognition. Further provided are a facial recognition apparatus and a computer-readable storage medium. The present application can realize an accurate facial recognition function.

Description

人脸识别方法、装置及计算机可读存储介质Face recognition method, device and computer readable storage medium
本申请基于巴黎公约申明享有2019年5月20日递交的申请号为CN201910417997.3、名称为“人脸识别方法、装置及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。Based on the Paris Convention, this application declares that it enjoys the priority of the Chinese patent application filed on May 20, 2019, with the application number CN201910417997.3 and the title "face recognition method, device and computer readable storage medium". The Chinese patent application The overall content of is incorporated in this application by reference.
技术领域Technical field
本申请涉及人工智能技术领域,尤其涉及一种可用于智能安防的人脸识别方法、装置及计算机可读存储介质。This application relates to the field of artificial intelligence technology, and in particular to a face recognition method, device and computer-readable storage medium that can be used for smart security.
背景技术Background technique
随着科技的进步和人民生活水平的不断提高,人们对生活工作环境的要求越来越严格,特别是对安全性和智能性等方面提出了更高的要求,视频监控系统是安防的代表系统,随着物联网技术的不断发展,视频监控系统在国家安防领域和城市化管理中的重要性越来越突显,其功能和性能的要求也因此不断提高。但由于当今社会流动人口的大量增加、缺乏信息化管理方法等诸多因素,交通事故和社会治安问题表现出越来越严峻的事态。据公安部门介绍,现在不法分子破门或破窗进入实验科研大楼、写字楼、居民小区进行盗窃、抢劫等违法犯罪活动依然很严重,因此,安防监控系统的完善和发展已是当务之急的工作。目前国内外基于人脸识别的安防监控主要采用红外传感器的人脸报警系统,但红外报警系统易受各种热源、光源、射频辐射、热气流的干扰,难以达到高效的人脸识别效果。With the advancement of science and technology and the continuous improvement of people’s living standards, people’s requirements for the living and working environment are becoming more and more stringent, especially for safety and intelligence. The video surveillance system is the representative system of security. With the continuous development of Internet of Things technology, the importance of video surveillance systems in the field of national security and urbanization management has become more and more prominent, and the requirements for its functions and performance have also been continuously improved. However, due to the massive increase of the migrant population in today's society, the lack of information management methods and many other factors, traffic accidents and social security problems are showing increasingly serious situations. According to the public security department, criminal activities such as theft and robbery by breaking doors or breaking windows into experimental and scientific research buildings, office buildings, and residential communities are still very serious. Therefore, the improvement and development of security monitoring systems are urgent tasks. At present, the security monitoring based on face recognition at home and abroad mainly adopts the face alarm system of infrared sensor, but the infrared alarm system is susceptible to interference from various heat sources, light sources, radio frequency radiation, and hot air flow, and it is difficult to achieve efficient face recognition effects.
发明内容Summary of the invention
本申请提供一种人脸识别方法、装置及计算机可读存储介质,其主要目的在于提供一种能够从视频或图片数据中高效地识别出人脸的技术方案。This application provides a face recognition method, device, and computer-readable storage medium, the main purpose of which is to provide a technical solution that can efficiently recognize a face from video or picture data.
为实现上述目的,本申请提供的一种人脸识别方法,包括:In order to achieve the above objective, a face recognition method provided by this application includes:
步骤A:数据采集层采集人脸图像集、非人脸图像集和人脸对照集,将所述人脸图像集和所述非人脸图像集保存为原始数据集,并将所述原始数据 集输入至数据处理层,将所述人脸对照集输入至数据库中;Step A: The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
步骤B:所述数据处理层对所述原始数据集进行灰度化和降噪处理,得到预处理数据集,其中,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层;Step B: The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
步骤C:所述数据切割层接收所述人脸预处理数据集,对所述人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层,;Step C: The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer;
步骤D:所述模型训练层接收由所述人脸训练集和所述非人脸预处理数据集组成的训练集,并从所述数据库中提取所述人脸对照集,根据方向梯度直方法对所述训练集进行计算得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时,所述模型训练层退出训练;Step D: The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method The training set is calculated to obtain a gradient feature set, and the gradient feature set and the face control set are input to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model The training layer exits training;
步骤E:数据采集层接收捕捉到的图像,对所述输入图像进行灰度化和降噪处理后输入至所述模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果;Step E: The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the input image, and then inputs it to the model training layer. The model training layer determines whether the captured image contains a person Face, when the captured image does not contain a human face, output the result that the human face is not recognized;
步骤F:当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。Step F: When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
此外,为实现上述目的,本申请还提供一种人脸识别装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的人脸识别程序,所述人脸识别程序被所述处理器执行时实现如下步骤:In addition, in order to achieve the above object, the present application also provides a face recognition device, which includes a memory and a processor. The memory stores a face recognition program that can run on the processor. The following steps are implemented when the recognition program is executed by the processor:
步骤A:数据采集层采集人脸图像集、非人脸图像集和人脸对照集,将所述人脸图像集和所述非人脸图像集保存为原始数据集,并将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中;Step A: The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
步骤B:所述数据处理层对所述原始数据集进行灰度化和降噪处理,得到预处理数据集,其中,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层;Step B: The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
步骤C:所述数据切割层接收所述人脸预处理数据集,对所述人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层,;Step C: The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer;
步骤D:所述模型训练层接收由所述人脸训练集和所述非人脸预处理数据集组成的训练集,并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时,所述模型训练层退出训练;Step D: The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method Calculate the training set to obtain a gradient feature set, and input the gradient feature set and the face control set to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer Exit training;
步骤E:数据采集层接收捕捉到的图像,对所述捕捉到的图像进行灰度化和降噪处理后输入至所述模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果;Step E: The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the captured image, and then inputs it to the model training layer. The model training layer determines whether the captured image is Contains a human face, and when the captured image does not contain a human face, output the result that the human face is not recognized;
步骤F:当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。Step F: When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有人脸识别程序,所述人脸识别程序可被一个或者多个处理器执行,以实现如上所述的人脸识别方法的步骤。In addition, in order to achieve the above-mentioned object, the present application also provides a computer-readable storage medium that stores a face recognition program on the computer-readable storage medium, and the face recognition program can be executed by one or more processors to Implement the steps of the face recognition method as described above.
自适应图像降噪滤波器可以减少噪声对图像的影响,提升算法很好的利用弱分类器进行级联,最终组合形式强分类器,具有很高的分类精度,因此本申请提出的人脸识别方法、装置及计算机可读存储介质可以实现精准的人脸识别功能。The adaptive image denoising filter can reduce the impact of noise on the image, and the improvement algorithm makes good use of weak classifiers for cascading, and the final combination form of strong classifiers has high classification accuracy. Therefore, the face recognition proposed in this application The method, device and computer-readable storage medium can realize accurate face recognition function.
附图说明Description of the drawings
图1为本申请一实施例提供的人脸识别方法的流程示意图;FIG. 1 is a schematic flowchart of a face recognition method provided by an embodiment of this application;
图2为本申请一实施例提供的人脸识别装置的内部结构示意图;2 is a schematic diagram of the internal structure of a face recognition device provided by an embodiment of the application;
图3为本申请一实施例提供的人脸识别装置中人脸识别程序的模块示意图。FIG. 3 is a schematic diagram of modules of a face recognition program in a face recognition device provided by an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the application, and are not used to limit the application.
本申请提供一种人脸识别方法。参照图1所示,为本申请一实施例提供的人脸识别方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a face recognition method. Referring to FIG. 1, it is a schematic flowchart of a face recognition method provided by an embodiment of this application. The method can be executed by a device, and the device can be implemented by software and/or hardware.
在本实施例中,人脸识别方法包括:In this embodiment, the face recognition method includes:
S1、数据采集层采集人脸图像集、非人脸图像集和人脸对照集,将所述人脸图像集和所述非人脸图像集保存为原始数据集,并将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中。S1. The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data set Input to the data processing layer, and input the face comparison set into the database.
本申请较佳实施例在一预设场景,如实验科研大楼、写字楼、居民小区等部署若干处视频监控区域,从所述若干处视频监控区域内所捕捉的图像集中选取包括人脸的图像,组成人脸图像集;基于所述人脸图像集内不相同的人脸,采集与所述各不相同的人脸对应的证件照图片,同时从相关监控部门获取证件照片,如从公安部门获取犯罪在逃人员的证件照、失信老赖证件照等,组成所述人脸对照集。The preferred embodiment of the present application deploys several video surveillance areas in a preset scene, such as an experimental scientific research building, office building, residential area, etc., and selects images including human faces from the images captured in the several video surveillance areas. Form a face image set; based on different faces in the face image set, collect ID photo pictures corresponding to the different faces, and obtain ID photos from the relevant monitoring department, such as from the public security department The ID photos of the criminals at large, the ID photos of the untrustworthy Lai Lai, etc., constitute the face comparison set.
进一步地,本申请较佳实施例从所述若干处视频监控区域内所捕捉的图像集中选取不包括人脸的图像,并从预设数据集,如COCO数据集中,获取非人类的目标数据集,组成非人脸图像集。所述COCO数据集是大型图像数据集,专为对象检测、分割、人体关键点检测、语义分割和字幕生成而设计。Further, the preferred embodiment of the present application selects images that do not include human faces from the captured image sets in the several video surveillance areas, and obtains non-human target data sets from a preset data set, such as the COCO data set , Compose a set of non-face images. The COCO data set is a large-scale image data set specially designed for object detection, segmentation, human key point detection, semantic segmentation and caption generation.
S2、所述数据处理层对所述原始数据集进行灰度化和降噪处理,得到预处理数据集,其中,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层。S2. The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessed data set and a non-face preprocessed data Set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer.
本申请较佳实施例中,所述灰度化是采用比例法将所述原始数据集内的数据从RGB格式转为黑白灰格式。所述比例法如下:获取所述原始数据集内的每个像素点的R、G、B像素值,根据如下函数将所述像素点转为黑白灰格式:In a preferred embodiment of the present application, the gray scale is to convert the data in the original data set from an RGB format to a black and white gray format by using a proportional method. The ratio method is as follows: Obtain the R, G, and B pixel values of each pixel in the original data set, and convert the pixel to a black-and-white gray format according to the following function:
0.30*R+0.59*G+0.11*B0.30*R+0.59*G+0.11*B
本申请较佳实施例中,所述降噪处理采用如下自适应图像降噪滤波法:In a preferred embodiment of the present application, the noise reduction processing adopts the following adaptive image noise reduction filtering method:
g(x,y)=η(x,y)+f(x,y)g(x,y)=η(x,y)+f(x,y)
Figure PCTCN2019117342-appb-000001
Figure PCTCN2019117342-appb-000001
其中,(x,y)表示所述原始数据集内图像像素点坐标,f(x,y)为基于所述自适应图像降噪滤波法对所述原始数据集进行降噪处理后的输出数据,η(x,y)为噪声,g(x,y)为所述原始数据集,
Figure PCTCN2019117342-appb-000002
为所述原始数据集的噪声总方差,
Figure PCTCN2019117342-appb-000003
为所述(x,y)的像素灰度均值,
Figure PCTCN2019117342-appb-000004
为所述(x,y)的像素灰度方差,L表示当前像素点坐标。
Wherein, (x, y) represents the coordinates of the image pixels in the original data set, and f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method , Η(x,y) is noise, g(x,y) is the original data set,
Figure PCTCN2019117342-appb-000002
Is the total noise variance of the original data set,
Figure PCTCN2019117342-appb-000003
Is the average gray value of the pixel (x, y),
Figure PCTCN2019117342-appb-000004
Is the pixel gray variance of the (x, y), and L represents the current pixel coordinates.
S3、所述数据切割层接收所述人脸预处理数据集,对所述人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层。S3. The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set to obtain a face training set and inputs it to the model training layer.
本申请较佳实施例所述边缘检测和所述分割处理是根据所述边缘检测寻找所述人脸预处理数据集中像素灰度阶跃变化较大的像素集合,并基于所述分割处理将所述像素集合重新连接,分割出人脸与所述人脸背景。其中,所述阶跃变化较大即是灰度导数为极大值或极小值。In the preferred embodiment of the present application, the edge detection and the segmentation process are based on the edge detection to find a pixel set with a large change in the pixel gray level in the face preprocessing data set, and based on the segmentation process. The pixel set is reconnected to segment the human face and the human face background. Wherein, the larger step change means that the gray-scale derivative has a maximum value or a minimum value.
本申请较佳实施例采用Canny边缘检测法。所述Canny边缘检测法基于高斯滤波器对所述人脸预处理数据集进行平滑滤波处理,基于一阶偏导有限差分计算所述平滑滤波处理后的数据集,得到非局部极大值点和极小值点,完成边缘检测。The preferred embodiment of the present application adopts the Canny edge detection method. The Canny edge detection method smooths and filters the face preprocessing data set based on a Gaussian filter, and calculates the smoothed and filtered data set based on the first-order partial derivative finite difference to obtain non-local maximum points and Minimal value point, complete edge detection.
S4、所述模型训练层接收由所述人脸训练集和所述非人脸预处理数据集组成的训练集,并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时,所述模型训练层退出训练。S4. The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, and calculates according to the direction gradient straight method The training set obtains a gradient feature set, and the gradient feature set and the face control set are input to a lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer exits training.
本申请较佳实施例计算所述训练集内的数据各像素点(x,y)的梯度幅值和梯度方向值,并将所述梯度幅值作为第一分量,所述梯度方向值作为第二分量形成梯度矩阵;将所述梯度矩阵内数据划分为多个小块,并相加各小块的梯度幅值与梯度方向值,得到相加值,并将所述相加值串联形成所述梯度特征集。The preferred embodiment of the present application calculates the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set, and uses the gradient amplitude as the first component and the gradient direction value as the first component. Two components form a gradient matrix; divide the data in the gradient matrix into multiple small blocks, and add the gradient amplitude and the gradient direction value of each small block to obtain the added value, and the added value is connected in series to form the The gradient feature set.
本申请较佳实施例中,所述提升算法包括AdaBoost算法,所述AdaBoost算法包括若干个弱分类器和强分类器;In a preferred embodiment of the present application, the boosting algorithm includes the AdaBoost algorithm, and the AdaBoost algorithm includes several weak classifiers and strong classifiers;
其中,所述弱分类器h(x,t,p,θ)为:Wherein, the weak classifier h(x, t, p, θ) is:
Figure PCTCN2019117342-appb-000005
Figure PCTCN2019117342-appb-000005
其中,t为包括所述梯度特征集的分类函数,x表示检测子窗口,p为权衡不等号方向系数,θ为所述弱分类器阈值,本申请较佳实施例根据所述梯度特征集训练所述弱分类器h(x,t,p,θ),直至确定最优阈值θ,得到所述强分类器C(x):Wherein, t is the classification function including the gradient feature set, x is the detection sub-window, p is the weighted inequality direction coefficient, and θ is the weak classifier threshold. The preferred embodiment of the present application is trained on the basis of the gradient feature set. The weak classifier h(x, t, p, θ) until the optimal threshold θ is determined to obtain the strong classifier C(x):
Figure PCTCN2019117342-appb-000006
Figure PCTCN2019117342-appb-000006
其中,α k为所述强分类器C(x)的系数,T为所述弱分类器的总数,β k=ε k/(1-ε k),所述ε k为: Where α k is the coefficient of the strong classifier C(x), T is the total number of the weak classifiers, β kk /(1-ε k ), and the ε k is:
Figure PCTCN2019117342-appb-000007
Figure PCTCN2019117342-appb-000007
其中,w i所述梯度特征集的权重,y i为所述人脸对照集。 Wherein, w i is the weight of the gradient feature set, and yi is the face control set.
本申请较佳实施例,当所述强分类器C(x)对所述训练集的人脸识别判断准确率大于所述预设阈值时,所述提升算法退出训练,所述预设阈值一般设置为0.97。In a preferred embodiment of the present application, when the strong classifier C(x) judges that the accuracy of the face recognition of the training set is greater than the preset threshold, the boosting algorithm exits training, and the preset threshold is generally Set to 0.97.
S5、接收捕捉图像,对所述捕捉图像进行灰度化和降噪处理后输入至模型训练层,以判断所述捕捉图像中是否包含人脸。S5. Receive a captured image, perform grayscale and noise reduction processing on the captured image, and then input it to the model training layer to determine whether the captured image contains a human face.
较佳地,所述捕捉图像使用室外摄像头、手机等装备所捕捉到的图像。Preferably, the captured image uses an image captured by equipment such as an outdoor camera and a mobile phone.
S6、当所述捕捉图像不包含人脸,输出未识别出人脸的结果。S6. When the captured image does not contain a human face, output the result that the human face is not recognized.
S7、当所述捕捉图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。S7. When the captured image contains a face, the model training layer sequentially determines the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face comparison with the highest similarity Collect pictures to complete face recognition.
本申请较佳实施例,所述欧式距离法为:In a preferred embodiment of the present application, the Euclidean distance method is:
Figure PCTCN2019117342-appb-000008
Figure PCTCN2019117342-appb-000008
其中,a为所述捕捉图像,y i为所述人脸对照集,n为所述人脸对照集的数据总量。 Wherein, a is the captured image, yi is the face comparison set, and n is the total amount of data in the face comparison set.
发明还提供一种人脸识别装置。参照图2所示,为本申请一实施例提供 的人脸识别装置的内部结构示意图。(对应修改)The invention also provides a face recognition device. Referring to FIG. 2, it is a schematic diagram of the internal structure of a face recognition device provided by an embodiment of this application. (Corresponding modification)
在本实施例中,所述人脸识别装置1可以是PC(Personal Computer,个人电脑),或者是智能手机、平板电脑、便携计算机等终端设备,也可以是一种服务器等。该人脸识别装置1至少包括存储器11、处理器12,通信总线13,以及网络接口14。In this embodiment, the face recognition apparatus 1 may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, or a portable computer, or a server. The face recognition device 1 at least includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是人脸识别装置1的内部存储单元,例如该人脸识别装置1的硬盘。存储器11在另一些实施例中也可以是人脸识别装置1的外部存储设备,例如人脸识别装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括人脸识别装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于人脸识别装置1的应用软件及各类数据,例如人脸识别程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may be an internal storage unit of the face recognition device 1 in some embodiments, such as a hard disk of the face recognition device 1. In other embodiments, the memory 11 may also be an external storage device of the face recognition device 1, for example, a plug-in hard disk equipped on the face recognition device 1, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital) Digital, SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the face recognition apparatus 1 and an external storage device. The memory 11 can be used not only to store application software and various data installed in the face recognition device 1, such as the code of the face recognition program 01, etc., but also to temporarily store data that has been output or will be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行人脸识别程序01等。In some embodiments, the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, and is used to run the program code or processing stored in the memory 11 Data, such as execution of face recognition program 01, etc.
通信总线13用于实现这些组件之间的连接通信。The communication bus 13 is used to realize the connection and communication between these components.
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置1与其他电子设备之间建立通信连接。The network interface 14 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the device 1 and other electronic devices.
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在人脸识别装置1中处理的信息以及用于显示可视化的用户界面。Optionally, the device 1 may also include a user interface. The user interface may include a display (Display) and an input unit such as a keyboard (Keyboard). The optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc. Among them, the display can also be called a display screen or a display unit as appropriate, for displaying information processed in the face recognition device 1 and for displaying a visualized user interface.
图2仅示出了具有组件11-14以及人脸识别程序01的人脸识别装置1,本领域技术人员可以理解的是,图1示出的结构并不构成对人脸识别装置1 的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 2 only shows the face recognition device 1 with components 11-14 and the face recognition program 01. Those skilled in the art will understand that the structure shown in FIG. 1 does not constitute a limitation on the face recognition device 1 It may include fewer or more components than shown, or a combination of some components, or a different component arrangement.
在图2所示的装置1实施例中,存储器11中存储有人脸识别程序01;处理器12执行存储器11中存储的人脸识别程序01时实现如下步骤:In the embodiment of the device 1 shown in FIG. 2, the memory 11 stores the face recognition program 01; when the processor 12 executes the face recognition program 01 stored in the memory 11, the following steps are implemented:
步骤一、采集人脸图像集、非人脸图像集和人脸对照集,所述人脸图像集和所述非人脸图像集统称为原始数据集,将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中。 Step 1. Collect a face image set, a non-face image set, and a face comparison set. The face image set and the non-face image set are collectively referred to as the original data set, and the original data set is input to the data processing Layer, input the face comparison set into the database.
本申请较佳实施例部署若干处视频监控区域,将所述若干处视频监控区域内所捕捉的图像集传送至数据库中;选取所述数据库中存储的图像集中包括人脸的图像,组成人脸图像集;基于所述人脸图像集内不相同的人脸,采集与所述各不相同的人脸对应的证件照图片,同时从相关监控部门获取证件照片,如从公安部门获取犯罪在逃人员的证件照、失信老赖证件照等,组成所述人脸对照集。The preferred embodiment of the present application deploys several video surveillance areas, and transfers the image sets captured in the several video surveillance areas to the database; selects images that include human faces in the image set stored in the database to form human faces Image set; based on the different faces in the face image set, collect ID photos corresponding to the different faces, and obtain ID photos from the relevant monitoring department, such as obtaining criminals at large from the public security department The ID photos and the ID photos of the untrustworthy old Lai, etc. form the face comparison set.
本申请较佳实施例选取所述数据库中存储的图像集中不包括人脸的图像,并从预设数据集,如COCO数据集中,选择非人类的目标数据集,组成非人脸图像集,所述COCO数据集是大型图像数据集,专为对象检测、分割、人体关键点检测、语义分割和字幕生成而设计。The preferred embodiment of this application selects images that do not include human faces in the image set stored in the database, and selects non-human target data sets from a preset data set, such as the COCO data set, to form a non-human face image set. The COCO data set is a large-scale image data set designed for object detection, segmentation, human key point detection, semantic segmentation and caption generation.
步骤二、所述数据处理层对所述原始数据集进行灰度化和降噪处理得到预处理数据集,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层。Step 2: The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, and the preprocessed data set includes a face preprocessed data set and a non-face preprocessed data set, The face preprocessing data set is input to the data cutting layer, and the non-face preprocessing data set is input to the model training layer.
本申请较佳实施例中,所述灰度化是采用比例法将所述原始数据集内的数据从RGB格式转为黑白灰格式。所述比例法如下:获取所述原始数据集内的每个像素点的R、G、B像素值,根据如下函数将所述像素点转为黑白灰格式:In a preferred embodiment of the present application, the gray scale is to convert the data in the original data set from an RGB format to a black and white gray format by using a proportional method. The ratio method is as follows: Obtain the R, G, and B pixel values of each pixel in the original data set, and convert the pixel to a black-and-white gray format according to the following function:
0.30*R+0.59*G+0.11*B0.30*R+0.59*G+0.11*B
本申请较佳实施例所述降噪处理采用自适应图像降噪滤波法:The noise reduction processing in the preferred embodiment of the application adopts an adaptive image noise reduction filtering method:
g(x,y)=η(x,y)+f(x,y)g(x,y)=η(x,y)+f(x,y)
Figure PCTCN2019117342-appb-000009
Figure PCTCN2019117342-appb-000009
其中,(x,y)表示所述原始数据集内图像像素点坐标,f(x,y)为基于所述自适应图像降噪滤波法对所述原始数据集进行降噪处理后的输出数据,η(x,y)为噪声,g(x,y)为所述原始数据集,
Figure PCTCN2019117342-appb-000010
为所述原始数据集的噪声总方差,
Figure PCTCN2019117342-appb-000011
为所述(x,y)的像素灰度均值,
Figure PCTCN2019117342-appb-000012
为所述(x,y)的像素灰度方差,L表示当前像素点坐标。
Wherein, (x, y) represents the coordinates of the image pixels in the original data set, and f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method , Η(x,y) is noise, g(x,y) is the original data set,
Figure PCTCN2019117342-appb-000010
Is the total noise variance of the original data set,
Figure PCTCN2019117342-appb-000011
Is the average gray value of the pixel (x, y),
Figure PCTCN2019117342-appb-000012
Is the pixel gray variance of the (x, y), and L represents the current pixel coordinates.
步骤三、所述数据切割层接收所述人脸预处理数据集,对人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层,所述人脸训练集和所述非人脸预处理数据集统称训练集。Step 3. The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer. The face training set The non-face preprocessing data set is collectively referred to as a training set.
本申请较佳实施例所述边缘检测和所述分割处理是根据所述边缘检测寻找所述人脸预处理数据集中像素灰度阶跃变化较大的像素集合,并基于所述分割处理将所述像素集合重新连接,分割出人脸与所述人脸背景。进一步地,所述阶跃变化较大即灰度导数为极大值或极小值。In the preferred embodiment of the present application, the edge detection and the segmentation process are based on the edge detection to find a pixel set with a large change in the pixel gray level in the face preprocessing data set, and based on the segmentation process. The pixel set is reconnected to segment the human face and the human face background. Further, the step change is large, that is, the gray-scale derivative is a maximum value or a minimum value.
本申请较佳实施例采用Canny边缘检测法,所述Canny边缘检测法基于高斯滤波器对所述人脸预处理数据集进行平滑滤波处理,基于一阶偏导有限差分计算所述平滑滤波处理后的数据集,得到非局部极大值点和极小值点,完成边缘检测。The preferred embodiment of the present application adopts the Canny edge detection method. The Canny edge detection method performs smoothing filtering processing on the face preprocessing data set based on a Gaussian filter, and calculating after the smoothing filtering processing based on the first-order partial derivative finite difference Obtain the non-local maximum and minimum points for the data set, and complete the edge detection.
步骤四、所述模型训练层接收所述训练集并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时退出训练。Step 4. The model training layer receives the training set and extracts the face control set from the database, calculates the training set according to the directional gradient method to obtain a gradient feature set, and compares the gradient feature set with all The face comparison set is input to the lifting algorithm for training, and training is exited when the training accuracy of the lifting algorithm is greater than a preset threshold.
本申请较佳实施例,计算所述训练集内的数据各像素点(x,y)的梯度幅值和梯度方向值,并将所述梯度幅值作为第一分量,所述梯度方向值作为第二分量形成梯度矩阵;将所述梯度矩阵内数据划分为多个小块,并相加各小块的梯度幅值与梯度方向值得到相加值,并将所述相加值串联形成梯度特征集输入至所述提升算法。In a preferred embodiment of this application, the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set are calculated, and the gradient amplitude is used as the first component, and the gradient direction value is used as The second component forms a gradient matrix; divide the data in the gradient matrix into a plurality of small blocks, and add the gradient amplitude and the gradient direction value of each small block to obtain an added value, and connect the added value in series to form a gradient The feature set is input to the lifting algorithm.
本申请较佳实施例所述提升算法包括AdaBoost算法,所述AdaBoost算法包括若干个弱分类器和强分类器;The boosting algorithm of the preferred embodiment of the present application includes the AdaBoost algorithm, and the AdaBoost algorithm includes several weak classifiers and strong classifiers;
所述弱分类器h(x,t,p,θ)为:The weak classifier h(x, t, p, θ) is:
Figure PCTCN2019117342-appb-000013
Figure PCTCN2019117342-appb-000013
其中,t为包括所述梯度特征集的分类函数,x表示检测子窗口,p为权衡 不等号方向系数,θ为所述弱分类器阈值,所述弱分类器根据所述梯度特征集训练所述弱分类器h(x,t,p,θ),直至确定最优阈值θ;Where t is the classification function including the gradient feature set, x is the detection sub-window, p is the weighted inequality direction coefficient, and θ is the threshold of the weak classifier, and the weak classifier is trained according to the gradient feature set. Weak classifier h(x,t,p,θ) until the optimal threshold θ is determined;
所述强分类器C(x)为:The strong classifier C(x) is:
Figure PCTCN2019117342-appb-000014
Figure PCTCN2019117342-appb-000014
其中,α k为所述强分类器C(x)的系数,T为所述弱分类器的总数,β k=ε k/(1-ε k),所述ε k为: Where α k is the coefficient of the strong classifier C(x), T is the total number of the weak classifiers, β kk /(1-ε k ), and the ε k is:
Figure PCTCN2019117342-appb-000015
Figure PCTCN2019117342-appb-000015
其中,w i所述梯度特征集的权重,y i为所述人脸对照集。 Wherein, w i is the weight of the gradient feature set, and yi is the face control set.
本申请较佳实施例,当所述强分类器C(x)对所述训练集的人脸识别判断准确率大于所述预设阈值时,所述提升算法退出训练,所述预设阈值一般设置为0.97。In a preferred embodiment of the present application, when the strong classifier C(x) judges that the accuracy of the face recognition of the training set is greater than the preset threshold, the boosting algorithm exits training, and the preset threshold is generally Set to 0.97.
步骤五、接收捕捉图像,对所述捕捉图像进行灰度化和降噪处理后输入至模型训练层,以判断所述捕捉图像中是否包含人脸。Step 5: Receive a captured image, perform grayscale and noise reduction processing on the captured image, and input it to the model training layer to determine whether the captured image contains a human face.
较佳地,所述捕捉图像使用室外摄像头、手机等装备所捕捉到的图像。Preferably, the captured image uses an image captured by equipment such as an outdoor camera and a mobile phone.
步骤六、当所述捕捉图像不包含人脸,输出未识别出人脸的结果。 Step 6. When the captured image does not contain a human face, output the result that the human face is not recognized.
步骤七、当所述捕捉图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。 Step 7. When the captured image contains a face, the model training layer sequentially judges the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face with the highest similarity Comparing the pictures in the collection to complete face recognition.
本申请较佳实施例,所述欧式距离法为:In a preferred embodiment of the present application, the Euclidean distance method is:
Figure PCTCN2019117342-appb-000016
Figure PCTCN2019117342-appb-000016
其中,a为所述捕捉图像,y i为所述人脸对照集,n为所述人脸对照集的数据总量。 Wherein, a is the captured image, yi is the face comparison set, and n is the total amount of data in the face comparison set.
可选地,在其他实施例中,人脸识别程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述人脸识别程序在人脸识别装 置中的执行过程。Optionally, in other embodiments, the face recognition program can also be divided into one or more modules, and the one or more modules are stored in the memory 11 and run by one or more processors (this embodiment is The processor 12) is executed to complete the application. The module referred to in the application refers to a series of computer program instruction segments capable of completing specific functions, and is used to describe the execution process of the face recognition program in the face recognition device.
例如,参照图3所示,为本申请人脸识别装置一实施例中的人脸识别程序的程序模块示意图,该实施例中,所述人脸识别程序可以被分割为数据接收模块10、数据处理模块20、模型训练模块30、人脸识别输出模块40示例性地:For example, referring to FIG. 3, it is a schematic diagram of the program modules of the face recognition program in an embodiment of the applicant’s face recognition device. In this embodiment, the face recognition program can be divided into a data receiving module 10 and a data The processing module 20, the model training module 30, and the face recognition output module 40 are exemplary:
所述数据接收模块10用于:采集人脸图像集、非人脸图像集和人脸对照集,所述人脸图像集和所述非人脸图像集统称为原始数据集,将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中。The data receiving module 10 is used to collect a face image set, a non-face image set, and a face comparison set. The face image set and the non-face image set are collectively referred to as an original data set, and the original The data set is input into the data processing layer, and the face comparison set is input into the database.
所述数据处理模块20用于:所述数据处理层对所述原始数据集进行灰度化和降噪处理得到预处理数据集,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层。所述数据切割层接收所述人脸预处理数据集,对人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层,所述人脸训练集和所述非人脸预处理数据集统称训练集。The data processing module 20 is configured to: the data processing layer performs grayscale and noise reduction processing on the original data set to obtain a preprocessed data set, and the preprocessed data set includes a face preprocessed data set and a non-human face The face preprocessing data set is input to the data cutting layer, and the non-face preprocessing data set is input to the model training layer. The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer. The face training set and the Non-face preprocessing data sets are collectively referred to as training sets.
所述模型训练模块30用于:所述模型训练层接收所述训练集并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时退出训练。The model training module 30 is configured to: the model training layer receives the training set and extracts the face control set from the database, calculates the training set according to the directional gradient method to obtain a gradient feature set, The gradient feature set and the face control set are input to a lifting algorithm for training, and training is exited when the training accuracy of the lifting algorithm is greater than a preset threshold.
所述人脸识别输出模块40用于:接收捕捉到的图像,对所述用户捕捉到的图像进行灰度化和降噪处理后输入至模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果。当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。The face recognition output module 40 is configured to: receive the captured image, perform grayscale and noise reduction processing on the image captured by the user, and then input it to the model training layer, and the model training layer determines the captured image Whether the captured image contains a human face, when the captured image does not contain a human face, output the result that the human face is not recognized. When the captured image contains a face, the model training layer sequentially determines the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face comparison with the highest similarity Collect pictures to complete face recognition.
上述数据接收模块10、数据处理模块20、模型训练模块30、人脸识别输出模块40等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。The functions or operation steps implemented by the program modules such as the data receiving module 10, the data processing module 20, the model training module 30, and the face recognition output module 40 when executed are substantially the same as those in the foregoing embodiment, and will not be repeated here.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有人脸识别程序,所述人脸识别程序可被一个或多个处理器执行,以实现如下操作:In addition, an embodiment of the present application also proposes a computer-readable storage medium that stores a face recognition program on the computer-readable storage medium, and the face recognition program can be executed by one or more processors to implement the following operations :
采集人脸图像集、非人脸图像集和人脸对照集,所述人脸图像集和所述非人脸图像集统称为原始数据集,将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中。Collect a face image set, a non-face image set, and a face control set. The face image set and the non-face image set are collectively referred to as the original data set. The original data set is input to the data processing layer, and The face comparison set is input into the database.
所述数据处理层对所述原始数据集进行灰度化和降噪处理得到预处理数据集,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层。所述数据切割层接收所述人脸预处理数据集,对人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层,所述人脸训练集和所述非人脸预处理数据集统称训练集。The data processing layer performs grayscale and noise reduction processing on the original data set to obtain a preprocessed data set. The preprocessed data set includes a face preprocessed data set and a non-face preprocessed data set, and the The face preprocessing data set is input to the data cutting layer, and the non-face preprocessing data set is input to the model training layer. The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer. The face training set and the Non-face preprocessing data sets are collectively referred to as training sets.
所述模型训练层接收所述训练集并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时退出训练。The model training layer receives the training set and extracts the face control set from the database, calculates the training set according to the directional gradient method to obtain a gradient feature set, and compares the gradient feature set with the face The control set is input to the lifting algorithm for training, and the training is exited when the training accuracy of the lifting algorithm is greater than the preset threshold.
接收捕捉到的图像,对所述捕捉到的图像进行灰度化和降噪处理后输入至模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果。当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。Receive the captured image, perform grayscale and noise reduction processing on the captured image, and then input it to the model training layer. The model training layer determines whether the captured image contains a human face. When the captured image is The obtained image does not contain human faces, and the result of unrecognized human faces is output. When the captured image contains a face, the model training layer sequentially determines the similarity between the captured image and the face comparison set of the database based on the Euclidean distance method, and outputs the face comparison with the highest similarity Collect pictures to complete face recognition.
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the serial numbers of the above embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. And the terms "include", "include" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements not only includes those elements, but also includes The other elements listed may also include elements inherent to the process, device, article, or method. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, device, article or method that includes the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (20)

  1. 一种人脸识别方法,其特征在于,所述方法包括:A face recognition method, characterized in that the method includes:
    步骤A:数据采集层采集人脸图像集、非人脸图像集和人脸对照集,将所述人脸图像集和所述非人脸图像集保存为原始数据集,并将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中;Step A: The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
    步骤B:所述数据处理层对所述原始数据集进行灰度化和降噪处理,得到预处理数据集,其中,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层;Step B: The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
    步骤C:所述数据切割层接收所述人脸预处理数据集,对所述人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层;Step C: The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set to obtain a face training set and inputs it to the model training layer;
    步骤D:所述模型训练层接收由所述人脸训练集和所述非人脸预处理数据集组成的训练集,并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时,所述模型训练层退出训练;Step D: The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method Calculate the training set to obtain a gradient feature set, and input the gradient feature set and the face control set to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer Exit training;
    步骤E:数据采集层接收捕捉到的图像,对所述捕捉到的图像进行灰度化和降噪处理后输入至所述模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果;Step E: The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the captured image, and then inputs it to the model training layer. The model training layer determines whether the captured image is Contains a human face, and when the captured image does not contain a human face, output the result that the human face is not recognized;
    步骤F:当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。Step F: When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
  2. 如权利要求1所述的人脸识别方法,其特征在于,采集人脸图像集、非人脸图像集和人脸对照集,包括:The face recognition method according to claim 1, wherein collecting a face image set, a non-face image set and a face comparison set comprises:
    从预设场景内部署的若干处视频监控区域内所捕捉的图像集中选择包括人脸的图像,组成人脸图像集;Select images including faces from a collection of images captured in several video surveillance areas deployed in preset scenes to form a face image set;
    从所捕捉的图像集中选取不包括人脸的图像,并从预设数据库中选择非人类的目标数据集,组成非人脸图像集;Select images that do not include human faces from the captured image set, and select non-human target data sets from the preset database to form a non-human face image set;
    基于所述人脸图像集内不相同的人脸,采集与所述各不相同的人脸对应的证件照图片,组成人脸对照集。Based on different faces in the face image set, ID photo images corresponding to the different faces are collected to form a face comparison set.
  3. 如权利要求1或2所述的人脸识别方法,其特征在于,所述降噪处理采用如下自适应图像降噪滤波法:The face recognition method of claim 1 or 2, wherein the noise reduction processing adopts the following adaptive image noise reduction filtering method:
    g(x,y)=η(x,y)+f(x,y)g(x,y)=η(x,y)+f(x,y)
    Figure PCTCN2019117342-appb-100001
    Figure PCTCN2019117342-appb-100001
    其中,(x,y)表示所述原始数据集内图像像素点坐标,f(x,y)为基于所述自适应图像降噪滤波法对所述原始数据集进行降噪处理后的输出数据,η(x,y)为噪声,g(x,y)为所述原始数据集,
    Figure PCTCN2019117342-appb-100002
    为所述原始数据集的噪声总方差,
    Figure PCTCN2019117342-appb-100003
    为所述(x,y)的像素灰度均值,
    Figure PCTCN2019117342-appb-100004
    为所述(x,y)的像素灰度方差,L表示当前像素点坐标。
    Wherein, (x, y) represents the coordinates of the image pixels in the original data set, and f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method , Η(x,y) is noise, g(x,y) is the original data set,
    Figure PCTCN2019117342-appb-100002
    Is the total noise variance of the original data set,
    Figure PCTCN2019117342-appb-100003
    Is the average gray value of the pixel (x, y),
    Figure PCTCN2019117342-appb-100004
    Is the pixel gray variance of the (x, y), and L represents the current pixel coordinates.
  4. 如权利要求3所述的人脸识别方法,其特征在于,所述边缘检测采用Canny边缘检测法。The face recognition method according to claim 3, wherein the edge detection adopts the Canny edge detection method.
  5. 如权利要求3所述的人脸识别方法,其特征在于,所述根据方向梯度直方法计算所述训练集得到梯度特征集,包括:The face recognition method according to claim 3, wherein the calculating the training set according to the directional gradient straight method to obtain the gradient feature set comprises:
    计算所述训练集内的数据各像素点(x,y)的梯度幅值和梯度方向值,并将所述梯度幅值作为第一分量,所述梯度方向值作为第二分量形成梯度矩阵;Calculate the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set, and use the gradient amplitude as the first component and the gradient direction value as the second component to form a gradient matrix;
    将所述梯度矩阵内数据划分为多个小块,并相加各小块的梯度幅值与梯度方向值得到相加值,并将所述相加值串联形成所述梯度特征集。The data in the gradient matrix is divided into a plurality of small blocks, and the gradient amplitude and the gradient direction value of each small block are added to obtain an added value, and the added value is connected in series to form the gradient feature set.
  6. 如权利要求5所述的人脸识别方法,其特征在于,所述提升算法包括AdaBoost算法,所述AdaBoost算法包括若干个弱分类器和强分类器;The face recognition method according to claim 5, wherein the boosting algorithm comprises an AdaBoost algorithm, and the AdaBoost algorithm comprises several weak classifiers and strong classifiers;
    其中,所述弱分类器h(x,t,p,θ)为:Wherein, the weak classifier h(x, t, p, θ) is:
    Figure PCTCN2019117342-appb-100005
    Figure PCTCN2019117342-appb-100005
    其中,t为包括所述梯度特征集的分类函数,x表示检测子窗口,p为权衡不等号方向系数,θ为所述弱分类器阈值,所述弱分类器根据所述梯度特征集训练所述弱分类器h(x,t,p,θ),直至确定最优阈值θ,得到所述强分类器C(x):Where t is the classification function including the gradient feature set, x is the detection sub-window, p is the weighted inequality direction coefficient, and θ is the threshold of the weak classifier, and the weak classifier is trained according to the gradient feature set. The weak classifier h(x, t, p, θ) until the optimal threshold θ is determined to obtain the strong classifier C(x):
    Figure PCTCN2019117342-appb-100006
    Figure PCTCN2019117342-appb-100006
    其中,α k为所述强分类器C(x)的系数,T为所述弱分类器的总数,β k=ε k/(1-ε k),所述ε k为: Where α k is the coefficient of the strong classifier C(x), T is the total number of the weak classifiers, β kk /(1-ε k ), and the ε k is:
    Figure PCTCN2019117342-appb-100007
    Figure PCTCN2019117342-appb-100007
    其中,w i所述梯度特征集的权重,y i为所述人脸对照集。 Wherein, w i is the weight of the gradient feature set, and yi is the face control set.
  7. 如权利要求6所述的人脸识别方法,其特征在于,所述欧式距离法为:8. The face recognition method of claim 6, wherein the Euclidean distance method is:
    Figure PCTCN2019117342-appb-100008
    Figure PCTCN2019117342-appb-100008
    其中,a为捕捉到的图像,y i为人脸对照集,n为人脸对照集的数据总量。 Among them, a is the captured image, yi is the face comparison set, and n is the total amount of data in the face comparison set.
  8. 一种人脸识别装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的人脸识别程序,所述人脸识别程序被所述处理器执行时实现如下步骤:A face recognition device, characterized in that the device includes a memory and a processor, the memory stores a face recognition program that can be run on the processor, and the face recognition program is processed by the processor. The following steps are implemented when the device is executed:
    步骤A:数据采集层采集人脸图像集、非人脸图像集和人脸对照集,将所述人脸图像集和所述非人脸图像集保存为原始数据集,并将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中;Step A: The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
    步骤B:所述数据处理层对所述原始数据集进行灰度化和降噪处理,得到预处理数据集,其中,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层;Step B: The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
    步骤C:所述数据切割层接收所述人脸预处理数据集,对所述人脸预处理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层,;Step C: The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer;
    步骤D:所述模型训练层接收由所述人脸训练集和所述非人脸预处理数据集组成的训练集,并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时,所述模型训练层退出训练;Step D: The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method Calculate the training set to obtain a gradient feature set, and input the gradient feature set and the face control set to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer Exit training;
    步骤E:数据采集层接收捕捉到的图像,对所述捕捉到的图像进行灰度化和降噪处理后输入至所述模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果;Step E: The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the captured image, and then inputs it to the model training layer. The model training layer determines whether the captured image is Contains a human face, and when the captured image does not contain a human face, output the result that the human face is not recognized;
    步骤F:当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。Step F: When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
  9. 如权利要求8所述的人脸识别装置,其特征在于,采集人脸图像集、非人脸图像集和人脸对照集,包括:8. The face recognition device according to claim 8, wherein collecting a face image set, a non-face image set and a face comparison set comprises:
    从预设场景内部署的若干处视频监控区域内所捕捉的图像集中选择包括人脸的图像,组成人脸图像集;Select images including faces from a collection of images captured in several video surveillance areas deployed in preset scenes to form a face image set;
    从所捕捉的图像集中选取不包括人脸的图像,并从预设数据库中选择非人类的目标数据集,组成非人脸图像集;Select images that do not include human faces from the captured image set, and select non-human target data sets from the preset database to form a non-human face image set;
    基于所述人脸图像集内不相同的人脸,采集与所述各不相同的人脸对应的证件照图片,组成人脸对照集。Based on different faces in the face image set, ID photo images corresponding to the different faces are collected to form a face comparison set.
  10. 如权利要求9所述的人脸识别装置,其特征在于,所述降噪处理采用如下自适应图像降噪滤波法:The face recognition device according to claim 9, wherein the noise reduction processing adopts the following adaptive image noise reduction filtering method:
    g(x,y)=η(x,y)+f(x,y)g(x,y)=η(x,y)+f(x,y)
    Figure PCTCN2019117342-appb-100009
    Figure PCTCN2019117342-appb-100009
    其中,(x,y)表示所述原始数据集内图像像素点坐标,f(x,y)为基于所述自适应图像降噪滤波法对所述原始数据集进行降噪处理后的输出数据,η(x,y)为噪声,g(x,y)为所述原始数据集,
    Figure PCTCN2019117342-appb-100010
    为所述原始数据集的噪声总方差,
    Figure PCTCN2019117342-appb-100011
    为所述(x,y)的像素灰度均值,
    Figure PCTCN2019117342-appb-100012
    为所述(x,y)的像素灰度方差,L表示当前像素点坐标。
    Wherein, (x, y) represents the coordinates of the image pixels in the original data set, and f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method , Η(x,y) is noise, g(x,y) is the original data set,
    Figure PCTCN2019117342-appb-100010
    Is the total noise variance of the original data set,
    Figure PCTCN2019117342-appb-100011
    Is the average gray value of the pixel (x, y),
    Figure PCTCN2019117342-appb-100012
    Is the pixel gray variance of the (x, y), and L represents the current pixel coordinates.
  11. 如权利要求10所述的人脸识别装置,其特征在于,所述边缘检测采用Canny边缘检测法。The face recognition device of claim 10, wherein the edge detection adopts the Canny edge detection method.
  12. 如权利要求10所述的人脸识别装置,其特征在于,所述根据方向梯度直方法计算所述训练集得到梯度特征集,包括:The face recognition device according to claim 10, wherein the calculating the training set according to the directional gradient straight method to obtain the gradient feature set comprises:
    计算所述训练集内的数据各像素点(x,y)的梯度幅值和梯度方向值,并将所述梯度幅值作为第一分量,所述梯度方向值作为第二分量形成梯度矩阵;Calculate the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set, and use the gradient amplitude as the first component and the gradient direction value as the second component to form a gradient matrix;
    将所述梯度矩阵内数据划分为多个小块,并相加各小块的梯度幅值与梯度方向值得到相加值,并将所述相加值串联形成所述梯度特征集。The data in the gradient matrix is divided into a plurality of small blocks, and the gradient amplitude and the gradient direction value of each small block are added to obtain an added value, and the added value is connected in series to form the gradient feature set.
  13. 如权利要求10所述的人脸识别装置,其特征在于,所述提升算法包 括AdaBoost算法,所述AdaBoost算法包括若干个弱分类器和强分类器;The face recognition device according to claim 10, wherein the boosting algorithm comprises an AdaBoost algorithm, and the AdaBoost algorithm comprises several weak classifiers and strong classifiers;
    其中,所述弱分类器h(x,t,p,θ)为:Wherein, the weak classifier h(x, t, p, θ) is:
    Figure PCTCN2019117342-appb-100013
    Figure PCTCN2019117342-appb-100013
    其中,t为包括所述梯度特征集的分类函数,x表示检测子窗口,p为权衡不等号方向系数,θ为所述弱分类器阈值,所述弱分类器根据所述梯度特征集训练所述弱分类器h(x,t,p,θ),直至确定最优阈值θ,得到所述强分类器C(x):Where t is the classification function including the gradient feature set, x is the detection sub-window, p is the weighted inequality direction coefficient, and θ is the threshold of the weak classifier, and the weak classifier is trained according to the gradient feature set. The weak classifier h(x, t, p, θ) until the optimal threshold θ is determined to obtain the strong classifier C(x):
    Figure PCTCN2019117342-appb-100014
    Figure PCTCN2019117342-appb-100014
    其中,α k为所述强分类器C(x)的系数,T为所述弱分类器的总数,β k=ε k/(1-ε k),所述ε k为: Where α k is the coefficient of the strong classifier C(x), T is the total number of the weak classifiers, β kk /(1-ε k ), and the ε k is:
    Figure PCTCN2019117342-appb-100015
    Figure PCTCN2019117342-appb-100015
    其中,w i所述梯度特征集的权重,y i为所述人脸对照集。 Wherein, w i is the weight of the gradient feature set, and yi is the face control set.
  14. 如权利要求13所述的人脸识别装置,其特征在于,所述欧式距离法为:The face recognition device according to claim 13, wherein the Euclidean distance method is:
    Figure PCTCN2019117342-appb-100016
    Figure PCTCN2019117342-appb-100016
    其中,a为捕捉到的图像,y i为人脸对照集,n为人脸对照集的数据总量。 Among them, a is the captured image, yi is the face comparison set, and n is the total amount of data in the face comparison set.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有人脸识别程序,所述人脸识别程序可被一个或者多个处理器执行,以实现如下步骤:A computer-readable storage medium, characterized in that a face recognition program is stored on the computer-readable storage medium, and the face recognition program can be executed by one or more processors to implement the following steps:
    步骤A:数据采集层采集人脸图像集、非人脸图像集和人脸对照集,将所述人脸图像集和所述非人脸图像集保存为原始数据集,并将所述原始数据集输入至数据处理层,将所述人脸对照集输入至数据库中;Step A: The data collection layer collects a face image set, a non-face image set, and a face comparison set, saves the face image set and the non-face image set as an original data set, and sends the original data Input the set to the data processing layer, and input the face comparison set into the database;
    步骤B:所述数据处理层对所述原始数据集进行灰度化和降噪处理,得到预处理数据集,其中,所述预处理数据集包括人脸预处理数据集和非人脸预处理数据集,将所述人脸预处理数据集输入至数据切割层,将所述非人脸预处理数据集输入至模型训练层;Step B: The data processing layer performs grayscale and denoising processing on the original data set to obtain a preprocessed data set, where the preprocessed data set includes a face preprocessing data set and a non-face preprocessing Data set, input the face preprocessing data set to the data cutting layer, and input the non-face preprocessing data set to the model training layer;
    步骤C:所述数据切割层接收所述人脸预处理数据集,对所述人脸预处 理数据集进行边缘检测和分割处理后得到人脸训练集并输入至模型训练层;Step C: The data cutting layer receives the face preprocessing data set, performs edge detection and segmentation processing on the face preprocessing data set, and then obtains the face training set and inputs it to the model training layer;
    步骤D:所述模型训练层接收由所述人脸训练集和所述非人脸预处理数据集组成的训练集,并从所述数据库中提取所述人脸对照集,根据方向梯度直方法计算所述训练集得到梯度特征集,将所述梯度特征集和所述人脸对照集输入至提升算法进行训练,直至所述提升算法的训练准确率大于预设阈值时,所述模型训练层退出训练;Step D: The model training layer receives a training set consisting of the face training set and the non-face preprocessing data set, and extracts the face control set from the database, according to the direction gradient straight method Calculate the training set to obtain a gradient feature set, and input the gradient feature set and the face control set to the lifting algorithm for training, until the training accuracy of the lifting algorithm is greater than a preset threshold, the model training layer Exit training;
    步骤E:数据采集层接收捕捉到的图像,对所述捕捉到的图像进行灰度化和降噪处理后输入至所述模型训练层,所述模型训练层判断所述捕捉到的图像中是否包含人脸,当所述捕捉到的图像不包含人脸,输出未识别出人脸的结果;Step E: The data acquisition layer receives the captured image, performs grayscale and noise reduction processing on the captured image, and then inputs it to the model training layer. The model training layer determines whether the captured image is Contains a human face, and when the captured image does not contain a human face, output the result that the human face is not recognized;
    步骤F:当所述捕捉到的图像包含人脸时,所述模型训练层基于欧式距离法依次判断所述捕捉到的图像与所述数据库的人脸对照集的相似度,输出相似度最高的人脸对照集图片,完成人脸识别。Step F: When the captured image contains a human face, the model training layer sequentially determines the similarity between the captured image and the face control set of the database based on the Euclidean distance method, and outputs the highest similarity Face comparison set pictures to complete face recognition.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,采集人脸图像集、非人脸图像集和人脸对照集,包括:15. The computer-readable storage medium of claim 15, wherein the collection of a face image set, a non-face image set, and a face comparison set comprises:
    从预设场景内部署的若干处视频监控区域内所捕捉的图像集中选择包括人脸的图像,组成人脸图像集;Select images including faces from a collection of images captured in several video surveillance areas deployed in preset scenes to form a face image set;
    从所捕捉的图像集中选取不包括人脸的图像,并从预设数据库中选择非人类的目标数据集,组成非人脸图像集;Select images that do not include human faces from the captured image set, and select non-human target data sets from the preset database to form a non-human face image set;
    基于所述人脸图像集内不相同的人脸,采集与所述各不相同的人脸对应的证件照图片,组成人脸对照集。Based on different faces in the face image set, ID photo images corresponding to the different faces are collected to form a face comparison set.
  17. 如权利要求15或16所述的计算机可读存储介质,其特征在于,所述降噪处理采用如下自适应图像降噪滤波法:The computer-readable storage medium according to claim 15 or 16, wherein the noise reduction processing adopts the following adaptive image noise reduction filtering method:
    g(x,y)=η(x,y)+f(x,y)g(x,y)=η(x,y)+f(x,y)
    Figure PCTCN2019117342-appb-100017
    Figure PCTCN2019117342-appb-100017
    其中,(x,y)表示所述原始数据集内图像像素点坐标,f(x,y)为基于所述自适应图像降噪滤波法对所述原始数据集进行降噪处理后的输出数据,η(x,y)为噪声,g(x,y)为所述原始数据集,
    Figure PCTCN2019117342-appb-100018
    为所述原始数据集的噪声总方差,
    Figure PCTCN2019117342-appb-100019
    为所述(x,y)的像素灰度均值,
    Figure PCTCN2019117342-appb-100020
    为所述(x,y)的像素灰度方差,L表示当前像素 点坐标。
    Wherein, (x, y) represents the coordinates of the image pixels in the original data set, and f(x, y) is the output data after the original data set is denoised based on the adaptive image noise reduction filtering method , Η(x,y) is noise, g(x,y) is the original data set,
    Figure PCTCN2019117342-appb-100018
    Is the total noise variance of the original data set,
    Figure PCTCN2019117342-appb-100019
    Is the average gray value of the pixel (x, y),
    Figure PCTCN2019117342-appb-100020
    Is the pixel gray variance of the (x, y), and L represents the current pixel coordinates.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述边缘检测采用Canny边缘检测法。17. The computer-readable storage medium of claim 17, wherein the edge detection adopts a Canny edge detection method.
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,所述根据方向梯度直方法计算所述训练集得到梯度特征集,包括:17. The computer-readable storage medium according to claim 17, wherein said calculating said training set to obtain a gradient feature set according to a directional gradient straight method comprises:
    计算所述训练集内的数据各像素点(x,y)的梯度幅值和梯度方向值,并将所述梯度幅值作为第一分量,所述梯度方向值作为第二分量形成梯度矩阵;Calculate the gradient amplitude and gradient direction value of each pixel (x, y) of the data in the training set, and use the gradient amplitude as the first component and the gradient direction value as the second component to form a gradient matrix;
    将所述梯度矩阵内数据划分为多个小块,并相加各小块的梯度幅值与梯度方向值得到相加值,并将所述相加值串联形成所述梯度特征集。The data in the gradient matrix is divided into a plurality of small blocks, and the gradient amplitude and the gradient direction value of each small block are added to obtain an added value, and the added value is connected in series to form the gradient feature set.
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述提升算法包括AdaBoost算法,所述AdaBoost算法包括若干个弱分类器和强分类器;18. The computer-readable storage medium of claim 19, wherein the boosting algorithm comprises an AdaBoost algorithm, and the AdaBoost algorithm comprises several weak classifiers and strong classifiers;
    其中,所述弱分类器h(x,t,p,θ)为:Wherein, the weak classifier h(x, t, p, θ) is:
    Figure PCTCN2019117342-appb-100021
    Figure PCTCN2019117342-appb-100021
    其中,t为包括所述梯度特征集的分类函数,x表示检测子窗口,p为权衡不等号方向系数,θ为所述弱分类器阈值,所述弱分类器根据所述梯度特征集训练所述弱分类器h(x,t,p,θ),直至确定最优阈值θ,得到所述强分类器C(x):Where t is the classification function including the gradient feature set, x is the detection sub-window, p is the weighted inequality direction coefficient, and θ is the threshold of the weak classifier, and the weak classifier is trained according to the gradient feature set. The weak classifier h(x, t, p, θ) until the optimal threshold θ is determined to obtain the strong classifier C(x):
    Figure PCTCN2019117342-appb-100022
    Figure PCTCN2019117342-appb-100022
    其中,α k为所述强分类器C(x)的系数,T为所述弱分类器的总数,β k=ε k/(1-ε k),所述ε k为: Where α k is the coefficient of the strong classifier C(x), T is the total number of the weak classifiers, β kk /(1-ε k ), and the ε k is:
    Figure PCTCN2019117342-appb-100023
    Figure PCTCN2019117342-appb-100023
    其中,w i所述梯度特征集的权重,y i为所述人脸对照集。 Wherein, w i is the weight of the gradient feature set, and yi is the face control set.
PCT/CN2019/117342 2019-05-20 2019-11-12 Facial recognition method and apparatus, and computer-readable storage medium WO2020233000A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910417997.3A CN110309709A (en) 2019-05-20 2019-05-20 Face identification method, device and computer readable storage medium
CN201910417997.3 2019-05-20

Publications (1)

Publication Number Publication Date
WO2020233000A1 true WO2020233000A1 (en) 2020-11-26

Family

ID=68074686

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117342 WO2020233000A1 (en) 2019-05-20 2019-11-12 Facial recognition method and apparatus, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN110309709A (en)
WO (1) WO2020233000A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633192A (en) * 2020-12-28 2021-04-09 杭州魔点科技有限公司 Gesture interaction face recognition temperature measurement method, system, equipment and medium
CN113420739A (en) * 2021-08-24 2021-09-21 北京通建泰利特智能系统工程技术有限公司 Intelligent emergency monitoring method and system based on neural network and readable storage medium
CN114445093A (en) * 2022-01-27 2022-05-06 黑龙江邮政易通信息网络有限责任公司 Product management and control and anti-counterfeiting traceability system

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309709A (en) * 2019-05-20 2019-10-08 平安科技(深圳)有限公司 Face identification method, device and computer readable storage medium
CN110853047B (en) * 2019-10-12 2023-09-15 平安科技(深圳)有限公司 Intelligent image segmentation and classification method, device and computer readable storage medium
CN112712004B (en) * 2020-12-25 2023-09-12 英特灵达信息技术(深圳)有限公司 Face detection system, face detection method and device and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521622A (en) * 2011-11-18 2012-06-27 常州蓝城信息科技有限公司 Face detecting system based on advertisement putting
CN102831411A (en) * 2012-09-07 2012-12-19 云南晟邺科技有限公司 Quick face detection method
US20130108123A1 (en) * 2011-11-01 2013-05-02 Samsung Electronics Co., Ltd. Face recognition apparatus and method for controlling the same
CN103605964A (en) * 2013-11-25 2014-02-26 上海骏聿数码科技有限公司 Face detection method and system based on image on-line learning
CN106022254A (en) * 2016-05-17 2016-10-12 上海民实文化传媒有限公司 Image recognition technology
CN106355138A (en) * 2016-08-18 2017-01-25 电子科技大学 Face recognition method based on deep learning and key features extraction
CN106485273A (en) * 2016-10-09 2017-03-08 湖南穗富眼电子科技有限公司 A kind of method for detecting human face based on HOG feature and DNN grader
CN106503615A (en) * 2016-09-20 2017-03-15 北京工业大学 Indoor human body detecting and tracking and identification system based on multisensor
CN110309709A (en) * 2019-05-20 2019-10-08 平安科技(深圳)有限公司 Face identification method, device and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100568262C (en) * 2007-12-29 2009-12-09 浙江工业大学 Human face recognition detection device based on the multi-video camera information fusion
CN104978550B (en) * 2014-04-08 2018-09-18 上海骏聿数码科技有限公司 Face identification method based on extensive face database and system
CN106127114A (en) * 2016-06-16 2016-11-16 北京数智源科技股份有限公司 Intelligent video analysis method
CN106529448A (en) * 2016-10-27 2017-03-22 四川长虹电器股份有限公司 Method for performing multi-visual-angle face detection by means of integral channel features

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130108123A1 (en) * 2011-11-01 2013-05-02 Samsung Electronics Co., Ltd. Face recognition apparatus and method for controlling the same
CN102521622A (en) * 2011-11-18 2012-06-27 常州蓝城信息科技有限公司 Face detecting system based on advertisement putting
CN102831411A (en) * 2012-09-07 2012-12-19 云南晟邺科技有限公司 Quick face detection method
CN103605964A (en) * 2013-11-25 2014-02-26 上海骏聿数码科技有限公司 Face detection method and system based on image on-line learning
CN106022254A (en) * 2016-05-17 2016-10-12 上海民实文化传媒有限公司 Image recognition technology
CN106355138A (en) * 2016-08-18 2017-01-25 电子科技大学 Face recognition method based on deep learning and key features extraction
CN106503615A (en) * 2016-09-20 2017-03-15 北京工业大学 Indoor human body detecting and tracking and identification system based on multisensor
CN106485273A (en) * 2016-10-09 2017-03-08 湖南穗富眼电子科技有限公司 A kind of method for detecting human face based on HOG feature and DNN grader
CN110309709A (en) * 2019-05-20 2019-10-08 平安科技(深圳)有限公司 Face identification method, device and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633192A (en) * 2020-12-28 2021-04-09 杭州魔点科技有限公司 Gesture interaction face recognition temperature measurement method, system, equipment and medium
CN112633192B (en) * 2020-12-28 2023-08-25 杭州魔点科技有限公司 Gesture interaction face recognition temperature measurement method, system, equipment and medium
CN113420739A (en) * 2021-08-24 2021-09-21 北京通建泰利特智能系统工程技术有限公司 Intelligent emergency monitoring method and system based on neural network and readable storage medium
CN113420739B (en) * 2021-08-24 2022-10-18 北京通建泰利特智能系统工程技术有限公司 Intelligent emergency monitoring method and system based on neural network and readable storage medium
CN114445093A (en) * 2022-01-27 2022-05-06 黑龙江邮政易通信息网络有限责任公司 Product management and control and anti-counterfeiting traceability system

Also Published As

Publication number Publication date
CN110309709A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
WO2020233000A1 (en) Facial recognition method and apparatus, and computer-readable storage medium
US8761446B1 (en) Object detection with false positive filtering
CN112200043B (en) Intelligent danger source identification system and method for outdoor construction site
CN105893920B (en) Face living body detection method and device
US8351662B2 (en) System and method for face verification using video sequence
US8340366B2 (en) Face recognition system
CN107169458B (en) Data processing method, device and storage medium
US7995807B2 (en) Automatic trimming method, apparatus and program
CN109190475A (en) A kind of recognition of face network and pedestrian identify network cooperating training method again
CN113012383B (en) Fire detection alarm method, related system, related equipment and storage medium
JP2006146626A (en) Pattern recognition method and device
WO2011132387A1 (en) Collating device
CN111539351B (en) Multi-task cascading face frame selection comparison method
KR20190093799A (en) Real-time missing person recognition system using cctv and method thereof
CN101923637A (en) Mobile terminal as well as human face detection method and device thereof
KR102171384B1 (en) Object recognition system and method using image correction filter
CN112633179A (en) Farmer market aisle object occupying channel detection method based on video analysis
CN110795995A (en) Data processing method, device and computer readable storage medium
CN104615985B (en) A kind of recognition methods of human face similarity degree
CN111091056A (en) Method and device for identifying sunglasses in image, electronic equipment and storage medium
Wan et al. Face detection method based on skin color and adaboost algorithm
US8929613B2 (en) Device and method for internally and externally assessing whitelists
Dargham et al. Lip detection by the use of neural networks
Günay et al. Online adaptive decision fusion framework based on projections onto convex sets with application to wildfire detection in video
CN112699810A (en) Method and device for improving figure identification precision of indoor monitoring system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19929976

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19929976

Country of ref document: EP

Kind code of ref document: A1