A face clustering method based on link prediction
Through the face clustering method based on link prediction, graph convolution network and isolated point merging technology are used to solve the problem of poor accuracy and efficiency of existing face clustering methods in large-scale data processing, achieving faster and Accurate face clustering results.
Patent Information
- Application Number
- CN202010721776.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-07-24
AI Technical Summary
Existing face clustering methods suffer from poor accuracy and efficiency in large-scale data processing, and too many generated subgraphs lead to high redundant computational costs, and heuristic steps that rely on simple assumptions limit the upper limit of performance.
A face clustering method based on link prediction is adopted. By constructing a face relationship graph, using a graph convolution network for prediction, iteratively updating the neighbor list, reducing the number of subgraphs and improving clustering accuracy, and combining with isolated point merging and adjustment to obtain the final clustering. class result.
It improves the speed and accuracy of face clustering, reduces redundant calculations, achieves more accurate clustering results, reduces the number of subgraphs, and improves processing efficiency.
Smart Images

Figure CN112101086B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision, and in particular relates to a method for realizing face clustering and recognition by applying deep learning. Background Art
[0002] Face clustering is an important tool for mining unlabeled face data, and has a wide range of applications in face annotation and retrieval. With the increasing amount of facial data, it is becoming increasingly difficult to continue to expand the size of face datasets. Even manual annotation will inevitably introduce noise. Face clustering can greatly reduce the workload of data annotation and achieve automation, so it has a wide range of applications in life. The general process of face clustering is as follows: first, extract features from facial data through machine learning or deep learning methods, and then group facial data based on the extracted features and relationships. The goal of clustering is to give the same label to images of the same class, and different labels to images of different classes. Although many clustering technologies and products have achieved good results in face clustering, the problem of how to cluster facial data faster and more accurately on large-scale data remains unsolved.
[0003] Existing face clustering methods can be roughly divided into two categories, namely unsupervised methods and supervised methods. Unsupervised methods, such as K-Means ("Stuart Lloyd. Least squares quantization in PCM. IEEE transactions on information theory, 28 (2): 129–137, 1982. 1, 6") and DBSCAN ("Martin Ester, Hans-Peter Kriegel, J¨org Sander, Xiaowei Xu, et al. A density-based algorithm for discovering clusters in large spatial databases with noise. In KDD, 1996. 1, 2, 6, 7"), rely on specific assumptions, resulting in their lack of ability to handle the complex clustering structure of real data sets. In order to improve the adaptability to different data, supervised clustering methods are proposed to learn clustering patterns in “Zhongdao Wang, Liang Zheng, Yali Li, and Shengjin Wang. Linkage based face clustering via graph convolution network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1117–1125, 2019. 1, 2, 4, 5, 6” and “Lei Yang, Xiaohang Zhan, Dapeng Chen, Junjie Yan, Chen Change Loy, and Dahua Lin. Learning to cluster faces on anaffinitygraph. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2298–2306, 2019. 1, 2, 5, 6, 7”. However, these methods are not satisfactory in terms of accuracy or efficiency. At the same time, in order to complete the task of clustering large-scale face data, existing methods generally generate many subgraphs for data, which will lead to two major problems. First, processing subgraphs involves heuristic steps based on simple assumptions. Both subgraph generation and prediction aggregation rely on heuristic procedures, thus limiting their performance upper bounds.Moreover, the subgraphs required by these methods are usually highly overlapping, resulting in excessive redundant computational costs.
[0004] Therefore, in the process of processing face images, we seek an algorithm that can learn clustering more accurately and effectively. For higher accuracy, we hope that all parameters in the structure can be learned, and the parameters can be better learned by changing the link values in the graph. On the other hand, in order to reduce redundant calculations, we intend to reduce the number of required subgraphs. Summary of the invention
[0005] The purpose of the present invention is to provide a face clustering method based on link prediction to improve the speed and accuracy of clustering.
[0006] To achieve the above object, the present invention adopts the following technical solution:
[0007] A face clustering method based on link prediction comprises the following steps:
[0008] Step 1: Select a face image database, pre-process the face images in the database, then extract the features of a single face image, and obtain a neighbor relationship list of the single face image;
[0009] Step 2: construct a face relationship graph, and construct a local subgraph for each face according to the neighbor relationship list and features of the single face image obtained in step 1, to obtain a face relationship local subgraph set;
[0010] Step 3: Link prediction: The local subgraph set of face relationship obtained in step 2 is input into the graph convolutional network for prediction, and the relationship between nodes is predicted through the linear layer to obtain the modified neighbor list. Through continuous updating and iteration, it is finally determined whether the node is connected to the center to achieve the purpose of node division and obtain the node clustering result.
[0011] Step 4: Based on the obtained clustering results, select clusters with isolated points for merging and adjustment to obtain the final clustering results.
[0012] In the step 1, the face images in the database are preprocessed by using the SeetaFace face recognition engine to extract and correct the face images from the pictures in the database.
[0013] In the step 1, the facial features F of the face image are extracted by a deep convolutional neural network. n ={f i |f i =g(x i ),x i∈X}, where n represents the dimension of facial feature extraction, g(·) represents the CNN network that extracts the features, X represents the face image set, and x i Represents the i-th face image; uses the facial features F of the extracted face image n , calculate the similarity, and finally get the k-nearest neighbor relationship list of each face image. Define C(·) as the neighbor list C of a face image in the face image set X. Then face image x i The neighbor list of Among them, k represents the current face image x i The maximum number of nearest neighbors.
[0014] In the step 2, the neighbor relationship list C(x i ), connect the face data into a graph G, and construct a face relationship graph from the graph G. The steps of constructing the relationship graph include:
[0015] (1) Constructing the central node: First, define the number of active nodes μ, which represents the first μ nodes in the neighbor relationship list. Then, for a node x i , if it has been visited, continue to look for the central subgraph of the next node, if it has not been visited, then x i The neighbor list C(x i ) and determine whether there is a complete graph relationship between these nodes. If so, then this graph constitutes a central subgraph. If it does not exist, then this node itself constitutes a central subgraph Repeat the above process to search for each node x in graph G i The complete graph Finally, we get the set of central subgraphs
[0016] (2) Add other neighboring nodes: Through the obtained central subgraph set G c , each central subgraph as the center of the subgraph, and then from Select some nodes from the neighbor relationship list of the nodes in the face relationship graph to build the face relationship graph; filter the nodes in several neighbor lists according to the order of the nodes in the neighbor list and the differences between the features, and select some nodes to generate the following The subgraph centered
[0017] First, the central node subgraph We use p to represent the current subgraph. The number of nodes in the subgraph Each node in this way gets a new neighbor list The number of nodes is k·p; for each node, calculate the The distance between The definition is as follows:
[0018]
[0019] Among them, p represents the number of nodes in the central subgraph, and j represents the current subgraph is the central subgraph set G c The number of subgraphs in the graph, k represents the number of subgraphs in the graph For each face image x i The original neighbor list C(x i ) in the graph; v represents the central subgraph A node in Indicates that in the new neighbor list C(x i ) p The mth node, represents v and Are there links between these two points in the original neighbor list? If so, Equal to 1, if not present, equals 0, f v and Represents node characteristics, represents f v The transpose of , and finally the inner product between the two vectors is calculated;
[0020] By sorting the obtained distances, a new neighbor relationship list is obtained, and C(x i ) is added to the central subgraph and the filtered nodes to obtain the final subgraph Finally, repeat the above steps to obtain the face relationship local subgraph set G s .
[0021] The step three is specifically as follows: first, based on the generated face relationship local subgraph set G s , each of which is a subgraph The structure of is expressed in the form of an adjacency matrix, denoted by A j , and also need to sub-graph The nodes and central subgraphs in Whether there is a link is represented by a 0-1 vector, denoted as q j , and then the subgraph Node features present in With the adjacency matrix A jInput graph convolutional network, the form is as follows:
[0022]
[0023] Among them, σ(·) represents the convolution operation, W represents the weight to be learned, Represents the features obtained at the tth and t+1th iterations;
[0024] Then according to the features obtained by iteration Use the mapping function g(·) to map this feature to the central subgraph Whether there is a link between them is predicted in the following form:
[0025]
[0026] The mapping function g(·) is composed of several linear layers. In order to learn the hidden attributes in the features, the features are finally classified and predicted. Part of it is related to the central subgraph. There are links between them, and some do not have links. It is a 0-1 vector indicating whether there is a link; To complete the adjacency matrix A j The update during the iteration process is as follows:
[0027]
[0028] in, Is The predicted adjacency matrix obtained, α is the calculation factor, used to calculate The difference between them is calculated as follows:
[0029]
[0030] Among them, q j is a representation subgraph The nodes and central subgraphs in Is there a linked 0-1 vector, so that a relatively accurate adjacency matrix can be obtained through continuous updating? The adjacency matrix is then updated and new Input for the next iteration.
[0031] In the step 4, isolated points are found to form clusters, the distance between them and each cluster is calculated, and the clusters with the closest distance are selected for merging to obtain the final clustering result.
[0032] Beneficial effects: Different from some traditional face clustering methods, the present invention proposes innovations in two aspects. On the one hand, by expanding the triangular constraints to obtain the complete graph relationship between multiple fixed points, the number of subgraphs to be input in the prediction process is reduced. On the other hand, the present invention iteratively modifies the adjacency matrix in the graph convolution through prediction, so as to obtain more accurate prediction results during the training process. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 For three nodes P in a graph i , P j , P k Schematic diagram of the four situations that exist. DETAILED DESCRIPTION
[0034] The present invention will be further explained below in conjunction with the accompanying drawings.
[0035] A face clustering method based on link prediction of the present invention comprises the following steps:
[0036] Step 1: Select a face image database and pre-process the face images in the database by using the SeetaFace face recognition engine to extract face images from the pictures in the database and correct them, then extract the features of a single face image and obtain a neighbor relationship list of a single face image; specifically:
[0037] Extract facial features of face images through deep convolutional neural network n ={f i |f i =g(x i ),x i ∈X}, where n represents the dimension of facial feature extraction, g(·) represents the CNN network that extracts the features, X represents the face image set, and x i Represents the i-th face image; uses the facial features F of the extracted face image n , calculate the similarity, and finally get the k-nearest neighbor relationship list of each face image. Define C(·) as the neighbor list C of a face image in the face image set X. Then face image x i The neighbor list of Among them, k represents the current face image x i The maximum number of nearest neighbors.
[0038] Step 2: construct a face relationship graph, and construct a local subgraph for each face according to the neighbor relationship list and features of the single face image obtained in step 1, to obtain a face relationship local subgraph set;
[0039] Through each face image neighbor relationship list C(x i), the face data can be connected into a graph G, but because the graph G contains too many nodes, it cannot be processed directly. Therefore, to build a face relationship graph from the graph G, the steps of building the relationship graph are mainly divided into the following two steps:
[0040] (1) Building a central node:
[0041] First, for three nodes P in a graph i , P j , P k There are four situations in total, such as Figure 1 As shown;
[0042] according to Figure 1 Analyze, analyze Figure 1 As can be seen from (a), if P i , P j , P k If there is a similarity relationship between the three points, then they can form a triangle. Figure 1 As can be seen from (b), if P i , P j , P k There is only a link between two points, that is, P i With P j , P j With P k Similar, but P i With P k If they are not similar, then such a relationship is not very reasonable; Figure 1 (c) and Figure 1 In (d), two other relationships are shown. Then, when the problem is extended to the relationship between m points, if there is a similarity relationship between these m points, a complete graph consisting of m points can be obtained.
[0043] Based on the above analysis, we first define the number of active nodes μ, which represents the first μ nodes in the neighbor relationship list. Then for a node x i , if it has been visited, continue to look for the central subgraph of the next node, if it has not been visited, then x i The neighbor list C(x i ) and determine whether there is a complete graph relationship between these nodes. If so, then this graph constitutes a central subgraph If it does not exist, then this node itself constitutes a central subgraph Repeat the above process to search for each node x in graph G i The complete graph Finally, we get the set of central subgraphs This will reorganize the nodes and reduce the number of nodes that need to be calculated.
[0044] (2) Add other neighboring nodes:
[0045] Through the obtained central subgraph set G c , each central subgraph as the center of the subgraph, and then from Select some nodes from the neighbor relationship list of the nodes in the face relationship graph to build the face relationship graph; filter the nodes in several neighbor lists according to the order of the nodes in the neighbor list and the differences between the features, and select some nodes to generate the following The subgraph centered
[0046] First, the central node subgraph We use p to represent the current subgraph. The number of nodes in the subgraph Each node in this way gets a new neighbor list The number of nodes is k·p; for each node, calculate the The distance between The definition is as follows:
[0047]
[0048] Among them, p represents the number of nodes in the central subgraph, and j represents the current subgraph is the central subgraph set G c The number of subgraphs in the graph, k represents the number of subgraphs in the graph For each face image x i The original neighbor list C(x i ) in the graph; v represents the central subgraph A node in Indicates that in the new neighbor list C(x i ) p The mth node, represents v and Are there links between these two points in the original neighbor list? If so, Equal to 1, if not present, equals 0, f v and Represents node characteristics, represents f v The transpose of , and finally the inner product between the two vectors is calculated;
[0049] By sorting the obtained distances, a new neighbor relationship list is obtained, and C(x i ) is added to the central subgraph and the filtered nodes to obtain the final subgraph Finally, repeat the above steps to obtain the face relationship local subgraph set G s .
[0050] Step 3: Link prediction, using the face relationship local subgraph set G obtained in step 2 s , input into the graph convolutional network for prediction, and predict the relationship between nodes through the linear layer to obtain the changed neighbor list. Through continuous updating and iteration, it is finally determined whether the node is connected to the center to achieve the purpose of node division and obtain the node clustering result;
[0051] Since too many layers of convolution may lead to overfitting problems, this paper chooses to use a four-layer graph convolutional network as the basis of the model. The specific process is as follows:
[0052] First, according to the generated face relationship local subgraph set G s , each of which is a subgraph The structure of is expressed in the form of an adjacency matrix, denoted by A j , and also need to sub-graph The nodes and central subgraphs in Whether there is a link is represented by a 0-1 vector, denoted as q j , and then the subgraph Node features present in With the adjacency matrix A j Input graph convolutional network, the form is as follows:
[0053]
[0054] Among them, σ(·) represents the convolution operation, W represents the weight to be learned, Represents the features obtained at the tth and t+1th iterations;
[0055] Then according to the features obtained by iteration Use the mapping function g(·) to map this feature to the central subgraph Whether there is a link between them is predicted in the following form:
[0056]
[0057] The mapping function g(·) is composed of several linear layers. In order to learn the hidden attributes in the features, the features are finally classified and predicted. Part of it is related to the central subgraph. There are links between them, and some do not have links. It is a 0-1 vector indicating whether there is a link; It is just a prediction result, and the accuracy cannot be guaranteed. The same adjacency matrix A i It is only a prediction result, and its accuracy cannot be guaranteed. To complete the adjacency matrix A j The update during the iteration process is as follows:
[0058]
[0059] in, Is The predicted adjacency matrix obtained, α is the calculation factor, used to calculate The difference between them is calculated as follows:
[0060]
[0061] Among them, q j is a representation subgraph The nodes and central subgraphs in Is there a linked 0-1 vector, so that a relatively accurate adjacency matrix can be obtained through continuous updating? The adjacency matrix is then updated and new Input for the next iteration.
[0062] Step 4: Merge links. After link prediction, we can determine the center Whether there is a connection, the clustering result is obtained, but some clusters in the result may be composed of isolated points; therefore, by finding isolated points to form clusters, calculating the distance between it and each cluster, and selecting the cluster with the closest distance to merge, the final clustering result is obtained.
[0063] In this embodiment, two face databases are selected, namely MS-Celeb-1M and IJB-B Dataset face detection data sets. For the extraction of facial features, the trained ArcFace model is used to extract facial features. The features extracted from the MS-Celeb-1M data set are then input into the defined model for training, with the purpose of fixing the parameters. The features extracted from the images in the IJB-B Dataset data set are then input into the trained model to obtain the clustered results, and finally the final result is obtained by processing the isolated points after clustering.
[0064] Face clustering can mine the information existing in unlabeled face data. Face clustering is an important tool that saves a lot of time and energy compared to manual labeling. In face clustering, unsupervised methods rely too much on specific assumptions, which may lead to large deviations when processing complex clustering structures of real data sets. However, in supervised clustering methods, subgraphs are too simple, and the large number of them leads to a lot of time spent in the process of learning clustering patterns. In the present invention, for multiple face images in a picture, the inherent attributes and features in the face images are extracted, and the triangular constraints are extended to multiple vertices according to the features and neighbor lists between the face images. A graph convolutional network is used to establish a model, and the adjacency matrix is modified in combination with various constraints. Fixed parameters are learned through iteration. Finally, tests are performed on different data sets, and clustering evaluation methods are used to evaluate the clustering effect. It is found through experiments that the method of the present invention not only has a high accuracy rate, but also a fast clustering process.
[0065] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A face clustering method based on link prediction, characterized in that: The steps include: Step 1: Select a face image database, pre-process the face images in the database, then extract the features of a single face image, and obtain a neighbor relationship list of the single face image; Step 2: construct a face relationship graph, and construct a local subgraph for each face according to the neighbor relationship list and features of the single face image obtained in step 1, to obtain a face relationship local subgraph set; In the step 2, the neighbor relationship list C(x i ), connect the face data into a graph G, and construct a face relationship graph from the graph G. The steps of constructing the relationship graph include: (1) Constructing the central node: First, define the number of active nodes μ, which represents the first μ nodes in the neighbor relationship list. Then, for a node x i , if it has been visited, continue to look for the central subgraph of the next node, if it has not been visited, then x i The neighbor list C(x i ) and determine whether there is a complete graph relationship between these nodes. If so, then this graph constitutes a central subgraph If it does not exist, then this node itself constitutes a central subgraph Repeat the above process to search for each node x in graph G i The complete graph Finally, we get the set of central subgraphs (2) Add other neighboring nodes: Through the obtained central subgraph set G c , each central subgraph as the center of the subgraph, and then from Select some nodes from the neighbor relationship list of the nodes in the face relationship graph to build the face relationship graph; filter the nodes in several neighbor lists according to the order of the nodes in the neighbor list and the differences between the features, and select some nodes to generate the following The subgraph centered First, the central node subgraph We use p to represent the current subgraph. The number of nodes in the subgraph Each node in this way gets a new neighbor list The number of nodes is k·p; for each node, calculate the The distance between The definition is as follows: Among them, p represents the number of nodes in the central subgraph, and j represents the current subgraph is the central subgraph set G c The number of subgraphs in the graph, k represents the number of subgraphs in the graph For each face image x i The original neighbor list C(x i ) in the graph; v represents the central subgraph A node in Indicates that in the new neighbor list C(x i ) p The mth node, represents v and Are there links between these two points in the original neighbor list? If so, Equal to 1, if not present, equals 0, f v and Represents node characteristics, represents f v The transpose of , and finally the inner product between the two vectors is calculated; By sorting the obtained distances, a new neighbor relationship list is obtained, and C(x i ) is added to the central subgraph and the filtered nodes to obtain the final subgraph Finally, repeat the above steps to obtain the face relationship local subgraph set G s ; Step 3: Link prediction: The local subgraph set of face relationship obtained in step 2 is input into the graph convolutional network for prediction, and the relationship between nodes is predicted through the linear layer to obtain the modified neighbor list. Through continuous updating and iteration, it is finally determined whether the node is connected to the center to achieve the purpose of node division and obtain the node clustering result. The step three is specifically as follows: first, based on the generated face relationship local subgraph set G s , each of which is a subgraph The structure of is expressed in the form of an adjacency matrix, denoted by A j , and also need to sub-graph The nodes and central subgraphs in Whether there is a link is represented by a 0-1 vector, denoted as q j , and then the subgraph Node features present in With the adjacency matrix A j Input graph convolutional network, the form is as follows: Among them, σ(·) represents the convolution operation, W represents the weight to be learned, Represents the features obtained at the tth and t+1th iterations; Then according to the features obtained by iteration Use the mapping function g(·) to map this feature to the central subgraph Whether there is a link between them is predicted in the following form: The mapping function g(·) is composed of several linear layers. In order to learn the hidden attributes in the features, the features are finally classified and predicted. Part of it is related to the central subgraph. There are links between them, and some do not have links. It is a 0-1 vector indicating whether there is a link; To complete the adjacency matrix A j The update during the iteration process is as follows: in, Is The predicted adjacency matrix obtained, α is the calculation factor, used to calculate The difference between them is calculated as follows: Among them, q j is a representation subgraph The nodes and central subgraphs in Is there a linked 0-1 vector, so that a relatively accurate adjacency matrix can be obtained through continuous updates The adjacency matrix is then updated and new Input for next iteration; Step 4: Based on the obtained clustering results, select clusters with isolated points for merging and adjustment to obtain the final clustering results.
2. The face clustering method based on link prediction according to claim 1, characterized in that: In the step 1, the face images in the database are preprocessed by using the SeetaFace face recognition engine to extract and correct the face images from the pictures in the database.
3. The face clustering method based on link prediction according to claim 1, characterized in that: In the step 1, the facial features F of the face image are extracted by a deep convolutional neural network. n ={f i |f i =g(x i ),x i ∈X}, where n represents the dimension of facial feature extraction, g(·) represents the CNN network that extracts the features, X represents the face image set, and x i Represents the i-th face image; uses the facial features F of the extracted face image n , calculate the similarity, and finally get the k-nearest neighbor relationship list of each face image. Define C(·) as the neighbor list C of a face image in the face image set X. Then face image x i The neighbor list of Among them, k represents the current face image x i The maximum number of nearest neighbors.
4. The face clustering method based on link prediction according to claim 1, characterized in that: In the step 4, isolated points are found to form clusters, the distance between them and each cluster is calculated, and the clusters with the closest distance are selected for merging to obtain the final clustering result.
