CN111626074A - Face classification method and device - Google Patents

Face classification method and device Download PDF

Info

Publication number
CN111626074A
CN111626074A CN201910145371.1A CN201910145371A CN111626074A CN 111626074 A CN111626074 A CN 111626074A CN 201910145371 A CN201910145371 A CN 201910145371A CN 111626074 A CN111626074 A CN 111626074A
Authority
CN
China
Prior art keywords
face
target
face group
group
similarity
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201910145371.1A
Other languages
Chinese (zh)
Inventor
李艳杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201910145371.1A priority Critical patent/CN111626074A/en
Publication of CN111626074A publication Critical patent/CN111626074A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种人脸分类方法及装置,所述方法包括:在人脸图片中提取所述人脸图片对应的目标特征;根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。本发明无需进行人脸样本的采集和人脸特征标记注册,即可实现人脸特征的自动分类,并返回分类后的识别标记,节省时间,提高了人脸特征分类效率,有利于普通用户或家庭使用。

Figure 201910145371

The invention discloses a face classification method and device. The method includes: extracting a target feature corresponding to the face picture from a face picture; face features, obtain the similarity between the target feature and each face group, wherein one face group corresponds to save the corresponding face features of the same person; according to the similarity corresponding to each face group, determine the target The target face group to which the feature belongs; save the target feature to the target face group, and return the identification information corresponding to the target face group. The invention can realize automatic classification of face features without collecting face samples and registering face feature marks, and returns the classified identification marks, which saves time, improves the efficiency of face feature classification, and is beneficial to ordinary users or users. Home use.

Figure 201910145371

Description

一种人脸分类方法及装置A kind of face classification method and device

技术领域technical field

本发明涉图像识别及分类技术领域,尤其涉及一种人脸分类方法及装置。The present invention relates to the technical field of image recognition and classification, and in particular, to a face classification method and device.

背景技术Background technique

当前包含摄像头的智能设备越来越普及,例如智能摄像机、智能门铃、智能手机、机器人等。一般的,在这些智能设备上都均有配备有人脸识别的功能,他们的一般工作流程是拍摄一张图像或一段视频,然后通过对视频进行处理和分析并识别出其中的人脸。Currently, smart devices including cameras are becoming more and more popular, such as smart cameras, smart doorbells, smartphones, robots, etc. Generally, these smart devices are equipped with the function of face recognition. Their general workflow is to shoot an image or a video, and then process and analyze the video to identify the face in it.

人脸识别算法一般需要先人工标注出每个人的若干张人脸图片,而后出现一张新的图片时,算法会将其与标注的人脸数据进行对比,而后确定该图片对应的人。由于该种分类方式需要大量的人脸样本集,在实际的应用场景中需要耗费大量时间进行大量的人脸样本的采集和标记以实现注册,最后才能实现人脸的分类及返回分类后的识别信息,这种分类方式一般适用于公安、银行等大型机构,不利于普通用户或家庭的使用。The face recognition algorithm generally needs to manually mark several face pictures of each person, and then when a new picture appears, the algorithm will compare it with the marked face data, and then determine the person corresponding to the picture. Since this classification method requires a large number of face sample sets, in actual application scenarios, it takes a lot of time to collect and mark a large number of face samples to achieve registration, and finally to achieve face classification and return after classification. This classification method is generally suitable for large institutions such as public security and banks, and is not conducive to the use of ordinary users or families.

发明内容SUMMARY OF THE INVENTION

鉴于上述问题,本发明提出的一种人脸分类方法及装置,无需进行人脸样本的采集和人脸特征标记注册,即可实现人脸特征的自动分类,并返回分类后的识别标记,节省时间,提高了人脸特征分类效率,有利于普通用户或家庭使用。In view of the above problems, a face classification method and device proposed by the present invention can realize automatic classification of face features without collecting face samples and registering face feature marks, and returning the classified identification marks, saving energy. Time, improve the efficiency of face feature classification, and is beneficial to ordinary users or families.

第一方面,本申请通过一实施例提供如下技术方案:In the first aspect, the present application provides the following technical solutions through an embodiment:

一种人脸分类方法,所述方法包括:A face classification method, the method includes:

在人脸图片中提取所述人脸图片对应的目标特征;根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。Extract the target feature corresponding to the face picture from the face picture; obtain the similarity between the target feature and each face group according to the target feature and the stored face feature in each face group , wherein, a face group corresponds to save the corresponding face features of the same person; according to the similarity corresponding to each face group, determine the target face group to which the target feature belongs; save the target feature to the target face group, and return the identification information corresponding to the target face group.

优选地,所述根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,包括:Preferably, obtaining the similarity between the target feature and each face group according to the target feature and the stored face features in each face group, including:

计算所述目标特征与已储存的每个人脸组中的每个人脸特征之间的相似度;获取同一个人脸组中每个人脸特征对应的每个相似度之间的平均值,并将所述平均值作为所述目标特征与当前所述人脸组之间的相似度。Calculate the similarity between the target feature and each face feature in each stored face group; obtain the average value between each similarity corresponding to each face feature in the same face group, and use the The average value is used as the similarity between the target feature and the current face group.

优选地,所述根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组,包括:Preferably, determining the target face group to which the target feature belongs according to the similarity corresponding to each face group, including:

若所述相似度中的最大值大于预设的判断阈值,则将最大的相似度对应的人脸组作为目标人脸组。If the maximum value of the similarity is greater than the preset judgment threshold, the face group corresponding to the maximum similarity is used as the target face group.

优选地,所述根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组,包括:Preferably, determining the target face group to which the target feature belongs according to the similarity corresponding to each face group, including:

若所述相似度中的最大值小于预设的判断阈值,则新建一人脸组;将新建的人脸组作为所述目标人脸组。If the maximum value of the similarity is less than the preset judgment threshold, a new face group is created; the newly created face group is used as the target face group.

优选地,所述将新建的人脸组作为所述目标人脸组之后,包括:Preferably, after taking the newly created face group as the target face group, it includes:

为所述目标人脸组分配所述标识信息。The identification information is allocated to the target face group.

优选地,所述将所述目标特征保存至所述目标人脸组,包括:Preferably, the storing the target feature to the target face group includes:

判断所述目标人脸组中存储的人脸特征的数量是否超过预设的存储阈值;若所述目标人脸组中存储的人脸特征的数量超过预设的存储阈值,则删除存储时间最早的人脸特征,将所述目标特征保存至所述目标人脸组;若所述目标人脸组中存储的人脸特征的数量未超过预设的存储阈值,则将所述目标特征保存至所述目标人脸组。Judging whether the number of face features stored in the target face group exceeds the preset storage threshold; if the number of face features stored in the target face group exceeds the preset storage threshold, then delete the earliest storage time If the number of face features stored in the target face group does not exceed the preset storage threshold, the target features are saved to the target face group. the target face group.

第二方面,基于同一发明构思,本申请通过一实施例提供如下技术方案:In the second aspect, based on the same inventive concept, the present application provides the following technical solutions through an embodiment:

一种人脸分类装置,所述装置包括:A face classification device, the device includes:

特征提取模块,用于在人脸图片中提取所述人脸图片对应的目标特征;相似度计算模块,用于根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;人脸组确定模块,用于根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;特征保存模块,用于将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。The feature extraction module is used to extract the target feature corresponding to the face picture in the face picture; the similarity calculation module is used to obtain the target feature according to the target feature and the stored face features in each face group. Describe the similarity between the target feature and each face group, wherein one face group corresponds to save the corresponding face features of the same person; the face group determination module is used to determine the similarity according to the corresponding similarity of each face group. The target face group to which the target feature belongs; a feature saving module is configured to save the target feature to the target face group, and return the identification information corresponding to the target face group.

优选地,所述相似度计算模块,还用于:Preferably, the similarity calculation module is also used for:

计算所述目标特征与已储存的每个人脸组中的每个人脸特征之间的相似度;获取同一个人脸组中每个人脸特征对应的每个相似度之间的平均值,并将所述平均值作为所述目标特征与当前所述人脸组之间的相似度。Calculate the similarity between the target feature and each face feature in each stored face group; obtain the average value between each similarity corresponding to each face feature in the same face group, and use the The average value is used as the similarity between the target feature and the current face group.

优选地,所述人脸组确定模块,还用于:Preferably, the face group determination module is also used for:

若所述相似度中的最大值大于预设的判断阈值,则将最大的相似度对应的人脸组作为目标人脸组。If the maximum value of the similarity is greater than the preset judgment threshold, the face group corresponding to the maximum similarity is used as the target face group.

优选地,所述人脸组确定模块,还用于:Preferably, the face group determination module is also used for:

若所述相似度中的最大值小于预设的判断阈值,则新建一人脸组;If the maximum value in the similarity is less than the preset judgment threshold, create a new face group;

将新建的人脸组作为所述目标人脸组。The newly created face group is used as the target face group.

优选地,还包括:标识分配模块,用于:Preferably, it also includes: an identification distribution module for:

在所述将新建的人脸组作为所述目标人脸组之后,为所述目标人脸组分配所述标识信息。After the newly created face group is used as the target face group, the identification information is allocated to the target face group.

优选地,特征保存模块,还用于:Preferably, the feature preservation module is also used for:

判断所述目标人脸组中存储的人脸特征的数量是否超过预设的存储阈值;若所述目标人脸组中存储的人脸特征的数量超过预设的存储阈值,则删除存储时间最早的人脸特征,将所述目标特征保存至所述目标人脸组;若所述目标人脸组中存储的人脸特征的数量未超过预设的存储阈值,则将所述目标特征保存至所述目标人脸组。Judging whether the number of face features stored in the target face group exceeds the preset storage threshold; if the number of face features stored in the target face group exceeds the preset storage threshold, then delete the earliest storage time If the number of face features stored in the target face group does not exceed the preset storage threshold, the target features are saved to the target face group. the target face group.

第三方面,基于同一发明构思,本申请通过一实施例提供如下技术方案:In the third aspect, based on the same inventive concept, the present application provides the following technical solutions through an embodiment:

一种人脸分类装置,包括处理器和存储器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时使所述人脸分类装置执行上述第一方面中任一项所述方法的步骤。A face classification apparatus, comprising a processor and a memory, the memory being coupled to the processor, the memory storing instructions, when the instructions are executed by the processor, the face classification apparatus is caused to perform the above-mentioned The steps of any of the methods of the first aspect.

第四方面,基于同一发明构思,本申请通过一实施例提供如下技术方案:In the fourth aspect, based on the same inventive concept, the present application provides the following technical solutions through an embodiment:

一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述第一方面中任一项所述方法的步骤。A computer-readable storage medium having a computer program stored thereon, when the program is executed by a processor, implements the steps of the method in any one of the above-mentioned first aspects.

本发明实施例提供的一种人脸分类方法及装置,其中方法通过在人脸图片中提取所述人脸图片对应的目标特征;根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。本发明在整个分类过程中不用事先进行人脸样本的采集和标记注册,直接通过相似度的计算结果来确定目标人脸组,即可实现目标特征的自动分类,并返回保存至目标人脸组后对应的标识信息,节省了人脸样本采集和标记注册的时间,提高了人脸特征分类效率,有利于普通用户或家庭使用。An embodiment of the present invention provides a face classification method and device, wherein the method extracts the target feature corresponding to the face picture from the face picture; according to the target feature and the stored people in each face group face features, obtain the similarity between the target feature and each face group, wherein one face group corresponds to save the corresponding face features of the same person; according to the similarity corresponding to each face group, determine the target The target face group to which the feature belongs; save the target feature to the target face group, and return the identification information corresponding to the target face group. The invention does not need to collect and mark and register face samples in advance in the whole classification process, and directly determines the target face group through the calculation result of the similarity, so as to realize the automatic classification of the target features, and return and save it to the target face group After the corresponding identification information, the time for face sample collection and mark registration is saved, the efficiency of face feature classification is improved, and it is beneficial to ordinary users or families.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, in order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand , the following specific embodiments of the present invention are given.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered limiting of the invention. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:

图1示出了本发明第一实施例提供的一种人脸分类方法的流程图;FIG. 1 shows a flowchart of a method for classifying human faces according to a first embodiment of the present invention;

图2示出了图1中步骤S20的子步骤流程图;Fig. 2 shows the sub-step flow chart of step S20 in Fig. 1;

图3示出了本发明第二实施例提供的一种人脸分类方法的功能模块图;3 shows a functional block diagram of a face classification method provided by a second embodiment of the present invention;

图4示出了本发明第三实施例提供的一种人脸分类装置的模块框图。FIG. 4 shows a block diagram of a module of a face classification apparatus provided by a third embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.

第一实施例first embodiment

请参见图1,图1示出了本发明第一实施例提供的一种人脸分类方法的方法流程图。该方法具体包括以下步骤:Referring to FIG. 1, FIG. 1 shows a method flowchart of a face classification method provided by the first embodiment of the present invention. The method specifically includes the following steps:

步骤S10:在人脸图片中提取所述人脸图片对应的目标特征。Step S10: Extract the target feature corresponding to the face picture from the face picture.

步骤S20:根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征。Step S20: Obtain the similarity between the target feature and each face group according to the target feature and the stored face feature in each face group, wherein one face group corresponds to save the correspondence of the same person. facial features.

步骤S30:根据每个人脸组对应的所述相似度,确定所述目标特征所属的目标人脸组。Step S30: Determine the target face group to which the target feature belongs according to the similarity corresponding to each face group.

步骤S40:将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。Step S40: Save the target feature to the target face group, and return the identification information corresponding to the target face group.

在步骤S10之前还可包括获取人脸图片的步骤,具体的可通过智能设备上安装的摄像头进行拍照、视频录制并解码的方式进行人脸图片的获取。Before step S10, a step of obtaining a face picture may also be included, and specifically, the face picture may be obtained by taking pictures, video recording and decoding with a camera installed on the smart device.

在步骤S10中,人脸图片为智能设备的所拍摄的图片或视频(包含人脸的视频帧)。智能设备例如,智能门铃、智能手机等。人脸图片对应的目标特征表示可对人脸图片中的人脸进行识别和表示的特征,例如通过现有的LBP(Local Binary Patterns)人脸特征提取方法、特征脸方法(Eigenface)以及人脸特征点位置检测等方式进行提取人脸特征,人脸特征的表示形式可为表示人脸纹理、特征脸、人脸特征点等的向量组,不作限制。In step S10, the face picture is a picture or video (video frame including a human face) captured by the smart device. Smart devices such as smart doorbells, smart phones, etc. The target feature corresponding to the face picture represents the feature that can identify and represent the face in the face picture, for example, through the existing LBP (Local Binary Patterns) face feature extraction method, eigenface method (Eigenface) and face The facial features are extracted by methods such as feature point position detection, and the representation form of the facial features can be a vector group representing facial texture, eigenface, and facial feature points, etc., without limitation.

需要说明的是,上述特征提取方法均为现有方法,其具体实施过程不再赘述。It should be noted that the above feature extraction methods are all existing methods, and the specific implementation process thereof will not be repeated.

在步骤S20中,人脸组用于保存人脸特征,在同一个人脸组中所保存的人脸特征均为同一人的人脸特征。在一个人脸组中可设置一存储阈值来限定对应的人脸特征的数量保存上限,可节约存储资源和相似度计算资源。In step S20, the face group is used to store face features, and the face features stored in the same face group are all face features of the same person. In a face group, a storage threshold can be set to limit the storage upper limit of the number of corresponding face features, which can save storage resources and similarity computing resources.

例如:人脸组A用于保存用户A的人脸特征,其保存上限为10个人脸特征,那么在人脸组A中保存的人脸特征为小于或等于10个。For example, face group A is used to store the face features of user A, and the upper limit for saving is 10 face features, then the face features stored in face group A are less than or equal to 10.

另外,也可对人脸组的存储占用大小进行限定,即该存储阈值可为数量也可为内容大小。例如每个人脸组的内存占用大小不超过1024K。In addition, the storage occupation size of the face group may also be limited, that is, the storage threshold may be the quantity or the content size. For example, the memory footprint of each face group does not exceed 1024K.

具体的,请参阅图2,步骤S20包括:Specifically, please refer to FIG. 2, step S20 includes:

步骤S21:计算所述目标特征与已储存的每个人脸组中的每个人脸特征之间的相似度。Step S21: Calculate the similarity between the target feature and each face feature in each stored face group.

步骤S22:获取同一个人脸组中每个人脸特征对应的每个相似度之间的平均值,并将所述平均值作为所述目标特征与当前所述人脸组之间的相似度。Step S22: Obtain the average value between each similarity corresponding to each face feature in the same face group, and use the average value as the similarity between the target feature and the current face group.

例如:在智能门铃中,或智能门铃的服务器中保存有人脸组A、人脸组B两个人脸组,该两个人脸组的人脸特征存储上限均为10,人脸组A中保存有10个人脸特征,人脸组B中保存有7个人脸特征。计算人脸组的相似度,对于人脸组A,计算目标特征与人脸组A中的10个人脸特征的相似度,可得到10个相似度,然后将人脸组A对应的10个相似度进行求平均值,得到的平均值即可作为目标特征与人脸组A之间的相似度;同样的,对于人脸组B,计算目标特征与人脸组B中的7个人脸特征的相似度,可得到7个相似度,然后将人脸组B对应的7个相似度进行求平均值,得到的平均值即可作为目标特征与人脸组B之间的相似度。For example: in the smart doorbell, or in the server of the smart doorbell, there are two face groups, face group A and face group B, and the face feature storage upper limit of the two face groups is 10. There are 10 facial features, and 7 facial features are stored in the face group B. Calculate the similarity of face groups. For face group A, calculate the similarity between the target feature and the 10 face features in face group A, and get 10 similarities, and then compare the 10 similarities corresponding to face group A. The average value obtained can be used as the similarity between the target feature and face group A; similarly, for face group B, calculate the difference between the target feature and the seven face features in face group B. Similarity, 7 similarities can be obtained, and then the 7 similarities corresponding to face group B are averaged, and the obtained average can be used as the similarity between the target feature and face group B.

计算相似度可在本地智能设备中进行,也可在云端服务器进行。例如,对于数据处理能力较弱(处理器性能较弱)的智能设备,可将数据上传至云端来进行相似度的计算,例如:智能门铃、智能手环等。对于数据处理能力较强(处理器性能较强)的智能设备,可在本地智能设备中进行相似度的计算,例如:智能手机、智能机器人等。The calculation of similarity can be carried out in the local smart device or in the cloud server. For example, for a smart device with weak data processing capability (weak processor performance), the data can be uploaded to the cloud for similarity calculation, such as: smart doorbell, smart bracelet, etc. For smart devices with strong data processing capabilities (strong processor performance), similarity calculation can be performed in local smart devices, such as smart phones, smart robots, and the like.

另外,相似度的具体衡量方式不作限制,例如:通过余弦距离、欧氏距离、汉明距离等衡量目标特征与人脸特征的相似度。In addition, the specific measurement method of the similarity is not limited, for example, the similarity between the target feature and the face feature is measured by cosine distance, Euclidean distance, Hamming distance, etc.

在步骤S30中,具体的,在获得各个人脸组于目标特征对应的相似度之后,可将最大的相似度对应的人脸组作为存储目标特征的目标人脸组。In step S30, specifically, after obtaining the similarities of each face group corresponding to the target feature, the face group corresponding to the maximum similarity may be used as the target face group for storing the target feature.

但是,为了进一步的提高目标特征保存的准确性,避免两个不为同一人但较为相似的人脸特征被错误的保存到了同一个人脸组中。可设置一判断阈值,当最大的相似度大于或等于该判断阈值时,才可在该人脸组中进行目标特征的保存。否则,判断当前所有的人脸组均不能用于保存目标特征,需要新建一人脸组作为目标人脸组进行保存目标特征。However, in order to further improve the accuracy of target feature preservation, it is avoided that two face features that are not the same person but are relatively similar are erroneously stored in the same face group. A judgment threshold can be set, and when the maximum similarity is greater than or equal to the judgment threshold, the target feature can be stored in the face group. Otherwise, it is judged that all current face groups cannot be used to save the target features, and a new face group needs to be created as the target face group to save the target features.

为了方便确定每个人脸组所对应的人,可在每个人脸组新建的时候添加对应的标识信息,用于区分不同的人脸组。例如对每个人脸组进行相应的编号进行区分,也可通过用户对新建的人脸组进行自定义设置,例如,在新建一人脸组作为目标人脸组后,目标特征对应的人为张三,则可将该目标人脸组标记“张三”或其对应的身份证号作为标识信息。In order to facilitate the determination of the person corresponding to each face group, corresponding identification information may be added when each face group is newly created to distinguish different face groups. For example, the corresponding number of each face group can be distinguished, or the user can customize the settings for the newly created face group. For example, after creating a new face group as the target face group, the person corresponding to the target feature is Zhang San, Then, the target face group can be marked with "Zhang San" or its corresponding ID number as identification information.

在步骤S40中,在目标人脸组中进行目标特征保存时,还应当判断目标人脸组中存储的人脸特征是否超过预设的存储阈值,其中不同的人脸组的存储阈值可以相同或不同,例如在智能门铃中,对于保存主人的人脸特征的人脸组可设置更大的存储上限,提高相似度计算的准确性,保证对智能门铃主人识别的准确性。In step S40, when the target feature is stored in the target face group, it should also be judged whether the face feature stored in the target face group exceeds a preset storage threshold, wherein the storage thresholds of different face groups may be the same or Different, for example, in a smart doorbell, a larger storage upper limit can be set for the face group that saves the owner's facial features to improve the accuracy of similarity calculation and ensure the accuracy of the smart doorbell owner identification.

进一步的,若目标人脸组中存储的人脸特征超过预设的存储阈值,则删除存储时间最早的人脸特征后将目标特征保存至目标人脸组;若目标人脸组中存储的人脸特征未超过预设的存储阈值,则直接将目标特征保存至目标人脸组。例如,若人脸组A与目标特征之间的相似度大于人脸组B与目标特征之间的相似度,且大于判断阈值时,需要将人脸组A中存储时间最早的人脸特征删除至少一个,然后再存入目标特征。若人脸组B与目标特征之间的相似度大于人脸组A与目标特征之间的相似度,且大于判断阈值时,由于人脸组B中存储有7个人脸特征,未达到存储上限,此时在人脸组B中无需进行人脸特征的删除,即可存放目标特征。Further, if the face features stored in the target face group exceed the preset storage threshold, delete the face features with the earliest storage time and then save the target features to the target face group; If the face feature does not exceed the preset storage threshold, the target feature is directly saved to the target face group. For example, if the similarity between face group A and the target feature is greater than the similarity between face group B and the target feature, and is greater than the judgment threshold, the face feature with the earliest storage time in face group A needs to be deleted at least one, and then store the target feature. If the similarity between face group B and the target feature is greater than the similarity between face group A and the target feature, and is greater than the judgment threshold, since there are 7 face features stored in face group B, the storage upper limit has not been reached. , at this time, the target feature can be stored in the face group B without deleting the face feature.

在步骤S40中,返回的标识信息可一为人脸组对应的人的姓名、自定义编号、身份证号等,不做限制。In step S40, the returned identification information may be the name, user-defined number, ID number, etc. of the person corresponding to the face group, which is not limited.

综上所述,本发明实施例提供的一种人脸分类方法,通过在人脸图片中提取所述人脸图片对应的目标特征;根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;根据每个人脸组对应的所述相似度,确定用于保存所述目标特征的目标人脸组;将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。在本发明执行的整个分类过程中不用事先进行人脸样本的采集和标记注册,直接通过相似度的计算结果来确定一目标人脸组,即可实现目标特征的自动分类,即不需要进行人工标记就可以实现人脸的自动分组;并且只需要输入一个人脸图像就可以返回其标识信息(如ID),而不需要输入很多个人脸之后才能返回各个人脸的标识信息,节省了人脸样本采集和标记注册的时间,提高了人脸特征分类效率,有利于普通用户或家庭使用,可大规模推广。To sum up, the embodiment of the present invention provides a face classification method, by extracting the target feature corresponding to the face picture from the face picture; according to the target feature and the stored data in each face group face features, obtain the similarity between the target feature and each face group, wherein one face group corresponds to save the corresponding face features of the same person; according to the similarity corresponding to each face group, determine A target face group for saving the target feature; saving the target feature to the target face group, and returning the identification information corresponding to the target face group. In the entire classification process performed by the present invention, it is not necessary to collect and register face samples in advance, and directly determine a target face group through the calculation result of the similarity, so that the automatic classification of target features can be realized, that is, no manual operation is required. Marking can realize the automatic grouping of faces; and only need to input a face image to return its identification information (such as ID), without the need to input a lot of faces to return the identification information of each face, saving face The time for sample collection and mark registration improves the efficiency of face feature classification, which is beneficial to ordinary users or families, and can be promoted on a large scale.

第二实施例Second Embodiment

基于同一发明构思,本发明第二实施例提供了一种人脸分类装置400。图3示出了本发明第二实施例提供的一种人脸分类装置400的功能模块框图。Based on the same inventive concept, the second embodiment of the present invention provides a face classification apparatus 400 . FIG. 3 shows a block diagram of functional modules of a face classification apparatus 400 provided by the second embodiment of the present invention.

具体的,该装置400包括:Specifically, the device 400 includes:

特征提取模块401,用于在人脸图片中提取所述人脸图片对应的目标特征。The feature extraction module 401 is used for extracting target features corresponding to the face picture in the face picture.

相似度计算模块402,用于根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征。The similarity calculation module 402 is used to obtain the similarity between the target feature and each face group according to the target feature and the stored face feature in each face group, wherein one face group corresponds to The corresponding facial features of the same person are saved.

人脸组确定模块403,用于根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组。The face group determination module 403 is configured to determine the target face group to which the target feature belongs according to the similarity corresponding to each face group.

特征保存模块404,用于将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。The feature saving module 404 is configured to save the target feature to the target face group, and return the identification information corresponding to the target face group.

作为一种可选的实施方式,所述相似度计算模块402,还用于:As an optional implementation manner, the similarity calculation module 402 is further configured to:

计算所述目标特征与已储存的每个人脸组中的每个人脸特征之间的相似度;获取同一个人脸组中每个人脸特征对应的每个相似度之间的平均值,并将所述平均值作为所述目标特征与当前所述人脸组之间的相似度。Calculate the similarity between the target feature and each face feature in each stored face group; obtain the average value between each similarity corresponding to each face feature in the same face group, and use the The average value is used as the similarity between the target feature and the current face group.

作为一种可选的实施方式,所述人脸组确定模块403,还用于:As an optional implementation manner, the face group determination module 403 is further configured to:

若所述相似度中的最大值大于预设的判断阈值,则将最大的相似度对应的人脸组作为目标人脸组。If the maximum value of the similarity is greater than the preset judgment threshold, the face group corresponding to the maximum similarity is used as the target face group.

作为一种可选的实施方式,所述人脸组确定模块403,还用于:As an optional implementation manner, the face group determination module 403 is further configured to:

若所述相似度中的最大值小于预设的判断阈值,则新建一人脸组;将新建的人脸组作为所述目标人脸组。If the maximum value of the similarity is less than the preset judgment threshold, a new face group is created; the newly created face group is used as the target face group.

作为一种可选的实施方式,还包括:标识分配模块,用于:As an optional implementation manner, it also includes: an identification allocation module for:

在所述将新建的人脸组作为所述目标人脸组之后,为所述目标人脸组分配所述标识信息。After the newly created face group is used as the target face group, the identification information is allocated to the target face group.

作为一种可选的实施方式,特征保存模块404,还用于:As an optional implementation manner, the feature saving module 404 is further configured to:

判断所述目标人脸组中存储的人脸特征的数量是否超过预设的存储阈值;若所述目标人脸组中存储的人脸特征的数量超过预设的存储阈值,则删除存储时间最早的人脸特征,将所述目标特征保存至所述目标人脸组;若所述目标人脸组中存储的人脸特征的数量未超过预设的存储阈值,则将所述目标特征保存至所述目标人脸组。Judging whether the number of face features stored in the target face group exceeds the preset storage threshold; if the number of face features stored in the target face group exceeds the preset storage threshold, then delete the earliest storage time If the number of face features stored in the target face group does not exceed the preset storage threshold, the target features are saved to the target face group. the target face group.

需要说明的是,本发明实施例所提供的装置400,其具体实现及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。It should be noted that the specific implementation and technical effects of the device 400 provided by the embodiments of the present invention are the same as those of the foregoing method embodiments. For brief description, for the parts not mentioned in the device embodiments, reference may be made to the foregoing method embodiments. corresponding content.

第三实施例Third Embodiment

另外,基于同一发明构思,本发明第三实施例还提供了一种人脸分类装置,包括处理器和存储器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时使所述人脸分类装置执行以下操作:In addition, based on the same inventive concept, a third embodiment of the present invention further provides a face classification apparatus, including a processor and a memory, the memory is coupled to the processor, and the memory stores an instruction, when the instruction When executed by the processor, the face classification apparatus is caused to perform the following operations:

在人脸图片中提取所述人脸图片对应的目标特征;根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。Extract the target feature corresponding to the face picture from the face picture; obtain the similarity between the target feature and each face group according to the target feature and the stored face feature in each face group , wherein, a face group corresponds to save the corresponding face features of the same person; according to the similarity corresponding to each face group, determine the target face group to which the target feature belongs; save the target feature to the target face group, and return the identification information corresponding to the target face group.

需要说明的是,本发明实施例所提供的人脸分类装置中,上述每个步骤的具体实现及产生的技术效果和前述方法实施例相同,为简要描述,本实施例未提及之处可参考前述方法实施例中相应内容。It should be noted that, in the face classification apparatus provided in the embodiment of the present invention, the specific implementation of each step and the technical effect produced are the same as those in the foregoing method embodiment. For brief description, the parts not mentioned in this embodiment may be Refer to the corresponding content in the foregoing method embodiments.

于本发明实施例中,人脸分类装置中安装有操作系统以及第三方应用程序。人脸分类装置可以为平板电脑、手机、智能门铃、扫地机器人、笔记本电脑、PC(personalcomputer,个人计算机)、可穿戴设备、车载终端等终端设备。In the embodiment of the present invention, an operating system and a third-party application program are installed in the face classification apparatus. The face classification device may be a tablet computer, a mobile phone, a smart doorbell, a cleaning robot, a notebook computer, a PC (personal computer, personal computer), a wearable device, a vehicle terminal and other terminal devices.

图4示出了一种示例性人脸分类装置500的模块框图。如图4所示,人脸分类装置500包括存储器502、存储控制器504,一个或多个(图中仅示出一个)处理器506、外设接口508、网络模块510、输入输出模块512、显示模块514等。这些组件通过一条或多条通讯总线/信号线516相互通讯。FIG. 4 shows a block diagram of an exemplary face classification apparatus 500 . As shown in FIG. 4 , the face classification apparatus 500 includes a memory 502, a storage controller 504, one or more (only one is shown in the figure) processor 506, a peripheral interface 508, a network module 510, an input and output module 512, Display module 514, etc. These components communicate with each other via one or more communication bus/signal lines 516 .

存储器502可用于存储软件程序以及模块,如本发明实施例中的人脸分类方法以及装置对应的程序指令/模块,处理器506通过运行存储在存储器502内的软件程序以及模块,从而执行各种功能应用以及数据处理,如本发明实施例提供的人脸分类方法。The memory 502 can be used to store software programs and modules, such as the program instructions/modules corresponding to the face classification method and the device in the embodiment of the present invention. The processor 506 executes various software programs and modules by running the software programs and modules stored in the memory 502. Function application and data processing, such as the face classification method provided by the embodiment of the present invention.

存储器502可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。处理器506以及其他可能的组件对存储器502的访问可在存储控制器504的控制下进行。Memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. Access to memory 502 by processor 506 and possibly other components may be under the control of memory controller 504 .

外设接口508将各种输入/输出装置耦合至处理器506以及存储器502。在一些实施例中,外设接口508,处理器506以及存储控制器504可以在单个芯片中实现。在其他一些实例中,他们可以分别由独立的芯片实现。Peripherals interface 508 couples various input/output devices to processor 506 and memory 502 . In some embodiments, peripheral interface 508, processor 506, and memory controller 504 may be implemented in a single chip. In other instances, they may be implemented by separate chips.

网络模块510用于接收以及发送网络信号。上述网络信号可包括无线信号或者有线信号。The network module 510 is used for receiving and sending network signals. The above-mentioned network signals may include wireless signals or wired signals.

输入输出模块512用于提供给用户输入数据实现用户与人脸分类装置的交互。所述输入输出模块512可以是,但不限于,鼠标、键盘和触控屏幕等。The input and output module 512 is used for providing input data to the user to realize the interaction between the user and the face classification apparatus. The input and output module 512 may be, but not limited to, a mouse, a keyboard, a touch screen, and the like.

显示模块514在人脸分类装置500与用户之间提供一个交互界面(例如用户操作界面)或用于显示图像数据给用户参考。在本实施例中,所述显示模块514可以是液晶显示器或触控显示器。若为触控显示器,其可为支持单点和多点触控操作的电容式触控屏或电阻式触控屏等。支持单点和多点触控操作是指触控显示器能感应到来自该触控显示器上一个或多个位置处同时产生的触控操作,并将该感应到的触控操作交由处理器进行计算和处理。The display module 514 provides an interactive interface (eg, a user operation interface) between the face classification apparatus 500 and the user or is used to display image data for the user's reference. In this embodiment, the display module 514 may be a liquid crystal display or a touch display. In the case of a touch display, it can be a capacitive touch screen or a resistive touch screen that supports single-point and multi-touch operations. Supporting single-point and multi-touch operation means that the touch display can sense the touch operation from one or more positions on the touch display at the same time, and hand over the sensed touch operation to the processor. calculation and processing.

可以理解,图4所示的结构仅为示意,人脸分类装置500还可包括比图4中所示更多或者更少的组件,或者具有与图4所示不同的配置。图4中所示的各组件可以采用硬件、软件或其组合实现。It can be understood that the structure shown in FIG. 4 is only for illustration, and the face classification apparatus 500 may further include more or less components than those shown in FIG. 4 , or have different configurations from those shown in FIG. 4 . Each component shown in FIG. 4 can be implemented in hardware, software, or a combination thereof.

第四实施例Fourth Embodiment

本发明第四实施例提供了一种计算机存储介质,本发明第二实施例中的人脸分类装置集成的功能模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述第一实施例的人脸分类方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。The fourth embodiment of the present invention provides a computer storage medium. If the functional modules integrated in the face classification device in the second embodiment of the present invention are implemented in the form of software functional modules and sold or used as independent products, they can store in a computer-readable storage medium. Based on this understanding, the present invention realizes all or part of the process in the above-mentioned first embodiment of the face classification method, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer readable. In the storage medium, when the computer program is executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable media Electric carrier signals and telecommunication signals are not included.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with teaching based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not directed to any particular programming language. It is to be understood that various programming languages may be used to implement the inventions described herein, and that the descriptions of specific languages above are intended to disclose the best mode for carrying out the invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. It will be understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it is to be understood that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or its description. This disclosure, however, should not be construed as reflecting an intention that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination, unless at least some of such features and/or procedures or elements are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, it will be understood by those skilled in the art that although some of the embodiments herein include certain features, but not others, included in other embodiments, that combinations of features of the different embodiments are intended to be within the scope of the present invention And form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的人脸分类装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。Various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the apparatus for face classification according to the embodiment of the present invention. The present invention can also be implemented as apparatus or apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from Internet sites, or provided on carrier signals, or in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.

本发明公开了A1.一种人脸分类方法,其特征在于,所述方法包括:The present invention discloses A1. a face classification method, characterized in that the method comprises:

在人脸图片中提取所述人脸图片对应的目标特征;extracting the target feature corresponding to the face image from the face image;

根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;According to the target feature and the stored face features in each face group, the similarity between the target feature and each face group is obtained, wherein one face group corresponds to save the corresponding face of the same person feature;

根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;Determine the target face group to which the target feature belongs according to the similarity corresponding to each face group;

将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。The target feature is saved to the target face group, and the identification information corresponding to the target face group is returned.

A2.根据A1所述的方法,其特征在于,所述根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,包括:A2. The method according to A1, characterized in that, according to the target feature and the face feature in each stored face group, the similarity between the target feature and each face group is obtained, include:

计算所述目标特征与已储存的每个人脸组中的每个人脸特征之间的相似度;Calculate the similarity between the target feature and each face feature in each stored face group;

获取同一个人脸组中每个人脸特征对应的每个相似度之间的平均值,并将所述平均值作为所述目标特征与当前所述人脸组之间的相似度。Obtain the average value between each similarity corresponding to each face feature in the same face group, and use the average value as the similarity between the target feature and the current face group.

A3.根据A1所述的方法,其特征在于,所述根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组,包括:A3. The method according to A1, characterized in that, determining the target face group to which the target feature belongs according to the similarity corresponding to each face group, including:

若所述相似度中的最大值大于预设的判断阈值,则将最大的相似度对应的人脸组作为目标人脸组。If the maximum value of the similarity is greater than the preset judgment threshold, the face group corresponding to the maximum similarity is used as the target face group.

A4.根据A1所述的方法,其特征在于,所述根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组,包括:A4. The method according to A1, characterized in that, determining the target face group to which the target feature belongs according to the similarity corresponding to each face group, comprising:

若所述相似度中的最大值小于预设的判断阈值,则新建一人脸组;If the maximum value in the similarity is less than the preset judgment threshold, create a new face group;

将新建的人脸组作为所述目标人脸组。The newly created face group is used as the target face group.

A5.根据A4所述的方法,其特征在于,所述将新建的人脸组作为所述目标人脸组之后,包括:A5. The method according to A4, characterized in that, after taking the newly created face group as the target face group, the method comprises:

为所述目标人脸组分配所述标识信息。The identification information is allocated to the target face group.

A6.根据A1所述的方法,其特征在于,所述将所述目标特征保存至所述目标人脸组,包括:A6. The method according to A1, wherein the storing the target feature to the target face group comprises:

判断所述目标人脸组中存储的人脸特征的数量是否超过预设的存储阈值;Judging whether the number of face features stored in the target face group exceeds a preset storage threshold;

若所述目标人脸组中存储的人脸特征的数量超过预设的存储阈值,则删除存储时间最早的人脸特征,将所述目标特征保存至所述目标人脸组;If the number of face features stored in the target face group exceeds a preset storage threshold, delete the face feature with the earliest storage time, and save the target feature to the target face group;

若所述目标人脸组中存储的人脸特征的数量未超过预设的存储阈值,则将所述目标特征保存至所述目标人脸组。If the number of face features stored in the target face group does not exceed a preset storage threshold, the target feature is stored in the target face group.

本发明公开了B7.一种人脸分类装置,其特征在于,所述装置包括:The present invention discloses B7. a face classification device, characterized in that the device comprises:

特征提取模块,用于在人脸图片中提取所述人脸图片对应的目标特征;a feature extraction module, used for extracting the target feature corresponding to the face image in the face image;

相似度计算模块,用于根据所述目标特征与已储存的每个人脸组中的人脸特征,获得所述目标特征与每个人脸组之间的相似度,其中,一个人脸组对应保存同一个人的对应的人脸特征;The similarity calculation module is used to obtain the similarity between the target feature and each face group according to the target feature and the stored face feature in each face group, wherein one face group corresponds to save The corresponding facial features of the same person;

人脸组确定模块,用于根据每个人脸组对应的相似度,确定所述目标特征所属的目标人脸组;a face group determination module, configured to determine the target face group to which the target feature belongs according to the similarity corresponding to each face group;

特征保存模块,用于将所述目标特征保存至所述目标人脸组,并返回所述目标人脸组对应的标识信息。A feature saving module, configured to save the target feature to the target face group, and return identification information corresponding to the target face group.

B8.根据B7所述的装置,其特征在于,所述相似度计算模块,还用于:B8. The device according to B7, wherein the similarity calculation module is also used for:

计算所述目标特征与已储存的每个人脸组中的每个人脸特征之间的相似度;Calculate the similarity between the target feature and each face feature in each stored face group;

获取同一个人脸组中每个人脸特征对应的每个相似度之间的平均值,并将所述平均值作为所述目标特征与当前所述人脸组之间的相似度。Obtain the average value between each similarity corresponding to each face feature in the same face group, and use the average value as the similarity between the target feature and the current face group.

B9.根据B7所述的装置,其特征在于,所述人脸组确定模块,还用于:B9. The device according to B7, wherein the face group determination module is also used for:

若所述相似度中的最大值大于预设的判断阈值,则将最大的相似度对应的人脸组作为目标人脸组。If the maximum value of the similarity is greater than the preset judgment threshold, the face group corresponding to the maximum similarity is used as the target face group.

B10.根据B7所述的装置,其特征在于,所述人脸组确定模块,还用于:B10. The device according to B7, wherein the face group determination module is further used for:

若所述相似度中的最大值小于预设的判断阈值,则新建一人脸组;If the maximum value in the similarity is less than the preset judgment threshold, create a new face group;

将新建的人脸组作为所述目标人脸组。The newly created face group is used as the target face group.

B11.根据B10所述的装置,其特征在于,还包括:标识分配模块,用于:B11. The device according to B10, further comprising: an identification distribution module for:

在所述将新建的人脸组作为所述目标人脸组之后,为所述目标人脸组分配所述标识信息。After the newly created face group is used as the target face group, the identification information is allocated to the target face group.

B12.根据B7所述的装置,其特征在于,特征保存模块,还用于:B12. The device according to B7, characterized in that the feature preservation module is also used for:

判断所述目标人脸组中存储的人脸特征的数量是否超过预设的存储阈值;Judging whether the number of face features stored in the target face group exceeds a preset storage threshold;

若所述目标人脸组中存储的人脸特征的数量超过预设的存储阈值,则删除存储时间最早的人脸特征,将所述目标特征保存至所述目标人脸组;If the number of face features stored in the target face group exceeds a preset storage threshold, delete the face feature with the earliest storage time, and save the target feature to the target face group;

若所述目标人脸组中存储的人脸特征的数量未超过预设的存储阈值,则将所述目标特征保存至所述目标人脸组。If the number of face features stored in the target face group does not exceed a preset storage threshold, the target feature is stored in the target face group.

本发明公开了C13.一种人脸分类装置,其特征在于,包括处理器和存储器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时使所述人脸分类装置执行A1-A6中任一项所述方法的步骤。The present invention discloses C13. A face classification device, characterized in that it comprises a processor and a memory, the memory is coupled to the processor, and the memory stores an instruction, when the instruction is executed by the processor At the same time, the face classification apparatus is made to execute the steps of any one of the methods in A1-A6.

本发明公开了D14.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现A1-A6中任一项所述方法的步骤。The present invention discloses D14. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of any one of the methods in A1-A6 are implemented.

Claims (10)

1. A face classification method, characterized in that the method comprises:
extracting target features corresponding to the face picture from the face picture;
according to the target features and stored face features in each face group, obtaining the similarity between the target features and each face group, wherein one face group correspondingly stores the corresponding face features of the same person;
determining a target face group to which the target features belong according to the corresponding similarity of each face group;
and storing the target features to the target face group, and returning identification information corresponding to the target face group.
2. The method of claim 1, wherein obtaining the similarity between the target feature and each face group according to the target feature and the stored face features in each face group comprises:
calculating the similarity between the target feature and each face feature in each stored face group;
and acquiring an average value between each similarity corresponding to each face feature in the same face group, and taking the average value as the similarity between the target feature and the current face group.
3. The method according to claim 1, wherein the determining the target face group to which the target feature belongs according to the similarity corresponding to each face group comprises:
and if the maximum value in the similarity is larger than a preset judgment threshold value, taking the face group corresponding to the maximum similarity as a target face group.
4. The method according to claim 1, wherein the determining the target face group to which the target feature belongs according to the similarity corresponding to each face group comprises:
if the maximum value in the similarity is smaller than a preset judgment threshold value, a face group is newly established;
and taking the newly-built face group as the target face group.
5. The method according to claim 4, wherein the step of setting the newly created face group as the target face group comprises:
and distributing the identification information to the target face group.
6. The method of claim 1, wherein saving the target features to the target face group comprises:
judging whether the number of the face features stored in the target face group exceeds a preset storage threshold value or not;
if the number of the face features stored in the target face group exceeds a preset storage threshold value, deleting the face feature with the earliest storage time, and storing the target feature into the target face group;
and if the number of the face features stored in the target face group does not exceed a preset storage threshold, storing the target features into the target face group.
7. An apparatus for classifying a human face, the apparatus comprising:
the characteristic extraction module is used for extracting target characteristics corresponding to the face image from the face image;
the similarity calculation module is used for obtaining the similarity between the target feature and each face group according to the target feature and the stored face features in each face group, wherein one face group correspondingly stores the corresponding face features of the same person;
the face group determining module is used for determining a target face group to which the target features belong according to the corresponding similarity of each face group;
and the characteristic storage module is used for storing the target characteristics to the target face group and returning the identification information corresponding to the target face group.
8. The apparatus of claim 7, wherein the similarity calculation module is further configured to:
calculating the similarity between the target feature and each face feature in each stored face group;
and acquiring an average value between each similarity corresponding to each face feature in the same face group, and taking the average value as the similarity between the target feature and the current face group.
9. A face classification apparatus comprising a processor and a memory coupled to the processor, the memory storing instructions that, when executed by the processor, cause the face classification apparatus to perform the steps of the method of any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN201910145371.1A 2019-02-27 2019-02-27 Face classification method and device Pending CN111626074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910145371.1A CN111626074A (en) 2019-02-27 2019-02-27 Face classification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910145371.1A CN111626074A (en) 2019-02-27 2019-02-27 Face classification method and device

Publications (1)

Publication Number Publication Date
CN111626074A true CN111626074A (en) 2020-09-04

Family

ID=72259618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910145371.1A Pending CN111626074A (en) 2019-02-27 2019-02-27 Face classification method and device

Country Status (1)

Country Link
CN (1) CN111626074A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112114985A (en) * 2020-09-22 2020-12-22 杭州海康威视系统技术有限公司 Method, device and equipment for issuing face information

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515324A (en) * 2009-01-21 2009-08-26 上海银晨智能识别科技有限公司 Control system applied to multi-pose face recognition and a method thereof
CN103177102A (en) * 2013-03-22 2013-06-26 北京小米科技有限责任公司 Method and device of image processing
CN104036261A (en) * 2014-06-30 2014-09-10 北京奇虎科技有限公司 Face recognition method and system
CN104036259A (en) * 2014-06-27 2014-09-10 北京奇虎科技有限公司 Face similarity recognition method and system
CN104133875A (en) * 2014-07-24 2014-11-05 北京中视广信科技有限公司 Face-based video labeling method and face-based video retrieving method
CN105869235A (en) * 2015-01-20 2016-08-17 阿里巴巴集团控股有限公司 Safe gate inhibition method and system thereof
CN106156755A (en) * 2016-07-29 2016-11-23 深圳云天励飞技术有限公司 Similarity calculating method in a kind of recognition of face and system
CN106778653A (en) * 2016-12-27 2017-05-31 北京光年无限科技有限公司 Towards the exchange method and device based on recognition of face Sample Storehouse of intelligent robot
WO2017162076A1 (en) * 2016-03-24 2017-09-28 北京握奇数据股份有限公司 Face identification method and system
CN107741996A (en) * 2017-11-30 2018-02-27 北京奇虎科技有限公司 Method and device for constructing family map based on face recognition, and computing equipment
CN107944427A (en) * 2017-12-14 2018-04-20 厦门市美亚柏科信息股份有限公司 Dynamic human face recognition methods and computer-readable recording medium
CN108021846A (en) * 2016-11-01 2018-05-11 杭州海康威视数字技术股份有限公司 A kind of face identification method and device
CN109145679A (en) * 2017-06-15 2019-01-04 杭州海康威视数字技术股份有限公司 A kind of method, apparatus and system issuing warning information

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515324A (en) * 2009-01-21 2009-08-26 上海银晨智能识别科技有限公司 Control system applied to multi-pose face recognition and a method thereof
CN103177102A (en) * 2013-03-22 2013-06-26 北京小米科技有限责任公司 Method and device of image processing
CN104036259A (en) * 2014-06-27 2014-09-10 北京奇虎科技有限公司 Face similarity recognition method and system
CN104036261A (en) * 2014-06-30 2014-09-10 北京奇虎科技有限公司 Face recognition method and system
CN104133875A (en) * 2014-07-24 2014-11-05 北京中视广信科技有限公司 Face-based video labeling method and face-based video retrieving method
CN105869235A (en) * 2015-01-20 2016-08-17 阿里巴巴集团控股有限公司 Safe gate inhibition method and system thereof
WO2017162076A1 (en) * 2016-03-24 2017-09-28 北京握奇数据股份有限公司 Face identification method and system
CN106156755A (en) * 2016-07-29 2016-11-23 深圳云天励飞技术有限公司 Similarity calculating method in a kind of recognition of face and system
CN108021846A (en) * 2016-11-01 2018-05-11 杭州海康威视数字技术股份有限公司 A kind of face identification method and device
CN106778653A (en) * 2016-12-27 2017-05-31 北京光年无限科技有限公司 Towards the exchange method and device based on recognition of face Sample Storehouse of intelligent robot
CN109145679A (en) * 2017-06-15 2019-01-04 杭州海康威视数字技术股份有限公司 A kind of method, apparatus and system issuing warning information
CN107741996A (en) * 2017-11-30 2018-02-27 北京奇虎科技有限公司 Method and device for constructing family map based on face recognition, and computing equipment
CN107944427A (en) * 2017-12-14 2018-04-20 厦门市美亚柏科信息股份有限公司 Dynamic human face recognition methods and computer-readable recording medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈芳信等: "计算机组成原理", 31 July 2013, 冶金工业出版社, pages: 106 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112114985A (en) * 2020-09-22 2020-12-22 杭州海康威视系统技术有限公司 Method, device and equipment for issuing face information
CN112114985B (en) * 2020-09-22 2024-03-01 杭州海康威视系统技术有限公司 Method, device and equipment for issuing face information

Similar Documents

Publication Publication Date Title
CN107808143B (en) Computer Vision-Based Dynamic Gesture Recognition Method
CN107958230B (en) Facial expression recognition method and device
CN110532984A (en) Critical point detection method, gesture identification method, apparatus and system
WO2019033569A1 (en) Eyeball movement analysis method, device and storage medium
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN108596955B (en) Image detection method, image detection device and mobile terminal
CN107679447A (en) Facial characteristics point detecting method, device and storage medium
CN108711161A (en) Image segmentation method, image segmentation device and electronic equipment
CN108898082B (en) Picture processing method, picture processing device and terminal equipment
CN111061898A (en) Image processing method, device, computer equipment and storage medium
CN110866236B (en) Private picture display method, device, terminal and storage medium
WO2019033570A1 (en) Lip movement analysis method, apparatus and storage medium
WO2019033568A1 (en) Lip movement capturing method, apparatus and storage medium
CN108197250A (en) Picture retrieval method, electronic equipment and storage medium
CN110431563B (en) Method and apparatus for image correction
CN108898587A (en) Picture processing method, picture processing device and terminal equipment
CN110517033A (en) A fast scanning payment method and device
CN108021905A (en) Image processing method, device, terminal equipment and storage medium
CN111444555A (en) A temperature measurement information display method, device and terminal equipment
CN112069342A (en) Image classification method, device, electronic device and storage medium
CN109711287B (en) Face acquisition method and related product
CN110263741A (en) Video frame extraction method, apparatus and terminal device
CN114255321A (en) Method and device for collecting pet nose print, storage medium and electronic equipment
CN111626074A (en) Face classification method and device
CN108932704B (en) Picture processing method, picture processing device and terminal equipment

Legal Events

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