Human face clustering method and device based on structure perception

Through the face clustering method based on structure awareness, the convolutional neural network and the edge score prediction model are used to prune the K nearest neighbor graph, which solves the problem of insufficient clustering accuracy in large-scale face data sets and achieves a more efficient Face clustering.

CN112766421BActive Publication Date: 2024-09-24TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110272409.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-12
Publication Date
2024-09-24
Estimated Expiration
2041-03-12

AI Technical Summary

Technical Problem

In large-scale face data sets, the clustering accuracy of existing face clustering algorithms is insufficient, making it difficult to effectively reduce the labeling cost.

Method used

A face clustering method based on structure awareness is used to extract facial features through a convolutional neural network, construct a K-nearest neighbor graph, and use the structure-preserving subgraph sampling strategy to train an edge score prediction model, and perform the first pruning of the K-nearest neighbor graph. operation to improve clustering accuracy.

Benefits of technology

The accuracy of face clustering is significantly improved, and accurate face features and internal and external relationships between clusters are obtained through deep learning technology, achieving more accurate face clustering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112766421B
    Figure CN112766421B
Patent Text Reader

Abstract

The present application proposes a method and device for face clustering based on structure perception, wherein the method comprises: obtaining a plurality of face images to be processed, extracting the face features of each face image to be processed based on a pre-trained convolutional neural network model, and constructing a K nearest neighbor graph according to the face features of each face image to be processed; inputting the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the scores of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training the graph convolutional neural network using the sampled subgraphs; performing a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph, and obtaining face clustering for the plurality of face images to be processed. The technical problem of insufficient accuracy of face clustering in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence and deep learning technology in the field of image processing technology, and in particular to a face clustering method and device based on structure perception. Background Art

[0002] The development of face recognition technology depends on the introduction of large-scale face datasets. In recent years, with the development of face recognition technology, the scale of face datasets has become larger and larger. However, with the increase in the scale of datasets, the annotation cost has also become more and more expensive.

[0003] Face clustering algorithm is an effective way to reduce annotation costs. However, in related technologies, when faced with large-scale real face data, the clustering accuracy of the clustering model needs to be improved. Summary of the invention

[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0005] To this end, the first purpose of the present application is to propose a face clustering method based on structure perception to improve the accuracy of face clustering.

[0006] The second object of the present application is to provide a device.

[0007] The third objective of the present application is to provide an electronic device.

[0008] A fourth object of the present application is to provide a non-transitory computer-readable storage medium.

[0009] A fifth object of the present application is to provide a computer program product.

[0010] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a face clustering method, including:

[0011] Acquire multiple facial images to be processed, extract facial features of each facial image to be processed based on a pre-trained convolutional neural network model, and construct a K nearest neighbor graph according to the facial features of each facial image to be processed;

[0012] Inputting the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the score of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training a graph convolutional neural network using the sampled subgraphs;

[0013] According to the scores of each edge in the K nearest neighbor graph, a first pruning operation is performed on the K nearest neighbor graph to obtain face clustering for the multiple face images to be processed.

[0014] To achieve the above-mentioned purpose, a second embodiment of the present application proposes a device, including:

[0015] A first acquisition module is used to acquire a plurality of face images to be processed;

[0016] A feature extraction module, used for extracting facial features of each of the facial images to be processed based on a pre-trained convolutional neural network model;

[0017] A construction module, used to construct a K nearest neighbor graph according to the facial features of each of the facial images to be processed;

[0018] A prediction module, used for inputting the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the score of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training a graph convolutional neural network using the sampled subgraphs;

[0019] A pruning operation module is used to perform a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph to obtain face clustering for the multiple face images to be processed.

[0020] According to a third aspect of the present application, an electronic device is provided, including:

[0021] at least one processor; and

[0022] a memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the structure-awareness-based face clustering method described in one aspect of the present application.

[0024] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the structure-awareness-based face clustering method described in the first aspect of the present application.

[0025] According to a fifth aspect of the present application, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the structure-awareness-based face clustering method according to the first aspect.

[0026] According to the technical solution of the embodiment of the present application, the features of the face image are extracted through a convolutional neural network to obtain accurate face features and generate a K nearest neighbor graph. A subgraph is obtained from the K nearest neighbor graph through a structure-preserving subgraph sampling strategy, and the subgraph can represent the relationship within the cluster and between clusters in the K nearest neighbor graph. The edge score prediction model trained with the subgraph is used to perform the first pruning operation on the K nearest neighbor graph, making face clustering more accurate.

[0027] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0029] Figure 1 is a flowchart of a face clustering method based on structure perception according to an embodiment of the present application;

[0030] Figure 2 is a flow chart of a face clustering method based on structure perception according to another embodiment of the present application;

[0031] Figure 3 is a schematic diagram of a second pruning operation according to an embodiment of the present application;

[0032] Figure 4 is a flowchart of a face clustering method based on structure perception according to another embodiment of the present application;

[0033] Figure 5 is a flowchart of a face clustering method based on structure perception according to an embodiment of the present application;

[0034] Figure 6 is a structural block diagram of a face clustering device based on structure perception according to an embodiment of the present application;

[0035] Figure 7 is a structural block diagram of a face clustering device based on structure perception according to another embodiment of the present application;

[0036] Figure 8 It is a block diagram of an electronic device used to implement the method of face clustering based on structure perception in an embodiment of the present application. DETAILED DESCRIPTION

[0037] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0038] The following describes the structure-aware face clustering method and device according to an embodiment of the present application with reference to the accompanying drawings.

[0039] Figure 1 It is a flow chart of a face clustering method based on structure perception according to an embodiment of the present application. It should be noted that the face clustering method based on structure perception of the embodiment of the present application can be applied to the face clustering device based on structure perception of the embodiment of the present application, and the face clustering device based on structure perception can be configured on the electronic device of the embodiment of the present application.

[0040] like Figure 1 As shown, the structure-aware face clustering method may include:

[0041] Step 101, obtain multiple face images to be processed, extract facial features of each face image to be processed based on a pre-trained convolutional neural network model, and construct a K nearest neighbor graph according to the facial features of each face image to be processed.

[0042] In some embodiments of the present application, facial images of the same type can be connected together through a K nearest neighbor graph, wherein the nodes in the K nearest neighbor graph represent facial images, and the edges of the nodes in the K nearest neighbor graph represent that the facial images corresponding to the nodes belong to the same category. In the process of constructing the K nearest neighbor graph, two parameters are required, which are: facial features of each facial image to be processed and the K value. Among them, the facial features can be extracted from the facial images to be processed through a pre-trained convolutional neural network model; the K value can be set based on experience and / or the number of facial images to be processed, and the K value can determine the classification effect of the K nearest neighbor graph.

[0043] Understandably, due to the limitations of the pre-trained convolutional neural network model and the selection of the K value, in the K nearest neighbor graph, not only face images belonging to the same category will be connected together, but also face images that do not belong to the same category will be connected together with a certain probability. Therefore, the accuracy of face image classification in the K nearest neighbor graph at this time cannot meet the requirements. In order to obtain accurate face clustering, it is necessary to further operate the K nearest neighbor graph to remove the connection relationship of incorrectly connected face images.

[0044] Step 102, input the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the score of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training a graph convolutional neural network using the sampled subgraphs.

[0045] It can be understood that each edge in the K-nearest neighbor graph can be scored to obtain the score of each edge, so that the K-nearest neighbor graph can be pruned by screening the scores, thereby obtaining more accurate face clustering.

[0046] In some embodiments of the present application, in order to score each edge in the K nearest neighbor graph, an edge score prediction model can be pre-trained. In some cases, due to the limitation of hardware computing power, the K nearest neighbor graph can be sampled using a structure-preserving subgraph sampling strategy, and a score prediction model can be obtained through the subgraph after sampling. In this way, an edge score prediction model suitable for the K nearest neighbor graph can be obtained while saving computing power. Generally speaking, in the K nearest neighbor graph, nodes with close connections can be used as a cluster, and different clusters can also be connected, but the connection relationship between different clusters is usually not close.

[0047] For example, the structure-preserving subgraph sampling strategy can be to randomly sample the same number of nodes from each cluster in the K-nearest neighbor graph, and retain the connection relationship between these nodes to obtain a subgraph. The subgraph can retain the connection relationship of the nodes in each cluster, and can also retain the connection relationship between clusters. It can be understood that each edge in the subgraph will connect two nodes, and two nodes connected by an edge can be regarded as a node pair. The edge score prediction model can be obtained through the subgraph, and the initial model of the edge score prediction model includes but is not limited to: any one of a graph convolutional neural network and a graph convolutional neural network connected to a multilayer perceptron. When training the edge score prediction model, the model input is the entire subgraph, and the model output is the edge score corresponding to each edge in the subgraph. It can be understood that when the node pair belongs to the same class, the edge score corresponding to the node pair is 1; when the node pair does not belong to the same class, the edge score corresponding to the node pair is 0. The training can also be supervised using a loss function, and the loss function includes but is not limited to: any one of an exponential loss function and a cross entropy loss function.

[0048] Step 103: Perform a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph to obtain face clustering for multiple face images to be processed.

[0049] In some embodiments of the present application, in order to make the face clustering in the K nearest neighbor graph more accurate, the K nearest neighbor graph can be subjected to a first pruning operation. The first pruning operation can be completed by a pre-trained edge score prediction model. The pre-trained edge score prediction model can score each edge in the K nearest neighbor graph. A threshold can be preset and the scoring result can be compared with the threshold. When the scoring result is greater than or equal to the threshold, it means that the two nodes connected by the edge belong to the same class, and the edge can be retained; when the scoring result is less than the threshold, it means that the two nodes connected by the edge do not belong to the same class, and the edge will be removed. It can be understood that the edge connecting nodes belonging to the same class can be called a true edge; the edge connecting nodes that do not belong to the same class can be called a false edge. After the first pruning operation, face clustering for multiple face images to be processed can be obtained.

[0050] According to the face clustering method based on structure perception of the embodiment of the present application, the face image to be processed is clustered according to the face features extracted by the convolutional neural network model to construct a K nearest neighbor graph. More accurate face features can be obtained through deep learning technology, so that the face clustering of the constructed K nearest neighbor graph is more accurate. Using the subgraph of the K nearest neighbor graph as a training set, the graph convolutional neural network is trained to obtain a score prediction model. The subgraph of the K nearest neighbor graph can represent the relationship between each face image in a cluster in the K nearest neighbor graph, and can also represent the relationship between different clusters in the K nearest neighbor graph. After the graph convolutional neural network is trained, a score prediction model can be obtained. The score prediction model is used to implement the pruning operation of the K nearest neighbor graph, remove false edges, and obtain more accurate face clustering.

[0051] In the second embodiment of the present application, based on the first embodiment, in order to make the face clustering more accurate, a second pruning operation can be performed on the face clustering after the first pruning. Figure 1 The structure-aware face clustering method is specifically described using Example 2. Optionally, after performing the first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph, steps 201-202 are also included.

[0052] Figure 2 is a flow chart of a structure-aware face clustering method according to another embodiment of the present application. Figure 2 Specifically, Figure 2 The flowchart of a structure-aware face clustering method according to an embodiment of the present application specifically includes:

[0053] Step 201, calculate the intimacy between each pair of nodes in the K nearest neighbor graph after the first pruning operation.

[0054] In some embodiments of the present application, there may be a degree of intimacy between two nodes of the K nearest neighbor graph. The intimacy reflects whether the two nodes belong to the same category. The higher the intimacy, the higher the probability that the two nodes belong to the same category; the lower the intimacy, the lower the probability that the two nodes belong to the same category. Generally speaking, the probability that the nodes connected by the edges between clusters are of the same category is low; the probability that the nodes connected by the edges within a cluster are of the same category is high.

[0055] For example, the calculation method of the intimacy can be to determine the range diameter according to the number of nodes in the cluster, with the center of the cluster as the center of the circle, and the nodes within the range diameter are considered to have sufficient intimacy, while the points not within the range diameter are considered to have insufficient intimacy.

[0056] In some embodiments of the present application, the intimacy between two nodes can also be calculated by the following formula:

[0057]

[0058] Among them, n1 represents the number of edges connected to node N1, n2 represents the number of edges connected to node N2, and k represents the number of neighbor nodes shared by node N1 and node N2.

[0059] Figure 3 This is a schematic diagram of the second pruning operation according to an embodiment of the present application. As shown in the figure, node A has nine edges, node B has eight edges, and node A and node B have one common neighbor node. Node C has seven edges, node D has ten edges, and node C and node D have six common neighbor nodes. It can be concluded that the intimacy between A and B is The intimacy between C and D is

[0060] In some embodiments of the present application, matrix operations can also be used to calculate the intimacy. The adjacency matrix corresponding to the K nearest neighbor graph is A∈RN×N, and the number of common neighbor nodes of all two nodes is Each element in Represents node N i and N j The number of common neighbors. Then the value of intimacy is Where sum0 = vec(∑ j a ·j -1 ),sum1=vec(∑ i a i· -1 ). Among them, vec() means vectorization, sum0 means taking the inverse of each element of matrix A after summing it by rows and then vectorizing it, and sum1 means taking the inverse of each element of matrix A after summing it by columns and then vectorizing it.

[0061] Step 202, performing a second pruning operation on the K nearest neighbor graph that has undergone the first pruning operation according to the intimacy between any two nodes.

[0062] In some embodiments of the present application, a second pruning operation can be performed based on the K nearest neighbor graph of the first pruning operation, and this operation can be achieved by presetting an intimacy threshold. When the intimacy between two nodes is greater than or equal to the threshold, the edges corresponding to the two nodes are retained; when the intimacy between two nodes is less than the threshold, the edges corresponding to the two nodes are removed.

[0063] According to the structure-aware face clustering method of the embodiment of the present application, after the first pruning operation, there are still some false edges, which will affect the accuracy of face clustering because the false edges incorrectly connect different categories. Therefore, the K nearest neighbor graph after the first pruning operation can be pruned for the second time through the intimacy between two nodes. This operation makes the obtained face clustering more accurate and the structure of the K nearest neighbor graph clearer. After the second pruning, most of the erroneous edges in the K nearest neighbor graph have been deleted, and the face clustering information read from the K nearest neighbor graph will be more accurate.

[0064] In the third embodiment of the present application, based on the above embodiments, the edge score prediction model can be obtained by training in advance using the following steps.

[0065] More clearly, you can Figure 4 Specifically, Figure 4 : is a flowchart of a face clustering method based on structure perception according to another embodiment of the present application, which specifically includes:

[0066] Step 401: Obtain a training sample set, where the training sample set includes a plurality of face sample images.

[0067] It is understandable that a training sample set is usually required for deep learning model training. The purpose of this application is to obtain face clustering. Therefore, in some embodiments of this application, the training sample set may include multiple face sample images.

[0068] Step 402: extracting facial features of each facial sample image based on a convolutional neural network model.

[0069] It is understandable that a subgraph for training a graph convolutional neural network can be obtained by sampling based on a K-nearest neighbor graph. When constructing a K-nearest neighbor graph, the facial features of the face sample image are required. In some embodiments of the present application, a convolutional neural network model can be used to extract the facial features of the face sample image, and the facial features can be a vector.

[0070] Step 403: construct a K nearest neighbor graph sample based on the facial features of each facial sample image.

[0071] It can be understood that each face sample image has its corresponding face feature, and a K nearest neighbor graph sample can be constructed based on the face feature.

[0072] Step 404, based on the structure-preserving subgraph sampling strategy, the K nearest neighbor graph samples are sampled to obtain the sampled subgraph, and the sampled subgraph is used to train the graph convolutional neural network to obtain network parameters, and an edge score prediction model is generated according to the network parameters.

[0073] In some embodiments of the present application, a K nearest neighbor graph sample is sampled based on a structure-preserving subgraph sampling strategy to obtain a subgraph obtained after sampling. The subgraph can be obtained by randomly selecting a certain number of face images from each cluster of the K nearest neighbor graph to obtain a subgraph, or can be obtained by the following steps:

[0074] Step 1: Randomly select M clusters from the K nearest neighbor graph samples as sampling seeds.

[0075] It can be understood that in order to model the edges between face images in a cluster, M clusters can be randomly selected from the K nearest neighbor graph samples as sampling seeds, with clusters as units. The sampling seeds can be one or more.

[0076] Step 2: For each seed cluster, select N nearest neighbor clusters of each seed cluster, and use the graph consisting of M clusters and N nearest neighbor clusters as the first subgraph S1.

[0077] In some embodiments of the present application, in order to model the relationship between clusters, for each seed cluster, N nearest neighbor clusters can be selected, and the calculation method of the nearest neighbor cluster can be implemented by similarity calculation, and the similarity calculation can be the cosine similarity of the cluster center. In order to simultaneously model the relationship between clusters, M clusters and N nearest neighbor clusters can be formed into a first subgraph S1.

[0078] Step 3: Randomly select K1 clusters from the first subgraph S1 to construct the second subgraph S2.

[0079] In some embodiments of the present application, in order to perform a generalization operation on the selected clusters, K1 clusters may be randomly selected from the first subgraph S1 to construct the second subgraph S2.

[0080] Step 4: randomly select K2 nodes from the second subgraph S2 as the subgraph obtained after sampling.

[0081] In some embodiments of the present application, in order to perform a generalization operation on the nodes in the cluster, K2 nodes may be randomly selected from the second subgraph S2 as the sampled subgraph.

[0082] The K nearest neighbor graph obtained by the structure-preserving subgraph sampling strategy can be used to train the graph convolutional neural network. The training method may include the following steps:

[0083] Step 1: Input the sampled subgraph into the graph convolutional neural network to obtain the score prediction value of each edge in the subgraph.

[0084] In some embodiments of the present application, when the nodes connected by each edge belong to the same class, the score prediction value can be 1; when the face images connected by each edge belong to different classes, the score prediction value can be 0.

[0085] Step 2: Calculate the loss value between the predicted score of each edge and the true score value of each corresponding edge based on the cross entropy loss function.

[0086] In some embodiments of the present application, there is a loss value between the predicted score value of each edge and the actual score value of its corresponding edge, and the cross entropy loss function can be used to calculate the loss value.

[0087] Step three: Train the graph convolutional neural network according to the loss value.

[0088] Understandably, the graph convolutional neural network can be trained based on the loss value.

[0089] Through training, network parameters can be obtained, and an edge score prediction model can be generated based on the obtained network parameters. The output of the edge score prediction model is as follows: Figure 5 As shown, Figure 5 It is the output result of the edge score prediction model according to the embodiment of the present application, where the horizontal axis represents the output of the edge score prediction model. The closer it is to 0, the smaller the probability that the two face images connected by the edge belong to the same type; the closer it is to 1, the smaller the probability that the two face images connected by the edge belong to the same type.

[0090] According to the structure-aware face clustering method of the embodiment of the present application, a K nearest neighbor graph is constructed, and the K nearest neighbor graph is processed using a structure-preserving subgraph sampling strategy to obtain a subgraph, thereby obtaining an edge score prediction model. In this method, the subgraph retains the important structural information of the entire K nearest neighbor graph, retaining both the connections with high correlation within the cluster and the connections with low correlation between clusters. In addition, randomness is introduced for generalization, and this processing method can enhance the performance of the model.

[0091] According to an embodiment of the present application, the present application also provides a face clustering device based on structure perception.

[0092] Figure 6 FIG. 1 is a structural block diagram of a face clustering device based on structure perception according to an embodiment of the present application. Figure 6As shown, the structure-awareness-based face clustering device 600 may include: a first acquisition module 601 , a construction module 602 , a prediction module 603 , and a pruning operation module 604 .

[0093] Specifically, the first acquisition module 601 is used to acquire a plurality of face images to be processed;

[0094] A feature extraction module, used for extracting facial features of each face image to be processed based on a pre-trained convolutional neural network model;

[0095] A construction module 602 is used to construct a K nearest neighbor graph according to the facial features of each face image to be processed;

[0096] Prediction module 603, used to input the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the score of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training a graph convolutional neural network using the sampled subgraphs;

[0097] The pruning operation module 604 is used to perform a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph to obtain face clustering for multiple face images to be processed.

[0098] Figure 7 FIG. 1 is a block diagram of a structure-aware face clustering device according to another embodiment of the present application. Figure 7 As shown, the structure-awareness-based face clustering device also includes: a pre-training module 705.

[0099] Specifically, the pre-training module 705 is used to pre-train the edge score prediction model; wherein the pre-training module is specifically used to: obtain a training sample set, the training sample set includes multiple face sample images; extract the facial features of each face sample image based on the convolutional neural network model; construct a K nearest neighbor graph sample according to the facial features of each face sample image; sample the K nearest neighbor graph samples based on the structure-preserving subgraph sampling strategy to obtain the sampled subgraph, and use the sampled subgraph to train the graph convolutional neural network to obtain network parameters, and generate an edge score prediction model according to the network parameters.

[0100] in Figure 7 701-704 and Figure 6 601-604 have the same function and structure.

[0101] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0102] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0103] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0104] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0105] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0106] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as information sorting methods. For example, in some embodiments, the information sorting method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the information sorting method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the information sorting method in any other appropriate manner (e.g., by means of firmware).

[0107] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0108] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0109] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0110] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0111] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0112] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0113] According to the structure-aware face clustering method of the embodiment of the present application, the face images to be processed are clustered according to the face features extracted by the convolutional neural network model to construct a K nearest neighbor graph. More accurate face features can be obtained through deep learning technology, so that the face clustering of the constructed K nearest neighbor graph is more accurate. Using the subgraph of the K nearest neighbor graph as a training set, the graph convolutional neural network is trained to obtain a score prediction model. The subgraph of the K nearest neighbor graph can represent the relationship between each face image in a cluster in the K nearest neighbor graph, and can also represent the relationship between different clusters in the K nearest neighbor graph. After the graph convolutional neural network is trained, a score prediction model can be obtained. The first pruning operation of the K nearest neighbor graph is implemented through the score prediction model, and the wrongly connected edges are removed to obtain more accurate face clustering.

[0114] After the first pruning operation, the K nearest neighbor graph can be pruned for the second time. This operation removes false edges through intimacy calculation, making the face clustering more accurate and the structure of the K nearest neighbor graph clearer. After the second pruning, most of the false edges in the K nearest neighbor graph have been deleted, and the face clustering information read from the K nearest neighbor graph will be more accurate.

[0115] In the process of constructing the K nearest neighbor graph, the structure-preserving subgraph sampling strategy can be used to process the K nearest neighbor graph to obtain a subgraph, thereby obtaining an edge score prediction model. In this method, the subgraph retains the important structural information of the entire K nearest neighbor graph, retaining both the connections with high correlation within the cluster and the connections with low correlation between clusters. In addition, randomness is introduced for generalization, and this processing method can enhance the performance of the model.

[0116] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A face clustering method based on structure perception, characterized in that: include: Acquire multiple facial images to be processed, extract facial features of each facial image to be processed based on a pre-trained convolutional neural network model, and construct a K nearest neighbor graph according to the facial features of each facial image to be processed; Inputting the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the score of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training a graph convolutional neural network using the sampled subgraphs; According to the scores of each edge in the K nearest neighbor graph, a first pruning operation is performed on the K nearest neighbor graph to obtain face clustering for the plurality of face images to be processed; The edge score prediction model is pre-trained using the following steps: Acquire a training sample set, wherein the training sample set includes a plurality of face sample images; Extracting facial features of each of the facial sample images based on the convolutional neural network model; Constructing a K nearest neighbor graph sample according to the facial features of each of the facial sample images; Based on the structure-preserving subgraph sampling strategy, K nearest neighbor graph samples are sampled to obtain a sampled subgraph, and the sampled subgraph is used to train a graph convolutional neural network to obtain network parameters, and the edge score prediction model is generated according to the network parameters; The step of sampling the K nearest neighbor graph samples based on the structure-preserving subgraph sampling strategy to obtain the sampled subgraph includes: Randomly select M clusters from the K nearest neighbor graph sample as sampling seeds; For each seed cluster, select N nearest neighbor clusters of each seed cluster, and use a graph consisting of the M clusters and the N nearest neighbor clusters as a first subgraph S1; Randomly select K1 clusters from the first subgraph S1 to construct a second subgraph S2; K2 nodes are randomly selected from the second subgraph S2 as the subgraph obtained after sampling.

2. The method according to claim 1, characterized in that: After performing a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph, the method further includes: Calculate the intimacy between two nodes in the K nearest neighbor graph after the first pruning operation; According to the intimacy between the two nodes, a second pruning operation is performed on the K nearest neighbor graph that has undergone the first pruning operation.

3. The method according to claim 2, characterized in that The intimacy between the two nodes is calculated by the following formula: in, represents the number of edges connected to node N1, represents the number of edges connected to node N2, Indicates the number of neighbor nodes shared by node N1 and node N2.

4. The method according to claim 1, characterized in that: The step of training the graph convolutional neural network using the subgraph obtained after sampling includes: Inputting the sampled subgraph into the graph convolutional neural network to obtain a score prediction value of each edge in the subgraph; Calculate the loss value between the score prediction value of each edge and the true score value of each corresponding edge based on the cross entropy loss function; The graph convolutional neural network is trained according to the loss value.

5. A face clustering device based on structure perception, characterized in that: include: A first acquisition module is used to acquire a plurality of face images to be processed; A feature extraction module, used for extracting facial features of each of the facial images to be processed based on a pre-trained convolutional neural network model; A construction module, used to construct a K nearest neighbor graph according to the facial features of each of the facial images to be processed; A prediction module, used for inputting the K nearest neighbor graph into a pre-trained edge score prediction model to obtain the score of each edge in the K nearest neighbor graph; wherein the edge score prediction model is obtained by sampling the K nearest neighbor graph using a structure-preserving subgraph sampling strategy, and training a graph convolutional neural network using the sampled subgraphs; A pruning operation module, configured to perform a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph, so as to obtain face clustering for the plurality of face images to be processed; Also includes: A pre-training module is used to pre-train the edge score prediction model; wherein the pre-training module is specifically used to: Acquire a training sample set, wherein the training sample set includes a plurality of face sample images; Extracting facial features of each of the facial sample images based on the convolutional neural network model; Constructing a K nearest neighbor graph sample according to the facial features of each of the facial sample images; Based on the structure-preserving subgraph sampling strategy, K nearest neighbor graph samples are sampled to obtain a sampled subgraph, and the sampled subgraph is used to train a graph convolutional neural network to obtain network parameters, and the edge score prediction model is generated according to the network parameters; The pre-training module is specifically used for: Randomly select M clusters from the K nearest neighbor graph sample as sampling seeds; For each seed cluster, select N nearest neighbor clusters of each seed cluster, and use a graph consisting of the M clusters and the N nearest neighbor clusters as a first subgraph S1; Randomly select K1 clusters from the first subgraph S1 to construct a second subgraph S2; K2 nodes are randomly selected from the second subgraph S2 as the subgraph obtained after sampling.

6. The device according to claim 5, characterized in that The pruning operation module is also used for: After performing a first pruning operation on the K nearest neighbor graph according to the scores of each edge in the K nearest neighbor graph, calculating the intimacy between each pair of nodes in the K nearest neighbor graph after the first pruning operation; According to the intimacy between the two nodes, a second pruning operation is performed on the K nearest neighbor graph that has undergone the first pruning operation.