Semi-supervised clustering method based on bipartite graph acceleration and incorporating pairwise constraints
By adopting a method based on bipartite graphs in video face clustering and GPS trajectory navigation services, the relationship between sample points is simplified and the must-link and must-not-link matrices are introduced, which solves the problem of high computational complexity in the existing technology and improves efficiency. Clustering speed and accuracy.
Patent Information
- Application Number
- CN202410733681.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-07
AI Technical Summary
In the existing technology, in video face clustering and GPS trajectory navigation services, graph-based methods are difficult to effectively satisfy the "must not link" constraint, resulting in high computational complexity and affecting the clustering effect.
A method based on bipartite graphs is adopted to simplify the relationship between sample points by constructing anchor point matrices and bipartite graph matrices, using similarity graphs and normalized Laplacian matrices to optimize the clustering process, and introducing necessary link matrices and necessary link matrices. matrix to improve clustering accuracy.
It significantly reduces the computational complexity of clustering, improves the speed and accuracy of clustering, reduces the dependence on prior information between sample points, and improves the efficiency of semi-supervised clustering methods.
Smart Images

Figure CN118312818B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pattern recognition, and in particular to a semi-supervised clustering method incorporating pairwise constraints accelerated by a bipartite graph. Background Art
[0002] Traditional clustering methods are designed under strict unsupervised conditions, and then pairwise constraint information for assisting clustering can be found in some applications. For example, in video face clustering, two faces in the same frame image belong to different actors, thus generating must-not-link constraints. According to the continuity of video image playback, faces on the same trajectory belong to the same actor, thus generating must-link constraints. Another example is in lane-level navigation services based on GPS trajectories, where vehicles usually need to be clustered. As time goes by, different coordinate points on the driving trajectories at different times can correspond to the same vehicle. Therefore, it can be inferred from the continuity of the trajectory that coordinate points at different positions on the same trajectory describe the same vehicle, thus generating must-link constraints. Two coordinate points that are more than 4 meters apart in the direction perpendicular to the driving direction of the vehicle belong to different vehicles (if the lane width is 4 meters, then two points that are 4 meters apart horizontally are definitely not the same vehicle), thus generating must-not-link constraints. If the pairwise constraint information naturally existing in these applications can be fully utilized, it can help improve the clustering effect.
[0003] Since "must-link" and "must-not-link" can be conveniently represented by an adjacency graph, a graph-based method can be used to solve it. The graph-based method lies in that the constraint of "must-not-link" is usually difficult to fully satisfy. The prior art discloses using the Laplacian matrix of the graph to satisfy the "must-not-link" constraint between known sample pairs, but the computational complexity is very high. To solve this problem, the present invention accelerates the semi-supervised clustering method incorporating pairwise constraints by constructing a bipartite graph. Summary of the Invention
[0004] The present invention provides a semi-supervised clustering method incorporating pairwise constraints accelerated by a bipartite graph to solve the problems raised in the above background art.
[0005] To achieve the above object, the present invention provides a semi-supervised clustering method incorporating pairwise constraints accelerated by a bipartite graph, including the following steps:
[0006] S1. Obtain a sample data matrix X, where the sample data matrix X includes n sample data, each sample data corresponds to a sample point, and the dimension of the sample data is d; obtain anchor points according to the sample data matrix X, and construct an anchor point matrix B; the number of anchor points is m, and m < d, and m < n;
[0007] S2. Initialize the anchor point matrix B such that , where I m Representing an m-order identity matrix; constructing a bipartite graph matrix Z according to the sample data matrix X and the anchor matrix B;
[0008] S3, taking the sample data as vertices, constructing a similarity matrix S and a similarity graph Laplace matrix according to the bipartite graph matrix Z and the normalized Laplacian matrix ;
[0009] S4. Obtain a must-link set and a must-not-link set according to the pairwise constraint information of the sample data, and construct a must-link matrix M and a must-not-link matrix Q;
[0010] S5. Construct the objective function:
[0011] ,
[0012] in Represents the square of the Frobenius norm of the matrix; represents the trace of a matrix; represents the transpose of the matrix; the first hyperparameter and the second hyperparameter are all positive numbers greater than 0; penalty parameters is a positive number greater than 0; the spectral embedding matrix F satisfies ,in express The order is the identity matrix, c is the number of clusters;
[0013] S6. Obtaining a local optimal solution of the objective function by using an alternating iteration method;
[0014] S7, according to the local optimal solution Z of the bipartite graph matrix Z opt , calculate the local optimal solution S of the similarity matrix S opt , the local optimal solution S of the similarity matrix S opt The sample points in each connected branch are clustered into one category.
[0015] Specifically, the method for constructing a bipartite graph matrix Z includes:
[0016] A bipartite graph matrix Z is constructed between the sample point and the anchor point, the element value range of the bipartite graph matrix Z is between [0,1], and the bipartite graph matrix Z satisfies the constraint condition ;
[0017] in, represents a column vector of dimension m whose elements are all 1, Represents a column vector of dimension n whose elements are all 1.
[0018] Furthermore, the method of step S3 includes:
[0019] Construct the similarity matrix ;
[0020] Construct the similarity graph Laplacian matrix , where the first diagonal matrix The diagonal elements of , the first diagonal matrix The remaining elements of are zero;
[0021] Construct the normalized Laplacian matrix ,in, Represents the first diagonal matrix All elements of are raised to the power of -1 / 2. Represents the n-th order identity matrix.
[0022] Specifically, the steps of constructing the necessary link matrix M include:
[0023] Select the elements of the matrix M that must be linked ,like The corresponding i-th sample data and the jth sample data The sample pairs formed belong to the required link set, then let
[0024] , otherwise let ;
[0025] in, ; ; The required link matrix M is matrix.
[0026] Further, the step of constructing the unlinked matrix Q comprises:
[0027] Construct the rth unlinked column vector according to the rth sample pair in the unlinked set , the rth sample pair includes Sample Data and Sample Data , so that the rth column vector must not be linked No. The first element is 1, so that the rth column vector must not be linked No. The rth element is -1, and the rth column vector must not be linked The dimension of is n, so The remaining elements of take random values in the interval (-1,1); ; ; ;
[0028] The rth column vector must not be linked Imposing constraints ;
[0029] make , with q r Construct unlink matrix for column vector Q = [ q 1 , q 2 , ⋯ , q n CL ] , the unlinked matrix Q is matrix, is the number of sample pairs in the unlinked set.
[0030] Specifically, the step of obtaining the local optimal solution of the objective function by using an alternating iteration method includes:
[0031] S61, fix the unlink matrix Q, the bipartite graph matrix Z, the spectral embedding matrix F, and optimize the anchor matrix B;
[0032] S62, fix the anchor matrix B, the bipartite graph matrix Z, the spectral embedding matrix F, and optimize the unlink matrix Q;
[0033] S63, fix the anchor matrix B, the unlink matrix Q, the spectral embedding matrix F, and optimize the bipartite graph matrix Z;
[0034] S64, fix anchor matrix B, unlink matrix Q, bipartite graph matrix Z, optimize spectral embedding matrix F;
[0035] S65, determine whether the convergence condition is met, if not, jump to step S61, if the convergence condition is met, output the local optimal solution Z of the bipartite graph matrix Z opt .
[0036] Furthermore, the specific steps of optimizing the anchor matrix B include:
[0037] right Perform singular value decomposition, let , solve the intermediate matrix , the intermediate matrix The pseudo-diagonal elements of for The singular values of the intermediate matrix The remaining elements of are zero;
[0038] Make the intermediate matrix The pseudo-diagonal elements of , solve the corresponding left matrix U and right matrix V; where, ; ; ; k is a matrix rank;
[0039] Get the first m columns of the left matrix U ;
[0040] Find the local optimal solution of the anchor matrix B .
[0041] Furthermore, the specific steps of optimizing the unlinked matrix Q are:
[0042] For the sample pairs in the unlinked set , from the rth unlinked column vector Extract sample column vector from and the remaining column vector ;
[0043] Select the bipartite graph matrix Z Row Elements and Row Elements , construct a sample bipartite graph matrix Z p = [ Zl i ′ Zl j ′ ] , use the remaining row elements of the bipartite graph matrix Z to construct the remaining bipartite graph matrix ;
[0044] According to the first diagonal matrix Construct the remaining diagonal matrix ;
[0045] The sample column vector Calculate the updated residual column vector :
[0046] ,
[0047] Use the updated remaining column vector The elements of correspond to updating the rth unlinked column vector in the unlinked matrix Q The corresponding element of .
[0048] Furthermore, the specific steps of optimizing the bipartite graph matrix Z include:
[0049] Fix the first diagonal matrix , the optimization problem is equivalent to:
[0050] ,
[0051] in , ;
[0052] Solve the bipartite graph matrix Z by augmented Lagrangian method;
[0053] Update the first diagonal matrix Similarity Graph Laplacian Matrix and the normalized Laplacian matrix .
[0054] Furthermore, the specific steps of optimizing the spectrum embedding matrix F include:
[0055] According to the optimization problem of F ,right Perform eigenvalue decomposition and obtain m eigenvalues , and the corresponding m eigenvectors ;
[0056] Select the first c eigenvalues from the m eigenvalues , and the corresponding c eigenvectors , find the local optimal solution F of the spectral embedding matrix F opt :
[0057] F opt = [ 1 β 1 D S − 1 / 2 ZF 1 ,..., 1 β c D S − 1 / 2 ZF c ] ,
[0058] The number of clusters c and the number of anchor points m satisfy the condition .
[0059] The above technical solution provided by the present invention has the following beneficial effects:
[0060] (1) The technical solution provided by the present invention simplifies the relationship between sample points into the relationship between sample points and anchor points by constructing a bipartite graph constraint between sample points and anchor points. After optimization, the relationship is converted back through a similarity graph. This not only eliminates the need for any prior information between sample points, thus saving the data labeling workload of traditional clustering methods, but also significantly reduces the computational complexity of clustering, thereby solving the problem of high computational complexity in the prior art and improving the speed of clustering calculation.
[0061] (2) By introducing terms related to the must-link matrix into the objective function, the bipartite graph distance between two sample points belonging to the same cluster can be continuously approached during the optimization process, reducing the uncontrollability of the existing technology during the optimization process and improving the clustering accuracy and reliability.
[0062] (3) By introducing the terms of the normalized Laplacian matrix of the similarity graph into the objective function and replacing the spectral decomposition of the existing technology with the singular value decomposition of the spectral embedding matrix, the clustering efficiency of the semi-supervised clustering method is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1It is a flow chart of a semi-supervised clustering method incorporating pairwise constraints based on bipartite graph acceleration according to an embodiment of the present invention;
[0064] Figure 2 Schematic diagram of a semi-supervised clustering device incorporating pairwise constraints based on bipartite graph acceleration according to an embodiment of the present invention;
[0065] Figure 3 It is a schematic diagram of a semi-supervised clustering device based on bipartite graph acceleration and incorporating pairwise constraints according to an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments and drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0067] Embodiment 1
[0068] Please see attached Figure 1 ,according to Figure 1 As shown in the flowchart of a semi-supervised clustering method based on bipartite graph acceleration and incorporating pairwise constraints in an embodiment of the present invention, the method includes the following steps:
[0069] S1. Obtain a sample data matrix X, wherein the sample data matrix X includes n sample data, each of which corresponds to a sample point, and the dimension of the sample data is d; obtain m anchor points according to the sample data matrix X, and construct an anchor point matrix B. The clustering method of the embodiment of the present invention is to cluster n sample points, and the number of clusters is c.
[0070] In an embodiment of the present invention, the sample data matrix The embodiment of the present invention automatically learns m anchor points through the K-means++ algorithm to obtain the anchor point matrix The K-means++ algorithm is an improved K-means clustering algorithm, which is mainly used to select the initial cluster centers to improve the performance and stability of the algorithm. The core idea is to ensure that the initial cluster centers are far away from each other, so that they can converge to better clustering results more quickly in the subsequent clustering process. Other embodiments of the present invention can also use other methods to obtain anchor points, thereby constructing an anchor point matrix.
[0071] S2. Initialize the anchor matrix B so that ,in represents an m-order identity matrix; m is the number of anchor points, the number of anchor points m is less than the dimension d of the sample data, and the number of anchor points m is less than the number of sample points n; construct a bipartite graph matrix Z based on the sample data matrix X and the anchor point matrix B. The specific steps include:
[0072] In the implementation of the present invention, according to the sample data matrix and anchor matrix , construct a bipartite graph matrix between sample points and anchor points Z ∈ [ 0 , 1 ] n × m , that is, the element value range of the bipartite graph matrix Z is between [0,1], and the bipartite graph matrix is Matrix. In particular, for a bipartite graph matrix Apply the constraint that the row sum is 1, that is, to satisfy the condition .in, and They represent an n-dimensional column vector whose elements are all 1 and an m-dimensional column vector whose elements are all 1 respectively.
[0073] S3, taking the sample data as vertices, constructing a similarity matrix S and a similarity graph Laplace matrix according to the bipartite graph matrix Z and the normalized Laplacian matrix Specifically
[0074] Construct the similarity matrix ; The elements of the similarity matrix S represent the degree of similarity between the two sample data corresponding to the coordinates.
[0075] Construct the similarity graph Laplacian matrix , where the first diagonal matrix The diagonal elements of , the first diagonal matrix The remaining elements of are zero;
[0076] Construct the normalized Laplacian matrix ,
[0077] in, Represents the first diagonal matrix All elements of are raised to the power of -1 / 2. Represents the n-th order identity matrix.
[0078] S4. Obtain a set of must-links and a set of must-not-links according to the paired constraint information of the sample data. In the embodiment of the present invention, the sample data matrix is , if the i-th sample data is known With the jth sample data belong to the same cluster, then the i-th sample data is called With the jth sample data If there is a "must link" between them, the i-th sample data With the jth sample data The sample pairs belongs to the set that must be linked. If it is known that Sample Data With Sample Data belong to different clusters, then they are called Sample Data With Sample Data If there is a "must not link" between Sample Data With Sample Data The sample pairs Belong to the must-not-link set. The "must-link" and "must-not-link" are collectively referred to as pairwise constraints. The basic idea of the traditional pairwise constrained semi-supervised clustering method is to use prior supervision information to adjust the interaction between sample data, and to enable the neighbors to be correctly divided based on a small amount of correctly divided sample data. Under the classical algorithm framework, the objective function is reasonably designed and then optimized, such as the classical algorithm framework spectral clustering. The technical solution provided by the present invention improves the traditional pairwise constrained semi-supervised clustering method. Under the premise of no known sample labels, it uses the relationship information of whether each sample pair belongs to the same cluster, and adopts the bipartite graph method to effectively reduce the amount of clustering calculations and significantly improve the clustering efficiency.
[0079] Specifically, the step of constructing a necessary link matrix M according to the necessary link set includes: selecting elements of the necessary link matrix M , investigate The corresponding i-th sample data and the jth sample data The sample pairs , if the sample is Belongs to the must-link set, then let
[0080] , otherwise let ;
[0081] in, ; ; The required link matrix M is Matrix. That is,
[0082] ,
[0083] In particular, the other situations include the corresponding sample pairs Belong to different clusters, or the corresponding elements are diagonal elements of the matrix M that must be linked.
[0084] In the implementation of the present invention, the step of constructing the unlinked matrix Q comprises:
[0085] Construct the rth unlinked column vector according to the rth sample pair in the unlinked set , the rth sample pair includes Sample Data With Sample Data , the rth column vector must not be linked The dimension is n, so that the rth column vector must not be linked No. The first element is 1, so that the rth column vector must not be linked No. The first element is -1, so that the rth column vector must not be linked The remaining elements of take random values in the interval (-1,1); ; ; .
[0086] For the unlinked column vector Imposing constraints , this constraint can ensure that the first Sample Data With Sample Data belong to different connected branches.
[0087] Use the same method to construct the column vectors of other unlinked sample pairs , to construct the unlink matrix Q = [ q 1 , q 2 , ⋯ , q n CL ] , the unlinked matrix Q is matrix, is the number of sample pairs in the unlinked set.
[0088] S5. Construct the objective function:
[0089] ,
[0090] in Represents the square of the Frobenius norm of the matrix; represents the trace of a matrix; represents the transpose of the matrix; the first hyperparameter and the second hyperparameter are all positive numbers greater than 0; penalty parameters is a positive number greater than 0; the spectral embedding matrix F satisfies ,in express is the identity matrix of order, and c is the number of clusters.
[0091] First hyperparameter and the second hyperparameter The value of is selected according to the actual calculation needs. Preferably, in the embodiment of the present invention, the first hyperparameter and the second hyperparameter The value of is selected from {0.001, 0.01, 0.1, 1, 10, 100, 1000}.
[0092] Penalty Parameters The value of is selected according to the actual calculation needs. Preferably, the penalty parameter is The initial value of is set to 1. In subsequent iterations, the penalty parameter The value of the normalized Laplacian matrix is calculated according to the iterative process. The number of zero eigenvalues is adjusted dynamically.
[0093] In the embodiment of the present invention, the objective function introduces a term related to the necessary link matrix M: , during the optimization process, by minimizing this term , the bipartite graphs corresponding to two sample points belonging to the same cluster can be made closer, which means better clustering effect and helps to improve the accuracy and reliability of clustering.
[0094] In addition, the embodiment of the present invention also introduces a normalized Laplace matrix into the objective function , which makes it easier to use singular value decomposition to replace spectral decomposition when solving the spectral embedding matrix F to accelerate the process and effectively improve the efficiency of clustering.
[0095] S6. Obtain the local optimal solution of the objective function by using an alternating iteration method. In the embodiment of the present invention, the optimization process of the objective function optimizes only one variable at a time, and the remaining variables are regarded as fixed constants. The specific steps include:
[0096] S61. Fix the unlinked matrix Q, the bipartite graph matrix Z, and the spectral embedding matrix F, and optimize the anchor matrix B. Specifically, the subproblem corresponding to optimizing the anchor matrix B is equivalent to solving ,right Perform singular value decomposition, let , solve the intermediate matrix , the intermediate matrix The pseudo-diagonal elements of for The singular values of the intermediate matrix The remaining elements of are zero. The pseudo-diagonal elements of , solve the corresponding left matrix U and right matrix V. Among them, ; ; k is a matrix In this embodiment of the present invention, the intermediate matrix , the left matrix , the right matrix . Get the first m columns of the left matrix U , the number of anchor points m is less than the dimension d of the sample data. Find the local optimal solution of the anchor point matrix B .
[0097] Specifically, singular value decomposition SVD (Single Value Decomposition) is a matrix decomposition method that can decompose a matrix into the product of three matrices, including a left matrix, an intermediate matrix and a right matrix. This is a prior art and will not be described in detail here.
[0098] The computational complexity of this step is .
[0099] S62, fix the anchor matrix B, the bipartite graph matrix Z, the spectral embedding matrix F, and optimize the unlink matrix Q.
[0100] Specifically, the unlink matrix is optimized by solving column by column Without loss of generality, from the rth unlinked column vector of the unlinked matrix Q Extract sample column vector from and the remaining column vector From the steps of constructing the unlinked matrix Q, we can see that the rth unlinked column vector The corresponding sample pairs Including Sample Data With Sample Data , in, ; ; .
[0101] The rth unlinked column vector Middle elements and elements are extracted to form a sample column vector q rp = [ q r ( i ′ ) q r ( j ′ ) ] , that is, the sample column vector is the rth unlinked column vector No. elements and The rth unlinked column vector The remaining elements of the original relative positions form an n-2-dimensional column vector, denoted as the remaining column vector .
[0102] For a bipartite graph matrix Do not link the column vector with the rth The same segmentation, specifically, select the first Row Elements and Row Elements , construct a sample bipartite graph matrix Z p = [ Zl i Zl j ] , the bipartite graph matrix The remaining rows of ,Right now . Similarly, the first diagonal matrix Perform partitioning and construct the remaining diagonal matrix , the remaining diagonal matrix The elements on the diagonal are the first diagonal matrix Diagonal The element at position, the remaining diagonal matrix for matrix.
[0103] According to the sample column vector Compute the updated residual column vector :
[0104] , (1)
[0105] The above formula (1) is obtained by the Woodbury formula of the block matrix inversion in the embodiment of the present invention, which can improve the update speed of the unlinked matrix Q and reduce the computational complexity from O(n 3 ) is reduced to O(m 3 ), where n is the number of sample points and m is the number of anchor points.
[0106] Get the updated residual column vector After that, replace the corresponding elements in the rth unlinked column vector The Bit element.
[0107] According to the above method, r takes , update each column vector of the unlinked matrix Q one by one. The computational complexity of this step is .
[0108] S63, fix the anchor matrix B, the unlink matrix Q, the spectral embedding matrix F, and optimize the bipartite graph matrix Z;
[0109] The specific steps include:
[0110] Fix the first diagonal matrix , the optimization problem is equivalent to solving:
[0111] ,
[0112] in, , .
[0113] The specific solution process is shown in the preset algorithm 1 provided in the second embodiment of the present invention. The local optimal solution Z of the bipartite graph matrix Z can be obtained by the preset algorithm 1. opt ;
[0114] Then, update the first diagonal matrix , and then calculate the similarity graph Laplacian matrix and the normalized Laplacian matrix .
[0115] The technical solution provided by the embodiment of the present invention solves the bipartite graph matrix The computational complexity is .
[0116] S64, fix the anchor matrix B, the unlink matrix Q, and the bipartite graph matrix Z, and optimize the spectral embedding matrix F. The specific steps include: according to the optimization problem of F ,right Perform eigenvalue decomposition and obtain m eigenvalues , and the corresponding m eigenvectors . Select the first c eigenvalues from the m eigenvalues , and the corresponding c eigenvectors , find the local optimal solution F of the spectral embedding matrix F opt :
[0117] F opt = [ 1 β 1 D S − 1 / 2 ZF 1 ,..., 1 β c D S − 1 / 2 ZF c ] ,
[0118] The number of clusters c and the number of anchor points m satisfy the condition The technical solution provided by the embodiment of the present invention solves F opt The computational complexity is .
[0119] S65, determine whether the convergence condition is met, if not, jump to step S61, if the convergence condition is met, output the local optimal solution Z of the bipartite graph matrix Z opt .
[0120] The convergence condition includes convergence condition 1 and convergence condition 2. The convergence condition 1 is that the number of iterations reaches the preset maximum number of iterations. The convergence condition 2 is that during the optimization of the objective function, the normalized Laplace matrix The number of zero eigenvalues of is equal to the number of clusters .
[0121] Preferably, in the embodiment of the present invention, the convergence condition is to first determine the convergence condition one, and then determine the convergence condition two.
[0122] Specifically, the preset maximum number of iterations needs to be selected according to specific requirements. Preferably, the preset maximum number of iterations in the embodiment of the present invention is 50.
[0123] Specifically, the specific steps of determining the second convergence condition in the embodiment of the present invention are as follows: Calculate the first convergence coefficient and the second convergence coefficient as follows:
[0124] ,
[0125] in, is the normalized Laplacian matrix The eigenvalue of is calculated as follows:
[0126] ,
[0127] in, is the number of clusters, is the eigenvalue obtained in the optimization step of the spectral embedding matrix F. It can be seen that .
[0128] Preset initial convergence coefficient , according to the first convergence coefficient and the initial convergence coefficient The relationship between the two, and the second convergence coefficient and the initial convergence coefficient , and judge whether the second convergence condition is satisfied. Specifically, the embodiment of the present invention presets the initial convergence coefficient , the judgment is as follows:
[0129] 1) If and , then the normalized Laplace matrix The number of zero eigenvalues of is equal to the number of clusters At this time, the second convergence condition is met, the iteration is stopped, and the local optimal solution Zopt of the bipartite graph matrix Z is output.
[0130] 2) If , indicating that the normalized Laplace matrix is The number of zero eigenvalues of is less than the number of clusters , the penalty parameter needs to be To enlarge, specifically, the penalty parameter Assign new values, In the embodiment of the present invention, a=2. In other embodiments of the present invention, a can be any number greater than 1 and can be set according to specific needs.
[0131] 3) If , indicating that the normalized Laplace matrix is The number of zero eigenvalues of is greater than the number of clusters , the penalty parameter needs to be To reduce, specifically, the penalty parameter Assign new values, In this embodiment of the present invention, b=0.9. In other embodiments of the present invention, b can be any positive number less than 1 and can be set according to specific needs.
[0132] The above cases 2) and 3) are both cases where the convergence condition 2 is not satisfied. After zooming in or out, the objective function related parameter matrix is updated, and then the process returns to step S61 to continue iterating until convergence condition 1 or convergence condition 2 is met, and the local optimal solution Z of the bipartite graph matrix Z is output. opt .
[0133] S7, according to the local optimal solution Z of the bipartite graph matrix Z opt , calculate the local optimal solution S of the similarity matrix S opt , the local optimal solution S of the similarity matrix S opt The sample points in each connected branch are clustered into one category.
[0134] It can be seen from the description of the embodiments of the present invention that the technical solution provided by the present invention converts the relationship between sample points into the relationship between sample points and anchor points through the bipartite graph matrix Z, and then constructs the similarity matrix S=ZZ T Restoring the relationship between sample points greatly reduces the computational complexity of traditional clustering methods.
[0135] Embodiment 2
[0136] The embodiment of the present invention provides a pseudo code to implement the preset algorithm 1, which is as follows:
[0137] The preset algorithm is The solution algorithm is:
[0138] Input: C,W;
[0139] initialization: , , ;
[0140] Output: A;
[0141] The algorithm solution process is:
[0142] Using the augmented Lagrangian method, the optimization problem is further equivalent to solving:
[0143] ,
[0144] repeat:
[0145] Fix A and solve for update ;
[0146] Fix E and solve A: , for the pth row of A, the preset algorithm 2 provided in the third embodiment of the present invention is used to solve the following problem:
[0147] ,
[0148] Solve the above problem for each row of A, that is, let p traverse from 1 to n1, where n1 is the number of row vectors of matrix A.
[0149] renew : ,
[0150] Update u: , Indicates the rate of increase of coefficient u in the preset algorithm 1
[0151] Until convergence, output E and A.
[0152] Embodiment 3
[0153] The embodiment of the present invention provides a preset algorithm 2 implemented by means of pseudo code, which is as follows:
[0154] The second preset algorithm is to solve the g-dimensional vector T through the g-dimensional vector Y:
[0155] Input: g-dimensional vector Y;
[0156] Output: g-dimensional vector T, satisfying ;
[0157] Define the function: ,in ;
[0158] Using Newton's method, we get The root of ,make .
[0159] Embodiment 4
[0160] Please see attached Figure 2The embodiment of the present invention discloses a semi-supervised clustering device based on bipartite graph acceleration and integrating pairwise constraints, comprising the following units:
[0161] The initialization unit is used to obtain a sample data matrix X, where the sample data matrix X includes n sample data, each of which corresponds to a sample point, and the dimension of the sample data is d; an anchor point is obtained according to the sample data matrix X, and an anchor point matrix B is constructed.
[0162] The bipartite graph construction unit is used to initialize the anchor matrix B so that ,in represents an m-order identity matrix, where m is the number of anchor points, the number of anchor points m is less than the dimension d of the sample data, and the number of anchor points m is less than the number of sample points n; constructing a bipartite graph matrix Z according to the sample data matrix X and the anchor point matrix B;
[0163] A Laplace matrix construction unit is used to construct a similarity matrix S and a similar graph Laplace matrix according to the bipartite graph matrix Z with the sample data as vertices. and the normalized Laplacian matrix ;
[0164] A relationship matrix construction unit is used to obtain a must-link set and a must-not-link set according to the paired constraint information of the sample data; construct a must-link matrix M according to the must-link set, and construct a must-not-link matrix Q according to the must-not-link set;
[0165] Objective function building unit, used to build the objective function:
[0166] ,
[0167] in Represents the square of the Frobenius norm of the matrix; represents the trace of a matrix; represents the transpose of the matrix; the first hyperparameter and the second hyperparameter are all positive numbers greater than 0; penalty parameters is a positive number greater than 0; the spectral embedding matrix F satisfies ,in express is the identity matrix of order; c is the number of clusters.
[0168] An iterative calculation unit, used for obtaining a local optimal solution of the objective function by using an alternating iteration method;
[0169] Clustering unit, according to the local optimal solution Z of the bipartite graph matrix Z opt , calculate the local optimal solution S of the similarity matrix Sopt , the local optimal solution S of the similarity matrix S opt The sample points in each connected branch are clustered into one category.
[0170] A semi-supervised clustering device based on bipartite graph acceleration and incorporating pairwise constraints provided in an embodiment of the present invention can execute a semi-supervised clustering method based on bipartite graph acceleration and incorporating pairwise constraints provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. It is worth noting that in the device provided in an embodiment of the present invention, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0171] Embodiment 5
[0172] Please see attached Figure 3 , Figure 3 1 is a schematic diagram of the structure of a semi-supervised clustering device based on bipartite graph acceleration and incorporating pairwise constraints according to an embodiment of the present invention. The device 20 includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, the steps in the above method embodiment are implemented. Alternatively, when the processor 21 executes the computer program, the functions of each module / unit in the above device embodiments are implemented.
[0173] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the semi-supervised clustering device 20 based on bipartite graph acceleration and incorporating pairwise constraints. For example, the computer program may be divided into the modules in Embodiment 2. For the specific functions of each module, please refer to the working process of the device described in the above embodiment, which will not be repeated here.
[0174] The semi-supervised clustering device 20 with pairwise constraints based on bipartite graph acceleration may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art may understand that the schematic diagram is merely an example of a semi-supervised clustering device 20 with pairwise constraints based on bipartite graph acceleration, and does not constitute a limitation of a semi-supervised clustering device 20 with pairwise constraints based on bipartite graph acceleration, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the semi-supervised clustering device 20 with pairwise constraints based on bipartite graph acceleration may also include input and output devices, network access devices, buses, and the like.
[0175] The processor 21 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 21 is the control center of the semi-supervised clustering device 20 based on bipartite graph acceleration and incorporating pairwise constraints, and uses various interfaces and lines to connect the various parts of the semi-supervised clustering device 20 based on bipartite graph acceleration and incorporating pairwise constraints.
[0176] The memory 22 can be used to store the computer program and / or module. The processor 21 realizes various functions of the semi-supervised clustering device 20 based on bipartite graph acceleration and integrating pairwise constraints by running or executing the computer program and / or module stored in the memory 22 and calling the data stored in the memory 22. The memory 22 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0177] Wherein, if the module / unit integrated in the semi-supervised clustering device 20 based on bipartite graph acceleration and incorporating pairwise constraints is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 21. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.
[0178] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between the modules, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement the invention without creative work.
[0179] So far, the technical solutions of the present invention have been described in combination with examples, but it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A semi-supervised clustering method based on bipartite graph acceleration and incorporating pairwise constraints, which can be used for video face clustering. Characterized in that, It includes the following steps: S1. Obtain a sample data matrix X, where the sample data matrix X includes n sample data, each sample data corresponds to a sample point, and the dimension of the sample data is d; obtain anchor points according to the sample data matrix X, and construct an anchor point matrix B; the number of anchor points is m, and m < d, and m < n; S2. Initialize the anchor matrix B so that BB T =I m , where I m represents the identity matrix of order m; Construct a bipartite graph matrix Z according to the sample data matrix X and the anchor point matrix B; S3, taking the sample data as vertices, constructing a similarity matrix S and a similarity graph Laplace matrix L according to the bipartite graph matrix Z S and the normalized Laplacian matrix S4. According to the pairwise constraint information of the sample data, obtain a must-link set and a must-not-link set, and construct a must-link matrix M and a must-not-link matrix Q; S5. Construct an objective function: in represents the square of the Frobenius norm of the matrix; Tr(×) represents the trace of the matrix; (×) T represents the transpose of the matrix; the first hyperparameter λ 1 and the second hyperparameter λ 2 are all positive numbers greater than 0; the penalty parameter λ 3 is a positive number greater than 0; the spectral embedding matrix F satisfies F T F=I c , where I c represents the c-order identity matrix, where c is the number of clusters; S6. Use the alternating iteration method to obtain the local optimal solution of the objective function; S7, according to the local optimal solution Z of the bipartite graph matrix Z opt , calculate the local optimal solution S of the similarity matrix S opt , the local optimal solution S of the similarity matrix S opt The sample points in each connected branch are clustered into one category.
2. The semi-supervised clustering method according to claim 1, Characterized in that, The method for constructing the bipartite graph matrix Z includes: A bipartite graph matrix Z is constructed between the sample point and the anchor point, the element value range of the bipartite graph matrix Z is between [0, 1], and the bipartite graph matrix Z satisfies the constraint condition Z1 m =1 n ; Among them, 1 m represents a column vector of dimension m whose elements are all 1, 1 n Represents a column vector of dimension n whose elements are all 1.
3. The semi-supervised clustering method according to claim 2, Characterized in that, The method of step S3 includes: Construct the similarity matrix S = ZZ T ; Construct the similarity graph Laplacian matrix L S =D S -S, where the first diagonal matrix D S The diagonal elements (D S ) ll =(ZZ T 1 n ) l ,l=1,2,...,n, the first diagonal matrix D S The remaining elements of are zero; Construct the normalized Laplacian matrix Among them, D S -1 / 2 Denote the first diagonal matrix D S All elements of I are raised to the power of -1 / 2. n Represents the n-th order identity matrix.
4. The semi-supervised clustering method according to claim 1, Characterized in that, The steps for constructing the must-link matrix M include: Select the element M of the matrix M that must be linked ij , if M ij The corresponding i-th sample data x i and the jth sample data x j The sample pairs formed belong to the required link set, then let M ij =1, otherwise let M ij =0, where i = 1, 2,..., n; j = 1, 2,..., n; the must-link matrix M is an n×n matrix.
5. The semi-supervised clustering method according to claim 3, Characterized in that, The steps for constructing the must-not-link matrix Q include: Construct the rth unlinked column vector q according to the rth sample pair in the unlinked set r , the rth sample pair includes the i′th sample data x i′ and the j′th sample data x j′ , so that the rth column vector q is not necessarily linked r The i′th element of is 1, so that the rth column vector q is not necessarily linked r The j′th element is -1, and the rth column vector q is not linked r The dimension is n, so that q r The remaining elements of are randomly selected in the interval (-1,1); where i′=1,2,...,n; j′=1,2,…,n; i′ <j′; The rth column vector q must not be linked r Apply constraints so that q r T L S q r =0; Let r = 1, 2, ..., n CL , with q r Construct unlink matrix for column vector The unlinked matrix Q is n×n CL Matrix, n CL is the number of sample pairs in the unlinked set.
6. The semi-supervised clustering method according to claim 5, Characterized in that, The steps for using the alternating iteration method to obtain the local optimal solution of the objective function include: S61. Fix the must-not-link matrix Q, the bipartite graph matrix Z, and the spectral embedding matrix F, and optimize the anchor point matrix B; S62. Fix the anchor point matrix B, the bipartite graph matrix Z, and the spectral embedding matrix F, and optimize the must-not-link matrix Q; S63. Fix the anchor point matrix B, the must-not-link matrix Q, and the spectral embedding matrix F, and optimize the bipartite graph matrix Z; S64. Fix the anchor point matrix B, the must-not-link matrix Q, and the bipartite graph matrix Z, and optimize the spectral embedding matrix F; S65, determine whether the convergence condition is met, if not, jump to step S61, if the convergence condition is met, output the local optimal solution Z of the bipartite graph matrix Z opt .
7. The semi-supervised clustering method according to claim 6, Characterized in that, The specific steps for optimizing the anchor point matrix B include: X T Z performs singular value decomposition, and X T Z=USV T , solve the intermediate matrix S, the pseudo-diagonal elements S of the intermediate matrix S ee For X T The singular values of Z, the remaining elements of the intermediate matrix S are zero; Make the pseudo-diagonal elements of the intermediate matrix S satisfy the condition S ee >S gg , and solve the corresponding left matrix U and right matrix V; where, e = 1, 2, …, k; g = 1, 2, …, k; e < g; k is the rank of the matrix X T Z; Get the first m columns of the left matrix U m ; Solve the local optimal solution B of the anchor matrix B opt =U m V T .
8. The semi-supervised clustering method according to claim 6, Characterized in that, The specific steps for optimizing the must-not-link matrix Q are: For the sample pairs in the unlinked set (x i′ ,x j′ ), from the rth unlinked column vector q r Extract the sample column vector q from rp and the remaining column vector q ru ; Select the i′th row element Zl of the bipartite graph matrix Z i′ and the j′th row element Zl j′ , construct a sample bipartite graph matrix Use the remaining row elements of the bipartite graph matrix Z to construct the remaining bipartite graph matrix Z u ; According to the first diagonal matrix D S Construct the remaining diagonal matrix D Su ; The sample column vector q rp Calculate the updated residual column vector Use the updated remaining column vector The elements of correspond to updating the rth unlinked column vector q in the unlinked matrix Q r The corresponding element of .
9. The semi-supervised clustering method according to claim 6, Characterized in that, The specific steps for optimizing the bipartite graph matrix Z include: Fix the first diagonal matrix D S , the optimization problem is equivalent to: in Solve the bipartite graph matrix Z by the augmented Lagrangian method; Update the first diagonal matrix D S , similar graph Laplacian matrix L S and the normalized Laplacian matrix 10. The method according to claim 6, Characterized in that, The specific steps for optimizing the spectral embedding matrix F include: According to the optimization problem of F right Perform eigenvalue decomposition and obtain m eigenvalues β 1 3β 2 …3β c …3β m , and the corresponding m eigenvectors f 1 ,f 2 ,…,f c ,…,f m ; Select the first c eigenvalues β from the m eigenvalues 1 3β 2 …3β c , and the corresponding c eigenvectors f 1 ,f 2 ,...,f c , find the local optimal solution F of the spectral embedding matrix F opt : where the number of clusters c and the number of anchor points m satisfy the condition c < m.
Citation Information
Patent Citations
Weak supervision multi-view learning method integrated with pairwise constraint prior information
CN115935211A
