The content of the invention
When being marked manually to the face in picture to solve prior art, asking for very big workload can be caused
Topic, the embodiments of the invention provide a kind of face mask method, device and equipment.The technical scheme is as follows:
First aspect, there is provided a kind of face mask method, methods described, including:
Obtain the face distance between any two face in face database;
Obtained according to the face distance in the face database between face to be clustered and other faces described to be clustered
Neighbour's face of face;
Calculate the compound shared nearest neighbor score between the face to be clustered and neighbour's face;
Obtained according to the face distance between the face to be clustered and neighbour's face and the compound shared nearest neighbor
Divide and the face to be clustered is clustered, obtain the classification for including face;
Mark the face not yet marked in the classification.
In the first possible embodiment of first aspect, it is described acquisition face database in any two face it
Between face distance, including:
Obtain each respective high dimensional feature vector of face in the face database;
Any two in the face database is obtained according to the face range formula of the high dimensional feature vector correlation
Face distance between face;
The face range formula is:
Wherein, fijFace distance between face i and face j, fijValue belong to section [- 1,1], NdFor face
The dimension of high dimensional feature vector,For face i high dimensional feature vector d-th of component,For face j high dimensional feature vector
D-th of component.
With reference to the possible embodiment of the first of first aspect or first aspect, in second of possible embodiment
In, the face distance according in the face database between face to be clustered and other faces obtains the people to be clustered
Neighbour's face of face, including:
Search the face that the face distance between the face to be clustered is less than predetermined threshold;
The face found is ranked up according to the order of face distance from small to large;
Neighbour face of the m most preceding face of ranking as the face to be clustered in acquisition ranking results.
Second with reference to the first possible embodiment or first aspect of first aspect, first aspect is possible
Embodiment, in the third possible embodiment, the face distance obtained in face database between all faces
Afterwards, in addition to:
Index is established to all faces in the face database according to the respective high dimensional feature vector of each face;
Face distance between the lookup and the face to be clustered is less than the face of predetermined threshold, including:
It is less than the face of the predetermined threshold according to the face distance between the index search and the face to be clustered.
Second of possible reality of the first possible embodiment, first aspect with reference to first aspect, first aspect
The third possible embodiment of mode or first aspect is applied, in the 4th kind of possible embodiment, the calculating institute
The compound shared nearest neighbor score between face to be clustered and neighbour's face is stated, including:
When neighbour's face is face to be clustered, according to calculating the first compound shared nearest neighbor score formula
Compound shared nearest neighbor score between face to be clustered and neighbour's face;
The first described compound shared nearest neighbor score formula is:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K waits to gather to be described
Class face i neighbour's face sum, ikFor k-th of neighbour's face of the face i to be clustered, jk'For neighbour's face j's
Kth ' individual neighbour's face, δkk'For for stating neighbour's face of the face i to be clustered and the neighbour people of neighbour's face j
In face whether the jump function containing identical face, the k is less than or equal to the m, and the k' is less than or equal to the m.
Second of possible reality of the first possible embodiment, first aspect with reference to first aspect, first aspect
Mode, the 4th kind of possible embodiment of the third possible embodiment or first aspect of first aspect are applied,
In five kinds of possible embodiments, the compound shared nearest neighbor calculated between the face to be clustered and neighbour's face obtains
Point, including:
When neighbour's face is the face marked, institute is calculated according to second of compound shared nearest neighbor score formula
State the compound shared nearest neighbor score between face to be clustered and neighbour's face;
Second of compound shared nearest neighbor score formula be:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K waits to gather to be described
Class face i neighbour's face sum, ikFor k-th of neighbour's face of the face i to be clustered, CjFor the class belonging to neighbour's face j
Not, the k is less than or equal to the m.
Second of possible reality of the first possible embodiment, first aspect with reference to first aspect, first aspect
Apply the 4th kind of possible embodiment or first of mode, the third possible embodiment of first aspect, first aspect
5th kind of possible embodiment of aspect, in the 6th kind of possible embodiment, it is described according to the face to be clustered and
Face distance and compound shared nearest neighbor score between neighbour's face cluster to the face to be clustered, to obtain
Include the classification of face, including:
Detect the face i to be clustered and neighbour's face i0Between face distanceWhether default people is less than
Face distance threshold DTAnd the face i to be clustered and neighbour's face i0Between the compound shared nearest neighbor scoreWhether default compound shared nearest neighbor score threshold S is more thanT;
If testing result is describedLess than the DTIt is and describedMore than the ST, then the neighbour is detected
Face i0With neighbour's face i0Neighbour's face i00Between face distanceWhether it is less than describedAnd the neighbour
Face i0With neighbour's face i00Between compound shared nearest neighbor scoreWhether it is more than or equal to
If testing result is describedLess than describedIt is and describedIt is more than or equal toThen
Put i=i0, i0=i00, Described in perform detectionWhether D is less thanTIt is and describedWhether S is more thanTThe step of;
If testing result is describedMore than describedIt is or describedIt is less thanThen merge institute
State face i to be clustered and neighbour's face i0For same category;
If testing result is describedMore than the DTIt is or describedLess than the ST, then will be described to be clustered
Face i and neighbour's face i0Different classifications are designated as, if neighbour's face i0There is affiliated classification number, be then the face i points
With a new classification number.
Second of possible reality of the first possible embodiment, first aspect with reference to first aspect, first aspect
Apply the 4th kind of possible embodiment, first aspect of mode, the third possible embodiment of first aspect, first aspect
The 5th kind of possible embodiment or first aspect the 6th kind of possible embodiment, in the 7th kind of possible embodiment party
In formula, the face that is not yet marked in the mark classification, including:
When the face with markup information in the classification be present, then according to the markup information to the classification
In the face to be clustered be labeled;
When in the classification all faces do not mark it is out-of-date, then according to specifying markup information to all in the classification
Face carries out unified mark.
Second aspect, there is provided a kind of face annotation equipment, described device, including:
Face is apart from acquisition module, for obtaining the face distance in face database between any two face;
Neighbour's face acquisition module, for according to the people in the face database between face to be clustered and other faces
Face distance obtains neighbour's face of the face to be clustered;
Neighbour's score acquisition module, it is compound shared near between the face to be clustered and neighbour's face for calculating
Adjacent score;
Cluster module, for according between the face to be clustered and neighbour's face face distance and it is described multiple
Close shared nearest neighbor score to cluster the face to be clustered, obtain the classification for including face;
Labeling module, for the face not yet marked in the classification that marks the cluster module to cluster to obtain.
In the first possible embodiment of second aspect, the face apart from acquisition module, including:
High dimensional feature acquiring unit, for obtaining each respective high dimensional feature vector of face in the face database;
Face distance acquiring unit, for according to being obtained with the face range formula of the high dimensional feature vector correlation
Face distance in face database between any two face;
The face range formula is:
Wherein, fijFace distance between face i and face j, fijValue belong to section [- 1,1], NdFor face
The dimension of high dimensional feature vector,For face i high dimensional feature vector d-th of component,For face j high dimensional feature vector
D-th of component.
With reference to the possible embodiment of the first of second aspect or second aspect, in second of possible embodiment
In, neighbour's face acquisition module, including:
Searching unit, the face distance for searching between the face to be clustered are less than the face of predetermined threshold;
Sequencing unit, for the face found according to the order of face distance from small to large to the searching unit
It is ranked up;
Neighbour's face acquiring unit, m most preceding face of ranking is made in the ranking results for obtaining the sequencing unit
For neighbour's face of the face to be clustered.
Second with reference to the first possible embodiment or second aspect of second aspect, second aspect is possible
Embodiment, in the third possible embodiment, described device, in addition to:
Index establish module, for according to the respective high dimensional feature vector of each face to the institute in the face database
There is face to establish index;
The searching unit, is used for:
It is less than the face of the predetermined threshold according to the face distance between the index search and the face to be clustered.
Second of possible reality of the first possible embodiment, second aspect with reference to second aspect, second aspect
The third possible embodiment of mode or second aspect is applied, in the 4th kind of possible embodiment, the neighbour obtains
Divide acquisition module, be used for:
When neighbour's face is face to be clustered, according to calculating the first compound shared nearest neighbor score formula
Compound shared nearest neighbor score between face to be clustered and neighbour's face;
The first described compound shared nearest neighbor score formula is:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K waits to gather to be described
Class face i neighbour's face sum, ikFor k-th of neighbour's face of the face i to be clustered, jk'For neighbour's face j's
Kth ' individual neighbour's face, δkk'For for stating neighbour's face of the face i to be clustered and the neighbour people of neighbour's face j
In face whether the jump function containing identical face, the k is less than or equal to the m, and the k' is less than or equal to the m.
Second of possible reality of the first possible embodiment, second aspect with reference to second aspect, second aspect
Mode, the 4th kind of possible embodiment of the third possible embodiment or second aspect of second aspect are applied,
In five kinds of possible embodiments, neighbour's score acquisition module, it is used for:
When neighbour's face is the face marked, institute is calculated according to second of compound shared nearest neighbor score formula
State the compound shared nearest neighbor score between face to be clustered and neighbour's face;
Second of compound shared nearest neighbor score formula be:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K waits to gather to be described
Class face i neighbour's face sum, ikFor k-th of neighbour's face of the face i to be clustered, CjFor the class belonging to neighbour's face j
Not, the k is less than or equal to the m.
Second of possible reality of the first possible embodiment, second aspect with reference to second aspect, second aspect
Apply the 4th kind of possible embodiment or second of mode, the third possible embodiment of second aspect, second aspect
5th kind of possible embodiment of aspect, in the 6th kind of possible embodiment, the cluster module, including:
First detection unit, for detecting the face i to be clustered and neighbour's face i0Between face distance
Whether default face distance threshold D is less thanTAnd the face i to be clustered and neighbour's face i0Between it is described compound common
Enjoy neighbour's scoreWhether default compound shared nearest neighbor score threshold S is more thanT;
Second detection unit, it is described for the testing result in first detection unitLess than the DTIt is and describedMore than the STWhen, detect neighbour's face i0With neighbour's face i0Neighbour's face i00Between face
DistanceWhether it is less than describedAnd neighbour's face i0With neighbour's face i00Between compound shared nearest neighbor scoreWhether it is more than or equal to
Unit is replaced, for being described in the testing result of the second detection unitLess than describedIt is and describedIt is more than or equal toWhen, put i=i0, i0=i00,
Described in perform detectionWhether D is less thanTIt is and describedWhether S is more thanTThe step of;
Combining unit, it is described for the testing result in second detection unitMore than describedIt is or describedIt is less thanWhen, merge the face i to be clustered and neighbour's face i0For same category;
Taxon, it is described for the testing result in first detection unitMore than the DTIt is or describedLess than the STWhen, by the face i to be clustered and neighbour's face i0Different classifications are designated as, if the neighbour
Face i0There is affiliated classification number, then distribute a new classification number for the face i.
Second of possible reality of the first possible embodiment, second aspect with reference to second aspect, second aspect
Apply the 4th kind of possible embodiment, second aspect of mode, the third possible embodiment of second aspect, second aspect
The 5th kind of possible embodiment or second aspect the 6th kind of possible embodiment, in the 7th kind of possible embodiment party
In formula, the labeling module, including:
Mark unit, for when in the classification exist have markup information face when, then according to the mark
Information is labeled to the face to be clustered in the classification;
When in the classification all faces do not mark it is out-of-date, then according to specifying markup information to all in the classification
Face carries out unified mark.
The third aspect, there is provided a kind of equipment, the equipment include the various embodiment party of second aspect or second aspect
The described face annotation equipment provided in formula.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
By obtaining the face distance in face database between any two face, according to be clustered in face database
Face distance between face and other faces obtains neighbour's face of face to be clustered, calculates face to be clustered and neighbour's face
Between compound shared nearest neighbor score;According to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor
Score clusters to face to be clustered, obtains the classification for including face, the face not yet marked in mark classification;To same point
Face to be clustered in class is marked automatically, when solving prior art the face in picture being marked manually, can be made
The problem of into very big workload;Reach all faces not marked in the classification that can be obtained to cluster and carry out unified mark
Note, improve the effect for the efficiency being labeled to face.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Shown in Figure 1, it illustrates the method flow of the face mask method provided in one embodiment of the invention
Figure.The face mask method may be embodied to as the part in server or server, can also be implemented as terminal or
A part for terminal, the server said here are the clothes with storage album function or with storage human face data library facility
Business device, the terminal said here can be the equipment such as computer, mobile phone, electron album or multimedia television.The face mask method,
It can include:
Step 101, the face distance in face database between any two face is obtained;
In actual applications, photograph album collection is there may be in server or terminal, the photograph album collection includes at least one include
The picture of face.For example recognition of face can be carried out according to the picture that face recognition technology is concentrated to photograph album, obtain in picture
Face, and obtained all faces are preserved into face database.
That is, including at least one face in face database, it can include what is marked in face database
Face, the face not marked can also be included.
Step 102, obtained according to the face distance in face database between face to be clustered and other faces to be clustered
Neighbour's face of face;
Face in face database some be clustered mistake face, some is probably not yet to cluster
Face, this part face is face to be clustered.For example, if the face in face database in server
Cluster was carried out, when server have received new picture, and recognition of face is carried out to new picture and draws some faces, then will
These faces are preserved into face database, and now this part in face database is as to be clustered by the face of newest preservation
Face.
Generally, the face between neighbour's face of face to be clustered and face to be clustered is apart from smaller.
Step 103, the compound shared nearest neighbor score between face to be clustered and neighbour's face is calculated;
Step 104, according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score pair
Face to be clustered is clustered, and obtains the classification for including face;
I.e. according to the face distance between face to be clustered and neighbour's face of the face to be clustered and compound shared nearest neighbor
Score clusters to face to be clustered, and it is one kind to meet the face of preparatory condition and face cluster to be clustered.
Step 105, the face not yet marked in mark classification.
One or more classification can be obtained by cluster, can include at least one face in each classification.If classification
In one of face carried out mark, then other in the classification are not marked according to the markup information of the face
Face carries out unified mark;If all faces in classification did not mark, can be according to the actual information pair of the face
All faces in the classification carry out unified mark.
In summary, face mask method provided in an embodiment of the present invention, by obtaining any two in face database
Face distance between face, obtained according to the face distance in face database between face to be clustered and other faces and wait to gather
Neighbour's face of class face, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face;According to people to be clustered
Face distance and compound shared nearest neighbor score between face and neighbour's face cluster to face to be clustered, are included
The classification of face, the face not yet marked in mark classification;To being marked automatically with the face to be clustered in classification, solve
When prior art is marked manually to the face in picture, the problem of very big workload can be caused;Having reached can be to poly-
All faces not marked carry out unified mark in the classification that class obtains, and improve the effect for the efficiency being labeled to face.
Shown in Figure 2, it illustrates the method stream of the face mask method provided in another embodiment of the present invention
Cheng Tu.The face mask method may be embodied to as the part in server or server, can also be implemented as terminal
Or a part for terminal, the server said here are with storage album function or with storage human face data library facility
Server, the terminal said here can be the equipment such as computer, mobile phone, electron album or multimedia television.The face mark side
Method, it can include:
Step 201, each respective high dimensional feature vector of face in face database is obtained;
In actual applications, photograph album collection is there may be in server or terminal, the photograph album collection includes at least one include
The picture of face.For example recognition of face can be carried out according to the picture that face recognition technology is concentrated to photograph album, obtain in picture
Face, and obtained all faces are preserved into face database.
That is, including at least one face in face database, it can include what is marked in face database
Face, the face not marked can also be included.
Step 202, any two in face database is obtained according to the face range formula of high dimensional feature vector correlation
Face distance between face;
Face range formula with high dimensional feature vector correlation can be:
Wherein, fijFace distance between face i and face j, fijValue belong to section [- 1,1], NdFor face
The dimension of high dimensional feature vector,For face i high dimensional feature vector d-th of component,For face j high dimensional feature vector
D-th of component.
Face distance in face database between any two face can be obtained according to above-mentioned formula.In practical application
In, due to including many faces in face database, a face distance can be all produced between each two face, for the ease of
Expression, the face in face database can be numbered, and can establish a face distance matrix, and the in the matrix
The value of i rows jth row is face distance between i-th of face and j-th of face, wherein i >=1 and i≤n, j >=1 and j≤n,
Wherein n is the face sum in the face database.
Step 203, rope is established to all faces in face database according to the respective high dimensional feature vector of each face
Draw;
The index of high dimensional feature can use overlay tree Cover Tree, and the main purpose for establishing index here is in order to can
To be quickly found out neighbour's face of some face.
Step 204, the face of predetermined threshold is less than according to the face distance between index search and face to be clustered;
Here predetermined threshold is set smaller, and obtained face and face to be clustered are closer;What predetermined threshold was set
Bigger, obtained face is more kept off with face to be clustered.If when predetermined threshold set it is too small, may cause obtain not
To the face being closer to face to be clustered.Therefore, predetermined threshold here can be set according to actual conditions.
Step 205, the face found is ranked up according to the order of face distance from small to large;
Step 206, neighbour face of the m most preceding face of ranking as face to be clustered in acquisition ranking results;
Step 207, when neighbour's face of face to be clustered is face to be clustered, according to the first compound neighbour's score
Formula calculates the compound shared nearest neighbor score between face and neighbour's face to be clustered;
, can basis when neighbour's face of face to be clustered is face to be clustered, namely in the case of unsupervised
The first compound neighbour's score formula calculates the compound shared nearest neighbor score between face and neighbour's face to be clustered.
The first compound neighbour's score formula is:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K is people to be clustered
Face i neighbour's face sum, ikFor face i to be clustered k-th of neighbour's face, jk'For neighbour's face j kth ' individual neighbour people
Face, δkk'For for state face i to be clustered neighbour's face with neighbour's face j neighbour's face whether containing identical face
Jump function, k are less than or equal to m, and k' is less than or equal to m.
When there is multiple faces to be clustered in neighbour's face of face to be clustered, it is necessary to respectively according to compound shared nearest neighbor
Score formula calculates the compound shared nearest neighbor score between 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 weighting neighbour's score formula
Calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face;
, can be compound according to second when neighbour's face is the face marked, namely in the case where there is supervision
Shared nearest neighbor score formula calculates the composite weighted shared nearest neighbor score between face and neighbour's face to be clustered.
This second compound shared nearest neighbor score formula be:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K is people to be clustered
Face i neighbour's face sum, ikFor face i to be clustered k-th of neighbour's face, CjFor 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 have it is multiple marked face when, it is necessary to respectively according to weighting neighbour's score
Formula calculates the compound shared nearest neighbor score between face to be clustered and each neighbour's face marked.
Step 209, according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score pair
Face to be clustered is clustered, and obtains the classification for including face;
For example, according to the face distance between face to be clustered and neighbour's face and compound shared nearest neighbor score pair
Face to be clustered is clustered, and is obtained the classification for including face, be may include steps of:
Step a, detect face i to be clustered and neighbour's face i0Between face distanceWhether be less than default face away from
From threshold value DTAnd face i to be clustered and neighbour's face i0Between compound shared nearest neighbor scoreWhether it is more than default
Compound shared nearest neighbor score threshold ST;
Namely detect whether to meet:AndIf satisfied, then performing step b, otherwise perform
Step d.
Step b, if testing result isLess than DTAndMore than ST, then neighbour's face i is detected0With neighbour people
Face i0Neighbour's face i00Between face distanceWhether it is less thanAnd neighbour's face i0With neighbour's face i00Between answer
Close shared nearest neighbor scoreWhether it is more than or equal to
WhenAndWhen, detect whether to meet:And If satisfied, then perform step c.
Step c, if testing result isIt is less thanAndIt is more than or equal toThen put i=i0,
i0=i00, Perform detectionWhether D is less thanTAndWhether it is more than
STThe step of;
Step d, if testing result isIt is more thanOrIt is less thanThen merge people to be clustered
Face i and neighbour's face i0For same category;
Step e, if testing result isMore than DTOrLess than ST, then by face i to be clustered and neighbour's face
i0Different classifications are designated as, if neighbour's face i0There is affiliated classification number, then distribute a new classification number for face i.
Circulation performs step a to step e, untill all faces to be clustered have been classified.
Step 210, when the face with markup information in classification be present, then according to markup information in classification
Face to be clustered is labeled;
Step 211, when in classification all faces do not mark it is out-of-date, then according to specifying markup information to all in classification
Face carries out unified mark.
When in classification all faces be not marked it is out-of-date, then may remind the user that input specify markup information because with
Family can learn the face information in the classification according to face, and input to service using the face information as specified markup information
After device or terminal, server or terminal obtain the specified markup information of user's input, markup information is specified to this according to this
All faces in classification carry out unified mark.
In summary, face mask method provided in an embodiment of the present invention, by obtaining any two in face database
Face distance between face, obtained according to the face distance in face database between face to be clustered and other faces and wait to gather
Neighbour's face of class face, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face;According to people to be clustered
Face distance and compound shared nearest neighbor score between face and neighbour's face cluster to face to be clustered, are included
The classification of face, the face not yet marked in mark classification;To being marked automatically with the face to be clustered in classification, solve
When prior art is marked manually to the face in picture, the problem of very big workload can be caused;Having reached can be to poly-
All faces not marked carry out unified mark in the classification that class obtains, and improve the effect for the efficiency being labeled to face.
Shown in Figure 3, it illustrates the structural representation of face annotation equipment in one embodiment of the invention.The people
Face mask method may be embodied to as the part in server or server, can also be implemented as the one of terminal or terminal
Part, the server said here are the server with storage album function or with storage human face data library facility, this
In the terminal said can be the equipment such as computer, mobile phone, electron album or multimedia television.The face annotation equipment can include
But it is not limited to:Face is apart from acquisition module 301, neighbour's face acquisition module 302, neighbour's score acquisition module 303, cluster module
304 and labeling module 305.
Face is apart from acquisition module 301, for obtaining the face distance in face database between any two face;
Neighbour's face acquisition module 302, for according to the people in face database between face to be clustered and other faces
Face distance obtains neighbour's face of face to be clustered;
Neighbour's score acquisition module 303, the compound shared nearest neighbor for calculating between face to be clustered and neighbour's face obtain
Point;
Cluster module 304, for according to the face distance between face to be clustered and neighbour's face and compound shared near
Adjacent score clusters to face to be clustered, obtains the classification for including face;
Labeling module 305, the face not yet marked in obtained classification is clustered for marking cluster module 304.
In summary, face annotation equipment provided in an embodiment of the present invention, by obtaining any two in face database
Face distance between face, obtained according to the face distance in face database between face to be clustered and other faces and wait to gather
Neighbour's face of class face, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face;According to people to be clustered
Face distance and compound shared nearest neighbor score between face and neighbour's face cluster to face to be clustered, are included
The classification of face, the face not yet marked in mark classification;To being marked automatically with the face to be clustered in classification, solve
When prior art is marked manually to the face in picture, the problem of very big workload can be caused;Having reached can be to poly-
All faces not marked carry out unified mark in the classification that class obtains, and improve the effect for the efficiency being labeled to face.
Shown in Figure 4, it illustrates the structural representation of face annotation equipment in one embodiment of the invention.The people
Face mask method may be embodied to as the part in server or server, can also be implemented as the one of terminal or terminal
Part, the server said here are the server with storage album function or with storage human face data library facility, this
In the terminal said can be the equipment such as computer, mobile phone, electron album or multimedia television.The face annotation equipment can include
But it is not limited to:Face is apart from acquisition module 401, neighbour's face acquisition module 402, neighbour's score acquisition module 403, cluster module
404 and labeling module 405.
Face is apart from acquisition module 401, for obtaining the face distance in face database between any two face;
Neighbour's face acquisition module 402, for according to the people in face database between face to be clustered and other faces
Face distance obtains neighbour's face of face to be clustered;
Neighbour's score acquisition module 403, the compound shared nearest neighbor for calculating between face to be clustered and neighbour's face obtain
Point;
Cluster module 404, for according to the face distance between face to be clustered and neighbour's face and compound shared near
Adjacent score clusters to face to be clustered, obtains the classification for including face;
Labeling module 405, the face not yet marked in obtained classification is clustered for marking cluster module 404.
Preferably, face can include apart from acquisition module 401:High dimensional feature acquiring unit 401a and face distance obtain
Unit 401b.
High dimensional feature acquiring unit 401a, can be used for obtain face database in each respective high dimensional feature of face to
Amount;
Face distance acquiring unit 401b, it can be used for obtaining according to the face range formula of high dimensional feature vector correlation
Face distance in face database between any two face.
Face range formula can be:
Wherein, fijFace distance between face i and face j, fijValue belong to section [- 1,1], NdFor face
The dimension of high dimensional feature vector,For face i high dimensional feature vector d-th of component,For face j high dimensional feature vector
D-th of component.
Preferably, neighbour's face acquisition module 402 can include:Searching unit 402a, sequencing unit 402b and neighbour people
Face acquiring unit 402c.
Searching unit 402a, the face distance that can be used for searching between face to be clustered are less than the people of predetermined threshold
Face;
Sequencing unit 402b, it can be used for the face found according to the order of face distance from small to large to searching unit
It is ranked up;
Neighbour face acquiring unit 402c, it can be used for the m people that ranking is most preceding in the ranking results of acquisition sequencing unit
Neighbour face of the face as face to be clustered.
Preferably, the face annotation equipment can also include:Index establishes module 406.
Index establishes module 406, can be used for according to the respective high dimensional feature vector of each face in face database
All faces establish index;
Corresponding, searching unit 402a can be also used for:According to the face distance between index search and face to be clustered
Less than the face of predetermined threshold.
Preferably, neighbour's score acquisition module 403, can be also used for:
When neighbour's face is face to be clustered, people to be clustered is calculated according to the first compound shared nearest neighbor score formula
Compound shared nearest neighbor score between face and neighbour's face;
The formula of the first compound shared nearest neighbor score is:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K is people to be clustered
Face i neighbour's face sum, ikFor face i to be clustered k-th of neighbour's face, jk'For neighbour's face j kth ' individual neighbour people
Face, δkk'For for state face i to be clustered neighbour's face with neighbour's face j neighbour's face whether containing identical face
Jump function, k are less than or equal to m, and k' is less than or equal to m.
Preferably, neighbour's score acquisition module 403, can be also used for:
When neighbour's face is the face marked, calculated according to second of compound shared nearest neighbor score formula to be clustered
Compound shared nearest neighbor score between face and neighbour's face;
Second of compound shared nearest neighbor score formula be:
Wherein, SnnScoreijFor face i to be clustered and neighbour's face j compound shared nearest neighbor score, K is people to be clustered
Face i neighbour's face sum, ikFor face i to be clustered k-th of neighbour's face, CjFor the classification belonging to neighbour's face j, k is less than
Or equal to m.
Preferably, cluster module 404 can include:First detection unit 404a, the second detection unit 404b, displacement unit
404c, combining unit 404d and taxon 404e.
First detection unit 404a, it can be used for detecting face i to be clustered and neighbour's face i0Between face distance
Whether default face distance threshold D is less thanTAnd face i to be clustered and neighbour's face i0Between compound shared nearest neighbor scoreWhether default compound shared nearest neighbor score threshold S is more thanT;
Second detection unit 404b, can be used for be in the first detection unit 404a testing resultLess than DTAndMore than STWhen, detect neighbour's face i0With neighbour's face i0Neighbour's face i00Between face distanceWhether
It is less thanAnd neighbour's face i0With neighbour's face i00Between compound shared nearest neighbor scoreWhether it is more than or equal to
Replace unit 404c, can be used for be in the second detection unit 404b testing resultIt is less thanAndIt is more than or equal toWhen, put i=i0, i0=i00,
Perform detectionWhether D is less thanTAndWhether S is more thanTThe step of;
Combining unit 404d, can be used for be in the second detection unit 404b testing resultIt is more thanOrIt is less thanWhen, merge face i and neighbour's face i to be clustered0For same category;
Taxon 404e, can be used for be in the first detection unit 404b testing resultMore than DTOrLess than STWhen, by face i to be clustered and neighbour's face i0Different classifications are designated as, if neighbour's face i0There is affiliated classification
Number, then distribute a new classification number for face i.
Preferably, labeling module 405 can include:First mark unit 405a and the second mark unit 405b.
First mark unit 405a, it can be used for when the face with markup information in classification be present, then basis
Markup information is labeled to the face to be clustered in classification;
Second mark unit 405b, can be used for when classification in all faces do not mark it is out-of-date, then according to specify mark
Information carries out unified mark to all faces in classification.
In summary, face annotation equipment provided in an embodiment of the present invention, by obtaining any two in face database
Face distance between face, obtained according to the face distance in face database between face to be clustered and other faces and wait to gather
Neighbour's face of class face, calculate the compound shared nearest neighbor score between face to be clustered and neighbour's face;According to people to be clustered
Face distance and compound shared nearest neighbor score between face and neighbour's face cluster to face to be clustered, are included
The classification of face, the face not yet marked in mark classification;To being marked automatically with the face to be clustered in classification, solve
When prior art is marked manually to the face in picture, the problem of very big workload can be caused;Having reached can be to poly-
All faces not marked carry out unified mark in the classification that class obtains, and improve the effect for the efficiency being labeled to face.
It should be noted that:Above-described embodiment provide face annotation equipment carry out face cluster and mark when, only with
The division progress of above-mentioned each functional module, can be as needed and by above-mentioned function distribution by not for example, in practical application
Same functional module is completed, i.e., the internal structure of equipment is divided into different functional modules, to complete whole described above
Or partial function.In addition, the face annotation equipment that above-described embodiment provides belongs to same structure with face mask method embodiment
Think, its specific implementation process refers to embodiment of the method, repeated no more here.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment
To complete, by program the hardware of correlation can also be instructed to complete, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.