Face clustering method, device and electronic device based on graph convolution
Through the face clustering method based on graph convolution, K nearest neighbor graphs are constructed and density prediction is used to predict the graph convolution network, which solves the problems of low efficiency and insufficient accuracy of face clustering in the existing technology, and achieves more efficient and Accurate face clustering.
Patent Information
- Application Number
- CN202111672130.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing face clustering methods are inefficient and insufficiently accurate, especially when dealing with real data sets of complex clustering structures. Traditional methods rely on specific assumptions, and deep learning methods require the construction of a large number of subgraphs to affect efficiency.
Using the face clustering method based on graph convolution, the K nearest neighbor graph is constructed, and density prediction is used to construct independent face clusters, and refine and merge, to improve the efficiency and accuracy of the clustering algorithm. .
The operation efficiency and accuracy of the face clustering algorithm are improved, the need to build additional subgraphs is avoided, and the processing capability of complex clustering structures is enhanced.
Smart Images

Figure CN114333028B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of face clustering, and in particular to a face clustering method and device based on graph convolution. Background Art
[0002] In recent years, with the rapid development of face detection and face recognition technology, face images can be obtained more quickly from the Internet or surveillance cameras. For a large number of unlabeled face images, manual grouping is costly and prone to grouping errors, so there is a need for automatic grouping of face images. Face clustering is a practical tool with a wide range of applications. It can automatically classify and group a large amount of unlabeled face data, effectively saving the cost of data sorting.
[0003] Traditional clustering methods such as k-means (k-means clustering algorithm) and DBSCAN (Density-Based Spatial Clustering of Applications) rely on specific assumptions, lack the ability to handle complex clustering structures of real data sets, and have low clustering accuracy. Clustering methods based on deep learning usually require the construction of a large number of subgraphs to achieve connection prediction between nodes, which seriously affects the efficiency of clustering. Summary of the invention
[0004] The purpose of the present invention is to provide a face clustering method, device and electronic device based on graph convolution to improve the operating efficiency and accuracy of the clustering algorithm.
[0005] In a first aspect, an embodiment of the present invention provides a face clustering method based on graph convolution, comprising:
[0006] Acquire multiple face data to be clustered, and extract face features of the multiple face data to be clustered;
[0007] Constructing a first K nearest neighbor graph based on the facial features of the face data to be clustered, wherein the first K nearest neighbor graph includes a plurality of nodes, and there is a connection strength between the plurality of nodes;
[0008] Inputting the first K nearest neighbor graph into a trained graph convolutional network to obtain a density prediction value of each of the nodes in the first K nearest neighbor graph;
[0009] The node with the low predicted density value is connected in a directed manner to the node with the high predicted density value and the maximum connection strength to construct a plurality of independent face clusters.
[0010] Further, after the step of connecting the node with the low density prediction value to the node with the high density prediction value and the maximum connection strength in a directed manner to construct a plurality of independent face clusters, the method further includes:
[0011] Refining the multiple independent face clusters and filtering abnormal nodes in the multiple independent face clusters;
[0012] The distance between the abnormal node and the center of other face clusters is calculated, and the face cluster with the closest distance is selected for merging to obtain an optimized face cluster.
[0013] Furthermore, before the step of obtaining a plurality of face data to be clustered and extracting face features of the plurality of face data to be processed, the method further includes:
[0014] Determine a face clustering data set, and extract face features of each face sample in the face clustering data set;
[0015] Construct a second K nearest neighbor graph based on the facial features of the face samples;
[0016] The initial graph convolutional network is trained based on the second K nearest neighbor graph, the face clustering data set and a preset loss function to obtain a trained graph convolutional network.
[0017] Furthermore, the preset loss function L is determined based on the following formula:
[0018]
[0019] Where N represents the number of nodes input to the graph convolutional network; y i and y′ i They respectively represent the density value of the i-th node predicted by the graph convolutional network and the label value of the node.
[0020] Furthermore, the connection strength is determined based on the cosine similarity between the nodes; wherein the cosine similarity between two nodes is determined based on the following known determination:
[0021]
[0022] Among them, θ represents the vector angle, and A and B represent two nodes.
[0023] Furthermore, the trained graph convolutional network is based on section x i The sum of the cosine similarities between the point and its directly connected nodes, the sum of the connection strengths between the directly connected nodes and their indirectly connected nodes, and the sum of the cosine similarities between the point and its directly connected nodes. i The sum of the connection strengths with other cluster nodes is fused to obtain node x i The density value of the node x iis any node in the first K nearest neighbor graph.
[0024] Further, the density prediction value ρ of the node is calculated by the following formula: i ′:
[0025]
[0026] Among them, l d Indicates the connection strength between a node and its directly connected nodes; l i Indicates the connection strength between directly connected nodes and indirectly adjacent nodes; l e Represents node x i The connection strength with other nodes; N, M and Z represent the connection strength of node x i The number of directly connected nodes, the number of indirectly connected nodes, and the number of nodes x in the K nearest neighbor graph i The number of nodes connected to other nodes; k is the scaling factor.
[0027] In a second aspect, an embodiment of the present invention further provides a face clustering device based on graph convolution, comprising:
[0028] An acquisition module is used to acquire multiple face data to be clustered;
[0029] A feature extraction module, used for extracting facial features of the plurality of clustered facial data to be processed;
[0030] A first construction module is used to construct a first K nearest neighbor graph based on the facial features, wherein the first K nearest neighbor graph includes a plurality of nodes, and there is a connection strength between the plurality of nodes;
[0031] A prediction module, used for inputting the first K nearest neighbor graph into a pre-trained graph convolutional network to obtain a density prediction value of each of the nodes in the first K nearest neighbor graph;
[0032] The second construction module is used to connect the node with the low density prediction value with the node with the high density prediction value and the maximum connection strength in a directed manner to construct multiple independent face clusters.
[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method of the first aspect when executing the computer program.
[0034] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect is executed.
[0035] The embodiment of the present invention provides a face clustering method, device, electronic device and storage medium based on graph convolution, which obtains multiple face data to be clustered, extracts face features of multiple face data to be clustered, and constructs a first K nearest neighbor graph based on face features, wherein the first K nearest neighbor graph includes multiple nodes, and there is connection strength between multiple nodes. The first K nearest neighbor graph is input into a trained graph convolution network to obtain the density prediction value of each node in the first K nearest neighbor graph, and nodes with low density prediction values are directed connected to nodes with high density prediction values and the greatest connection strength to construct multiple independent face clusters. This method, which combines a graph convolutional neural network and a clustering algorithm based on density prediction values, does not require additional construction of subgraphs, and effectively improves the operating efficiency and accuracy of the clustering algorithm compared to existing methods.
[0036] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0037] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a flow chart of a face clustering method based on graph convolution provided in an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of the structure of a face clustering device based on graph convolution provided by an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Face clustering is a practical tool with wide applications. It can automatically classify and group a large amount of unlabeled face data, effectively saving the cost of data sorting. Existing methods are mainly divided into traditional clustering algorithms and face clustering algorithms based on deep learning. In traditional clustering algorithms, the k-means algorithm requires manual setting of the number of clusters, and then distributes data samples to each cluster. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) determines whether two nodes belong to the same cluster based on the set neighborhood radius and the number of core points in the neighborhood. Based on this, a face clustering method based on graph convolution is provided in an embodiment of the present invention, which combines a graph convolutional neural network and a density-based clustering algorithm. It does not require additional subgraph construction, and effectively improves the operating efficiency and accuracy of the clustering algorithm.
[0044] To facilitate understanding of this embodiment, a face clustering method based on graph convolution disclosed in an embodiment of the present invention is first introduced in detail.
[0045] The embodiment of the present invention provides a face clustering method based on graph convolution, which can be executed by an electronic device with image processing capability and is suitable for automatically grouping face images. Figure 1 The flowchart of a face clustering method based on graph convolution is shown in FIG. 1 , in which the method sequentially performs the face image clustering processing shown in steps S102 to S105 on a plurality of face image data to be clustered, and obtains a face clustering result:
[0046] Step S102, obtaining a plurality of face data to be clustered, and extracting face features of the plurality of face data to be clustered;
[0047] In some possible embodiments of the present invention, the multiple face data to be clustered are multiple face images containing facial features. In the embodiments of the present invention, the features of the face images are represented by feature vectors, and the dimension of the face feature vectors can be 256 dimensions.
[0048] In an optional embodiment, before the step of obtaining multiple face data to be clustered and extracting facial features of the multiple face data to be clustered, it also includes: determining a face clustering data set, extracting facial features of each face sample in the face clustering data set, constructing a second K nearest neighbor graph based on the facial features of the face samples, and training the initial graph convolutional network based on the second K nearest neighbor graph, the face clustering data set and a preset loss function to obtain a trained graph convolutional network.
[0049] In the embodiment of the present invention, the face clustering data set is composed of face samples with labels, and the face feature vector of each face sample is extracted using the face recognition model ArcFace, and a second K nearest neighbor graph is constructed based on the extracted feature vector. The second K nearest neighbor graph is constructed by connecting each face sample with several face samples with the highest cosine similarity to the sample. The purpose of collecting labeled face samples and constructing the second K nearest neighbor graph is to train the graph convolution network, and apply the trained graph convolution network to the generation of face clustering results.
[0050] Step S103, constructing a first K nearest neighbor graph based on the facial features, wherein the first K nearest neighbor graph includes a plurality of nodes, and there is connection strength between the plurality of nodes.
[0051] In an embodiment of the present invention, the first K nearest neighbor graph is constructed by extracting feature vectors from a large amount of facial data, in the same way as the second K nearest neighbor graph constructed based on samples, by connecting multiple facial data with the highest cosine similarity. There is a connection strength between each node, and the connection strength is the value of the cosine similarity between two nodes.
[0052] Step S104: input the first K nearest neighbor graph into a pre-trained graph convolutional network to obtain a density prediction value of each node in the first K nearest neighbor graph.
[0053] The first K nearest neighbor graph is input into the trained graph convolutional network. The trained graph convolutional network is obtained by training the initial graph convolutional network based on the second K nearest neighbor graph, the face clustering dataset and the preset loss function. The number of nodes and the connection strength of the nodes are input into the trained graph convolutional network to obtain the density prediction value of each node.
[0054] In some optional embodiments, the preset loss function L is determined based on the following formula:
[0055]
[0056] Where N represents the number of nodes input to the graph convolutional network; y i and y′ i They represent the density value of the i-th node predicted by the graph convolutional network and the label value of the node respectively. After obtaining the loss function, the initial graph convolutional network is trained through the loss function, the second K nearest neighbor graph, and the face clustering dataset.
[0057] In some optional embodiments, the connection strength is determined based on the cosine similarity between nodes, wherein the cosine similarity between two nodes is determined based on the following known determination:
[0058]
[0059] Among them, θ represents the vector angle, and A and B represent two nodes.
[0060] In the embodiment of the present invention, the cosine similarity between two nodes represents the connection strength between the two nodes, and the connection strength between the two nodes is obtained to connect the node with a low density prediction value to the node with a high density prediction value and the largest connection strength in a directed manner to construct multiple independent face clusters. The density prediction value is obtained by fusion calculation of the connection strength between the nodes.
[0061] In an optional embodiment, the trained graph convolutional network is based on the node x i The sum of the cosine similarities between the point and its directly connected nodes, the sum of the connection strengths between the directly connected nodes and their indirectly connected nodes, and the sum of the cosine similarities between the point and its directly connected nodes. i The sum of the connection strengths with other cluster nodes is fused to obtain node x i The density value of the node x i is any node in the first K nearest neighbor graph.
[0062] Among them, section x i The sum of the cosine similarities between the point and its directly connected nodes, the sum of the connection strengths between the directly connected nodes and their indirectly connected nodes, and the sum of the cosine similarities between the point and its directly connected nodes. i The sum of the connection strengths with other cluster nodes is calculated separately for the three parts. For example, the number of directly connected nodes is n, and the number of nodes indirectly connected to the directly connected nodes is also n. i The node x is calculated by summing the connection strengths of 2n+m with the nodes in other clusters as m. i The density value of .
[0063] In an optional embodiment, the density prediction value ρ of the node is calculated by the following formula: i ′:
[0064]
[0065] Among them, l d Indicates the connection strength between a node and its directly connected nodes; l i Indicates the connection strength between directly connected nodes and indirectly adjacent nodes; l e Represents node x i The connection strength with other nodes; N, M and Z represent the connection strength of node x i The number of directly connected nodes, the number of indirectly connected nodes, and the number of nodes x in the first K nearest neighbor graph i The number of nodes connected to other nodes; k is the scaling factor.
[0066] Section x iThe sum of the cosine similarities between the point and its directly connected nodes, the sum of the connection strengths between the directly connected nodes and their indirectly connected nodes, and the sum of the cosine similarities between the point and its directly connected nodes. i The sum of the connection strengths with other cluster nodes is substituted into the density prediction value calculation formula to obtain the node density prediction value in the constructed first K nearest neighbor graph. The node density prediction value is used to construct multiple independent face clusters.
[0067] Step S105 , connecting the nodes with low predicted density values to the nodes with high predicted density values and the largest connection strength in a directed manner, so as to construct a plurality of independent face clusters.
[0068] By obtaining the density prediction value of each node, for example, for node x, first find all nodes with a higher density prediction value than node x, then select the node with the strongest connection strength with node x for directed connection, and construct multiple independent face clusters through the directed connection of multiple nodes.
[0069] In some possible embodiments, after the step of connecting nodes with low predicted density values to nodes with high predicted density values and the greatest connection strength to construct multiple independent face clusters, the following steps are included:
[0070] Refine multiple independent face clusters, filter out abnormal nodes in multiple independent face clusters, calculate the distance between the abnormal nodes and the centers of other face clusters, select the closest face clusters for merging, and obtain optimized face clusters.
[0071] In the embodiment of the present invention, multiple independent face clusters are refined using the DBSCAN algorithm. DBSCAN is a density-based clustering algorithm. This type of density clustering algorithm generally assumes that the category can be determined by the density of sample distribution. Samples of the same category are closely connected, that is, there must be samples of the same category not far away from any sample of the category. By classifying closely connected samples into one category, a cluster category is obtained. By classifying all groups of closely connected samples into different categories, the final results of all cluster categories are obtained. When the number of nodes in the face cluster is greater than 3, the face cluster is filtered. First, each node in each cluster is used as the center point of the circle, and a circle with the parameter EPS as the radius is drawn. If the number of nodes in the circle is greater than or equal to the parameter MinPts, the point can be used as a core point. Among them, EPS = 0.6, MinPts = 3, the parameters are selected based on experience, and if there is another core point in the circle of a core point, the two points are connected. At the same time, the non-core points in the circle are connected to the core point with the closest cosine distance as the boundary point. Finally, the points that can be connected together are formed into a cluster. If a point is not in this cluster, it is an abnormal point. The cosine distance between the abnormal node and the center of other face clusters is calculated, and the cluster with the closest distance is selected for merging to finally obtain the face clustering result.
[0072] The embodiment of the present invention provides a face clustering method based on graph convolution, which obtains multiple face data to be clustered, extracts face features of multiple face data to be processed, and constructs a first K nearest neighbor graph based on face features, wherein the first K nearest neighbor graph includes multiple nodes, and there is connection strength between the multiple nodes. The first K nearest neighbor graph is input into a pre-trained graph convolution network to obtain the density prediction value of each node in the first K nearest neighbor graph, and nodes with low density prediction values are directed connected to nodes with high density prediction values and the greatest connection strength to construct multiple independent face clusters. This method, which combines a graph convolutional neural network and a clustering algorithm based on density prediction values, does not require additional subgraph construction, and effectively improves the operating efficiency and accuracy of the clustering algorithm compared to existing methods.
[0073] Corresponding to the above-mentioned face clustering method based on graph convolution, the embodiment of the present invention further provides a face clustering device based on graph convolution, see Figure 2 A structural schematic diagram of a face clustering device based on graph convolution is shown, and the device includes:
[0074] An acquisition module 2001 is used to acquire a plurality of face data to be clustered;
[0075] A feature extraction module 2002 is used to extract facial features of a plurality of clustered facial data to be processed;
[0076] A first construction module 2003 is used to construct a first K nearest neighbor graph based on facial features, wherein the first K nearest neighbor graph includes a plurality of nodes, and there is a connection strength between the plurality of nodes;
[0077] Prediction module 2004, used to input the first K nearest neighbor graph into a pre-trained graph convolutional network to obtain a density prediction value of each node in the first K nearest neighbor graph;
[0078] The second construction module 2005 is used to connect the nodes with low density prediction values to the nodes with high density prediction values and the largest connection strength in a directed manner to construct multiple independent face clusters.
[0079] The embodiment of the present invention provides a face clustering device based on graph convolution, which obtains multiple face data to be clustered, extracts face features of multiple face data to be processed, and constructs a first K nearest neighbor graph based on face features, wherein the first K nearest neighbor graph includes multiple nodes, and there is connection strength between the multiple nodes. The first K nearest neighbor graph is input into a pre-trained graph convolution network to obtain the density prediction value of each node in the first K nearest neighbor graph, and nodes with low density prediction values are directed connected to nodes with high density prediction values and the greatest connection strength to construct multiple independent face clusters. This method, which combines a graph convolutional neural network and a clustering algorithm based on density prediction values, does not require additional construction of subgraphs, and effectively improves the operating efficiency and accuracy of the clustering algorithm compared to existing methods.
[0080] The implementation principle and technical effects of the device provided in this embodiment are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0081] See also Figure 3 An embodiment of the present invention further provides an electronic device 100, including: a processor 1100, a memory 1101, a bus 1102 and a communication interface 1103, wherein the processor 1100, the communication interface 1103 and the memory 1101 are connected via the bus 1102; the processor 1100 is used to execute an executable module stored in the memory 1101, such as a computer program.
[0082] The memory 1101 may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 1103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0083] The bus 1102 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0084] Among them, the memory 1101 is used to store programs, and the processor 1100 executes the program after receiving the execution instruction. The method executed by the process definition device disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 1100, or implemented by the processor 1100.
[0085] The processor 1100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1100. The above processor 1100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1101, and the processor 1100 reads the information in the memory 1101 and completes the steps of the above method in combination with its hardware.
[0086] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for suppressing noise in seismic images described in the above method embodiment is executed. The computer-readable storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk, or an optical disk, and other media that can store program codes.
[0087] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.
[0088] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0090] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0091] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A face clustering method based on graph convolution, characterized in that: include: Acquire multiple face data to be clustered, and extract face features of the multiple face data to be clustered; Constructing a first K nearest neighbor graph based on the facial features of the face data to be clustered, wherein the first K nearest neighbor graph includes a plurality of nodes, and there is a connection strength between the plurality of nodes; The first K nearest neighbor graph is input into the trained graph convolutional network to obtain the density prediction value of each node in the first K nearest neighbor graph; wherein the trained graph convolutional network is based on the node The sum of the cosine similarities between the point and its directly connected nodes, the sum of the connection strengths between the directly connected nodes and their indirectly connected nodes, and the sum of the cosine similarities between the point and its directly connected nodes. The sum of the connection strengths with other cluster nodes is merged to obtain the node The density value of the node is any node in the first K nearest neighbor graph; Directly connect the node with the low predicted density value to the node with the high predicted density value and the largest connection strength to construct a plurality of independent face clusters; The step of connecting the node with the low predicted density value to the node with the high predicted density value and the maximum connection strength in a directed manner to construct a plurality of independent face clusters includes: For each node, find all nodes with higher density prediction values than this node, select the node with the strongest connection strength with this node for directed connection, and build multiple independent face clusters through directed connections of multiple nodes.
2. The face clustering method based on graph convolution according to claim 1, characterized in that: After the step of connecting the node with the low density prediction value to the node with the high density prediction value and the maximum connection strength in a directed manner to construct a plurality of independent face clusters, the method further includes: Refining the multiple independent face clusters and filtering abnormal nodes in the multiple independent face clusters; The distance between the abnormal node and the center of other face clusters is calculated, and the face cluster with the closest distance is selected for merging to obtain an optimized face cluster.
3. The face clustering method based on graph convolution according to claim 1, characterized in that: Before the step of obtaining a plurality of face data to be clustered and extracting face features of the plurality of face data to be clustered, the method further includes: Determine a face clustering data set, and extract the face features of each face sample in the face clustering data set; Construct a second K nearest neighbor graph based on the facial features of the face samples; The initial graph convolutional network is trained based on the second K nearest neighbor graph, the face clustering data set and a preset loss function to obtain a trained graph convolutional network.
4. The face clustering method based on graph convolution according to claim 3, characterized in that: The preset loss function L is determined based on the following formula: in, represents the number of nodes input to the graph convolutional network, and They represent the first The density value of a node and the label value of the node.
5. The face clustering method based on graph convolution according to claim 1, characterized in that: The connection strength is determined based on the cosine similarity between nodes; the cosine similarity between two nodes is Determined based on the following common knowledge: in, represents the vector angle, A. B Represents two nodes.
6. The face clustering method based on graph convolution according to claim 1, characterized in that: The density prediction value of the node is calculated by the following formula: : in, Indicates the connection strength between a node and directly connected nodes; Indicates the connection strength between directly connected nodes and indirectly adjacent nodes; Representation Node The strength of connections with other nodes; , and Respectively represent nodes The number of directly connected nodes, the number of connections from directly connected nodes to indirectly connected nodes, and the number of nodes in the K-nearest neighbor graph The number of nodes connected to other nodes; is the adjustment factor.
7. A face clustering device based on graph convolution, characterized in that: include: An acquisition module is used to acquire multiple face data to be clustered; A feature extraction module, used to extract facial features of the plurality of facial data to be clustered; A first construction module is used to construct a first K nearest neighbor graph based on the facial features, wherein the first K nearest neighbor graph includes a plurality of nodes, and there is a connection strength between the plurality of nodes; The prediction module inputs the first K nearest neighbor graph into the trained graph convolutional network to obtain the density prediction value of each node in the first K nearest neighbor graph; wherein the trained graph convolutional network is based on the node The sum of the cosine similarities between the point and its directly connected nodes, the sum of the connection strengths between the directly connected nodes and their indirectly connected nodes, and the sum of the cosine similarities between the point and its directly connected nodes. The sum of the connection strengths with other cluster nodes is merged to obtain the node The density value of the node is any node in the first K nearest neighbor graph; A second construction module is used to connect the node with a low density prediction value to the node with a high density prediction value and the largest connection strength in a directed manner to construct a plurality of independent face clusters; The second construction module is specifically used to: for each node, find all nodes whose density prediction values are higher than that of the node, select the node with the strongest connection strength with the node for directed connection, and build multiple independent face clusters through the directed connection of multiple nodes.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is performed.
Citation Information
Patent Citations
Neural image classification method, computer terminal and computer readable storage medium
CN110111325A
Image clustering method, device and equipment and storage medium
CN111291827A