Summary of the invention
In order to solve prior art the face in picture is manually marked time, the problem of very large workload can be caused, embodiments provide a kind of face mask method, device and equipment.Described technical scheme is as follows:
First aspect, provide a kind of face mask method, described method, comprising:
Obtain the face distance between any two faces in face database;
Neighbour's face of described face to be clustered is obtained according to the face distance between face to be clustered in described face database and other faces;
Calculate the compound shared nearest neighbor score between described face to be clustered and described neighbour's face;
According to the face distance between described face to be clustered and described neighbour's face and described compound shared nearest neighbor score, cluster is carried out to described face to be clustered, obtain the classification including face;
Mark the face not yet marked in described classification.
In the first possible embodiment of first aspect, the face distance in described acquisition face database between any two faces, comprising:
Obtain each face high dimensional feature vector separately in described face database;
The face distance in described face database between any two faces is obtained according to the face range formula of described high dimensional feature vector correlation;
Described face range formula is:
Wherein, f
ijfor the face distance between face i and face j, f
ijvalue belong to interval [-1,1], N
dfor the dimension of the high dimensional feature vector of face,
for d component of the high dimensional feature vector of face i,
for d component of the high dimensional feature vector of face j.
In conjunction with the first possible embodiment of first aspect or first aspect, in the embodiment that the second is possible, the described neighbour's face obtaining described face to be clustered according to the face distance between face to be clustered in described face database and other faces, comprising:
The face distance of searching between described face to be clustered is less than the face of predetermined threshold;
According to described face distance order from small to large, the face found is sorted;
M the face that in acquisition ranking results, rank is the most front is as neighbour's face of described face to be clustered.
In conjunction with the first possible embodiment of first aspect, first aspect or the possible embodiment of the second of first aspect, in the embodiment that the third is possible, the face distance in described acquisition face database between all faces afterwards, also comprises:
According to each face high dimensional feature vector separately, index is set up to all faces in described face database;
Described face distance of searching between described face to be clustered is less than the face of predetermined threshold, comprising:
The face of described predetermined threshold is less than according to the face distance between described index search and described face to be clustered.
The embodiment possible in conjunction with the second of the first possible embodiment of first aspect, first aspect, first aspect or the third possible embodiment of first aspect, in the 4th kind of possible embodiment, compound shared nearest neighbor score between the described face to be clustered of described calculating and described neighbour's face, comprising:
When described neighbour's face is face to be clustered, the compound shared nearest neighbor score according to the first compound shared nearest neighbor score formulae discovery between face to be clustered and described neighbour's face;
The first compound shared nearest neighbor score formula described is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of described face i to be clustered, i
kfor kth neighbour's face of described face i to be clustered, j
k'for described neighbour's face j kth ' individual neighbour's face, δ
kk'for the neighbour's face for stating described face i to be clustered and the step function whether containing identical face in neighbour's face of described neighbour's face j, described k is less than or equal to described m, and described k' is less than or equal to described m.
In conjunction with embodiment, the third possible embodiment of first aspect or the 4th kind of possible embodiment of first aspect that the second of the first possible embodiment of first aspect, first aspect, first aspect is possible, in the 5th kind of possible embodiment, compound shared nearest neighbor score between the described face to be clustered of described calculating and described neighbour's face, comprising:
When described neighbour's face is the face marked, the compound shared nearest neighbor score according to the second compound shared nearest neighbor score formulae discovery between face to be clustered and described neighbour's face;
Described the second compound shared nearest neighbor score formula is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of described face i to be clustered, i
kfor kth neighbour's face of described face i to be clustered, C
jfor the classification belonging to neighbour's face j, described k is less than or equal to described m.
In conjunction with the 5th kind of possible embodiment of possible embodiment, the third possible embodiment of first aspect, the 4th kind of possible embodiment of first aspect or the first aspect of the second of the first possible embodiment of first aspect, first aspect, first aspect, in the 6th kind of possible embodiment, described face distance according between described face to be clustered and described neighbour's face and compound shared nearest neighbor score carry out cluster to described face to be clustered, to obtain the classification including face, comprising:
Detect described face i to be clustered and described neighbour's face i
0between face distance
whether be less than default face distance threshold D
tand described face i to be clustered and described neighbour's face i
0between described compound shared nearest neighbor score
whether be greater than default compound shared nearest neighbor score threshold S
t;
If testing result for described in
be less than described D
tand described in
be greater than described S
t, then described neighbour's face i is detected
0with described neighbour's face i
0neighbour's face i
00between face distance
described in whether being less than
and described neighbour's face i
0with described neighbour's face i
00between compound shared nearest neighbor score
whether be more than or equal to
If testing result for described in
described in being less than
and described in
be more than or equal to
then put i=i
0, i
0=i
00,
perform described in detecting
whether be less than D
tand described in
whether be greater than S
tstep;
If testing result for described in
described in being greater than
or described in
be less than
then merge described face i to be clustered and described neighbour's face i
0for same category;
If testing result for described in
be greater than described D
tor described in
be less than described S
t, then by described face i to be clustered and described neighbour's face i
0be designated as different classification, if described neighbour's face i
0there is affiliated classification number, then distribute a new classification number for described face i.
In conjunction with the 6th kind of possible embodiment of the third possible embodiment of the possible embodiment of the second of the first possible embodiment of first aspect, first aspect, first aspect, first aspect, the 4th kind of possible embodiment of first aspect, the 5th kind of possible embodiment of first aspect or first aspect, in the 7th kind of possible embodiment, the face not yet marked in the described classification of described mark, comprising:
When there is the face with markup information in described classification, then according to described markup information, the face described to be clustered in described classification is marked;
When faces all in described classification all do not mark out-of-date, then according to appointment markup information to all faces in described classification unify mark.
Second aspect, provide a kind of face annotation equipment, described device, comprising:
Face distance acquisition module, for obtaining the face distance in face database between any two faces;
Neighbour's face acquisition module, for obtaining neighbour's face of described face to be clustered according to the face distance between face to be clustered in described face database and other faces;
Neighbour's score acquisition module, for calculating the compound shared nearest neighbor score between described face to be clustered and described neighbour's face;
Cluster module, for carrying out cluster according to the face distance between described face to be clustered and described neighbour's face and described compound shared nearest neighbor score to described face to be clustered, obtains the classification including face;
Labeling module, for marking the face not yet marked in classification that described cluster module cluster obtains.
In the first possible embodiment of second aspect, described face distance acquisition module, comprising:
High dimensional feature acquiring unit, for obtaining each face high dimensional feature vector separately in described face database;
Face distance acquiring unit, for according to and the face range formula of described high dimensional feature vector correlation obtain face distance in described face database between any two faces;
Described face range formula is:
Wherein, f
ijfor the face distance between face i and face j, f
ijvalue belong to interval [-1,1], N
dfor the dimension of the high dimensional feature vector of face,
for d component of the high dimensional feature vector of face i,
for d component of the high dimensional feature vector of face j.
In conjunction with the first possible embodiment of second aspect or second aspect, in the embodiment that the second is possible, described neighbour's face acquisition module, comprising:
Search unit, be less than the face of predetermined threshold for the face distance of searching between described face to be clustered;
Sequencing unit, for searching the face that unit finds according to described face distance order from small to large sort to described;
Neighbour's face acquiring unit, for obtain described sequencing unit ranking results in the most front m the face of rank as neighbour's face of described face to be clustered.
In conjunction with the first possible embodiment of second aspect, second aspect or the possible embodiment of the second of second aspect, in the embodiment that the third is possible, described device, also comprises:
Module set up in index, for setting up index according to each face high dimensional feature vector separately to all faces in described face database;
Describedly search unit, for:
The face of described predetermined threshold is less than according to the face distance between described index search and described face to be clustered.
The embodiment possible in conjunction with the second of the first possible embodiment of second aspect, second aspect, second aspect or the third possible embodiment of second aspect, in the 4th kind of possible embodiment, described neighbour's score acquisition module, for:
When described neighbour's face is face to be clustered, the compound shared nearest neighbor score according to the first compound shared nearest neighbor score formulae discovery between face to be clustered and described neighbour's face;
The first compound shared nearest neighbor score formula described is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of described face i to be clustered, i
kfor kth neighbour's face of described face i to be clustered, j
k'for described neighbour's face j kth ' individual neighbour's face, δ
kk'for the neighbour's face for stating described face i to be clustered and the step function whether containing identical face in neighbour's face of described neighbour's face j, described k is less than or equal to described m, and described k' is less than or equal to described m.
In conjunction with embodiment, the third possible embodiment of second aspect or the 4th kind of possible embodiment of second aspect that the second of the first possible embodiment of second aspect, second aspect, second aspect is possible, in the 5th kind of possible embodiment, described neighbour's score acquisition module, for:
When described neighbour's face is the face marked, the compound shared nearest neighbor score according to the second compound shared nearest neighbor score formulae discovery between face to be clustered and described neighbour's face;
Described the second compound shared nearest neighbor score formula is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of described face i to be clustered, i
kfor kth neighbour's face of described face i to be clustered, C
jfor the classification belonging to neighbour's face j, described k is less than or equal to described m.
In conjunction with the 5th kind of possible embodiment of possible embodiment, the third possible embodiment of second aspect, the 4th kind of possible embodiment of second aspect or the second aspect of the second of the first possible embodiment of second aspect, second aspect, second aspect, in the 6th kind of possible embodiment, described cluster module, comprising:
First detecting unit, for detecting described face i to be clustered and described neighbour's face i
0between face distance
whether be less than default face distance threshold D
tand described face i to be clustered and described neighbour's face i
0between described compound shared nearest neighbor score
whether be greater than default compound shared nearest neighbor score threshold S
t;
Second detecting unit, for described first detecting unit testing result for described in
be less than described D
tand described in
be greater than described S
ttime, detect described neighbour's face i
0with described neighbour's face i
0neighbour's face i
00between face distance
described in whether being less than
and described neighbour's face i
0with described neighbour's face i
00between compound shared nearest neighbor score
whether be more than or equal to
Permute unit, for the second detecting unit testing result for described in
described in being less than
and described in
be more than or equal to
time, put i=i
0, i
0=i
00,
perform described in detecting
whether be less than D
tand described in
whether be greater than S
tstep;
Merge cells, for described second detecting unit testing result for described in
described in being greater than
or described in
be less than
time, merge described face i to be clustered and described neighbour's face i
0for same category;
Taxon, for described first detecting unit testing result for described in
be greater than described D
tor described in
be less than described S
ttime, by described face i to be clustered and described neighbour's face i
0be designated as different classification, if described neighbour's face i
0there is affiliated classification number, then distribute a new classification number for described face i.
In conjunction with the 6th kind of possible embodiment of the third possible embodiment of the possible embodiment of the second of the first possible embodiment of second aspect, second aspect, second aspect, second aspect, the 4th kind of possible embodiment of second aspect, the 5th kind of possible embodiment of second aspect or second aspect, in the 7th kind of possible embodiment, described labeling module, comprising:
Mark unit, for when there is the face with markup information in described classification, then marks the face described to be clustered in described classification according to described markup information;
When faces all in described classification all do not mark out-of-date, then according to appointment markup information to all faces in described classification unify mark.
The third aspect, provides a kind of equipment, and described equipment comprises in the various embodiments of second aspect or second aspect the described face annotation equipment provided.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By obtaining the face distance in face database between any two faces, obtain neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face; According to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score, cluster is carried out to face to be clustered, obtain the classification including face, the face not yet marked in mark classification; Carry out automatic mark to the face to be clustered in classification, solve prior art when the face in picture is manually marked, the problem of very large workload can be caused; Reach all faces do not marked in the classification that can obtain cluster and unify mark, improve the effect to the efficiency that face marks.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Shown in Figure 1, the method flow diagram of the face mask method provided in one embodiment of the invention is provided.This face mask method may be embodied to as the part in server or server, also may be embodied to the part into terminal or terminal, here said server is have store album function or have the server storing human face data library facility, and terminal said here can be the equipment such as computer, mobile phone, electron album or multimedia television.This face mask method, can comprise:
Step 101, obtains the face distance between any two faces in face database;
In actual applications, may there is photograph album collection in server or terminal, this photograph album collection comprises at least one picture including face.Such as, recognition of face can be carried out according to face recognition technology to the picture that photograph album is concentrated, obtain the face in picture, and all faces obtained are saved in face database.
That is, include at least one face in face database, the face marked in face database, can be comprised, also can comprise the face do not marked.
Step 102, obtains neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces;
Face in face database some be the face crossed of cluster, some may be the not yet face crossed of cluster, and this part face is face to be clustered.For example, if the face in the face database in server carried out cluster, when server have received new picture, and recognition of face is carried out to new picture draw some faces, then be saved in face database by these faces, this part now in face database is face to be clustered by the face of up-to-date preservation.
Generally, the face between neighbour's face of face to be clustered and face to be clustered is apart from smaller.
Step 103, calculates the compound shared nearest neighbor score between face to be clustered and neighbour's face;
Step 104, carries out cluster according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score to face to be clustered, obtains the classification including face;
Namely according to the face Distance geometry compound shared nearest neighbor score between face to be clustered and neighbour's face of this face to be clustered, cluster is carried out to face to be clustered, meet pre-conditioned face and face cluster to be clustered is a class.
Step 105, the face not yet marked in mark classification.
One or more classification can be obtained by cluster, in each classification, at least one face can be included.If one of them face in classification carried out mark, then according to the markup information of this face, mark was unified to other faces do not marked in this classification; If all faces in classification did not all mark, then can unify mark according to the actual information of this face to all faces in this classification.
In sum, the face mask method that the embodiment of the present invention provides, by obtaining the face distance in face database between any two faces, obtain neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face; According to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score, cluster is carried out to face to be clustered, obtain the classification including face, the face not yet marked in mark classification; Carry out automatic mark to the face to be clustered in classification, solve prior art when the face in picture is manually marked, the problem of very large workload can be caused; Reach all faces do not marked in the classification that can obtain cluster and unify mark, improve the effect to the efficiency that face marks.
Shown in Figure 2, the method flow diagram of the face mask method provided in another embodiment of the present invention is provided.This face mask method may be embodied to as the part in server or server, also may be embodied to the part into terminal or terminal, here said server is have store album function or have the server storing human face data library facility, and terminal said here can be the equipment such as computer, mobile phone, electron album or multimedia television.This face mask method, can comprise:
Step 201, obtains each face high dimensional feature vector separately in face database;
In actual applications, may there is photograph album collection in server or terminal, this photograph album collection comprises at least one picture including face.Such as, recognition of face can be carried out according to face recognition technology to the picture that photograph album is concentrated, obtain the face in picture, and all faces obtained are saved in face database.
That is, include at least one face in face database, the face marked in face database, can be comprised, also can comprise the face do not marked.
Step 202, obtains the face distance in face database between any two faces according to the face range formula of high dimensional feature vector correlation;
With the face range formula of high dimensional feature vector correlation can be:
Wherein, f
ijfor the face distance between face i and face j, f
ijvalue belong to interval [-1,1], N
dfor the dimension of the high dimensional feature vector of face,
for d component of the high dimensional feature vector of face i,
for d component of the high dimensional feature vector of face j.
The face distance in face database between any two faces can be obtained according to above-mentioned formula.In actual applications, owing to including a lot of face in face database, a face distance all can be produced between every two faces, for the ease of expressing, the face in face database can be numbered, and a face distance matrix can be set up, the value of the i-th row jth row in this matrix is the face distance between i-th face and a jth face, wherein i >=1 and i≤n, j >=1 and j≤n, wherein n is the face sum in this face database.
Step 203, sets up index according to each face high dimensional feature vector separately to all faces in face database;
The index of high dimensional feature can adopt overlay tree Cover Tree, and the fundamental purpose setting up index is here the neighbour's face in order to find certain face fast.
Step 204, is less than the face of predetermined threshold according to the face distance between index search and face to be clustered;
Here it is less that predetermined threshold is arranged, the face obtained and face to be clustered more close; It is larger that predetermined threshold is arranged, and the face obtained and face to be clustered are more kept off.If when predetermined threshold arrange too small, then may cause obtain less than the face more close with face to be clustered.Therefore, predetermined threshold here can set according to actual conditions.
Step 205, sorts to the face found according to face distance order from small to large;
Step 206, m the face that in acquisition ranking results, rank is the most front is as neighbour's face of face to be clustered;
Step 207, when neighbour's face of face to be clustered is face to be clustered, according to the compound shared nearest neighbor score between the first compound neighbour score formulae discovery face to be clustered and neighbour's face;
When neighbour's face of face to be clustered is face to be clustered, also namely in unsupervised situation, can according to the compound shared nearest neighbor score between the first compound neighbour score formulae discovery face to be clustered and neighbour's face.
This first compound neighbour score formula is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of face i to be clustered, i
kfor kth neighbour's face of face i to be clustered, j
k'for neighbour's face j kth ' individual neighbour's face, δ
kk'for the neighbour's face for stating face i to be clustered and the step function whether containing identical face in neighbour's face of neighbour's face j, k is less than or equal to m, and k' is less than or equal to m.
When having multiple face to be clustered in neighbour's face of face to be clustered, need respectively according to the compound shared nearest neighbor score between compound shared nearest neighbor score formulae discovery face to be clustered and each multiple neighbour's face to be clustered.
Step 208, when neighbour's face of face to be clustered is the face marked, according to the compound shared nearest neighbor score between weighting neighbour score formulae discovery face to be clustered and neighbour's face;
When neighbour's face is the face marked, also namely when there being supervision, can according to the composite weighted shared nearest neighbor score between the second compound shared nearest neighbor score formulae discovery face to be clustered and neighbour's face.
This second compound shared nearest neighbor score formula is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of face i to be clustered, i
kfor kth neighbour's face of face i to be clustered, C
jfor the classification belonging to neighbour's face j, k is less than or equal to m.
When neighbour's face of face to be clustered has multiple face marked, need respectively according to the compound shared nearest neighbor score between weighting neighbour score formulae discovery face to be clustered and neighbour's face that each had marked.
Step 209, carries out cluster according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score to face to be clustered, obtains the classification including face;
For example, according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score, cluster is carried out to face to be clustered, obtain the classification including face, can comprise the steps:
Step a, detects face i to be clustered and neighbour's face i
0between face distance
whether be less than default face distance threshold D
tand face i to be clustered and neighbour's face i
0between compound shared nearest neighbor score
whether be greater than default compound shared nearest neighbor score threshold S
t;
Also namely detect and whether meet:
and
if meet, then perform step b, otherwise perform steps d.
Step b, if testing result is
be less than D
tand
be greater than S
t, then neighbour's face i is detected
0with neighbour's face i
0neighbour's face i
00between face distance
whether be less than
and neighbour's face i
0with neighbour's face i
00between compound shared nearest neighbor score
whether be more than or equal to
When
And
Time, detect and whether meet:
And
If meet, then perform step c.
Step c, if testing result is
be less than
and
be more than or equal to
then put i=i
0, i
0=i
00,
perform detection
whether be less than D
tand
whether be greater than S
tstep;
Steps d, if testing result is
be greater than
or
be less than
then merge face i to be clustered and neighbour's face i
0for same category;
Step e, if testing result is
be greater than D
tor
be less than S
t, then by face i to be clustered and neighbour's face i
0be designated as different classification, if neighbour's face i
0there is affiliated classification number, then for face i distributes a new classification number.
Circulation performs step a to step e, till all faces to be clustered are classified all.
Step 210, when there is the face with markup information in classifying, then marks the face to be clustered in classification according to markup information;
Step 211, when classification in all faces all do not mark out-of-date, then according to specify markup information to classification in all faces unify mark.
When classification in all faces be not all marked out-of-date, then reminding user input can specify markup information, because user can learn the face information in this classification according to face, and this face information is inputed to server or terminal as appointment markup information, after server or terminal obtain this appointment markup information of user's input, according to this appointment markup information, mark is unified to all faces in this classification.
In sum, the face mask method that the embodiment of the present invention provides, by obtaining the face distance in face database between any two faces, obtain neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face; According to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score, cluster is carried out to face to be clustered, obtain the classification including face, the face not yet marked in mark classification; Carry out automatic mark to the face to be clustered in classification, solve prior art when the face in picture is manually marked, the problem of very large workload can be caused; Reach all faces do not marked in the classification that can obtain cluster and unify mark, improve the effect to the efficiency that face marks.
Shown in Figure 3, it illustrates the structural representation of face annotation equipment in one embodiment of the invention.This face mask method may be embodied to as the part in server or server, also may be embodied to the part into terminal or terminal, here said server is have store album function or have the server storing human face data library facility, and terminal said here can be the equipment such as computer, mobile phone, electron album or multimedia television.This face annotation equipment can include but not limited to: face distance acquisition module 301, neighbour's face acquisition module 302, neighbour's score acquisition module 303, cluster module 304 and labeling module 305.
Face distance acquisition module 301, for obtaining the face distance in face database between any two faces;
Neighbour's face acquisition module 302, for obtaining neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces;
Neighbour's score acquisition module 303, for calculating the compound shared nearest neighbor score between face to be clustered and neighbour's face;
Cluster module 304, for carrying out cluster according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score to face to be clustered, obtains the classification including face;
Labeling module 305, for marking the face not yet marked in classification that cluster module 304 cluster obtains.
In sum, the face annotation equipment that the embodiment of the present invention provides, by obtaining the face distance in face database between any two faces, obtain neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face; According to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score, cluster is carried out to face to be clustered, obtain the classification including face, the face not yet marked in mark classification; Carry out automatic mark to the face to be clustered in classification, solve prior art when the face in picture is manually marked, the problem of very large workload can be caused; Reach all faces do not marked in the classification that can obtain cluster and unify mark, improve the effect to the efficiency that face marks.
Shown in Figure 4, it illustrates the structural representation of face annotation equipment in one embodiment of the invention.This face mask method may be embodied to as the part in server or server, also may be embodied to the part into terminal or terminal, here said server is have store album function or have the server storing human face data library facility, and terminal said here can be the equipment such as computer, mobile phone, electron album or multimedia television.This face annotation equipment can include but not limited to: face distance acquisition module 401, neighbour's face acquisition module 402, neighbour's score acquisition module 403, cluster module 404 and labeling module 405.
Face distance acquisition module 401, for obtaining the face distance in face database between any two faces;
Neighbour's face acquisition module 402, for obtaining neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces;
Neighbour's score acquisition module 403, for calculating the compound shared nearest neighbor score between face to be clustered and neighbour's face;
Cluster module 404, for carrying out cluster according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score to face to be clustered, obtains the classification including face;
Labeling module 405, for marking the face not yet marked in classification that cluster module 404 cluster obtains.
Preferably, face distance acquisition module 401 can comprise: high dimensional feature acquiring unit 401a and face distance acquiring unit 401b.
High dimensional feature acquiring unit 401a, may be used for obtaining each face high dimensional feature vector separately in face database;
Face distance acquiring unit 401b, may be used for according to and the face range formula of high dimensional feature vector correlation obtain face distance in face database between any two faces.
Face range formula can be:
Wherein, f
ijfor the face distance between face i and face j, f
ijvalue belong to interval [-1,1], N
dfor the dimension of the high dimensional feature vector of face,
for d component of the high dimensional feature vector of face i,
for d component of the high dimensional feature vector of face j.
Preferably, neighbour's face acquisition module 402 can comprise: search unit 402a, sequencing unit 402b and neighbour's face acquiring unit 402c.
Search unit 402a, may be used for the face that the face distance of searching between face to be clustered is less than predetermined threshold;
Sequencing unit 402b, may be used for sorting to searching the face that unit finds according to face distance order from small to large;
Neighbour's face acquiring unit 402c, to may be used for obtaining in the ranking results of sequencing unit the most front m the face of rank as neighbour's face of face to be clustered.
Preferably, this face annotation equipment can also comprise: module 406 set up in index.
Module 406 set up in index, may be used for setting up index according to each face high dimensional feature vector separately to all faces in face database;
Corresponding, searching unit 402a can also be used for: the face being less than predetermined threshold according to the face distance between index search and face to be clustered.
Preferably, neighbour's score acquisition module 403, can also be used for:
When neighbour's face is face to be clustered, according to the compound shared nearest neighbor score between the first compound shared nearest neighbor score formulae discovery face to be clustered and neighbour's face;
The formula of the first compound shared nearest neighbor score is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of face i to be clustered, i
kfor kth neighbour's face of face i to be clustered, j
k'for neighbour's face j kth ' individual neighbour's face, δ
kk'for the neighbour's face for stating face i to be clustered and the step function whether containing identical face in neighbour's face of neighbour's face j, k is less than or equal to m, and k' is less than or equal to m.
Preferably, neighbour's score acquisition module 403, can also be used for:
When neighbour's face is the face marked, according to the compound shared nearest neighbor score between the second compound shared nearest neighbor score formulae discovery face to be clustered and neighbour's face;
The second compound shared nearest neighbor score formula is:
Wherein, SnnScore
ijfor the compound shared nearest neighbor score of face i to be clustered and neighbour's face j, K is neighbour's face sum of face i to be clustered, i
kfor kth neighbour's face of face i to be clustered, C
jfor the classification belonging to neighbour's face j, k is less than or equal to m.
Preferably, cluster module 404 can comprise: the first detecting unit 404a, the second detecting unit 404b, permute unit 404c, merge cells 404d and taxon 404e.
First detecting unit 404a, may be used for detecting face i to be clustered and neighbour's face i
0between face distance
whether be less than default face distance threshold D
tand face i to be clustered and neighbour's face i
0between compound shared nearest neighbor score
whether be greater than default compound shared nearest neighbor score threshold S
t;
Second detecting unit 404b, may be used in the testing result of the first detecting unit 404a be
be less than D
tand
be greater than S
ttime, detect neighbour's face i
0with neighbour's face i
0neighbour's face i
00between face distance
whether be less than
and neighbour's face i
0with neighbour's face i
00between compound shared nearest neighbor score
whether be more than or equal to
Permute unit 404c, may be used in the testing result of the second detecting unit 404b be
be less than
and
be more than or equal to
time, put i=i
0, i
0=i
00,
Perform detection
whether be less than D
tand
whether be greater than S
tstep;
Merge cells 404d, may be used in the testing result of the second detecting unit 404b be
be greater than
or
be less than
time, merge face i to be clustered and neighbour's face i
0for same category;
Taxon 404e, may be used in the testing result of the first detecting unit 404b be
be greater than D
tor
be less than S
ttime, by face i to be clustered and neighbour's face i
0be designated as different classification, if neighbour's face i
0there is affiliated classification number, then for face i distributes a new classification number.
Preferably, labeling module 405 can comprise: the first mark unit 405a and second mark unit 405b.
First mark unit 405a, may be used for when there is the face with markup information in classifying, then marking the face to be clustered in classification according to markup information;
Second mark unit 405b, may be used for when all faces in classification all do not mark out-of-date, then according to specifying markup information to unify mark to all faces in classification.
In sum, the face annotation equipment that the embodiment of the present invention provides, by obtaining the face distance in face database between any two faces, obtain neighbour's face of face to be clustered according to the face distance between face to be clustered in face database and other faces, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face; According to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score, cluster is carried out to face to be clustered, obtain the classification including face, the face not yet marked in mark classification; Carry out automatic mark to the face to be clustered in classification, solve prior art when the face in picture is manually marked, the problem of very large workload can be caused; Reach all faces do not marked in the classification that can obtain cluster and unify mark, improve the effect to the efficiency that face marks.
It should be noted that: the face annotation equipment that above-described embodiment provides is when carrying out face cluster and mark, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by equipment is divided into different functional modules, to complete all or part of function described above.In addition, the face annotation equipment that above-described embodiment provides and face mask method embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.