WO2020134819A1 - 一种搜索人脸的方法及相关装置 - Google Patents

一种搜索人脸的方法及相关装置 Download PDF

Info

Publication number
WO2020134819A1
WO2020134819A1 PCT/CN2019/121362 CN2019121362W WO2020134819A1 WO 2020134819 A1 WO2020134819 A1 WO 2020134819A1 CN 2019121362 W CN2019121362 W CN 2019121362W WO 2020134819 A1 WO2020134819 A1 WO 2020134819A1
Authority
WO
WIPO (PCT)
Prior art keywords
face sample
residual
similarities
subset
personal
Prior art date
Application number
PCT/CN2019/121362
Other languages
English (en)
French (fr)
Inventor
魏新明
胡文泽
王孝宇
Original Assignee
深圳云天励飞技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳云天励飞技术有限公司 filed Critical 深圳云天励飞技术有限公司
Publication of WO2020134819A1 publication Critical patent/WO2020134819A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content

Definitions

  • the present application relates to the field of intelligent technology, and in particular to a method and related device for searching faces.
  • Embodiments of the present application provide a method and a related device for searching faces, which can increase the search speed for searching a target face in a massive data set and improve the accuracy of target face search.
  • a first aspect of an embodiment of this application provides a method for searching a face, including:
  • a second aspect of an embodiment of the present application provides an apparatus for searching faces, including:
  • An obtaining unit used to obtain preset ⁇ center vectors, where ⁇ >0; obtaining test features of the test face;
  • a calculation unit configured to calculate the ⁇ first similarity between the test feature and the ⁇ center vectors; sort the ⁇ first similarities according to a rule from large to small to obtain a sequence to determine the The first ⁇ first similarities in the sequence are ⁇ first target similarities; it is determined that the ⁇ first target similarities correspond to the ⁇ personal face sample subset, and the ⁇ individuals included in the ⁇ personal face sample subset are obtained Face sample features, calculating the test features and the ⁇ personal face sample features to obtain ⁇ second similarities;
  • the determining unit is configured to extract a maximum value among the ⁇ second similarities, and determine a face sample corresponding to the maximum value as a target face sample.
  • a third aspect of the present application provides a face collection device, including: a processor and a memory; and one or more programs, the one or more programs are stored in the memory, and configured to be configured by the The processor executes, and the program includes instructions for some or all of the steps as described in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, wherein the computer program causes the computer to execute the first aspect of the embodiment of the present application Instructions for some or all of the steps described in
  • an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause the computer to execute Apply for some or all of the steps described in the first aspect of the embodiments.
  • the computer program product may be a software installation package.
  • preset ⁇ center vectors are obtained, where ⁇ >0; the test features of the test face are acquired, and the test features are The ⁇ center vectors are calculated to obtain ⁇ first similarities; the ⁇ first similarities are sorted according to a rule from large to small to obtain a sequence, and the first ⁇ first similarities in the sequence are determined as ⁇ first target similarities; determine that the ⁇ first target similarities correspond to the ⁇ personal face sample subset, obtain the ⁇ personal face sample features contained in the ⁇ personal face sample subset, and compare the test features with all Calculate the characteristics of the ⁇ personal face sample to obtain ⁇ second similarities; extract the maximum value among the ⁇ second similarities, and determine the face sample corresponding to the maximum value as the target face sample.
  • the features of the concentrated face samples calculate the second similarity between the features of the face samples in the subset of face samples with high similarity and the test sample, and select the face sample corresponding to the maximum value in the second similarity as the target face sample , To achieve second-order rearrangement calculation, improve the accuracy of face search.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for searching a face provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of an embodiment of a processing method for a face sample set provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of an embodiment of a method for calculating a second similarity provided by an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of an apparatus for searching a human face provided by an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for searching a face provided by an embodiment of the present application.
  • the method for searching a face described in this embodiment includes the following steps:
  • Step 101 Acquire preset ⁇ center vectors, where ⁇ >0.
  • a face sample set is obtained from the database, where the face sample set may include: a preset face sample set, a face collected through an electronic device
  • the face sample set formed by the sample data is not limited here.
  • the face sample set is sent to the convolutional neural network model.
  • the convolutional neural network is used to extract the features of the face sample set, and the face sample set is used as the convolution
  • the input of the neural network model obtains the face sample feature set corresponding to the face sample set, and performs product quantization on the face sample features in the face sample feature set to obtain the product quantized face sample features, and updates the face sample features to
  • the face sample features after product quantization are used to compress the features.
  • the preset number ⁇ of face sample subsets is obtained, and the number ⁇ of face sample subsets is used to determine the number of divided face sample sets, and the first face sample included in the face sample feature set
  • the feature starts, and the division cycle is performed on the face sample features until the end of the division cycle is performed on the last face sample feature in the face sample feature set, and the ⁇ personal face sample subset is obtained, and the ⁇ cluster centers after the end of the division cycle are obtained X i , determine ⁇ clustering centers X i as ⁇ center vectors corresponding to the ⁇ personal face sample subset, and store the ⁇ personal face sample subsets corresponding to the ⁇ center vector and the ⁇ center vector to the database.
  • ⁇ cluster centers X i are ⁇ center vectors corresponding to the ⁇ personal face sample subset
  • Corresponding ⁇ residual vector set according to ⁇ personal face sample subset and ⁇ residual vector set, establish a one-to-one mapping relationship between the face sample subset and the residual vector, and store the one-to-one mapping relationship to the database in.
  • ⁇ center vectors are obtained from the database, and ⁇ personal face sample subsets corresponding to the ⁇ center vectors are obtained from the database.
  • Step 102 Obtain test features of a test sample, and calculate the test features and the ⁇ center vectors to obtain ⁇ first similarities.
  • the convolutional neural network is used to extract the characteristics of the test sample, and the test sample is used as the input of the convolutional neural network model to obtain the test corresponding to the test sample.
  • the first similarity in an embodiment provided by the present application, if the test sample is an N-dimensional vector, the center vector is also an N-dimensional vector, the test feature q(x) is the center point of the test sample, and q(z) is The center point of the center vector, u N (x) is the center point of the N-dimensional vector of the test sample, and u N (z) is the center point of the N-dimensional vector of the residual vector, then the calculation of the first similarity s may include:
  • the calculation of the first similarity may be other calculation methods.
  • Step 103 Sort the ⁇ first similarities according to a rule from large to small to obtain a sequence, and determine that the first ⁇ first similarities in the sequence are ⁇ first target similarities.
  • the first similarity is ⁇ first target similarity.
  • Step 104 Determine that the ⁇ first target similarities correspond to the ⁇ personal face sample subset, obtain the ⁇ personal face sample features included in the ⁇ personal face sample subset, and compare the test feature with the ⁇ personal face sample The feature is calculated to obtain ⁇ second similarities.
  • obtain ⁇ center vectors corresponding to the ⁇ personal face sample subset obtain a mapping relationship between the face sample subset and the residual vector, query the ⁇ personal face sample subset in the mapping relationship, and obtain the ⁇
  • the ⁇ residual vector set corresponding to the personal face sample subset obtain the ⁇ personal face sample features contained in the ⁇ personal face sample subset, and divide the ⁇ personal face sample features into the ⁇ residual vectors included in the ⁇ residual vectors and
  • the sum of the center vectors corresponding to the ⁇ residual vectors is expressed to obtain the test features of the test sample, calculate the ⁇ residual similarity corresponding to the ⁇ residual vectors, and calculate the ⁇ residual similarity and the ⁇ residuals
  • the sum of the first similarity corresponding to the center vector corresponding to the difference similarity is to obtain ⁇ calculation results, and the ⁇ calculation results are determined to be the ⁇ second similarity corresponding to the feature of the ⁇ face sample.
  • Step 105 Extract the maximum value of the ⁇ second similarities, and determine that the face sample corresponding to the maximum value is the target face sample.
  • extract the maximum value of ⁇ second similarities determine the face sample feature corresponding to the maximum value as the target face sample feature, and determine the face sample corresponding to the target face sample feature as the target face sample .
  • the test features of the test sample are obtained, and the test features and the ⁇ center vectors are calculated to obtain ⁇
  • the first similarity sort the ⁇ first similarities according to a rule from large to small to obtain a sequence, determine that the first ⁇ first similarities in the sequence are ⁇ first target similarities, and determine the ⁇ first target similarities correspond to the ⁇ personal face sample subset, obtain the ⁇ personal face sample features contained in the ⁇ personal face sample subset, and calculate the test feature and the ⁇ personal face sample feature to obtain ⁇
  • the second similarity extract the maximum value of the ⁇ second similarities, and determine that the face sample corresponding to the maximum value is the target face sample.
  • the central vector of each region in the sample set can be obtained by calculating
  • the similarity between the test sample and the center vector implements a first-order approximate search, avoiding the traversal of the entire sample set, and then obtaining the facial sample features of the face sample subset corresponding to the center vector with high similarity and the similarity calculation of the test sample It implements second-order rearrangement, improves the accuracy of face search, quantizes and compresses vectors by multiplying high-dimensional face sample features and test features, reduces storage space, and improves computation speed.
  • FIG. 2 is a schematic flowchart of an embodiment of a method for processing a face sample set provided by an embodiment of the present application. As shown in FIG. 2, the method includes:
  • Step 201 Acquire a face sample feature set corresponding to the face sample set and the face sample set.
  • a face sample set is obtained from a database, where the face sample set may include: a preset face sample set, a face sample set composed of face sample data collected through an electronic device, here Without limitation, the face sample set is sent to the convolutional neural network model.
  • the convolutional neural network is used to extract the features of the face sample set, and the face sample set is used as the input of the convolutional neural network model to obtain the face sample set
  • Corresponding face sample feature set perform product quantization on the face sample features in the face sample feature set to obtain the product quantized face sample features, update the face sample features to the product quantized face sample features, product quantify Used to compress features.
  • Step 202 Obtain the number ⁇ of face sample subsets, where ⁇ >0, perform a division cycle on the face sample features in the face sample feature set until the end of the traversal of the face sample feature set, to obtain the ⁇ face sample subset.
  • the preset number ⁇ of face sample subsets is obtained, and the number ⁇ of face sample subsets is used to determine the number of divided face sample sets, and the first face included in the face sample feature set
  • the sample feature starts, and the division cycle is performed on the face sample feature until the end of the division cycle is performed on the last face sample feature in the face sample feature set, and the ⁇ personal face sample subset is obtained.
  • the dividing cycle includes: determining ⁇ feature vectors in the face sample feature set according to preset conditions, the ⁇ feature vectors are ⁇ clustering centers X i , where i ⁇ ⁇ 1,2,. .., ⁇ ; Get the face sample Y in the feature set of the sample. If the face sample Y is an N-dimensional vector, ⁇ cluster centers X i are also N-dimensional vectors.
  • the calculation method may include: the average value of the face sample features included in the face sample subset, and dividing the next face sample according to the updated ⁇ cluster centers X i .
  • Step 203 Calculate ⁇ center vectors corresponding to the ⁇ personal face sample subset.
  • ⁇ clustering centers X i after the dividing cycle is obtained, and it is determined that the ⁇ clustering centers X i are ⁇ center vectors corresponding to the subset of ⁇ personal face samples.
  • Step 204 Perform a residual calculation operation on the ⁇ personal face sample subset until the traversal of the ⁇ personal face sample subset is completed, to obtain ⁇ residual vector sets corresponding to the ⁇ personal face sample subset.
  • a residual calculation operation is performed on the alpha personal face sample subset until the traversal of the alpha personal face sample subset ends, that is, from the first personal face sample in the alpha personal face sample subset The feature starts until the feature of the last face sample in the ⁇ -th face sample subset ends, and ⁇ residual vector sets corresponding to the ⁇ -face sample subset are obtained.
  • Step 205 Establish a mapping relationship between the face sample subset and the residual vector according to the ⁇ face sample subset and the ⁇ residual vector set, and map the face sample subset to the residual vector Store to database.
  • a one-to-one mapping relationship between the face sample subset and the residual vector is established based on the ⁇ face sample subset and ⁇ residual vector sets, and the one-to-one mapping relationship is stored in the database.
  • the face sample feature in the face sample feature set Perform the division loop until the end of the traversal of the face sample feature set, obtain the ⁇ personal face sample subset, calculate ⁇ center vectors corresponding to the ⁇ personal face sample subset, and perform a residual calculation action on the ⁇ personal face sample subset Until the traversal of the ⁇ personal face sample subset is completed, ⁇ residual vector sets corresponding to the ⁇ personal face sample subset are obtained, and a person is established according to the ⁇ personal face sample subset and the ⁇ residual vector set
  • the mapping relationship between the face sample subset and the residual vector, and the mapping relationship between the face sample subset and the residual vector is stored in the database, so that the face sample set can be divided into multiple face sample subsets, Calculate the center vector of the face sample subset to approximate the face sample subset.
  • FIG. 3 is a schematic flowchart of an embodiment of a method for calculating a second similarity provided by an embodiment of the present application. As shown in FIG. 3, the method includes the following steps:
  • Step 301 Acquire ⁇ center vectors corresponding to the ⁇ personal face sample subset.
  • Step 302 Determine ⁇ residual vector sets corresponding to the ⁇ personal face sample subset according to the mapping relationship between the face sample subset and the residual vector.
  • the mapping relationship between the face sample subset and the residual vector is obtained, and the ⁇ personal face sample subset is queried in the mapping relationship to obtain the ⁇ residual vector set corresponding to the ⁇ personal face sample subset, wherein, The value obtained by adding the ⁇ residual vector sets to the ⁇ center vectors is equal to the value of the ⁇ personal face sample subset.
  • Step 303 Determine that the ⁇ -person face sample feature included in the ⁇ -person face sample subset is the sum of the ⁇ residual vectors included in the ⁇ residual vectors and the center vector corresponding to the ⁇ residual vectors.
  • the ⁇ -person face sample features included in the ⁇ -person face sample subset and combine the ⁇ -person face sample features with the ⁇ residual vectors contained in the ⁇ residual vectors and the center vector corresponding to the ⁇ residual vectors
  • Step 304 Perform calculation on the test sample and the ⁇ residual vectors to obtain ⁇ residual similarity.
  • the test features of the test sample are obtained, and the similarity between the test features and the ⁇ residual vectors is calculated.
  • the test sample is an N-dimensional vector
  • the residual The vector is also an N-dimensional vector
  • the test feature q(x) is the center point of the test sample
  • q(y) is the center point of the residual vector
  • u N (x) is the center point of the N-dimensional vector of the test sample
  • u N (y) is the center point of the Nth dimensional vector of the residual vector
  • the calculation of the residual similarity d′ may include:
  • the calculation of the similarity between the test feature and the residual vector may be other calculation methods.
  • Step 305 Calculate the sum of the ⁇ residual similarities and the first similarity corresponding to the central vector corresponding to the ⁇ residual similarities to obtain the ⁇ second similarities.
  • the ⁇ residual vectors corresponding to the ⁇ face sample subset are determined according to the mapping relationship between the face sample subset and the residual vector Set, determine that the ⁇ -person face sample feature included in the ⁇ -person face sample subset is the sum of the ⁇ residual vectors contained in the ⁇ residual vectors and the central vector corresponding to the ⁇ residual vectors, for The test sample and the ⁇ residual vectors are calculated to obtain ⁇ residual similarity, and the first similarity corresponding to the center vector corresponding to the ⁇ residual similarity and the ⁇ residual similarity is calculated The sum of the ⁇ second similarities is obtained.
  • the residual vector and the center vector are used to represent the features of the face sample, and the residual similarity is added to the first similarity to obtain the second similarity, which avoids the face sample
  • the direct calculation of feature original data and test sample features reduces the calculation amount of the second similarity, and the residual similarity solves the problem of approximate loss in approximate search.
  • FIG. 4 is a schematic structural diagram of an apparatus 400 for searching a face provided by an embodiment of the present application.
  • the device for searching a face described in this embodiment includes: an obtaining unit 401, a calculating unit 402, and a pushing unit 403.
  • the obtaining unit 401 is used to obtain preset ⁇ center vectors, where ⁇ >0; obtain the test features of the test face;
  • the calculation unit 402 is configured to calculate the ⁇ first similarity degree between the test feature and the ⁇ center vectors; sort the ⁇ first similarity degrees according to a rule from large to small to obtain a sequence, and determine The first ⁇ first similarities in the sequence are ⁇ first target similarities; it is determined that the ⁇ first target similarities correspond to the ⁇ personal face sample subset, and the ⁇ contained in the ⁇ personal face sample subset is obtained Personal face sample features, calculating the test features and the ⁇ personal face sample features to obtain ⁇ second similarities;
  • the determining unit 403 is configured to extract the maximum value among the ⁇ second similarities, and determine the face sample corresponding to the maximum value as the target face sample.
  • the obtaining unit 401 is specifically used to obtain the preset ⁇ centers from the database Vector, obtain a subset of ⁇ personal face samples corresponding to ⁇ center vectors from the database, obtain test samples, send the test samples to the convolutional neural network model, the convolutional neural network is used to extract the characteristics of the test samples, and the test samples As the input of the convolutional neural network model, the test features corresponding to the test samples are obtained.
  • the calculation unit 402 is specifically configured to: obtain a preset value ⁇ , where 0 ⁇ ⁇ , sort ⁇ first similarity according to the rule from large to small, get the first similarity sequence arranged from large to small, and determine the first ⁇ first similarity as ⁇ first target similarity; obtain ⁇ center vectors corresponding to the ⁇ personal face sample subset, obtaining a mapping relationship between the face sample subset and the residual vector, querying the ⁇ personal face sample subset in the mapping relationship, and obtaining the ⁇
  • determining that the face sample corresponding to the maximum value is the target face sample and the determining unit 403 is specifically used to extract ⁇
  • the maximum value in the second similarity degree determines the face sample feature corresponding to the maximum value as the target face sample feature, and determines the face sample corresponding to the target face sample feature as the target face sample.
  • a target similarity determine that the ⁇ first target similarities correspond to the ⁇ personal face sample subset, obtain the ⁇ personal face sample features contained in the ⁇ personal face sample subset, and compare the test feature with the ⁇ personal Calculate the features of the face samples to obtain ⁇ second similarities, extract the maximum value of the ⁇ second similarities, and determine that the face sample corresponding to the maximum value is the target face sample.
  • the similarity calculation between the feature and the test sample realizes second-order rearrangement and improves the accuracy of face search.
  • An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a program, and when the program is executed, it includes some or all steps of any method for searching a human face described in the foregoing method embodiments.
  • the embodiments of the present application may be provided as a method, an apparatus (device), or a computer program product. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
  • the computer program is stored/distributed in a suitable medium, provided together with other hardware or as a part of the hardware, and may also adopt other distribution forms, such as via the Internet or other wired or wireless telecommunication systems.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种搜索人脸的方法及相关装置,其中,所述方法包括:获取预设的α个中心向量,其中,α>0(101);获取测试样本的测试特征,对所述测试特征与所述α个中心向量进行计算得到α个第一相似度(102);依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度(103);确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度(104);提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本(105)。所述方法具有搜索速度快且准确度高的优点。

Description

一种搜索人脸的方法及相关装置
本申请要求于2018年12月29日提交中国专利局,申请号为201811641859.5、发明名称为“一种搜索人脸的方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本本申请涉及智能技术领域,具体涉及一种搜索人脸的方法及相关装置。
背景技术
随着科技的发展,人脸技术逐渐成熟,人脸搜索技术的应用逐渐广泛,在许多情况下,需要在海量的照片中搜索出目标照片。现有的在海量照片中搜索出目标照片的方法,不仅速度较慢且准确度也比较低。
发明内容
本申请实施例提供了一种搜索人脸的方法及相关装置,可以提高在海量数据集中搜索目标人脸的搜索速度,并且提高目标人脸搜索的准确度。
本申请实施例第一方面提供了一种搜索人脸的方法,包括:
获取预设的α个中心向量,其中,α>0;
获取测试样本的测试特征,对所述测试特征与所述α个中心向量进行计算得到α个第一相似度;
依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;
确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度;
提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本 为目标人脸样本。
本申请实施例第二方面提供了一种搜索人脸的装置,包括:
获取单元,用于获取预设的α个中心向量,其中,α>0;获取测试人脸的测试特征;
计算单元,用于对所述测试特征与所述α个中心向量进行计算得到α个第一相似度;依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度;
确定单元,用于提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本。
本申请第三方面提供了一种人脸采集装置,包括:处理器和存储器;以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置成由所述处理器执行,所述程序包括用于如第一方面中所描述的部分或全部步骤的指令。
第四方面,本申请实施例提供了一种计算机可读存储介质,其中,所述计算机可读存储介质用于存储计算机程序,其中,所述计算机程序使得计算机执行如本申请实施例第一方面中所描述的部分或全部步骤的指令。
第五方面,本申请实施例提供了一种计算机程序产品,其中,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如本申请实施例第一方面中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
实施本申请实施例,具有如下有益效果:
可以看出,通过本申请实施例所描述的搜索人脸的方法及相关装置,获取预设的α个中心向量,其中,α>0;获取测试人脸的测试特征,对所述 测试特征与所述α个中心向量进行计算得到α个第一相似度;依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度;提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本。如此,可首先与中心向量进行相似度计算,选择相似度较高的人脸样本子集,避免遍历搜索整个样本库,提高一阶近似搜索的搜索速度;通过获取相似度高的人脸样本子集中的人脸样本特征,计算相似度高的人脸样本子集中的人脸样本特征与测试样本的第二相似度,选取第二相似度中的最大值对应的人脸样本为目标人脸样本,实现二阶重排计算,提高了人脸搜索的准确度。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种搜索人脸方法的实施例流程示意图;
图2是本申请实施例提供的一种针对人脸样本集的处理方法的实施例流程示意图;
图3是本申请实施例提供的一种计算第二相似度的方法的实施例流程示意图;
图4是本申请实施例提供的一种搜索人脸的装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置展示该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
为了更好的理解本申请实施例提供的一种搜索人脸的方法及相关装置,下面先对本申请实施例适用的人脸采集方法的系统构架进行描述。参阅图1,图1是本申请实施例提供的一种搜索人脸方法的实施例流程示意图,本实施例中所描述的搜索人脸的方法,包括以下步骤:
步骤101、获取预设的α个中心向量,其中,α>0。
可选的,在获取预设的α个中心向量之前,从数据库中获取人脸样本集,其中,人脸样本集可以包括:预先设定的人脸样本集、通过电子设备采集到的人脸样本数据构成的人脸样本集,在此不作限定,将人脸样本集发送至卷积神经网络模型,该卷积神经网络用于提取人脸样本集的特征,将人脸样本集作为卷积神经网络模型的输入,得到人脸样本集对应的人脸样本特征集,对人脸样本特征集中的人脸样本特征进行乘积量化得到乘积量化后的人脸样本特征,将 人脸样本特征更新为乘积量化后的人脸样本特征,乘积量化用于对特征进行压缩。
进一步地,获取预先设置好的人脸样本子集数α,该人脸样本子集数α用于确定人脸样本集被划分的数量,从人脸样本特征集中包含的第一个人脸样本特征开始,对人脸样本特征执行划分循环,直至对人脸样本特征集中的最后一个人脸样本特征执行划分循环结束,得到α个人脸样本子集,获取划分循环结束后的α个聚类中心X i,确定α个聚类中心X i为α个人脸样本子集对应的α个中心向量,将α个中心向量与α个中心向量对应的α个人脸样本子集存储至数据库。
可选的,确定α个聚类中心X i为α个人脸样本子集对应的α个中心向量之后,对α个人脸样本子集执行残差计算动作直至α个人脸样本子集遍历结束,即从α个人脸样本子集中的第一个人脸样本子集中的第一个人脸样本特征开始,直至第α个人脸样本子集中的最后一个人脸样本特征结束,得到α个人脸样本子集对应的α个残差向量集;依据α个人脸样本子集与α个残差向量集,建立人脸样本子集与残差向量的一一映射关系,并将该一一映射关系存储至数据库中。
可选的,从数据库中获取α个中心向量,从数据库中获取α个中心向量对应的α个人脸样本子集。
步骤102、获取测试样本的测试特征,对所述测试特征与所述α个中心向量进行计算得到α个第一相似度。
可选的,获取测试样本,将测试样本发送至卷积神经网络模型,该卷积神经网络用于提取测试样本的特征,将测试样本作为卷积神经网络模型的输入,得到测试样本对应的测试特征,对测试特征进行乘积量化运算得到乘积量化后的测试特征,将测试特征更新为乘积量化后的测试特征,乘积量化运算用于对特征进行压缩,依据测试特征与α个中心向量计算α个第一相似度,在本申请提供的一种实施例中,若测试样本为N维向量,中心向量也为N维向量,测试 特征q(x)为测试样本的中心点,q(z)为中心向量的中心点,u N(x)为测试样本第N维向量的中心点,u N(z)为残差向量第N维向量的中心点,则第一相似度s的计算可以包括:
Figure PCTCN2019121362-appb-000001
在其他实施例中,第一相似度的计算可以为其他计算方法。
步骤103、依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度。
可选的,获取预设数值β,其中0<β<α,依据从大到小的规则对α个第一相似度进行排序,得到从大到小排列的第一相似度序列,确定前β个第一相似度为β个第一目标相似度。
步骤104、确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度。
可选的,获取所述β个人脸样本子集对应的β个中心向量,获取人脸样本子集与残差向量的映射关系,在该映射关系中查询β个人脸样本子集,获取该β个人脸样本子集对应的β个残差向量集,获取β个人脸样本子集中包含的γ个人脸样本特征,将γ个人脸样本特征以β个残差向量中包含的γ个残差向量与γ个残差向量对应的中心向量之和进行表示,获取测试样本的测试特征,计算测试特征与γ个残差向量对应的γ个残差相似度,计算γ个残差相似度与γ个残差相似度对应的中心向量对应的第一相似度的和,得到γ个计算结果,确定γ个计算结果为γ个人脸样本特征对应的γ个第二相似度。
步骤105、提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本。
可选的,提取γ个第二相似度中的最大值,确定该最大值对应的人脸样本特征为目标人脸样本特征,确定该目标人脸样本特征对应的人脸样本为目标人脸样本。
可以看出,通过本申请实施例,通过获取预设的α个中心向量,其中,α>0,获取测试样本的测试特征,对所述测试特征与所述α个中心向量进行计算得到α个第一相似度,依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度,确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度,提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本,如此,可通过获取样本集中每个区域的中心向量,计算测试样本与中心向量的相似度实现一阶近似搜索,避免了对整个样本集的遍历,然后获取相似度高的中心向量对应的人脸样本子集中的人脸样本特征与测试样本进行相似度计算实现二阶重排,提高人脸搜索的准确性,对高维度的人脸样本特征与测试特征进行乘积量化压缩向量,减小存储空间,并且提高计算速率。
请参阅图2,图2是本申请实施例提供的一种针对人脸样本集的处理方法的实施例流程示意图,如图2所示,该方法包括:
步骤201、获取人脸样本集与所述人脸样本集对应的人脸样本特征集。
可选的,从数据库中获取人脸样本集,其中,人脸样本集可以包括:预先设定的人脸样本集、通过电子设备采集到的人脸样本数据构成的人脸样本集,在此不作限定,将人脸样本集发送至卷积神经网络模型,该卷积神经网络用于提取人脸样本集的特征,将人脸样本集作为卷积神经网络模型的输入,得到人脸样本集对应的人脸样本特征集,对人脸样本特征集中的人脸样本特征进行乘积量化得到乘积量化后的人脸样本特征,将人脸样本特征更新为乘积量化后的人脸样本特征,乘积量化用于对特征进行压缩。
步骤202、获取人脸样本子集数α,其中α>0,对人脸样本特征集中的人脸样本特征执行划分循环至人脸样本特征集遍历结束,得到α个人脸样本子集。
可选的,获取预先设置好的人脸样本子集数α,该人脸样本子集数α用于确定人脸样本集被划分的数量,从人脸样本特征集中包含的第一个人脸样本特 征开始,对人脸样本特征执行划分循环,直至对人脸样本特征集中的最后一个人脸样本特征执行划分循环结束,得到α个人脸样本子集。
其中,该划分循环包括:按照预设的条件在所述人脸样本特征集中确定α个特征向量,该α个特征向量为α个聚类中心X i,其中,i∈{1,2,...,α};获取该样本特征集中的人脸样本Y,若人脸样本Y为N维向量,α个聚类中心X i也为N维向量,通过计算人脸样本Y与α个聚类中心X i对应的α个距离D i;获取α个距离D i中的最小值D min,确定该人脸样本特征Y属于最小值D min对应的人脸样本子集,则将人脸样本特征Y添加至最小值D min对应的人脸样本子集中,计算该人脸样本子集的中心向量,将该人脸样本子集对应的聚类中心更新为该中心向量,其中,中心向量的计算方式可以包括:人脸样本子集中包含的人脸样本特征的均值,依据更新后的α个聚类中心X i对下一个人脸样本进行划分。
步骤203、计算所述α个人脸样本子集对应的α个中心向量。
可选的,获取划分循环结束后的α个聚类中心X i,确定α个聚类中心X i为α个人脸样本子集对应的α个中心向量。
步骤204、对所述α个人脸样本子集执行残差计算动作直至所述α个人脸样本子集遍历结束,得到所述α个人脸样本子集对应的α个残差向量集。
可选的,对α个人脸样本子集执行残差计算动作直至α个人脸样本子集遍历结束,即从α个人脸样本子集中的第一个人脸样本子集中的第一个人脸样本特征开始,直至第α个人脸样本子集中的最后一个人脸样本特征结束,得到α个人脸样本子集对应的α个残差向量集。
其中,该残差计算动作包括:获取人脸样本子集包含的人脸样本特征X与人脸样本子集对应的中心向量q i;将人脸样本特征X与中心向量q代入公式x r=x-q i进行计算结果x r;确定人脸样本特征X对应的残差向量X r为计算结果x r;例如,对第一个人脸样本子集执行残差计算,首先获取第一个人脸样本子集对应的中心向量为q 1;由第一个人脸样本子集 中的第一个人脸样本特征开始,获取第一个人脸样本特征为x 1,计算x r1=x r-q r得到计算结果x r1,即第一个人脸样本特征的残差向量为x r1,将x r1存储在第一个残差向量集的第一个位置,接着以同样的方法计算第二个人脸样本特征对应的残差向量,直至将第一个人脸样本子集中的最后一个人脸样本对应的残差向量计算完毕,得到第一个人脸样本子集对应的第一个残差向量集;接着计算第二个人脸样本子集对应的第二个残差向量集,直至第α个人脸样本子集对应的第α个残差向量集计算完毕,残差计算动作执行结束。
步骤205、依据所述α个人脸样本子集与所述α个残差向量集建立人脸样本子集与残差向量的映射关系,将所述人脸样本子集与残差向量的映射关系存储至数据库。
可选的,依据α个人脸样本子集与α个残差向量集,建立人脸样本子集与残差向量的一一映射关系,并将该一一映射关系存储至数据库中。
可以看出,通过获取人脸样本集与所述人脸样本集对应的人脸样本特征集,获取人脸样本子集数α,其中α>0,对人脸样本特征集中的人脸样本特征执行划分循环至人脸样本特征集遍历结束,得到α个人脸样本子集,计算所述α个人脸样本子集对应的α个中心向量,对所述α个人脸样本子集执行残差计算动作直至所述α个人脸样本子集遍历结束,得到所述α个人脸样本子集对应的α个残差向量集,依据所述α个人脸样本子集与所述α个残差向量集建立人脸样本子集与残差向量的映射关系,将所述人脸样本子集与残差向量的映射关系存储至数据库,如此,可通过对人脸样本集进行划分为多个人脸样本子集,计算人脸样本子集的中心向量近似替代人脸样本子集,通过将测试特征与中心向量进行计算得到相似度,避免了令测试特征与整个人脸样本集进行计算,加快了一阶搜索速度,计算每个人脸样本特征的残差向量,通过残差向量与中心向量之和表示人脸样本特征,为二阶重排的快速搜索与无损搜索提供条件。
请参阅图3,图3是本申请实施例提供的一种计算第二相似度的方法的实 施例流程示意图,如图3所示,所述方法包括以下步骤:
步骤301、获取所述β个人脸样本子集对应的β个中心向量。
步骤302、依据人脸样本子集与残差向量的映射关系确定所述β个人脸样本子集对应的β个残差向量集。
可选的,获取人脸样本子集与残差向量的映射关系,在该映射关系中查询β个人脸样本子集,获取该β个人脸样本子集对应的β个残差向量集,其中,β个残差向量集与β个中心向量相加得到的值等于β个人脸样本子集的值。
步骤303、确定所述β个人脸样本子集中包含的γ个人脸样本特征为所述β个残差向量中包含的γ个残差向量与所述γ个残差向量对应的中心向量之和。
可选的,获取β个人脸样本子集中包含的γ个人脸样本特征,将γ个人脸样本特征以β个残差向量中包含的γ个残差向量与γ个残差向量对应的中心向量之和进行表示,即假设一个人脸样本特征为x 1,该人脸样本特征的残差向量为x r1,该人脸样本特征属于第一人脸样本子集,则该残差向量属于第一残差向量集,则该残差向量对应的中心向量为第一中心向量q 1,则该人脸样本特征可以表示为x 1=x r1+q 1
步骤304、对所述测试样本与所述γ个残差向量进行计算得到γ个残差相似度。
可选的,获取测试样本的测试特征,计算测试特征与γ个残差向量对应的γ个残差相似度,在本申请提供的一种实施例中,若测试样本为N维向量,残差向量也为N维向量,测试特征q(x)为测试样本的中心点,q(y)为残差向量的中心点,u N(x)为测试样本第N维向量的中心点,u N(y)为残差向量第N维向量的中心点,则残差相似度d′的计算可以包括:
Figure PCTCN2019121362-appb-000002
在其他实施例中,测试特征与残差向量的相似度计算可以为其他计算方法。
步骤305、计算所述γ个残差相似度与所述γ个残差相似度对应的中心向量对应的第一相似度之和得到所述γ个第二相似度。
可选的,计算γ个残差相似度与γ个残差相似度对应的中心向量对应的第一相似度的和,得到γ个计算结果,确定γ个计算结果为γ个人脸样本特征对应的γ个第二相似度;例如,一个残差相似度为d′,该残差相似度对应的中心向量为第一中心向量q 1,第一中心向量q 1对应的第一相似度为s 1,则该人脸样本特征对应的第二相似度o 1=s 1+d′。
由此可见,通过获取所述β个人脸样本子集对应的β个中心向量,依据人脸样本子集与残差向量的映射关系确定所述β个人脸样本子集对应的β个残差向量集,确定所述β个人脸样本子集中包含的γ个人脸样本特征为所述β个残差向量中包含的γ个残差向量与所述γ个残差向量对应的中心向量之和,对所述测试样本与所述γ个残差向量进行计算得到γ个残差相似度,计算所述γ个残差相似度与所述γ个残差相似度对应的中心向量对应的第一相似度之和得到所述γ个第二相似度,如此,通过残差向量与中心向量表示人脸样本特征,用残差相似度与第一相似度相加得到第二相似度,避免了人脸样本特征原始数据与测试样本特征的直接计算,减少了第二相似度的计算量,残差相似度解决了近似搜索中的近似损失问题。
请参阅图4,图4是本申请实施例提供的一种搜索人脸的装置400的结构示意图。本实施例中所描述的搜索人脸的装置,包括:获取单元401、计算单元402、推送单元403。
获取单元401,用于获取预设的α个中心向量,其中,α>0;获取测试人脸的测试特征;
计算单元402,用于对所述测试特征与所述α个中心向量进行计算得到α个第一相似度;依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β 个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度;
确定单元403,用于提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本。
在一可能的示例中,用于获取预设的α个中心向量,其中,α>0;获取测试人脸的测试特征,获取单元401,具体用于:从数据库中获取预设的α个中心向量,从数据库中获取α个中心向量对应的α个人脸样本子集,获取测试样本,将测试样本发送至卷积神经网络模型,该卷积神经网络用于提取测试样本的特征,将测试样本作为卷积神经网络模型的输入,得到测试样本对应的测试特征。
在一可能的示例中,用于对所述测试特征与所述α个中心向量进行计算得到α个第一相似度;依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度,计算单元402,具体用于:获取预设数值β,其中0<β<α,依据从大到小的规则对α个第一相似度进行排序,得到从大到小排列的第一相似度序列,确定前β个第一相似度为β个第一目标相似度;获取所述β个人脸样本子集对应的β个中心向量,获取人脸样本子集与残差向量的映射关系,在该映射关系中查询β个人脸样本子集,获取该β个人脸样本子集对应的β个残差向量集,获取β个人脸样本子集中包含的γ个人脸样本特征,将γ个人脸样本特征以β个残差向量中包含的γ个残差向量与γ个残差向量对应的中心向量之和进行表示,获取测试样本的测试特征,计算测试特征与γ个残差向量对应的γ个残差相似度,计算γ个残差相似度与γ个残差相似度对应的中心向量对应的第一相似度的和,得到γ个计算结果,确定γ个计算结果为γ个人脸样本特征对应的γ个第二相似度。
在一可能的示例中,用于提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本,确定单元403,具体用于:提取γ个第二相似度中的最大值,确定该最大值对应的人脸样本特征为目标人脸样本特征,确定该目标人脸样本特征对应的人脸样本为目标人脸样本。
可以看出,通过本申请实施例所描述的搜索人脸的装置,通过获取预设的α个中心向量,其中,α>0,获取测试样本的测试特征,对所述测试特征与所述α个中心向量进行计算得到α个第一相似度,依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度,确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度,提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本,如此,可通过获取样本集中每个区域的中心向量,计算测试样本与中心向量的相似度实现一阶近似搜索,避免了对整个样本集的遍历,然后获取相似度高的中心向量对应的人脸样本子集中的人脸样本特征与测试样本进行相似度计算实现二阶重排,提高人脸搜索的准确性。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的任何一种搜索人脸的方法的部分或全部步骤。
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来 产生良好的效果。
本领域技术人员应明白,本申请的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机程序存储/分布在合适的介质中,与其它硬件一起提供或作为硬件的一部分,也可以采用其他分布形式,如通过Internet或其它有线或无线电信系统。
本申请是参照本申请实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。

Claims (10)

  1. 一种搜索人脸的方法,其特征在于,所述方法包括:
    获取预设的α个中心向量,其中,α>0;
    获取测试样本的测试特征,对所述测试特征与所述α个中心向量进行计算得到α个第一相似度;
    依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;
    确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度;
    提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本。
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度包括:
    获取所述β个人脸样本子集对应的β个中心向量;
    依据人脸样本子集与残差向量的映射关系确定所述β个人脸样本子集对应的β个残差向量集;
    确定所述β个人脸样本子集中包含的γ个人脸样本特征为所述β个残差向量集中包含的γ个残差向量与所述γ个残差向量对应的中心向量之和;
    依据所述γ个残差向量与所述γ个残差向量对应的中心向量计算所述γ个第二相似度。
  3. 根据权利要求2所述的方法,其特征在于,所述依据所述γ个残差向量与所述γ个残差向量对应的中心向量计算所述γ个第二相似度包括:
    对所述测试样本与所述γ个残差向量进行计算得到γ个残差相似 度;
    计算所述γ个残差相似度与所述γ个残差相似度对应的中心向量对应的第一相似度之和得到所述γ个第二相似度。
  4. 根据权利要求1所述的方法,其特征在于,所述获取预设的α个中心向量之前还包括:
    获取人脸样本集与所述人脸样本集对应的人脸样本特征集,对人脸样本特征集进行划分得到人脸样本子集,计算所述人脸样本子集的中心向量;
    获取人脸样本子集数α,其中,α>0;
    对人脸样本特征集中的人脸样本特征执行划分循环至人脸样本特征集遍历结束,得到α个人脸样本子集;
    所述划分循环包括:
    从所述人脸样本特征集中确定α个聚类中心X i,其中,i∈{1,2,...,α};
    计算所述特征集中的人脸样本特征Y与所述α个聚类中心X i对应的α个距离D i
    确定所述α个距离D i中的最小值D min,确定所述人脸样本特征Y属于所述最小值D min对应的人脸样本子集;
    依据所述人脸样本特征Y更新所述α个聚类中心。
  5. 根据权利要求4所述的方法,其特征在于,所述得到α个人脸样本子集之后还包括:
    获取所述α个聚类中心X i
    确定所述α个聚类中心X i为所述α个人脸样本子集的中心向量q i
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    对所述α个人脸样本子集执行残差计算动作直至所述α个人脸样本子集遍历结束,得到所述α个人脸样本子集对应的α个残差向量集;
    依据所述α个人脸样本子集与所述α个残差向量集建立人脸样本子集与残差向量的映射关系,将所述人脸样本子集与残差向量的映射关系存储至数据库;
    所述残差计算包括:
    获取所述人脸样本子集包含的人脸样本特征X与所述人脸样本子集对应的中心向量q i
    将所述人脸样本特征X与所述中心向量q代入公式x r=x-q i进行计算结果x r
    确定所述人脸样本特征X对应的残差向量X r为所述计算结果x r
  7. 一种搜索人脸的装置,其特征在于,所述装置包括:
    获取单元,用于获取预设的α个中心向量,其中,α>0;获取测试人脸的测试特征;
    计算单元,用于对所述测试特征与所述α个中心向量进行计算得到α个第一相似度;依据从大到小规则对所述α个第一相似度进行排序得到序列,确定所述序列中的前β个第一相似度为β个第一目标相似度;确定所述β个第一目标相似度对应β个人脸样本子集,获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度;
    确定单元,用于提取所述γ个第二相似度中的最大值,确定所述最大值对应的人脸样本为目标人脸样本。
  8. 根据权利要求7所述的装置,其特征在于,在所述获取所述β个人脸样本子集包含的γ个人脸样本特征,对所述测试特征与所述γ个人脸样本特征进行计算得到γ个第二相似度方面,所述计算单元具体用于:
    获取所述β个人脸样本子集对应的β个中心向量;
    依据所述人脸样本子集与残差向量的映射关系确定所述β个人脸样本子集对应的β个残差向量集;
    确定所述β个人脸样本子集为所述β个残差向量集与所述β个中心向量的和;
    确定所述β个人脸样本子集中包含的γ个人脸样本特征为所述β个残差向量;
    对所述测试样本与所述γ个残差向量进行计算得到γ个残差相似度;
    计算所述γ个残差相似度与所述γ个残差相似度对应的中心向量对应的第一相似度之和得到所述γ个第二相似度。集中包含的γ个残差向量与所述γ个残差向量对应的中心向量之和;
    依据所述γ个残差向量与所述γ个残差向量对应的中心向量计算所述γ个第二相似度。
  9. 一种搜索人脸的装置,其特征在于,包括处理器、存储器,所述存储器用于存储一个或多个程序,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-6任一项所述的方法中的步骤的指令。
  10. 一种计算机可读存储介质,其特征在于,存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-6任一项所述的方法。
PCT/CN2019/121362 2018-12-29 2019-11-27 一种搜索人脸的方法及相关装置 WO2020134819A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811641859.5A CN109753577B (zh) 2018-12-29 2018-12-29 一种搜索人脸的方法及相关装置
CN201811641859.5 2018-12-29

Publications (1)

Publication Number Publication Date
WO2020134819A1 true WO2020134819A1 (zh) 2020-07-02

Family

ID=66404493

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121362 WO2020134819A1 (zh) 2018-12-29 2019-11-27 一种搜索人脸的方法及相关装置

Country Status (2)

Country Link
CN (1) CN109753577B (zh)
WO (1) WO2020134819A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753577B (zh) * 2018-12-29 2021-07-06 深圳云天励飞技术有限公司 一种搜索人脸的方法及相关装置
CN110414452A (zh) * 2019-07-31 2019-11-05 中国工商银行股份有限公司 一种基于面部特征位置信息的人脸搜索方法及系统
CN110472091B (zh) * 2019-08-22 2022-01-11 深圳市商汤科技有限公司 图像处理方法及装置、电子设备和存储介质
CN110909197A (zh) * 2019-11-04 2020-03-24 深圳力维智联技术有限公司 一种高维特征的处理方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050078869A1 (en) * 2003-07-28 2005-04-14 Samsung Electronics Co., Ltd. Method for feature extraction using local linear transformation functions, and method and apparatus for image recognition employing the same
CN103235825A (zh) * 2013-05-08 2013-08-07 重庆大学 一种基于Hadoop云计算框架的海量人脸识别搜索引擎设计方法
CN104765768A (zh) * 2015-03-09 2015-07-08 深圳云天励飞技术有限公司 海量人脸库的快速准确检索方法
CN109753577A (zh) * 2018-12-29 2019-05-14 深圳云天励飞技术有限公司 一种搜索人脸的方法及相关装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1191459A1 (en) * 2000-09-22 2002-03-27 Nightingale Technologies Ltd. Data clustering methods and applications
US7941442B2 (en) * 2007-04-18 2011-05-10 Microsoft Corporation Object similarity search in high-dimensional vector spaces
CN101859326B (zh) * 2010-06-09 2012-04-18 南京大学 一种图像检索方法
ES2530687B1 (es) * 2013-09-04 2016-08-19 Shot & Shop. S.L. Método implementado por ordenador para recuperación de imágenes por contenido y programa de ordenador del mismo
CN107885778B (zh) * 2017-10-12 2020-08-04 浙江工业大学 一种基于动态临近点谱聚类的个性化推荐方法
CN108319987B (zh) * 2018-02-20 2021-06-29 东北电力大学 一种基于支持向量机的过滤-封装式组合流量特征选择方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050078869A1 (en) * 2003-07-28 2005-04-14 Samsung Electronics Co., Ltd. Method for feature extraction using local linear transformation functions, and method and apparatus for image recognition employing the same
CN103235825A (zh) * 2013-05-08 2013-08-07 重庆大学 一种基于Hadoop云计算框架的海量人脸识别搜索引擎设计方法
CN104765768A (zh) * 2015-03-09 2015-07-08 深圳云天励飞技术有限公司 海量人脸库的快速准确检索方法
CN109753577A (zh) * 2018-12-29 2019-05-14 深圳云天励飞技术有限公司 一种搜索人脸的方法及相关装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, CHUNXIA: "Research of Fast Searching Algorithm In Large Scale Face Database", INFORMATION & TECHNOLOGY (MASTER), CHINA MASTER’S THESES FULL-TEXT DATABASE, no. 9, 15 September 2006 (2006-09-15), ISSN: 1671-6779, DOI: 20200219103932X *

Also Published As

Publication number Publication date
CN109753577B (zh) 2021-07-06
CN109753577A (zh) 2019-05-14

Similar Documents

Publication Publication Date Title
WO2020134819A1 (zh) 一种搜索人脸的方法及相关装置
CN109101620B (zh) 相似度计算方法、聚类方法、装置、存储介质及电子设备
US9442929B2 (en) Determining documents that match a query
US9454580B2 (en) Recommendation system with metric transformation
CN110609916A (zh) 视频图像数据检索方法、装置、设备和存储介质
WO2019080411A1 (zh) 电子装置、人脸图像聚类搜索方法和计算机可读存储介质
JP7280393B2 (ja) 視覚位置決め方法、関連モデルの訓練方法及び関連装置並びに機器
CN108595688A (zh) 基于在线学习的潜在语义跨媒体哈希检索方法
Wei et al. Projected residual vector quantization for ANN search
WO2018076495A1 (zh) 检索人脸图像的方法和系统
CN110825894A (zh) 数据索引建立、数据检索方法、装置、设备和存储介质
CN111368133A (zh) 一种视频库的索引表建立方法、装置、服务器及存储介质
WO2014177050A1 (zh) 对文档进行聚类的方法和装置
EP3115908A1 (en) Method and apparatus for multimedia content indexing and retrieval based on product quantization
WO2021135063A1 (zh) 病理数据分析方法、装置、设备及存储介质
CN104835174B (zh) 基于超图模式搜索的鲁棒模型拟合方法
WO2021007999A1 (zh) 视频帧处理方法及装置
CN111400301B (zh) 一种数据查询方法、装置及设备
WO2012159320A1 (zh) 一种大规模图像数据的聚类方法及装置
CN110209895B (zh) 向量检索方法、装置和设备
CN113761017A (zh) 相似性搜索方法和装置
WO2023116816A1 (zh) 蛋白质序列比对方法、装置、服务器以及存储介质
CN117056465A (zh) 一种向量搜索方法、系统、电子设备和存储介质
JP6393982B2 (ja) 空間分割方法、空間分割装置および空間分割プログラム
WO2022188080A1 (zh) 图像分类网络模型训练方法、图像分类方法及相关设备

Legal Events

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

Ref document number: 19903659

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19903659

Country of ref document: EP

Kind code of ref document: A1