


技术领域technical field
本发明涉及生物识别技术领域,特别是涉及一种基于LBP特征的人脸活体检测方法和装置。The present invention relates to the technical field of biometric identification, in particular to a method and device for detecting a face living body based on an LBP feature.
背景技术Background technique
人脸识别,是基于人的脸部特征信息进行身份识别的一种生物识别技术。用摄像机或摄像头采集含有人脸的图像或视频流,并自动在图像中检测和跟踪人脸,进而对检测到的人脸进行脸部的一系列相关技术,通常也叫做人像识别、面部识别。现代人们的生活和工作中,利用人脸识别技术可以有效的加强安全和隐私。但现实中也存在一个问题,比如利用照片、面具或视频等虚假的信息可能会欺骗人脸识别设备,使得非法用户通过人脸识别这道安全防线,对安全和隐私构成威胁。Face recognition is a kind of biometric identification technology based on human facial feature information. Use a camera or camera to collect images or video streams containing faces, and automatically detect and track faces in the images, and then perform a series of face-related technologies on the detected faces, usually also called portrait recognition, face recognition. In modern people's life and work, the use of face recognition technology can effectively enhance security and privacy. However, there is also a problem in reality. For example, the use of false information such as photos, masks or videos may deceive face recognition devices, allowing illegal users to use face recognition as a security line of defense, posing a threat to security and privacy.
因此,在人脸识别前,先进行活体检测,可以有效地防止利用打印的照片、手机或Pad等移动终端里的照片和视频、人脸面具等虚假信息通过人脸识别,从而避免安全漏洞。Therefore, before face recognition, liveness detection can effectively prevent the use of printed photos, photos and videos in mobile terminals such as mobile phones or Pads, and false information such as face masks to pass through face recognition, thereby avoiding security loopholes.
现有的活体检测技术主要有:基于纹理的、基于光流的和基于交互的活体检测等。其中,基于光流的方法通过建立光流场模型,获取活体真人、照片、屏幕等不同的三维结构在运动时的光流特点,进行活体检测,缺点是需要用户有一定的运动。基于交互的活体检测,需要被检测对象完成系统指示的动作,比如转头、眨眼、张嘴等动作,但这些特定动作可以通过录制视频或其他方式进行欺瞒从而骗过活体检测系统。上面两种检活方式因为需要用户运动或动作配合,不够友好,用户体验性差。基于纹理的活体检测方法,只提取可见光下用户图片的纹理特征,提取的特征受限,准确性不高、鲁棒性不好。The existing liveness detection technologies mainly include: texture-based, optical flow-based and interaction-based liveness detection. Among them, the optical flow-based method obtains the optical flow characteristics of different three-dimensional structures such as live people, photos, and screens during motion by establishing an optical flow field model, and performs live detection. The disadvantage is that the user needs to have a certain movement. Interaction-based liveness detection requires the object to be detected to complete actions instructed by the system, such as turning head, blinking, opening mouth, etc., but these specific actions can be deceived by recording video or other methods to deceive the liveness detection system. The above two live detection methods are not friendly enough and have poor user experience because they require the user's movement or action cooperation. The texture-based living detection method only extracts the texture features of user images under visible light, and the extracted features are limited, with low accuracy and poor robustness.
发明内容SUMMARY OF THE INVENTION
本发明提供了一种基于LBP特征的人脸活体检测方法和装置,以解决现有活体检测技术用户体验性差、准确性和鲁棒性较低的问题。The present invention provides a method and device for face liveness detection based on LBP features, so as to solve the problems of poor user experience, low accuracy and robustness of the existing liveness detection technology.
为了解决上述问题,本发明提供了一种基于LBP特征的人脸活体检测方法,包括:In order to solve the above-mentioned problems, the present invention provides a method for detecting human face liveness based on LBP features, including:
采集被测人脸的近红外人脸图像和可见光人脸图像;Collect near-infrared face images and visible light face images of the tested face;
分别对近红外人脸图像和可见光人脸图像进行预处理;Preprocess the near-infrared face image and the visible light face image respectively;
分别提取预处理后的近红外人脸图像的第一LBP特征和预处理后的可见光人脸图像的第二LBP特征;extracting the first LBP feature of the preprocessed near-infrared face image and the second LBP feature of the preprocessed visible light face image;
将所述第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,根据分类结果判断被测人脸是否为活体。The first LBP feature and the second LBP feature are respectively input into the cascaded first classifier and the second classifier for classification, and it is determined whether the tested face is a living body according to the classification result.
作为一个举例说明,所述将所述第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,包括:将第一LBP特征输入第一分类器进行分类后,再将第二LBP特征输入第二分类器进行分类;或者,将第二LBP特征输入第二分类器进行分类后,再将第一LBP特征输入第一分类器进行分类。As an example, the inputting the first LBP feature and the second LBP feature into the cascaded first classifier and the second classifier respectively for classification includes: inputting the first LBP feature into the first classifier for classification Then, the second LBP feature is input into the second classifier for classification; or, after the second LBP feature is input into the second classifier for classification, the first LBP feature is input into the first classifier for classification.
作为一个举例说明,所述第一分类器包括:级联的第一子分类器和第二子分类器;所述第一子分类器为由活体、照片的近红外人脸样本图像训练的分类器;所述第二子分类器为由活体、面具的近红外人脸样本图像训练的分类器。As an example, the first classifier includes: a cascaded first sub-classifier and a second sub-classifier; the first sub-classifier is a classification trained by near-infrared face sample images of living bodies and photographs The second sub-classifier is a classifier trained from near-infrared face sample images of living bodies and masks.
作为一个举例说明,所述第二分类器包括:级联的第三子分类器和第四子分类器;所述第三子分类器为由活体、照片的可见光人脸样本图像训练的分类器;所述第四子分类器为由活体、面具的可见光人脸样本图像训练的分类器。As an example, the second classifier includes: a cascaded third sub-classifier and a fourth sub-classifier; the third sub-classifier is a classifier trained by visible light face sample images of living bodies and photographs ; The fourth sub-classifier is a classifier trained by visible light face sample images of living bodies and masks.
作为一个举例说明,所述第一LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合;其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。As an example, the first LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features; of which, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with 16 neighborhood pixels and 2 neighborhood radius.
作为一个举例说明,所述第二LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合;其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。As an example, the second LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features; of which, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with 16 neighborhood pixels and 2 neighborhood radius.
相应的,本发明还提供了一种基于LBP特征的人脸活体检测装置,包括:Correspondingly, the present invention also provides a face liveness detection device based on LBP features, including:
图像采集单元,用于采集被测人脸的近红外人脸图像和可见光人脸图像;The image acquisition unit is used to collect the near-infrared face image and the visible light face image of the tested face;
图像处理单元,用于分别对近红外人脸图像和可见光人脸图像进行预处理;an image processing unit for preprocessing the near-infrared face image and the visible light face image respectively;
特征提取单元,用于分别提取预处理后的近红外人脸图像的第一LBP特征和预处理后的可见光人脸图像的第二LBP特征;a feature extraction unit, configured to extract the first LBP feature of the preprocessed near-infrared face image and the second LBP feature of the preprocessed visible light face image;
分类判断单元,用于将所述第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,根据分类结果判断被测人脸是否为活体。The classification judgment unit is used for inputting the first LBP feature and the second LBP feature into the cascaded first classifier and the second classifier respectively for classification, and judging whether the tested face is a living body according to the classification result.
作为一个举例说明,所述分类判断单元用于将第一LBP特征输入第一分类器进行分类后,再将第二LBP特征输入第二分类器进行分类;或者,将第二LBP特征输入第二分类器进行分类后,再将第一LBP特征输入第一分类器进行分类。As an example, the classification judgment unit is configured to input the first LBP feature into the first classifier for classification, and then input the second LBP feature into the second classifier for classification; or, input the second LBP feature into the second After the classifier performs classification, the first LBP feature is input into the first classifier for classification.
作为一个举例说明,所述第一分类器包括:级联的第一子分类器和第二子分类器;所述第一子分类器为由活体、照片的近红外人脸样本图像训练的分类器;所述第二子分类器为由活体、面具的近红外人脸样本图像训练的分类器。As an example, the first classifier includes: a cascaded first sub-classifier and a second sub-classifier; the first sub-classifier is a classification trained by near-infrared face sample images of living bodies and photographs The second sub-classifier is a classifier trained from near-infrared face sample images of living bodies and masks.
作为一个举例说明,所述第二分类器包括:级联的第三子分类器和第四子分类器;所述第三子分类器为由活体、照片的可见光人脸样本图像训练的分类器;所述第四子分类器为由活体、面具的可见光人脸样本图像训练的分类器。As an example, the second classifier includes: a cascaded third sub-classifier and a fourth sub-classifier; the third sub-classifier is a classifier trained by visible light face sample images of living bodies and photographs ; The fourth sub-classifier is a classifier trained by visible light face sample images of living bodies and masks.
作为一个举例说明,所述第一LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合;其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。As an example, the first LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features; of which, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with 16 neighborhood pixels and 2 neighborhood radius.
作为一个举例说明,所述第二LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合;其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。As an example, the second LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features; of which, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with 16 neighborhood pixels and 2 neighborhood radius.
与现有技术相比,本发明具有以下优点:Compared with the prior art, the present invention has the following advantages:
在本发明除了采集被测人脸的可见光人脸图像,提取预处理后的可见光人脸图像的第二LBP特征,还采集了被测人脸的近红外人脸图像,并提取了预处理后的近红外人脸图像的第一LBP特征,将第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,以实现活体检测,该过程不需要用户的运动、动作配合,用户体验度好。并且,提取了不同光照环境下的纹理特征,即,预处理后的近红外人脸图像的第一LBP特征和预处理后的可见光人脸图像的第二LBP特征,综合考虑二者进行多级联分类,参与分类的纹理特征更加丰富、全面,增强了活体检测的准确率和鲁棒性。In the present invention, in addition to collecting the visible light face image of the tested face and extracting the second LBP feature of the preprocessed visible light face image, the present invention also collects the near-infrared face image of the tested face, and extracts the preprocessed face image. The first LBP feature of the near-infrared face image of Sports, action coordination, user experience is good. In addition, the texture features under different lighting environments are extracted, that is, the first LBP feature of the preprocessed near-infrared face image and the second LBP feature of the preprocessed visible light face image. Combined classification, the texture features involved in the classification are more abundant and comprehensive, and the accuracy and robustness of live detection are enhanced.
此外,本发明的第一分类器可以包括:级联的第一子分类器和第二子分类器;通过将第一分类器作进一步分类拆分,将活体的近红外人脸图像作为正样本,照片、面具的近红外人脸图像分别作为不同的负样本,输入到不同的子分类器中,对于近红外采集的图像,能够更精确的对活体、照片和面具这些不同类型的非活体进行划分,提高活体检测的准确性、鲁棒性。In addition, the first classifier of the present invention may include: a cascaded first sub-classifier and a second sub-classifier; by further classifying and splitting the first classifier, the near-infrared face image of the living body is used as a positive sample , the near-infrared face images of photos and masks are used as different negative samples and input into different sub-classifiers. For the images collected by near-infrared, different types of non-living bodies, photos and masks can be more accurately analyzed. Division to improve the accuracy and robustness of live detection.
相应的,本发明的第二分类器可以包括:级联的第三子分类器和第四子分类器。通过对第二分类器作进一步分类拆分,将活体的可见光人脸图像作为正样本,照片、面具的可见光人脸图像分别作为不同的负样本,输入到不同的子分类器中,对于可见光采集的图像,能够更精确的对活体、照片和面具这些不同类型的非活体进行划分,同样能够提高活体检测的准确性、鲁棒性。Correspondingly, the second classifier of the present invention may include: a cascaded third sub-classifier and a fourth sub-classifier. By further classifying and splitting the second classifier, the visible light face image of the living body is used as a positive sample, and the visible light face image of the photo and mask are respectively used as different negative samples, which are input into different sub-classifiers. For visible light collection It can more accurately divide different types of non-living bodies such as living bodies, photos and masks, and can also improve the accuracy and robustness of living body detection.
附图说明Description of drawings
图1是本发明一种基于LBP特征的人脸活体检测方法实施例一的流程图;1 is a flowchart of Embodiment 1 of a method for detecting a living body of a human face based on LBP features of the present invention;
图2是本发明一种基于LBP特征的人脸活体检测方法实施例二的流程图;2 is a flowchart of Embodiment 2 of a method for detecting a living body of a human face based on LBP features of the present invention;
图3是本发明一种基于LBP特征的人脸活体检测装置实施例的结构示意图。FIG. 3 is a schematic structural diagram of an embodiment of an apparatus for detecting a living body of a human face based on an LBP feature of the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
参照图1,示出了本发明一种基于LBP特征的人脸活体检测方法实施例一的流程图,所述方法包括:Referring to FIG. 1 , a flow chart of Embodiment 1 of a method for detecting a face living body based on an LBP feature of the present invention is shown, and the method includes:
步骤101、采集被测人脸的近红外人脸图像和可见光人脸图像;
所述被测人脸可能是活体人脸,也可能是非活体人脸,例如,照片、视频、面具等,使用双模图像采集单元采集被测人脸在两种模式下的图像,所述双模图像采集单元可以包括:近红外补光灯、近红外摄像头和可见光摄像头。其中,可见光摄像头具有可见光滤光片,其可以过滤掉某些波段的近红外光、透过可见光,利用可见光摄像头采集可见光人脸图像;近红外摄像头具有近红外滤光片,其可以过滤掉可见光、透过某些波段的近红外光,利用近红外摄像头采集近红外人脸图像;近红外补光灯进行近红外补光,可设置在近红外摄像头的周围。The tested face may be a living face or a non-living face, for example, a photo, video, mask, etc., and a dual-mode image acquisition unit is used to collect images of the tested face in two modes. The analog image acquisition unit may include: near-infrared fill light, near-infrared camera and visible light camera. Among them, the visible light camera has a visible light filter, which can filter out near-infrared light in certain bands, transmit visible light, and use the visible light camera to collect visible light face images; the near-infrared camera has a near-infrared filter, which can filter out visible light. , Through the near-infrared light of certain bands, the near-infrared camera is used to collect the near-infrared face image; the near-infrared fill light can be set around the near-infrared camera for near-infrared fill light.
图像的采集过程可以是同时采集,也可以是分时采集,例如,先采集近红外人脸图像,再采集可见光人脸图像,或者,先采集近红外人脸图像,再采集可见光人脸图像。可以理解的是,应针对于同一个被测人脸采集其对应的近红外人脸图像和可见光人脸图像。The image collection process may be simultaneous collection or time-division collection, for example, first collect the near-infrared face image, and then collect the visible light face image, or first collect the near-infrared face image, and then collect the visible light face image. It can be understood that the corresponding near-infrared face image and visible light face image should be collected for the same tested face.
步骤102、分别对近红外人脸图像和可见光人脸图像进行预处理;Step 102: Preprocess the near-infrared face image and the visible light face image respectively;
采集的原始人脸图像由于受到各种条件的限制和随机干扰,往往不能直接使用,必须对其进行图像预处理,使其能够适用于特征提取的过程。对于人脸图像而言,其预处理过程主要包括灰度变换和归一化。近红外人脸图像和可见光人脸图像经过灰度转化后,图像的像素具有在0~255之间的灰度值,然后,将经过灰度转化后的图像归一化到固定的大小,例如,可以归一化到64像素*64像素的大小。另外,根据不同的需求,预处理过程还可以包括人脸图像的光线补偿、几何校正、滤波以及锐化等。Due to the limitation of various conditions and random interference, the collected original face images cannot be used directly, and image preprocessing must be performed to make them suitable for the process of feature extraction. For face images, the preprocessing process mainly includes grayscale transformation and normalization. After the near-infrared face image and the visible light face image are transformed into grayscale, the pixels of the image have a grayscale value between 0 and 255. Then, the grayscale transformed image is normalized to a fixed size, for example , which can be normalized to a size of 64 pixels*64 pixels. In addition, according to different requirements, the preprocessing process may also include light compensation, geometric correction, filtering, and sharpening of the face image.
步骤103、分别提取预处理后的近红外人脸图像的第一LBP特征和预处理后的可见光人脸图像的第二LBP特征;
活体人脸、照片、面具等由于光照反射率不同,会导致它们成像的纹理信息出现差异,本发明实施例利用这种差异来进行活体和非活体分类,具体的,利用的纹理信息是LBP(Local Binary Pattern,局部二值模式)特征,它能很好的表征纹理信息并具有一定的光照不变性。LBP是一种用来描述图像局部纹理特征的算子,它具有旋转不变性和灰度不变性等显著的优点,用于纹理特征提取。Living faces, photos, masks, etc., due to different light reflectivity, will cause differences in their imaged texture information. The embodiment of the present invention uses this difference to classify living and non-living bodies. Specifically, the texture information used is LBP ( Local Binary Pattern) feature, which can well represent texture information and has certain illumination invariance. LBP is an operator used to describe the local texture features of images. It has significant advantages such as rotation invariance and grayscale invariance, and is used for texture feature extraction.
提取LBP特征的过程如下:首先,对于每个一个像素,将其与相邻像素的灰度值进行比较,若相邻像素的灰度值大于中心像素的灰度值,则该相邻像素点的位置被标记为1,否则为0。这样,相邻的像素点可以组成一个二进制数,即得到中心像素点的LBP值;然后,利用LBP值获取对应的LBP直方图特征;将直方图作为一个特征向量,也就得到了整幅图的LBP特征。The process of extracting LBP features is as follows: First, for each pixel, compare it with the gray value of the adjacent pixel, if the gray value of the adjacent pixel is greater than the gray value of the central pixel, then the adjacent pixel The position of is marked as 1, otherwise it is 0. In this way, adjacent pixels can form a binary number, that is, the LBP value of the central pixel is obtained; then, the LBP value is used to obtain the corresponding LBP histogram feature; the histogram is used as a feature vector, and the entire image is obtained. the LBP features.
本步骤分别提取预处理后的近红外人脸图像的LBP特征(即,第一LBP特征)和预处理后的可见光人脸图像的LBP特征(即,第二LBP特征),可以理解的是,第一LBP特征和第二LBP特征的提取过程可以是同时进行,也可以是分时进行。In this step, the LBP feature (ie, the first LBP feature) of the preprocessed near-infrared face image and the LBP feature (ie, the second LBP feature) of the preprocessed visible light face image are respectively extracted. It can be understood that, The extraction process of the first LBP feature and the second LBP feature may be performed simultaneously, or may be performed in a time-sharing manner.
步骤104、将第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,根据分类结果判断被测人脸是否为活体。Step 104: Input the first LBP feature and the second LBP feature respectively into the cascaded first classifier and the second classifier for classification, and determine whether the tested face is a living body according to the classification result.
在本步骤中,第一分类器用于对第一LBP特征进行分类,第二分类器用于对第二LBP特征进行分类。级联分类器中的第一分类器、第二分类器都是SVM(Support VectorMachine,支持向量机)分类器。在机器学习领域,SVM是一个有监督的学习模型,通常用来进行模式识别、分类、以及回归分析。所述第一分类器、第二分类器是预置的由样本图像训练得到的分类器,可以预先采集并获取大量的活体人脸样本和非活体人脸样本的LBP特征数据,用Matlab的SVM训练函数svmtrain(线性核参数)来训练分类器。具体的:In this step, the first classifier is used to classify the first LBP feature, and the second classifier is used to classify the second LBP feature. The first classifier and the second classifier in the cascade classifier are both SVM (Support Vector Machine, support vector machine) classifiers. In the field of machine learning, SVM is a supervised learning model commonly used for pattern recognition, classification, and regression analysis. The first classifier and the second classifier are preset classifiers obtained from sample image training, which can collect and obtain a large number of LBP feature data of living face samples and non-living face samples in advance, and use Matlab's SVM. The training function svmtrain (linear kernel parameters) to train the classifier. specific:
对于第一分类器,样本图像为活体的近红外人脸样本图像、非活体的近红外人脸样本图像,其中,非活体包括各种情形(比如平铺、折叠、弯曲、扣掉眼睛嘴巴等)的照片和各种面具。获取上万多份活体的近红外人脸样本图像的LBP特征,上万多份非活体的近红外人脸样本图像的LBP特征,输入到第一分类器进行SVM训练,并且标记分类结果,其中,标记活体人脸为+1,非活体人脸为-1。For the first classifier, the sample images are a near-infrared face sample image of a living body and a near-infrared face sample image of a non-living body, wherein the non-living body includes various situations (such as tiling, folding, bending, deducting eyes and mouths, etc. ) photos and various masks. Obtain the LBP features of more than 10,000 live near-infrared face sample images, and the LBP features of more than 10,000 non-living near-infrared face sample images, input them to the first classifier for SVM training, and mark the classification results, where , marking live faces as +1 and non-live faces as -1.
对于第二分类器,样本图像为活体的可见光人脸样本图像、非活体的可见光人脸样本图像,其中,非活体包括各种情形(比如平铺、折叠、弯曲、扣掉眼睛嘴巴等)的照片和各种面具。获取上万多份活体的可见光人脸样本图像的LBP特征,上万多份非活体的可见光人脸样本图像的LBP特征,输入到第二分类器进行SVM训练,并且标记分类结果,其中,标记活体人脸为+1,非活体人脸为-1。For the second classifier, the sample images are visible light face sample images of living bodies and visible light face sample images of non-living bodies, wherein non-living bodies include various situations (such as tiling, folding, bending, deducting eyes and mouths, etc.). Photos and various masks. Obtain the LBP features of more than 10,000 live visible light face sample images, and the LBP features of more than 10,000 non-living visible light face sample images, input them to the second classifier for SVM training, and mark the classification results, where the mark Live faces are +1, non-live faces are -1.
在本发明方法实施例一中,除了采集被测人脸的可见光人脸图像,提取预处理后的可见光人脸图像的第二LBP特征,还采集了被测人脸的近红外人脸图像,并提取了预处理后的近红外人脸图像的第一LBP特征,将第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,以实现活体检测,该过程不需要用户的运动、动作配合,用户体验度好。并且,采用了预处理后的近红外人脸图像的第一LBP特征、预处理后的可见光人脸图像的第二LBP特征,综合考虑二者进行多级联分类,由于提取了可见光和近红外两种不同采集模式下的LBP特征,参与分类的纹理特征更加丰富、全面,增强了活体检测的准确率和鲁棒性。In the first embodiment of the method of the present invention, in addition to collecting the visible light face image of the tested face, extracting the second LBP feature of the preprocessed visible light face image, and also collecting the near-infrared face image of the tested face, And the first LBP feature of the preprocessed near-infrared face image is extracted, and the first LBP feature and the second LBP feature are respectively input into the cascaded first classifier and the second classifier for classification, so as to realize living body detection, This process does not require the user's movement and action coordination, and the user experience is good. In addition, the first LBP feature of the preprocessed near-infrared face image and the second LBP feature of the preprocessed visible light face image are used, and the two are comprehensively considered for multi-cascade classification. LBP features in two different acquisition modes, the texture features involved in classification are more abundant and comprehensive, which enhances the accuracy and robustness of live detection.
可以理解的是,第一分类器和第二分类器的级联顺序可以先后调整,相应的,第一LBP特征和第二LBP特征输入到对应分类器的顺序也可以先后调整。It can be understood that the cascade order of the first classifier and the second classifier can be adjusted successively, and correspondingly, the order in which the first LBP feature and the second LBP feature are input to the corresponding classifiers can also be adjusted successively.
作为一个举例说明,在本步骤中,可以将第一LBP特征输入第一分类器进行分类后,再将第二LBP特征输入第二分类器进行分类,如果全部通过,即两次分类结果均为+1,则判断被测人脸为活体;否则,则判断被测人脸为非活体。具体的,将第一LBP特征输入第一分类器进行首次分类,首次分类结果为非活体时,则结束检测过程;首次分类结果为活体时,再将第二LBP特征输入第二分类器进行二次分类,二次分类结果为非活体时,则结束检测过程;二次分类结果为活体时,则最终判断被测人脸为活体。As an example, in this step, the first LBP feature can be input into the first classifier for classification, and then the second LBP feature can be input into the second classifier for classification. If all pass, that is, the two classification results are both +1, the tested face is judged to be living; otherwise, the tested face is judged to be non-living. Specifically, the first LBP feature is input into the first classifier for the first classification, and when the first classification result is non-living, the detection process ends; when the first classification result is living, the second LBP feature is input into the second classifier for two Secondary classification, when the result of the secondary classification is non-living, the detection process is ended; when the result of the secondary classification is living, the face to be tested is finally judged to be living.
作为另一个举例说明,在本步骤中,可以将第二LBP特征输入第二分类器进行分类后,再将第一LBP特征输入第一分类器进行分类,如果全部通过,即两次分类结果均为+1,则判断被测人脸为活体;否则,则判断被测人脸为非活体。As another example, in this step, the second LBP feature may be input into the second classifier for classification, and then the first LBP feature may be input into the first classifier for classification. If all pass, that is, the two classification results are both If it is +1, it is judged that the tested face is living; otherwise, it is judged that the tested face is not living.
作为一个举例说明,所述第一分类器包括:级联的第一子分类器和第二子分类器;其中,所述第一子分类器为由活体、照片的近红外人脸样本图像训练的分类器;所述第二子分类器为由活体、面具的近红外人脸样本图像训练的分类器。通过对第一分类器作进一步分类拆分,将活体的近红外人脸图像作为正样本,照片、面具的近红外人脸图像分别作为不同的负样本,输入到不同的子分类器中,对于近红外采集的图像,能够更精确的对活体、照片和面具这些不同类型的非活体进行划分,提高活体检测的准确性、鲁棒性。可以理解的是,第一子分类器和第二子分类器的级联顺序可以先后调整,例如,可以将第一LBP特征输入第一子分类器进行分类,之后,再将第一LBP特征输入第二子分类器进行分类;或者,将第一LBP特征输入第二子分类器进行分类,之后,再将第一LBP特征输入第一子分类器进行分类。As an example, the first classifier includes: a cascaded first sub-classifier and a second sub-classifier; wherein the first sub-classifier is trained from near-infrared face sample images of living bodies and photos The second sub-classifier is a classifier trained from near-infrared face sample images of living bodies and masks. By further classifying and splitting the first classifier, the near-infrared face image of the living body is used as a positive sample, and the near-infrared face image of a photo and a mask is used as a different negative sample, which is input into different sub-classifiers. The images collected by near-infrared can more accurately divide different types of non-living bodies, such as living bodies, photos and masks, and improve the accuracy and robustness of living body detection. It can be understood that the cascade order of the first sub-classifier and the second sub-classifier can be adjusted successively. For example, the first LBP feature can be input into the first sub-classifier for classification, and then the first LBP feature can be input into the first sub-classifier. The second sub-classifier performs classification; or, the first LBP feature is input into the second sub-classifier for classification, and then the first LBP feature is input into the first sub-classifier for classification.
作为另一个举例说明,所述第二分类器包括:级联的第三子分类器和第四子分类器;其中,所述第三子分类器为由活体、照片的可见光人脸样本图像训练的分类器;所述第四子分类器为由活体、面具的可见光人脸样本图像训练的分类器。通过对第二分类器作进一步分类拆分,将活体的可见光人脸图像作为正样本,照片、面具的可见光人脸图像分别作为不同的负样本,输入到不同的子分类器中,对于可见光采集的图像,能够更精确的对活体、照片和面具这些不同类型的非活体进行划分,提高活体检测的准确性、鲁棒性。可以理解的是,第三子分类器和第四子分类器的级联顺序可以先后调整,例如,可以将第二LBP特征输入第三子分类器进行分类,之后,再将第二LBP特征输入第四子分类器进行分类;或者,将第二LBP特征输入第四子分类器进行分类,之后,再将第二LBP特征输入第三子分类器进行分类。As another example, the second classifier includes: a cascaded third sub-classifier and a fourth sub-classifier; wherein the third sub-classifier is trained by visible light face sample images of living bodies and photos The classifier; the fourth sub-classifier is a classifier trained by visible light face sample images of living bodies and masks. By further classifying and splitting the second classifier, the visible light face image of the living body is used as a positive sample, and the visible light face image of the photo and mask are respectively used as different negative samples, which are input into different sub-classifiers. For visible light collection It can more accurately divide different types of non-living bodies, such as living bodies, photos and masks, and improve the accuracy and robustness of living body detection. It can be understood that the cascade order of the third sub-classifier and the fourth sub-classifier can be adjusted successively. For example, the second LBP feature can be input into the third sub-classifier for classification, and then the second LBP feature can be input into the third sub-classifier. The fourth sub-classifier is used for classification; or, the second LBP feature is input into the fourth sub-classifier for classification, and then the second LBP feature is input into the third sub-classifier for classification.
作为一个举例说明,所述第一LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合。As an example, the first LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features.
作为一个举例说明,所述第二LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合。As an example, the second LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features.
其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。in, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with 16 neighborhood pixels and 2 neighborhood radius.
下面,以特征为例进行具体说明:对于预处理后的人脸图像中每个像素点,比较其与邻域半径为1的周围8个领域像素点的灰度值大小,若领域像素点的灰度值大于中心像素点的灰度值,则该领域像素点的位置被标记为1,否则为0。按顺时针方向将8个数字连成一个8位的2进制数,共有256种;将得到的8位2进制数首尾相连,形成一个环,将其0到1以及1到0的变化次数不超过2次的归为一类,称为Uniform模式(即,均匀模式或者等价模式),其中,u2即代表变化次数不超过2次的Uniform模式。经统计,均匀模式LBP算子共58种,非均匀LBP算子计为1种,则用一个59维的向量描述邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征。Below, with The feature is taken as an example for specific description: for each pixel in the preprocessed face image, compare the gray value of the pixel with the surrounding 8 pixels with a neighborhood radius of 1. If the gray value of the pixel in the domain is If it is greater than the gray value of the center pixel, the position of the pixel in this area is marked as 1, otherwise it is 0. Connect 8 numbers into an 8-digit binary number in a clockwise direction, there are 256 kinds in total; connect the obtained 8-digit binary number end to end to form a ring, change its 0 to 1 and 1 to 0 Those whose number of times does not exceed 2 are classified into one category, which is called a Uniform mode (ie, a uniform mode or an equivalent mode), wherein u2 represents a Uniform mode whose number of changes does not exceed 2 times. According to statistics, there are 58 kinds of uniform mode LBP operators in total, and one non-uniform LBP operator is counted, then a 59-dimensional vector is used to describe the uniform mode LBP algorithm with 8 neighborhood pixels and 1 neighborhood radius. The LBP histogram feature.
特征、特征的获取过程与特征的获取过程类似,且属于现有技术的内容,此处不再赘述。 feature, The process of acquiring features and The acquisition process of the feature is similar and belongs to the content of the prior art, and will not be repeated here.
作为一个举例说明,所述59维的特征、59维的特征、243维的特征可以是针对整个近红外人脸图像和可见光人脸图像的统计得到的特征。例如,所述第一LBP特征可以是59维的特征;也可以是59维的特征与59维的特征的组合,形成一个118维的特征向量;还可以是59维的特征、59维的特征、243维的特征的组合,形成一个361维的特征向量。例如,所述第二LBP特征可以是59维的特征;也可以是59维的特征与59维的特征的组合,形成一个118维的特征向量;还可以是59维的特征、59维的特征、243维的特征的组合,形成一个361维的特征向量。As an illustration, the 59-dimensional feature, 59-dimensional feature, 243-dimensional The feature may be a feature obtained by statistics for the entire near-infrared face image and the visible light face image. For example, the first LBP feature may be 59-dimensional feature; can also be 59-dimensional features with 59 dimensions The combination of features forms a 118-dimensional feature vector; it can also be 59-dimensional feature, 59-dimensional feature, 243-dimensional The combination of features forms a 361-dimensional feature vector. For example, the second LBP feature may be 59-dimensional feature; can also be 59-dimensional features with 59 dimensions The combination of features forms a 118-dimensional feature vector; it can also be 59-dimensional feature, 59-dimensional feature, 243-dimensional The combination of features forms a 361-dimensional feature vector.
作为另一个举例说明,还可以对整个近红外人脸图像和可见光人脸图像分别划分成不同的小区域(cell),例如,划分为9块小区域,所述59维的特征、59维的特征、243维的特征中的至少一种是分别针对不同的小区域统计得到的特征,然后将得到的每个小区域的统计直方图进行连接成为一个多维的特征向量。需要说明的是,各个小区域可以边界相互相接,各个小区域也可以具有相互重叠的地方。例如,所述第一LBP特征包括:59维的特征、59维的特征、243维的特征的组合,其中,将近红外人脸图像按照预设规则划分为9个小区域,针对每一个小区域获取其对应的59维的特征,则,整个红外人脸图像的特征的维度为59*9=531维,第一LBP特征的维度为:531+59+243=833维。As another example, the entire near-infrared face image and the visible light face image can also be divided into different small areas (cells), for example, divided into 9 small areas, the 59-dimensional feature, 59-dimensional feature, 243-dimensional At least one of the features is a feature obtained by statistics for different small regions, and then the obtained statistical histograms of each small region are connected to form a multi-dimensional feature vector. It should be noted that, the boundaries of each small area may be adjacent to each other, and each small area may also have overlapping places. For example, the first LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional A combination of features, wherein the near-infrared face image is divided into 9 small areas according to preset rules, and its corresponding 59-dimensional image is obtained for each small area. features, then, of the entire infrared face image The dimension of the feature is 59*9=531 dimensions, and the dimension of the first LBP feature is: 531+59+243=833 dimensions.
参照图2,示出了本发明一种基于LBP特征的人脸活体检测方法实施例二的流程图,所述方法包括:Referring to FIG. 2 , a flowchart of Embodiment 2 of a method for detecting a face living body based on an LBP feature of the present invention is shown, and the method includes:
步骤201、采集被测物的近红外图像和可见光图像;
本步骤使用双模采集单元采集被测物在两种模式下的图像,所述双模采集单元可以包括:近红外补光灯、近红外摄像头和可见光摄像头。In this step, a dual-mode acquisition unit is used to acquire images of the measured object in two modes, and the dual-mode acquisition unit may include: a near-infrared fill light, a near-infrared camera, and a visible light camera.
步骤202、检测近红外图像中是否存在人脸;若是,则执行步骤203;若否,则判断没有人脸或被测人脸为非活体人脸,并结束;
在本方法实施例二中,首先,利用近红外人脸检测算法检测近红外图像中的人脸,先检测近红外图像而非可见光图像,是因为某些照片,如喷墨照片,以及手机、Pad或笔记本等媒介里的视频不会在近红外环境中成像,这样可以先滤掉部分非活体,提高了算法的准确性。In the second embodiment of the method, first, the near-infrared face detection algorithm is used to detect the human face in the near-infrared image, and the near-infrared image is detected first instead of the visible light image, because some photos, such as inkjet photos, as well as mobile phones, Videos in media such as Pads or notebooks will not be imaged in the near-infrared environment, so that some non-living bodies can be filtered out first, which improves the accuracy of the algorithm.
步骤203、检测可见光图像的对应位置处是否存在人脸;若是,则执行步骤204;若否,则判断没有人脸,并结束;
根据可见光摄像头和近红外摄像头的视场角、二者之间的位置关系、以及近红外图像中检测到的人脸位置,可以推算出可见光图像中人脸的区域范围,在这个区域范围内检测是否存在人脸,相对于整个可见光图像中人脸的检测,由于缩小了检测范围,速度会更快些,同时也保证了活体检测针对的是同一个被测人脸,避免了图像中有多个人脸时相互混淆的情况。According to the field of view of the visible light camera and the near-infrared camera, the positional relationship between the two, and the detected face position in the near-infrared image, the area of the face in the visible light image can be calculated, and the detection within this area can be performed. Whether there is a face, compared with the detection of the face in the entire visible light image, the detection range will be reduced, and the speed will be faster. A situation where individual faces are confused with each other.
步骤204、分别对近红外图像和可见光图像进行预处理;
经过步骤202和203的检测,确认采集的图像中均具有人脸,则此处所称的近红外图像即为近红外人脸图像,所称的可见光图像即为可见光人脸图像。所述预处理包括:灰度转化和归一化处理。After the detection in
步骤205、提取预处理后的近红外图像的第一LBP特征;
步骤206、将第一LBP特征输入第一子分类器进行分类,根据分类结果判断是否为活体;若是,则执行步骤207;若否,则判断为非活体,并结束;
将预处理后的近红外人脸图像的第一LBP特征输入到第一子分类器,所述第一子分类器为由活体、照片的近红外人脸样本图像训练的分类器,通过第一级分类,在判断结果为是时,暂定被测人脸为活体并进行下一步处理;在判断结果为否时,可以识别出作为非活体的部分照片。The first LBP feature of the preprocessed near-infrared face image is input into the first sub-classifier, and the first sub-classifier is a classifier trained by the near-infrared face sample image of the living body and the photo. When the judgment result is yes, the tested face is tentatively determined to be a living body and the next step is processed; when the judgment result is no, part of the photos that are not living bodies can be identified.
步骤207、将第一LBP特征输入第二子分类器进行分类,根据分类结果判断是否为活体;若是,则执行步骤208;若否,则判断为非活体,并结束;
将预处理后的近红外人脸图像的第一LBP特征输入到第二子分类器,所述第二子分类器为由活体、面具的近红外人脸样本图像训练的分类器,通过第二级分类,在判断结果为是时,暂定被测人脸为活体并进行下一步处理;在判断结果为否时,可以识别出作为非活体的部分面具。The first LBP feature of the preprocessed near-infrared face image is input into the second sub-classifier, and the second sub-classifier is a classifier trained by the near-infrared face sample images of living bodies and masks, and the second sub-classifier is trained by the second sub-classifier. When the judgment result is yes, the face to be tested is tentatively determined as a living body and the next step is processed; when the judgment result is no, part of the mask as a non-living body can be identified.
步骤208、提取预处理后的可见光图像的第二LBP特征;
步骤209、将第二LBP特征输入第三子分类器进行分类,根据分类结果判断是否为活体;若是,则执行步骤210;若否,则判断为非活体,并结束;
将预处理后的可见光人脸图像的第二LBP特征输入到第三子分类器,所述第三子分类器为由活体、照片的可见光人脸样本图像训练的分类器,通过第三级分类,在判断结果为是时,暂定被测人脸为活体并进行下一步处理;在判断结果为否时,可以将步骤206没识别出来的照片检测出来,作为非活体。The second LBP feature of the preprocessed visible light face image is input into the third sub-classifier, and the third sub-classifier is a classifier trained by the visible light face sample images of living bodies and photos, and is classified by the third level. , when the judgment result is yes, the face to be tested is tentatively determined to be a living body and the next step is processed; when the judgment result is no, the photos not identified in
步骤210、将第二LBP特征输入第四子分类器进行分类,根据分类结果判断是否为活体;若是,则判断被测人脸为活体,并结束;若否,则判断为非活体,并结束。
将预处理后的可见光人脸图像的第二LBP特征输入到第四子分类器,所述第四子分类器为由活体、面具的可见光人脸样本图像训练的分类器,通过第四级分类,在判断结果为是时,得到最终的检测结果,被测人脸为活体;在判断结果为否时,可以将步骤207没识别出来的面具检测出来,作为非活体。Input the second LBP feature of the preprocessed visible light face image to the fourth sub-classifier, and the fourth sub-classifier is a classifier trained by the visible light face sample images of living bodies and masks, and is classified by the fourth level. , when the judgment result is yes, the final detection result is obtained, and the detected face is a living body; when the judgment result is no, the mask not identified in
在本发明方法实施例二中,通过四级分类器,能够通过近红外人脸图像把一部分照片、面具识别出来,通过可见光人脸图像把另一部分照片、面具识别出来,进而判断被测人脸是否为活体。In the second embodiment of the method of the present invention, through the four-level classifier, a part of the photos and masks can be identified through the near-infrared face image, and another part of the photos and masks can be identified through the visible light face image, and then the measured face can be judged. whether it is alive.
作为一个举例说明,所述步骤206、步骤207的先后顺序可以调整,所述步骤209、步骤210的先后顺序也可以调整。作为另一个举例说明,可以先执行步骤208~步骤210,再执行步骤205~步骤207。作为另一个举例说明,可以将步骤208提到步骤206之前,即,分别提取预处理后的近红外人脸图像的第一LBP特征和预处理后的可见光人脸图像的第二LBP特征之后,再执行步骤206、步骤207、步骤209和步骤210。As an example, the sequence of
参照图3,示出了本发明一种基于LBP特征的人脸活体检测装置实施例二的结构示意图,所述装置300包括:Referring to FIG. 3, it shows a schematic structural diagram of Embodiment 2 of an LBP feature-based face liveness detection apparatus according to the present invention. The
图像采集单元301,用于采集被测人脸的近红外人脸图像和可见光人脸图像;The image acquisition unit 301 is used to collect the near-infrared face image and the visible light face image of the tested face;
图像处理单元302,用于分别对近红外人脸图像和可见光人脸图像进行预处理;An image processing unit 302, configured to preprocess the near-infrared face image and the visible light face image respectively;
特征提取单元303,用于分别提取预处理后的近红外人脸图像的第一LBP特征和预处理后的可见光人脸图像的第二LBP特征;A feature extraction unit 303, configured to extract the first LBP feature of the preprocessed near-infrared face image and the second LBP feature of the preprocessed visible light face image;
分类判断单元304,用于将所述第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,根据分类结果判断被测人脸是否为活体。The classification determination unit 304 is configured to input the first LBP feature and the second LBP feature into the cascaded first classifier and the second classifier respectively for classification, and determine whether the detected face is a living body according to the classification result.
在本发明装置实施例中,使用双模的图像采集单元301采集被测人脸在两种模式下的图像,所述双模的图像采集单元301可以包括:近红外补光灯、近红外摄像头和可见光摄像头。其中,可见光摄像头具有可见光滤光片,其可以过滤掉某些波段的近红外光、透过可见光,利用可见光摄像头采集可见光人脸图像;近红外摄像头具有近红外滤光片,其可以过滤掉可见光、透过某些波段的近红外光,利用近红外摄像头采集近红外人脸图像;近红外补光灯进行近红外补光,可设置在近红外摄像头的周围。In the embodiment of the device of the present invention, a dual-mode image acquisition unit 301 is used to acquire images of the tested face in two modes, and the dual-mode image acquisition unit 301 may include: a near-infrared fill light, a near-infrared camera and visible light cameras. Among them, the visible light camera has a visible light filter, which can filter out near-infrared light in certain bands, transmit visible light, and use the visible light camera to collect visible light face images; the near-infrared camera has a near-infrared filter, which can filter out visible light. , Through the near-infrared light of certain bands, the near-infrared camera is used to collect the near-infrared face image; the near-infrared fill light can be set around the near-infrared camera for near-infrared fill light.
图像处理单元302预处理过程主要包括灰度变换和归一化。分类判断单元304的第一分类器用于对第一LBP特征进行分类,第二分类器用于对第二LBP特征进行分类。所述第一分类器、第二分类器是预置的由样本图像训练得到的分类器,可以预先采集并获取大量的活体人脸样本和非活体人脸样本的LBP特征数据,用Matlab的SVM训练函数svmtrain(线性核参数)来训练分类器。具体的:The preprocessing process of the image processing unit 302 mainly includes grayscale transformation and normalization. The first classifier of the classification determination unit 304 is used for classifying the first LBP feature, and the second classifier is used for classifying the second LBP feature. The first classifier and the second classifier are preset classifiers obtained from sample image training, which can collect and obtain a large number of LBP feature data of living face samples and non-living face samples in advance, and use Matlab's SVM. The training function svmtrain (linear kernel parameters) to train the classifier. specific:
对于第一分类器,样本图像为活体的近红外人脸样本图像、非活体的近红外人脸样本图像,其中,非活体包括各种情形(比如平铺、折叠、弯曲、扣掉眼睛嘴巴等)的照片和各种面具。对于第二分类器,样本图像为活体的可见光人脸样本图像、非活体的可见光人脸样本图像,其中,非活体包括各种情形(比如平铺、折叠、弯曲、扣掉眼睛嘴巴等)的照片和各种面具。For the first classifier, the sample images are a near-infrared face sample image of a living body and a near-infrared face sample image of a non-living body, wherein the non-living body includes various situations (such as tiling, folding, bending, deducting eyes and mouths, etc. ) photos and various masks. For the second classifier, the sample images are visible light face sample images of living bodies and visible light face sample images of non-living bodies, wherein non-living bodies include various situations (such as tiling, folding, bending, deducting eyes and mouths, etc.). Photos and various masks.
在本发明装置实施例中,除了采集被测人脸的可见光人脸图像,提取预处理后的可见光人脸图像的第二LBP特征,还采集了被测人脸的近红外人脸图像,并提取了预处理后的近红外人脸图像的第一LBP特征,将第一LBP特征和第二LBP特征分别输入级联的第一分类器和第二分类器进行分类,以实现活体检测,该过程不需要用户的运动、动作配合,用户体验度好。并且,采用了预处理后的近红外人脸图像的第一LBP特征、预处理后的可见光人脸图像的第二LBP特征,综合考虑二者进行多级联分类,由于提取了可见光和近红外两种不同采集模式下的LBP特征,参与分类的纹理特征更加丰富、全面,增强了活体检测的准确率和鲁棒性。In the embodiment of the device of the present invention, in addition to collecting the visible light face image of the tested face, and extracting the second LBP feature of the preprocessed visible light face image, the near-infrared face image of the tested face is also collected, and The first LBP feature of the preprocessed near-infrared face image is extracted, and the first LBP feature and the second LBP feature are respectively input into the cascaded first classifier and the second classifier for classification, so as to realize the living body detection. The process does not require the user's movement and action coordination, and the user experience is good. In addition, the first LBP feature of the preprocessed near-infrared face image and the second LBP feature of the preprocessed visible light face image are used, and the two are comprehensively considered for multi-cascade classification. LBP features in two different acquisition modes, the texture features involved in classification are more abundant and comprehensive, which enhances the accuracy and robustness of live detection.
作为一个举例说明,所述分类判断单元304用于将第一LBP特征输入第一分类器进行分类后,再将第二LBP特征输入第二分类器进行分类;或者,将第二LBP特征输入第二分类器进行分类后,再将第一LBP特征输入第一分类器进行分类。As an example, the classification judging unit 304 is configured to input the first LBP feature into the first classifier for classification, and then input the second LBP feature into the second classifier for classification; or, input the second LBP feature into the After the second classifier performs classification, the first LBP feature is input into the first classifier for classification.
作为一个举例说明,所述第一分类器包括:级联的第一子分类器和第二子分类器;所述第一子分类器为由活体、照片的近红外人脸样本图像训练的分类器;所述第二子分类器为由活体、面具的近红外人脸样本图像训练的分类器。As an example, the first classifier includes: a cascaded first sub-classifier and a second sub-classifier; the first sub-classifier is a classification trained by near-infrared face sample images of living bodies and photographs The second sub-classifier is a classifier trained from near-infrared face sample images of living bodies and masks.
作为一个举例说明,所述第二分类器包括:级联的第三子分类器和第四子分类器;所述第三子分类器为由活体、照片的可见光人脸样本图像训练的分类器;所述第四子分类器为由活体、面具的可见光人脸样本图像训练的分类器。As an example, the second classifier includes: a cascaded third sub-classifier and a fourth sub-classifier; the third sub-classifier is a classifier trained by visible light face sample images of living bodies and photographs ; The fourth sub-classifier is a classifier trained by visible light face sample images of living bodies and masks.
作为一个举例说明,所述第一LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合;其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。As an example, the first LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features; of which, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with 16 neighborhood pixels and 2 neighborhood radius.
作为一个举例说明,所述第二LBP特征包括:59维的特征、59维的特征、243维的特征中的一种或者几种组合;其中,特征为邻域像素点个数为8、邻域半径为1的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为8、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征;特征为邻域像素点个数为16、邻域半径为2的均匀模式LBP算法得到的LBP直方图特征。As an example, the second LBP features include: 59-dimensional feature, 59-dimensional feature, 243-dimensional one or a combination of features; of which, The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 1; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 8 and a neighborhood radius of 2; The feature is the LBP histogram feature obtained by the uniform mode LBP algorithm with a neighborhood pixel number of 16 and a neighborhood radius of 2.
本说明书中的各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other. As for the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for related parts.
以上对本发明所提供的一种基于LBP特征的人脸活体检测方法和装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method and device for detecting a face living body based on the LBP feature provided by the present invention have been described in detail above. In this paper, specific examples are used to illustrate the principles and implementations of the present invention. The description of the above embodiments is only used for In order to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In summary, this specification The contents should not be construed as limiting the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610808240.3ACN107798281B (en) | 2016-09-07 | 2016-09-07 | A method and device for face liveness detection based on LBP feature |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610808240.3ACN107798281B (en) | 2016-09-07 | 2016-09-07 | A method and device for face liveness detection based on LBP feature |
| Publication Number | Publication Date |
|---|---|
| CN107798281A CN107798281A (en) | 2018-03-13 |
| CN107798281Btrue CN107798281B (en) | 2021-10-08 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610808240.3AActiveCN107798281B (en) | 2016-09-07 | 2016-09-07 | A method and device for face liveness detection based on LBP feature |
| Country | Link |
|---|---|
| CN (1) | CN107798281B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108875546A (en)* | 2018-04-13 | 2018-11-23 | 北京旷视科技有限公司 | Face auth method, system and storage medium |
| CN110443102B (en)* | 2018-05-04 | 2022-05-24 | 北京眼神科技有限公司 | Live face detection method and device |
| CN108776786A (en)* | 2018-06-04 | 2018-11-09 | 北京京东金融科技控股有限公司 | Method and apparatus for generating user's truth identification model |
| CN108921041A (en)* | 2018-06-06 | 2018-11-30 | 深圳神目信息技术有限公司 | A kind of biopsy method and device based on RGB and IR binocular camera |
| CN108830229A (en)* | 2018-06-20 | 2018-11-16 | 哈尔滨理工大学 | The vivo identification method of Face datection is combined under a kind of frame based on caffe |
| CN109558794B (en)* | 2018-10-17 | 2024-06-28 | 平安科技(深圳)有限公司 | Moire-based image recognition method, device, equipment and storage medium |
| CN109697417A (en)* | 2018-12-14 | 2019-04-30 | 江阴弘远新能源科技有限公司 | A kind of production management system for pitch-controlled system cabinet |
| CN110008820A (en)* | 2019-01-30 | 2019-07-12 | 广东世纪晟科技有限公司 | Silent in-vivo detection method |
| CN110008878B (en)* | 2019-03-27 | 2021-07-30 | 熵基科技股份有限公司 | Anti-fake method for face detection and face recognition device with anti-fake function |
| CN110059607B (en)* | 2019-04-11 | 2023-07-11 | 深圳华付技术股份有限公司 | Living body multiplex detection method, living body multiplex detection device, computer equipment and storage medium |
| CN112395929A (en)* | 2019-08-19 | 2021-02-23 | 扬州盛世云信息科技有限公司 | Face living body detection method based on infrared image LBP histogram characteristics |
| CN110580454A (en)* | 2019-08-21 | 2019-12-17 | 北京的卢深视科技有限公司 | Liveness detection method and device |
| CN112651268B (en)* | 2019-10-11 | 2024-05-28 | 北京眼神智能科技有限公司 | Method, device and electronic device for excluding black and white photos in liveness detection |
| CN111832464B (en)* | 2020-07-08 | 2024-10-15 | 福建捷宇电脑科技有限公司 | Living body detection method and device based on near infrared camera |
| CN111879724B (en)* | 2020-08-05 | 2021-05-04 | 中国工程物理研究院流体物理研究所 | Human skin mask identification method and system based on near infrared spectrum imaging |
| CN117953591B (en)* | 2024-03-27 | 2024-06-14 | 中国人民解放军空军军医大学 | Intelligent limb rehabilitation assisting method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101404060A (en)* | 2008-11-10 | 2009-04-08 | 北京航空航天大学 | Human face recognition method based on visible light and near-infrared Gabor information amalgamation |
| CN102163288A (en)* | 2011-04-06 | 2011-08-24 | 北京中星微电子有限公司 | Eyeglass detection method and device |
| CN102867188A (en)* | 2012-07-26 | 2013-01-09 | 中国科学院自动化研究所 | Method for detecting seat state in meeting place based on cascade structure |
| CN104680141A (en)* | 2015-02-13 | 2015-06-03 | 华中师范大学 | Motion unit layering-based facial expression recognition method and system |
| CN105069448A (en)* | 2015-09-29 | 2015-11-18 | 厦门中控生物识别信息技术有限公司 | True and false face identification method and device |
| CN105320950A (en)* | 2015-11-23 | 2016-02-10 | 天津大学 | A video human face living body detection method |
| CN105718868A (en)* | 2016-01-18 | 2016-06-29 | 中国科学院计算技术研究所 | Face detection system and method for multi-pose faces |
| CN105787437A (en)* | 2016-02-03 | 2016-07-20 | 东南大学 | Vehicle brand type identification method based on cascading integrated classifier |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101404060A (en)* | 2008-11-10 | 2009-04-08 | 北京航空航天大学 | Human face recognition method based on visible light and near-infrared Gabor information amalgamation |
| CN102163288A (en)* | 2011-04-06 | 2011-08-24 | 北京中星微电子有限公司 | Eyeglass detection method and device |
| CN102867188A (en)* | 2012-07-26 | 2013-01-09 | 中国科学院自动化研究所 | Method for detecting seat state in meeting place based on cascade structure |
| CN104680141A (en)* | 2015-02-13 | 2015-06-03 | 华中师范大学 | Motion unit layering-based facial expression recognition method and system |
| CN105069448A (en)* | 2015-09-29 | 2015-11-18 | 厦门中控生物识别信息技术有限公司 | True and false face identification method and device |
| CN105320950A (en)* | 2015-11-23 | 2016-02-10 | 天津大学 | A video human face living body detection method |
| CN105718868A (en)* | 2016-01-18 | 2016-06-29 | 中国科学院计算技术研究所 | Face detection system and method for multi-pose faces |
| CN105787437A (en)* | 2016-02-03 | 2016-07-20 | 东南大学 | Vehicle brand type identification method based on cascading integrated classifier |
| Title |
|---|
| Jukka Määttä等."Face Spoofing Detection From Single Images Using Micro-Texture Analysis".《2011 International Joint Conference on Biometrics》.2011,第1-7页.* |
| Publication number | Publication date |
|---|---|
| CN107798281A (en) | 2018-03-13 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107798281B (en) | A method and device for face liveness detection based on LBP feature | |
| CN107798279B (en) | Face living body detection method and device | |
| CN107423690B (en) | A face recognition method and device | |
| JP7242528B2 (en) | Systems and methods for performing fingerprint user authentication using images captured using mobile devices | |
| CN110443102B (en) | Live face detection method and device | |
| Karthick | Deep Learning For Age Group Classification System | |
| JP4756705B2 (en) | Biometric imaging system and method | |
| JP5517858B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
| CN109948566B (en) | Double-flow face anti-fraud detection method based on weight fusion and feature selection | |
| CN105956572A (en) | In vivo face detection method based on convolutional neural network | |
| CN105574509B (en) | A kind of face identification system replay attack detection method and application based on illumination | |
| KR20170006355A (en) | Method of motion vector and feature vector based fake face detection and apparatus for the same | |
| WO2016149944A1 (en) | Face recognition method and system, and computer program product | |
| CN105354554A (en) | Color and singular value feature-based face in-vivo detection method | |
| CN111126240A (en) | A three-channel feature fusion face recognition method | |
| CN104951940A (en) | Mobile payment verification method based on palmprint recognition | |
| CN106650752B (en) | A method of car body color recognition | |
| CN107480586B (en) | Detection method of biometric photo counterfeiting attack based on facial feature point displacement | |
| CN103440035A (en) | Gesture recognition system in three-dimensional space and recognition method thereof | |
| Kruthi et al. | Offline signature verification using support vector machine | |
| Wild et al. | Comparative test of smartphone finger photo vs. touch-based cross-sensor fingerprint recognition | |
| Ruhitha et al. | Implementation of IOT based attendance management system on Raspberry Pi | |
| CN108921006B (en) | A method for establishing the authenticity identification model of a handwritten signature image and a method for authenticating it | |
| Yimyam et al. | Development of heat stroke detection system using image processing techniques | |
| He et al. | Face Spoofing Detection Based on Combining Different Color Space Models |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP02 | Change in the address of a patent holder | Address after:071800 Beijing Tianjin talent home (Xincheng community), West District, Xiongxian Economic Development Zone, Baoding City, Hebei Province Patentee after:BEIJING EYECOOL TECHNOLOGY Co.,Ltd. Address before:100085 20 / F, building 4, yard 1, shangdishi street, Haidian District, Beijing 2013 Patentee before:BEIJING EYECOOL TECHNOLOGY Co.,Ltd. | |
| CP02 | Change in the address of a patent holder | ||
| PE01 | Entry into force of the registration of the contract for pledge of patent right | Denomination of invention:A method and device for detecting human face in vivo based on LBP feature Effective date of registration:20220614 Granted publication date:20211008 Pledgee:China Construction Bank Corporation Xiongxian sub branch Pledgor:BEIJING EYECOOL TECHNOLOGY Co.,Ltd. Registration number:Y2022990000332 | |
| PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
| CB03 | Change of inventor or designer information | Inventor after:Kong Yong Inventor after:Zhang Xiangde Inventor before:Zhang Xiangde | |
| CB03 | Change of inventor or designer information | ||
| PC01 | Cancellation of the registration of the contract for pledge of patent right | Granted publication date:20211008 Pledgee:China Construction Bank Corporation Xiongxian sub branch Pledgor:BEIJING EYECOOL TECHNOLOGY Co.,Ltd. Registration number:Y2022990000332 | |
| PC01 | Cancellation of the registration of the contract for pledge of patent right | ||
| PE01 | Entry into force of the registration of the contract for pledge of patent right | Denomination of invention:A method and device for detecting human face in vivo based on LBP feature Granted publication date:20211008 Pledgee:China Construction Bank Corporation Xiongxian sub branch Pledgor:BEIJING EYECOOL TECHNOLOGY Co.,Ltd. Registration number:Y2025980020547 | |
| PE01 | Entry into force of the registration of the contract for pledge of patent right |