Complex network clustering method and system based on comparative learning optimization
By introducing a triangle model and significance matrix into complex network clustering, the comparative learning loss function is optimized, and the problem of inability to effectively distinguish positive and negative samples from false positive samples in the prior art is solved, and more accurate clustering results are achieved.
Patent Information
- Application Number
- CN202411550834.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The method used for clustering of comparative learning in the prior art cannot effectively expand the positive samples in comparative learning, cannot strictly distinguish false positive samples, and the distribution of positive and negative samples is uneven, which reduces the model's ability to identify a few categories.
A complex network clustering method based on contrast learning optimization is proposed. By identifying a triangular model from the first complex network, constructing a model adjacency matrix, weighting the complex network, obtaining the second complex network, and obtaining the significance matrix through clustering processing, calculating the model homogeneity loss and the comparison loss between nodes, and adjusting the network parameters to obtain the target complex network.
Effectively identify false positive samples, optimize positive samples selection, reduce misjudgment of positive samples, and improve the accuracy of clustering results.
Smart Images

Figure CN119598234A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network processing technology, and in particular to a complex network clustering method and system based on contrastive learning optimization. Background Art
[0002] In the related art, contrastive learning is a self-supervised learning method that does not rely on labeled data. It learns the representation of complex networks by maximizing the similarity between positive sample pairs and minimizing the similarity between negative sample pairs in complex networks. Since the current methods of using contrastive learning for clustering in complex networks are mainly focused on the enhancement of complex networks, it is impossible to effectively expand the positive samples in contrastive learning, nor can it strictly distinguish false positive samples. In addition, the definition of the existing contrastive learning loss function makes it impossible to evenly distribute positive and negative samples, reducing the model's ability to recognize minority categories, and thus unable to effectively process nodes near the decision boundary, resulting in an inability to well identify false positive samples.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a complex network clustering method and system based on contrastive learning optimization, which can effectively identify false positive samples.
[0005] To achieve the above object, an embodiment of the present application proposes a complex network clustering method based on contrastive learning optimization, the method comprising the following steps:
[0006] Identifying a triangular motif from a first complex network, wherein the first complex network includes a network adjacency matrix and a feature matrix;
[0007] Constructing a motif adjacency matrix of the triangular motif according to the network adjacency matrix;
[0008] Performing weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network;
[0009] Performing clustering processing on the second complex network to obtain a saliency matrix, and calculating the motif homogeneity loss obtained in the clustering process, wherein the saliency in the saliency matrix is used to distinguish positive samples between two views in contrastive learning;
[0010] Probabilistically enhancing the second complex network to obtain a first view and a second view;
[0011] Calculating inter-node contrast loss of the first view and the second view according to the saliency matrix;
[0012] According to the motif homogeneity loss and the inter-node contrast loss, the network parameters of the first complex network are adjusted to obtain a target complex network;
[0013] The preset information is clustered through the target complex network.
[0014] In some embodiments, the step of identifying a triangular motif from the first complex network includes:
[0015] Calculating a motif morphology evaluation score in the first complex network;
[0016] A triangular motif is determined from the first complex network according to the motif morphology evaluation score.
[0017] In some embodiments, clustering the second complex network to obtain a significance matrix includes:
[0018] Using a k-means algorithm to cluster the nodes in the second complex network to obtain a number of cluster centers;
[0019] Calculate the probability that each node in the second complex network belongs to each of the cluster centers as a posterior probability by using a Gaussian distribution model;
[0020] Obtaining a priori probability that each node in the second complex network belongs to each of the cluster centers;
[0021] Calculating a clustering allocation matrix according to the posterior probability and the prior probability;
[0022] The significance matrix is calculated based on the cluster assignment matrix.
[0023] In some embodiments, the calculation formula of the motif homogeneity loss is as follows:
[0024]
[0025] In the formula, L Moho represents the homogeneity loss of the motif, k represents the total number of cluster centers, r represents the rth cluster center, and E represents the set of edges in the second complex network; (V i , V j )∈E represents the edge formed by the i-th node and the j-th node in the second complex network and belongs to the edge in the set E; MSE() represents the calculation method of mean square error, represents the cluster value in the cluster assignment matrix.
[0026] In some embodiments, the probabilistically enhancing the second complex network to obtain the first view and the second view includes:
[0027] Calculating the importance weights of nodes in the second complex network;
[0028] Obtaining the attenuation factor and the first node drop probability;
[0029] Calculating a second node discard probability according to the node importance weight, the decay factor and the first node discard probability;
[0030] Calculating the edge drop probability according to the second node drop probability;
[0031] The second complex network is processed according to the edge discard probability to obtain the first view and the second view.
[0032] In some embodiments, the calculation formula of the second node drop probability is as follows:
[0033]
[0034] In the formula, p′ drop (v i ) represents the probability of second node dropping, p drop represents the first node drop probability, ε represents the attenuation factor, represents the importance weight of the node;
[0035] The calculation formula of the edge drop probability is as follows:
[0036]
[0037] In the formula, p′ drop (e ij ) represents the edge drop probability, p′ drop (v i ) represents node v i The probability of second node dropping, p′ drop (v j ) represents the second node drop probability of node vj.
[0038] In some embodiments, the calculation formula of the inter-node contrast loss is as follows:
[0039]
[0040] In the formula, L cont represents the inter-node contrast loss, N represents the total number of nodes in the first view or the second view; l cont (u i ,v i ) is calculated by the following formula:
[0041]
[0042] In the formula, θ() represents the cosine similarity function, N u (i) and N v (i) represents the node neighbor set in the first view and the second view, u i represents the i-th node in the node neighbor set, v i and v k Respectively represent the i-th node and the k-th node in the node neighbor set; S ij represents the significance in the significance matrix, and τ represents the temperature parameter;
[0043] l cont (v i ,u i ) is calculated by the following formula:
[0044]
[0045] In the formula,
[0046] In some embodiments, adjusting the network parameters of the first complex network according to the motif homogeneity loss and the inter-node contrast loss to obtain a target complex network includes:
[0047] Obtaining the homogeneity loss weight of the motif;
[0048] Calculating the overall loss according to the motif homogeneity loss weight, the motif homogeneity loss and the inter-node contrast loss;
[0049] When the size of the overall loss meets the preset requirements, the node embedding parameters corresponding to the optimized complex network are output;
[0050] The complex network corresponding to the node embedding parameters is used as the target complex network.
[0051] To achieve the above purpose, another aspect of the embodiment of the present application proposes a complex network clustering system based on contrastive learning optimization, the system comprising:
[0052] A first module is used to identify a triangular motif from a first complex network, wherein the first complex network includes a network adjacency matrix and a feature matrix;
[0053] A second module is used to construct a motif adjacency matrix of the triangular motif according to the network adjacency matrix;
[0054] A third module is used to perform weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network;
[0055] A fourth module is used to perform clustering processing on the second complex network to obtain a saliency matrix, and calculate the homogeneity loss of the motif obtained in the clustering process, wherein the saliency in the saliency matrix is used to distinguish positive samples between two views in contrastive learning;
[0056] A fifth module, configured to perform probability enhancement on the second complex network to obtain a first view and a second view;
[0057] A sixth module, configured to calculate the inter-node contrast loss of the first view and the second view according to the saliency matrix;
[0058] A seventh module is used to adjust the network parameters of the first complex network according to the motif homogeneity loss and the inter-node contrast loss to obtain a target complex network;
[0059] The eighth module is used to cluster the preset information through the target complex network.
[0060] To achieve the above purpose, another aspect of the embodiment of the present application proposes a complex network clustering system based on contrastive learning optimization, including:
[0061] at least one processor;
[0062] at least one memory for storing at least one program;
[0063] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0064] The embodiments of the present application include at least the following beneficial effects: The present application provides a complex network clustering method and system based on contrastive learning optimization. The scheme obtains a triangular motif by identifying it from a first complex network, and then can deeply explore the high-order structural features of the complex network through the triangular motif, and then constructs a motif adjacency matrix of the triangular motif according to the network adjacency matrix in the complex network, and then performs weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network, and then performs clustering processing on the second complex network to obtain a saliency matrix, and can optimize the selection of positive samples of the two views in contrastive learning through the saliency in the saliency matrix to reduce the misjudgment of positive samples, and at the same time calculate the motif homogeneity loss obtained in the clustering process, and after probability enhancement of the second complex network to obtain the first view and the second view, calculate the node contrast loss of the first view and the second view according to the saliency matrix, and then adjust the network parameters of the first complex network according to the motif homogeneity loss and the node contrast loss to obtain the target complex network, and cluster the preset information through the target complex network, and then can effectively improve the accuracy of the clustering results. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 is a flow chart of a complex network clustering method based on contrastive learning optimization provided in an embodiment of the present application;
[0066] Figure 2 It is a schematic diagram of an application framework of a complex network clustering method based on contrastive learning optimization provided in an embodiment of the present application;
[0067] Figure 3 It is a schematic diagram of a complex network reconstructed by a motif provided in an embodiment of the present application;
[0068] Figure 4 It is a module schematic diagram of a complex network clustering system based on contrastive learning optimization provided in an embodiment of the present application;
[0069] Figure 5 It is a schematic diagram of the hardware structure of a complex network clustering system based on contrastive learning optimization provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application, they are only examples of systems and methods consistent with some aspects of the embodiments of the present application.
[0071] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0072] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0074] In the related art, contrastive learning is a self-supervised learning method that does not rely on labeled data. It learns the representation of complex networks by maximizing the similarity between positive sample pairs and minimizing the similarity between negative sample pairs in complex networks. The method of using contrastive learning for clustering in complex networks is mainly an enhancement of complex networks, which cannot strictly distinguish false positive samples. In addition, the definition of most contrastive learning loss functions in the past makes it impossible to evenly distribute positive and negative samples, which may reduce the model's ability to recognize minority categories and cannot handle nodes near the decision boundary well, resulting in an inability to identify false positive samples well.
[0075] In view of this, an embodiment of the present application provides a complex network clustering method and system based on contrastive learning optimization. The present application obtains a triangular motif by identifying it from a first complex network, and then can deeply explore the high-order structural features of the complex network through the triangular motif, and then constructs a motif adjacency matrix of the triangular motif according to the network adjacency matrix in the complex network, and then performs weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network, and then performs clustering processing on the second complex network to obtain a significance matrix, and can optimize the selection of positive samples of the two views in contrastive learning through the significance in the significance matrix to reduce the misjudgment of positive samples, and at the same time calculate the motif homogeneity loss obtained in the clustering process, and after probability enhancement of the second complex network to obtain the first view and the second view, calculate the node contrast loss of the first view and the second view according to the significance matrix, and then adjust the network parameters of the first complex network according to the motif homogeneity loss and the node contrast loss to obtain the target complex network, and cluster the preset information through the target complex network, thereby effectively improving the accuracy of the clustering results.
[0076] The complex network clustering method based on contrastive learning optimization provided in the embodiment of the present application relates to the field of network processing technology. The complex network clustering method based on contrastive learning optimization provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The cloud server, the server can also be a node server in the blockchain network; the software can be an application that implements a complex network clustering method based on contrastive learning optimization, etc., but is not limited to the above form.
[0077] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0078] Figure 1 is an optional flow chart of a complex network clustering method based on contrastive learning optimization provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S110 to S180:
[0079] Step S110, identifying a triangular motif from a first complex network, wherein the first complex network includes a network adjacency matrix and a feature matrix;
[0080] Step S120, constructing a motif adjacency matrix of the triangular motif according to the network adjacency matrix;
[0081] Step S130, performing weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network;
[0082] Step S140, clustering the second complex network to obtain a saliency matrix, and calculating the motif homogeneity loss obtained in the clustering process, wherein the saliency in the saliency matrix is used to distinguish positive samples between two views in contrastive learning;
[0083] Step S150, performing probability enhancement on the second complex network to obtain a first view and a second view;
[0084] Step S160, calculating the inter-node contrast loss of the first view and the second view according to the saliency matrix;
[0085] Step S170, adjusting the network parameters of the first complex network according to the motif homogeneity loss and the inter-node contrast loss to obtain a target complex network;
[0086] Step S180: clustering the preset information through the target complex network.
[0087] In the embodiment of the present application, it is first assumed that in the complex network G = (V, E), V = {V 1 ,V 2 ,…,V N} represents a complex network node set, is the set of complex network edges. The adjacency matrix and characteristic matrix of a complex network are respectively represented by A∈{0,1} N×N and X∈R N×d Indicates that if (V i ,V j )∈E then A ij =1,x i ∈R d Yes V i The node representation after experimental learning is represented as H = f θ (X, A), U = f θ (X 1 ,A′ 1 ), V=F θ (X 2 ,A′ 2 ), where H, U, and V represent the embedding matrix of the node, σ(·) is the RELU activation function, and f θ The representation of a two-layer GCN as an encoder is given by formula (1) and formula (2):
[0088]
[0089] f θ(X,A)=GC 2 (GC 1 (X,A),A) Formula (2);
[0090] in, is the self-loop adjacency matrix, is the degree matrix of A+I, I is the identity matrix, W i is a trainable weight matrix.
[0091] Based on the above assumptions, the process of identifying the triangular motif from the first complex network in the present application can be to first calculate the motif morphology evaluation score in the first complex network, and then determine the triangular motif from the first complex network according to the motif morphology evaluation score. Specifically, first calculate the standard score (z-score) of each motif morphology by formula (3):
[0092]
[0093] In the formula, K total , and They represent the total number, mean and variance of the motifs M in the complex network G respectively.
[0094] After calculating the standard score of the response, the motif shape with the highest standard score is selected as the triangle motif involved in the embodiment of the present application.
[0095] In the embodiment of the present application, after the motif adjacency matrix of the triangular motif is constructed according to the network adjacency matrix, the first complex network is weighted by the adjacency matrix and the network adjacency matrix to obtain the second complex network. Specifically, the calculation formula of the motif adjacency matrix is shown in formula (4):
[0096]
[0097] In the formula, v represents the motif adjacency matrix, which can also represent the total number of motifs M that contain both node i and node j. That is, v represents the set of nodes. Node i and node j appear in the set v at the same time. W m (i,j) plus 1, and the final accumulated value is used as the element of the motif adjacency matrix; W m (i,j) represents the motif adjacency matrix.
[0098] Then, the first complex network is reweighted by formula (5) to obtain the adjacency matrix A′(i,j) of the second complex network:
[0099] A′(i,j)=A(i,j)+W m (i,j) Formula (5);
[0100] In the formula, A(i,j) represents the adjacency matrix of the first complex network.
[0101] In the embodiment of the present application, the process of clustering the second complex network to obtain a significance matrix includes but is not limited to the following steps:
[0102] The probability that each node in the second complex network belongs to each cluster center is calculated as the posterior probability through the Gaussian distribution model;
[0103] Obtaining the prior probability that each node in the second complex network belongs to each cluster center;
[0104] The clustering assignment matrix is calculated based on the posterior probability and the prior probability;
[0105] The significance matrix is calculated based on the cluster assignment matrix.
[0106] It can be understood that after obtaining the second complex network, the k-means algorithm is used to obtain k cluster centers {C 1 ,C 2 ,···,C k}, after taking the cluster center obtained by k-means as the optimization parameter of GMM, calculate each node h i Belongs to each cluster C i The probability of , that is, the calculation formula of the posterior probability is shown in formula (6):
[0107]
[0108] In the formula, σ 2 Represents the variance of the Gaussian distribution.
[0109] At the same time, the prior probability that each node in the second complex network belongs to each cluster center Soft clustering value between nodes and clusters The calculation process is shown in formula (7):
[0110]
[0111] Based on formula (7), the clustering assignment matrix can be obtained (or expressed as R), the significance matrix is calculated based on the clustering assignment matrix, and the calculation process is shown in formula (8):
[0112]
[0113] In the formula, S ij It can be used to distinguish the true positive samples between two views in contrastive learning. norm(·) represents the L 2 Normalization.
[0114] When clustering the second complex network, the motif homogeneity loss of the motif is calculated, and the calculation process is shown in formula (9):
[0115]
[0116] In the formula, L Moho represents the homogeneity loss of the motif, k represents the total number of cluster centers, r represents the rth cluster center, and E represents the set of edges in the second complex network; (V i , V j )∈E represents the edge formed by the i-th node and the j-th node in the second complex network and belongs to the edge in the set E; MSE() represents the calculation method of mean square error, represents the cluster value in the cluster assignment matrix.
[0117] In the embodiment of the present application, the process of performing probability enhancement on the second complex network to obtain the first view and the second view includes but is not limited to the following steps:
[0118] Calculate the importance weights of nodes in the second complex network;
[0119] Obtaining the attenuation factor and the first node drop probability;
[0120] Calculating the second node drop probability according to the node importance weight, the decay factor and the first node drop probability;
[0121] Calculate the edge drop probability according to the second node drop probability;
[0122] The second complex network is processed according to the edge discard probability to obtain a first view and a second view.
[0123] It is understandable that this embodiment can optimize the complex network model based on contrastive learning. Specifically, by fusion motif analysis, the significant relationship between the node pairs of the second complex network and the homogeneity metric is obtained to optimize the selection of positive samples in contrastive learning in the complex network. By carefully discarding nodes and edges of the complex network, combined with the vertex degree d(v i ) and the degree of the maximum vertex maxd(v), calculate the node importance weight, and the calculation process is shown in formula (10):
[0124]
[0125] It can be understood that since the probability enhancement is based on a decay factor ε with a value between (0,1], the drop probability of the original node (the drop probability of the first node) is recalculated by formula (11) to obtain the drop probability of the second node p′ drop (vi ):
[0126]
[0127] The edge e is calculated by formula (12): ij The drop probability (edge drop probability) p′ drop (e ij ):
[0128]
[0129] In the formula, p′ drop (v i ) represents node v i The probability of second node dropping, p′ drop (v j ) represents node v j The probability of second node being dropped.
[0130] After enhancing the second complex network by the discarding probability of nodes and edges, two complex network views (the first view and the second view) can be obtained, and then the inter-node contrast loss is calculated by formula (13):
[0131]
[0132] In the formula, L count represents the contrast loss between nodes, N represents the total number of nodes in the first view or the second view; l cont (u i ,v i ) is calculated by formula (14):
[0133]
[0134] In the formula, θ() represents the cosine similarity function, N u (i) and N v (i) represents the node neighbor set in the first view and the second view, u i represents the i-th node in the node neighbor set, v i and v k Respectively represent the i-th node and the k-th node in the node neighbor set; S ij represents the significance in the significance matrix, and τ represents the temperature parameter;
[0135] l cont (v i ,u i ) is calculated by formula (15):
[0136]
[0137] In the formula,
[0138] After obtaining the inter-node contrast loss, the network parameters of the first complex network are adjusted according to the motif homogeneity loss and the inter-node contrast loss to obtain the target complex network. The processing of this step includes but is not limited to the following steps:
[0139] Get the motif homogeneity loss weight;
[0140] The overall loss is calculated based on the motif homogeneity loss weight, motif homogeneity loss, and inter-node contrast loss;
[0141] When the size of the overall loss meets the preset requirements, the node embedding parameters corresponding to the optimized complex network are output;
[0142] The complex network corresponding to the node embedding parameters is used as the target complex network.
[0143] It can be understood that the calculation process of the overall loss is as shown in formula (16):
[0144] Loss = L cont +αL Moho Formula (16);
[0145] In the formula, Loss represents the overall loss, and α represents the motif homogeneity loss weight.
[0146] The pseudo code corresponding to the processing process of this application is shown in Table 1:
[0147] Table 1
[0148]
[0149]
[0150] It can be seen from the above that the present application uses the triangular motif in the complex network to deeply explore the high-order structural characteristics of the network to achieve effective encoding of high-order connections. And on the basis of fully considering the homogeneity of the complex network, the k-means algorithm is combined with the Gaussian mixture model to obtain the cluster allocation matrix, as well as the true intimacy relationship between nodes, and the nodes can be operated to belong to multiple clusters with different probabilities, so as to optimize the selection of positive samples in contrastive learning through the cluster allocation matrix and the node pair significance relationship, so as to effectively expand the positive samples in contrastive learning, and then solve the problem of the ownership of nodes at the class boundary, effectively reduce the misjudgment of positive samples, and improve the performance of complex networks. In addition, the method corresponding to the embodiment of the present application can not only be integrated with the existing node-level contrastive learning framework, expand its functions and performance, and help decision support, but also optimize the clustering, classification, structural evaluation, functional evolution and future trend prediction of incomplete complex networks.
[0151] For example, five real public complex network datasets are used as examples, including two citation networks, PubMed and CiteSeer, a common purchase network, Amazon-photo, and two academic networks, Coauthor-CS and Coauthor-Phys ics. Figure 2 As shown, the present application first obtains the high-order features of the network through motif recognition, and then reconstructs a new complex network G by combining the features of the high-order network and the low-order network through the motif. 0 , G 0 On the one hand, we first generate the clustering matrix R, significance S and L through k-means soft clustering. Moho loss, and on the other hand, two views G are generated by probabilistic enhancement 1 and G 2 Input to the shared GNN (graph neural network) encoder and calculate K in combination with the saliency S cont loss, and the final output is the trained GNN encoder f θ As well as the node embedding H and clustering results, the classification accuracy, NMI (mutual information) and ARI (Rand coefficient) are used to evaluate the performance of the method proposed in this application.
[0152] Specifically, Figure 3 Taking the complex network shown in the figure as an example, the z-score value of the motif selected by the original complex network G is 18.71, which is statistically significant. Taking nodes 1, 4, and 5 as an example, their initial information is: 1 =[0,1,1,2,0,0,0,0],X 4 =[1,1,1,0,1,0,0,0],X 5 =[0,0,0,1,0,1,1,0], two M 12 The motif contains these two nodes, so W m (1,4)=2, that is, A′(1,4)=3. The network node information after the motif reconstruction is: X 1 =[0,2,2,3,0,0,0,0],X 2 =[2,0,0,2,0,0,0,0],X 3 =[2,0,0,2,0,0,0,0],X 4 =[3,2,2,0,1,0,0,0],X 5 =[0,0,0,1,0,2,2,0],X 6 =[0,0,0,0,2,0,3,2],X 7 =[0,0,0,0,2,3,0,2],X 8=[0,0,0,0,0,2,2,0].
[0153] The degree of nodes 1 and 4 is d(v 1 )=2,d(v 4 )=4, the degree of the maximum node is maxd(v)=4, and its importance weights are Assume the probability of first node dropping is p drop = 0.4 and attenuation factor ε = 0.3, then p′ drop (v 1 )=0.31,p′ drop (v 4 ) = 0.24 and p′ drop (e 14 )=0.275. Assuming that one of the centroids obtained by k-means initialization is node 4, the posterior probability that each other node belongs to the cluster where node 4 is located can be calculated.
[0154] and According to the Bayesian formula
[0155] R 1 =[0.1994,0.1227,0.1227,0.1159,0.0934,0.0615,0.0615,0.0733], R 2 =
[0156] [0.1227,0.1994,0.1209,0.1209,0.0952,0.0733,0.0733,0.0733], R 3 =[0.1227,0.1994,0.1209,0.1209,0.0952,0.0733,0.0733,0.0733], R 4 =[0.1124,0.0968,0.0968,0.1994,0.0726,0.0834,0.0834,0.0733], R 5 =[0.0934,0.0968,0.0968,0.0726,0.1994,0.1191,0.1191,0.1883], the significance relationship S between node 5 and other neighboring nodes is obtained from the cluster assignment matrix R 41 =0.0933, S 42 =0.0934, S 43 =0.0934, S 45 =0.0824, that is, the node significance of nodes 4 and 5 is low, which may be false positive samples, such as Figure 2As shown in the framework diagram, the intra-class pair of node 4 is G 1 The nodes 2, 3, and 5 of the class have positive pairs G 2 Node 4, the negative pair within the class of node 4 is G 1 The nodes 6, 7, 8 and the negative pairs between classes are G 2 The nodes 6, 7, and 8 are selected and their significance is used in the processing of positive samples in the contrastive learning loss function. The result shows that pos=10.99 is reduced to pos=7.71, which reduces the misjudgment of false positive samples by nodes near the class boundary. Finally, k-means is used to obtain two clusters, namely (1, 2, 3, 4) and (5, 6, 7, 8), which optimizes the performance of contrastive learning and cluster analysis and improves the research ability of complex networks with missing labels or incompleteness.
[0157] Reference Figure 4 , the embodiment of the present application provides a complex network clustering system based on contrastive learning optimization, the system comprising:
[0158] A first module 410 is used to identify a triangular motif from a first complex network, where the first complex network includes a network adjacency matrix and a feature matrix;
[0159] The second module 420 is used to construct a motif adjacency matrix of the triangular motif according to the network adjacency matrix;
[0160] The third module 430 is used to perform weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network;
[0161] The fourth module 440 is used to perform clustering processing on the second complex network to obtain a saliency matrix, and calculate the homogeneity loss of the motif obtained in the clustering process, and the saliency in the saliency matrix is used to distinguish positive samples between two views in contrastive learning;
[0162] A fifth module 450 is configured to perform probability enhancement on the second complex network to obtain a first view and a second view;
[0163] A sixth module 460, configured to calculate the inter-node contrast loss of the first view and the second view according to the saliency matrix;
[0164] The seventh module 470 is used to adjust the network parameters of the first complex network according to the motif homogeneity loss and the inter-node contrast loss to obtain a target complex network;
[0165] The eighth module 480 is used to cluster the preset information through the target complex network.
[0166] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0167] The embodiment of the present application also provides a complex network clustering system based on contrastive learning optimization, the system includes a memory and a processor, the memory stores a computer program, and the processor implements the complex network clustering method based on contrastive learning optimization when executing the computer program. The system can be any intelligent terminal including a tablet computer, a car computer, etc.
[0168] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0169] See also Figure 5 , Figure 5 The hardware structure of a complex network clustering system based on contrastive learning optimization in another embodiment is illustrated. The system includes:
[0170] The processor 510 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0171] The memory 520 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 520 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 520, and the processor 510 calls and executes the complex network clustering method based on contrastive learning optimization in the embodiment of this application;
[0172] Input / output interface 530, used to implement information input and output;
[0173] Communication interface 540, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0174] bus 550 , which transmits information between the various components of the device (e.g., processor 510 , memory 520 , input / output interface 530 , and communication interface 540 );
[0175] The processor 510 , the memory 520 , the input / output interface 530 and the communication interface 540 are connected to each other in communication within the device via the bus 550 .
[0176] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0177] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0178] The system embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0179] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0180] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0181] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0182] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0183] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0184] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0185] If the integrated unit 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0186] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A complex network clustering method based on contrastive learning optimization, characterized in that: The method comprises the following steps: Identifying a triangular motif from a first complex network, wherein the first complex network includes a network adjacency matrix and a feature matrix; Constructing a motif adjacency matrix of the triangular motif according to the network adjacency matrix; Performing weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network; Performing clustering processing on the second complex network to obtain a saliency matrix, and calculating the motif homogeneity loss obtained in the clustering process, wherein the saliency in the saliency matrix is used to distinguish positive samples between two views in contrastive learning; Probabilistically enhancing the second complex network to obtain a first view and a second view; Calculating inter-node contrast loss of the first view and the second view according to the saliency matrix; According to the motif homogeneity loss and the inter-node contrast loss, the network parameters of the first complex network are adjusted to obtain a target complex network; The preset information is clustered through the target complex network.
2. The method according to claim 1, characterized in that The step of identifying a triangular motif from the first complex network comprises: Calculating a motif morphology evaluation score in the first complex network; A triangular motif is determined from the first complex network according to the motif morphology evaluation score.
3. The method according to claim 1, characterized in that The clustering process for the second complex network to obtain a significance matrix includes: Using a k-means algorithm to cluster the nodes in the second complex network to obtain a number of cluster centers; Calculate the probability that each node in the second complex network belongs to each of the cluster centers as a posterior probability by using a Gaussian distribution model; Obtaining a priori probability that each node in the second complex network belongs to each of the cluster centers; Calculating a clustering allocation matrix according to the posterior probability and the prior probability; The significance matrix is calculated based on the cluster assignment matrix.
4. The method according to claim 3, characterized in that The calculation formula of the motif homogeneity loss is as follows: In the formula, L Moho represents the homogeneity loss of the motif, k represents the total number of cluster centers, r represents the rth cluster center, and E represents the set of edges in the second complex network; (V i , V j )∈E represents the edge formed by the i-th node and the j-th node in the second complex network and belongs to the edge in the set E; MSE() represents the calculation method of mean square error, represents the cluster value in the cluster assignment matrix.
5. The method according to claim 1, characterized in that: The step of probabilistically enhancing the second complex network to obtain the first view and the second view includes: Calculating the importance weights of nodes in the second complex network; Obtaining the attenuation factor and the first node drop probability; Calculating a second node discard probability according to the node importance weight, the decay factor and the first node discard probability; Calculating the edge drop probability according to the second node drop probability; The second complex network is processed according to the edge discard probability to obtain the first view and the second view.
6. The method according to claim 5, characterized in that The calculation formula of the second node drop probability is as follows: In the formula, p′ drop (v i ) represents the probability of second node dropping, p drop represents the probability of dropping the first node, ε represents the attenuation factor, and w vi represents the importance weight of the node; The calculation formula of the edge drop probability is as follows: In the formula, p′ drop (e ij ) represents the edge drop probability, p′ drop (v i ) represents node v i The probability of second node dropping, p′ drop (v j ) represents the second node drop probability of node vj.
7. The method according to claim 1, characterized in that The calculation formula of the inter-node contrast loss is as follows: In the formula, L cont represents the inter-node contrast loss, N represents the total number of nodes in the first view or the second view; l cont (u i ,v i ) is calculated by the following formula: In the formula, θ() represents the cosine similarity function, N u (i) and N v (i) represents the node neighbor set in the first view and the second view, u i represents the i-th node in the node neighbor set, v i and v k Respectively represent the i-th node and the k-th node in the node neighbor set; S ij represents the significance in the significance matrix, and τ represents the temperature parameter; l cont (v i ,u i ) is calculated by the following formula: Officially, 8. The method according to claim 1, characterized in that The step of adjusting the network parameters of the first complex network according to the motif homogeneity loss and the inter-node contrast loss to obtain a target complex network includes: Obtaining the homogeneity loss weight of the motif; Calculating the overall loss according to the motif homogeneity loss weight, the motif homogeneity loss and the inter-node contrast loss; When the size of the overall loss meets the preset requirements, the node embedding parameters corresponding to the optimized complex network are output; The complex network corresponding to the node embedding parameters is used as the target complex network.
9. A complex network clustering system based on contrastive learning optimization, characterized in that: The system comprises: A first module is used to identify a triangular motif from a first complex network, wherein the first complex network includes a network adjacency matrix and a feature matrix; A second module is used to construct a motif adjacency matrix of the triangular motif according to the network adjacency matrix; A third module is used to perform weighted processing on the first complex network according to the adjacency matrix and the network adjacency matrix to obtain a second complex network; A fourth module is used to perform clustering processing on the second complex network to obtain a saliency matrix, and calculate the homogeneity loss of the motif obtained in the clustering process, wherein the saliency in the saliency matrix is used to distinguish positive samples between two views in contrastive learning; A fifth module, configured to perform probability enhancement on the second complex network to obtain a first view and a second view; A sixth module, configured to calculate the inter-node contrast loss of the first view and the second view according to the saliency matrix; A seventh module is used to adjust the network parameters of the first complex network according to the motif homogeneity loss and the inter-node contrast loss to obtain a target complex network; The eighth module is used to cluster the preset information through the target complex network.
10. A complex network clustering system based on contrastive learning optimization, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 8.