Method and system for directed graph data feature extraction and representation based on association matrix
By using an association matrix-based method to encode and regularize nodes and edges in directed graph data, the problem of insufficient feature extraction in existing technologies for directed graph data is solved. This enables the reconstruction and link prediction of directed graphs, improving the accuracy and completeness of feature extraction.
Patent Information
- Application Number
- CN202211066764.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing technologies cannot effectively extract features from directed graph data, cannot extract edge and direction information from directed graphs, and lose structural information when operating on adjacency matrices or Laplacian matrices.
A method based on the correlation matrix is used to encode the node set and edge set of directed graph data. The correlation matrix is then used to map them to node feature vectors and edge feature vectors in the same feature space. Structural information is extracted through regularization constraints to achieve the reconstruction and link prediction of the directed graph.
It enables automated feature extraction and representation of directed graph data, effectively handling the reconstruction and link prediction problems of directed graphs, and improving the accuracy and completeness of feature extraction.
Smart Images

Figure CN115544307B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer edge computing and artificial intelligence, and specifically relates to a method and system for feature extraction and representation of directed graph data based on the correlation matrix. Background Technology
[0002] Graph data is a highly complex data structure, representing discrete data in non-Euclidean space. Because graph data studies the relationships between different objects, its applications are widespread in daily life, such as automated design of neural network structures, construction and optimization of causal reasoning models, and analysis and improvement of constraint solvers. Therefore, a deeper and more systematic study of feature extraction and representation methods for graph data is of great significance for solving real-world problems.
[0003] Directed graphs are a more complex graph data structure that describes directional relationships, specifically unidirectional associations. For example, in traffic flow prediction, different paths are directional, so a directed graph is needed to represent them when modeling the data. To analyze and solve this problem more deeply, it's crucial to fully extract the features of directed edges and nodes. Unlike tabular data, graph data studies the relationships between different elements, often many-to-many. Graph data is formed by modeling research objects as nodes and the relationships between objects as edges between nodes, connecting nodes representing different objects based on these relationships. Depending on the research object, graph data can be broadly divided into undirected and directed graphs. In certain domains, the relationships between different objects need to be directional; in this case, edges can only point from some nodes to others, forming a directed graph. Directed graphs are a type of graph data that describes directional relationships, and their feature extraction and representation methods are more complex.
[0004] To process non-Euclidean discrete data like graphs, combining deep learning techniques with graph data structures is a mainstream approach, and graph neural networks (GNNs) are a highly effective means of solving this problem. Depending on the implementation, GNNs can be divided into spectral decomposition-based GNNs and spatial structure-based GNNs. GNNs can map the original input graph data to a new, continuously differentiable feature space, allowing for graph data analysis and processing. However, existing GNNs are designed for undirected graphs; their construction principles and implementation details require undirected inputs and cannot be directly transferred to directed graph tasks. In this context, many works have attempted to modify and optimize existing GNNs to enable feature extraction from directed graphs. However, these works typically involve relaxing and scaling the adjacency or Laplacian matrix of the directed graph to make the directed graph input satisfy the conditions for GNNs, thus enabling feature extraction and graph data processing using GNNs. However, this approach has two problems: First, approximating or scaling the adjacency matrix or Laplacian matrix will result in the loss of some structural information, and the features extracted by graph convolutional neural networks can only be used for tasks that do not require structural information; second, due to the limitations of the existing graph convolutional neural network principle, this approach can only extract node-level features and cannot obtain edge and direction information, which brings certain limitations and difficulties to the processing of directed graph data. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a method and system for feature extraction and representation of directed graph data based on the correlation matrix, which addresses the above-mentioned problems in the prior art. This invention aims to solve the problem that existing methods cannot fully extract the features of directed graph data, and to achieve effective processing of problems such as reconstruction of directed graphs, modeling of directed edges, and prediction of directed links.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] A method for feature extraction and representation of directed graph data based on the correlation matrix, comprising:
[0008] S1, aligns the node set V and the association matrix B of the input directed graph data;
[0009] S2, using the correlation matrix B, encode and sample the node set V and edge set E in the input directed graph data into node feature vectors Z in the same feature space. v And edge eigenvector Z e ;
[0010] S3, for the node feature vector Z v And edge eigenvector Z e Regularization constraints are applied to extract the structural information of the graph data into the feature vector obtained by the regularization constraints, and the feature vector obtained by the regularization constraints is output as the feature representation result.
[0011] Optionally, step S2 includes:
[0012] S2.1, Generate node initialization features from the node set V. Based on the association matrix B and node initialization features Generate edge initialization feature ε;
[0013] S2.2, Initialize node features Embedding is performed to obtain node feature vectors The edge initialization feature ε is embedded to obtain the edge feature vector ε′ in order to achieve sparsity reduction;
[0014] S2.3, use the correlation matrix B to extract the node feature vectors respectively. Encoded as node feature vector Z v The distribution of edge feature vectors, encoding edge feature vectors ε′ into edge feature vectors Z. e Distribution;
[0015] S2.4, respectively, for the node feature vector Z v The node feature vector Z is obtained by sampling the distribution. v , Eigenvectors of opposite sides Z e The edge feature vector Z is obtained by sampling the distribution. e .
[0016] Optionally, in step S2.1, the node set V is used to generate node initialization features. If the input directed graph data contains node attribute information, then the node attribute information is directly used as the node initialization feature. Otherwise, the attribute information of the nodes is generated based on the topological information of the input directed graph data, and the attribute information of the nodes is directly used as the node initialization features. The features based on the association matrix B and node initialization The function expression for generating the edge initialization feature ε is: in These are the weight parameters.
[0017] Optionally, in step S2.2, the node's initialization features are... Embedding is performed to obtain node feature vectors The function expression for embedding the edge initialization feature ε to obtain the edge feature vector ε′ is:
[0018] ε′=ψ E (ε),
[0019] In the above formula, ψ V To initialize node features The embedding function for embedding, ψ E This is an embedding function that embeds the edge initialization feature ε.
[0020] Optionally, in step S2.3, the node feature vectors are respectively processed using the correlation matrix B. Encoded as node feature vector Z v The distribution of edge feature vectors, encoding edge feature vectors ε′ into edge feature vectors Z. e The functional expression for the distribution is:
[0021]
[0022]
[0023] In the above formula, Let represent the characteristic distribution of the nodes, and n be the number of nodes in the input directed graph. For the posterior probability of node features, For node v i The multivariate Gaussian distribution, z v,i For node v i The latent space random variable, μ v,i For node v i The mean of the Gaussian distribution, σ v,i For node v i Gaussian distribution variance, p(Z) e |ε,B) represents the feature distribution of the edges, m is the number of edges in the input directed graph, and p(z) e,i |ε,B) is an edge e i The posterior probability of the features, For edge e i The multivariate Gaussian distribution, z e,i For edge e i The latent space random variable, μ e,i For edge e i The mean of the Gaussian distribution, σ e,i For edge e i The Gaussian distribution variance; and the final node feature vector Z. v The distribution is Edge feature vector Z e The distribution is Where μ v σ is the variance of the node features. v μ is the mean of the node features. eLet σ be the variance of the edge features. e The mean of the edge features.
[0024] Optionally, in step S2.4, the node feature vector Z is processed respectively. v The node feature vector Z is obtained by sampling the distribution. v , Eigenvectors of opposite sides Z e The edge feature vector Z is obtained by sampling the distribution. e In this context, sampling refers to sampling using a parameter reconstruction method, and the functional expression for sampling using the parameter reconstruction method is:
[0025] z i =∈ i ⊙σ i +μ i ,
[0026] In the above formula, z i Z is the node feature vector obtained by sampling. v or edge feature vector Z e , A random vector obtained by sampling from a standard normal distribution, σ i μ is the mean of the node features or edge features. i denoted as , where is the variance of node or edge features, and ⊙ represents the Hadamard product.
[0027] Optionally, the functional expression for the regularization constraint in step S2 is:
[0028]
[0029] In the above formula, p(B|Z) e Z v Let p(B) represent the incidence matrix of the input directed graph, m be the number of edges in the input directed graph, n be the number of nodes in the input directed graph, and p(B) be the number of nodes in the input directed graph. ij |z e,i ,z v,j ) is the element B of the correlation matrix ij The posterior probability, p(B) ij =1|z e,i ,z v,j ) is the element B of the correlation matrix ij The posterior probability when z = 1, where σ is the Sigmoid function, z e,i For edge e i The latent space random variable, z v,j For node v j The latent space random variable, Ψ(z) e,i ,z v,j ) for z e,i z v,j The correlation between them.
[0030] Optionally, any edge and node e i v j The function expression for calculating the correlation between them is:
[0031]
[0032] In the above formula, Let ω be the metric matrix. e ω is the correlation metric for edges. v This is the correlation metric for nodes.
[0033] Optionally, before step S1, the weight parameters are further included. metric matrix As learnable parameters, the optimal learnable parameters are obtained by iteratively executing steps S1 to S3 based on directed graph data samples. The expression for the loss function used in iteratively executing steps S1 to S3 to obtain the optimal learnable parameters is as follows:
[0034]
[0035] In the above formula, Let ω be the loss function, and ω be all learnable parameters. For mathematical expectation, p ω (B|Z e Z v ) represents the posterior probability of the correlation matrix B; α and β are hyperparameters used to control the influence of the regularization constraint KL on the solution of the entire optimization problem, and their values range from [0,1]; KL[p ω (Z e |ε,B)||p(Z e )] indicates the calculation of p ω (Z e |ε,B) and p(Z) e The degree of correlation between the two, with a higher correlation value indicating a stronger correlation. Indicates calculation and p(Z) v The degree of correlation between ) and p ω (Z e |ε,B) represents the feature distribution under all learnable parameters ω, p(Z) e ) represents the true probability of the edge feature. p(Z) represents the feature distribution of the nodes under all learnable parameters ω. v ) represents the true probability of a node feature.
[0036] Furthermore, the present invention also provides a directed graph data feature extraction and representation system based on an association matrix, comprising a microprocessor and a memory interconnected thereto, wherein the microprocessor is programmed or configured to execute the steps of the directed graph data feature extraction and representation method based on the association matrix.
[0037] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, the computer program being programmed or configured by a microprocessor to perform the steps of the method for extracting and representing directed graph data features based on the association matrix.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] 1. The method for feature extraction and representation of directed graph data based on the adjacency matrix of this invention includes aligning the node set V and the adjacency matrix B of the input directed graph data; and using the adjacency matrix B to encode and sample the node set V and edge set E in the input directed graph data into node feature vectors Z in the same feature space. v And edge eigenvector Z e ; For the node feature vector Z v And edge eigenvector Z e Regularization constraints are applied to extract structural information from graph data into the feature vectors obtained through regularization constraints, and these feature vectors are then output as the feature representation results. This invention addresses the problem that existing methods cannot fully extract features from directed graph data, enabling effective processing of problems such as directed graph reconstruction, directed edge modeling, and directed link prediction.
[0040] 2. This invention provides an end-to-end method for feature extraction from directed graph data. That is, the method of this invention can realize automated feature extraction and representation of directed graph data without the need for additional processing. Given a directed graph dataset, this embodiment can automatically analyze, process and learn it, and give the final feature representation. Attached Figure Description
[0041] Figure 1 This is a schematic diagram illustrating the principle framework of the method in an embodiment of the present invention.
[0042] Figure 2 This is a diagram illustrating the construction method of a binary classification problem in an embodiment of the present invention.
[0043] Figure 3 This is a flowchart of the state-adaptive perception method R(·) in an embodiment of the present invention.
[0044] Figure 4 This is a flowchart illustrating the search process of the method in an embodiment of the present invention. Detailed Implementation
[0045] Directed graph data is used to describe the interaction relationships between different entities or events, and these interactions are directed, i.e., directed edges. Directed graphs can be used to describe, analyze, and solve process scheduling and time series problems in engineering projects. For a large-scale computational engineering project (Project) for a supercomputer system, it can be divided into several computational engineering sub-projects, which can be called activities, each subject to certain constraints. For computational engineering project problems, the focus should be on whether the computational engineering project can be completed normally, what the related activities are that affect the project's progress, and the shortest time estimate for completing the project.
[0046] Based on this, the various activities of a computational engineering project can be abstracted as follows:
[0047] Node: Used to represent an activity, specifically a sub-project of a computational project;
[0048] Directed edges: used to represent the precedence (or dependency) relationship between different activities, that is, the execution of activity B (ActiveB) is conditional on the completion of activity A (ActiveA). If there is no precedence relationship between two activities, there is no directed edge connecting the corresponding two nodes; if activity A must be performed between activities B, there is a directed edge from the node corresponding to activity A to the node corresponding to activity B.
[0049] Therefore, based on the method and system for feature extraction and representation of directed graph data based on the association matrix of this invention, the features (attributes) of directed nodes and edges can be effectively obtained. The features (attributes) of nodes can be used to analyze the importance of activities and identify key nodes in the target project. The features (attributes) of edges can be used to analyze the overall situation of the entire project, such as shortest time estimation. The mapping calculation between these node and edge features (attributes) and the desired results generally uses a machine learning classifier. The machine learning classifier is pre-trained to establish the mapping relationship between node and edge features (attributes) and the desired results. In application, the node or edge features (attributes) obtained by the method and system for feature extraction and representation of directed graph data based on the association matrix of this invention are used as input to the machine learning classifier to obtain the corresponding results, such as key nodes or shortest time in the target project. The following will provide a more detailed description of the method and system for feature extraction and representation of directed graph data based on the association matrix (VDGAE, or Variational Directed Graph Auto-Encoders) of this invention, in conjunction with the accompanying drawings and specific embodiments.
[0050] like Figure 1 As shown, the method for feature extraction and representation of directed graph data based on the correlation matrix in this embodiment includes:
[0051] S1, aligns the node set V and the association matrix B of the input directed graph data;
[0052] S2, using the correlation matrix B, encode and sample the node set V and edge set E in the input directed graph data into node feature vectors Z in the same feature space. v And edge eigenvector Z e ;
[0053] S3, for the node feature vector Z v And edge eigenvector Z e Regularization constraints are applied to extract the structural information of the graph data into the feature vector obtained by the regularization constraints, and the feature vector obtained by the regularization constraints is output as the feature representation result.
[0054] A directed graph can be represented as G = (V, E), where V = {v1, v2, ..., v} n Let} be the set of nodes in the directed graph G, and n = |V| represent the number of nodes in the directed graph. Let e represent the set of directed edges, where each element e ij ∈E represents a path formed by node v i Pointing to v j The directed edges of a directed graph G. If the edges of a directed graph G have weights W... ij If the weight of an edge is greater than or equal to 0, then G is a weighted directed graph. For simplicity, the weight of the edges in all directed graphs mentioned in this paper is defined as W. ij =1.
[0055] Given a directed graph G, its incidence matrix can be represented as B(G), or simply the incidence matrix B. The incidence matrix is a {0, ±1} matrix, where its rows and columns correspond one-to-one with the edges and nodes of graph G, respectively. The value of each element represents the relationship between the edge and the corresponding node. If graph G has m directed edges and n nodes, then its incidence matrix B is an m×n matrix, and the value of each element is defined as in formula (1):
[0056]
[0057] In the above formula, B ij (e i ,v j ) represents the element in the i-th row and j-th column of the incidence matrix, which indicates the edge e. i and node v j The relationship between node v.j It is edge e i The endpoint, then B ij =1, if node v j It is edge e i The starting point, then B ij =-1, otherwise B ij =0. Because graph data is a data structure describing the relationships between different objects, and is a non-Euclidean discrete data, graph data can be constructed into arbitrary sizes and complex topologies. It has no fixed node order or reference point, and its structure is usually dynamic and multimodal, varying depending on the objects being described. While these characteristics give graph data stronger expressive power and allow for wide application in different task scenarios, they also bring significant difficulties to feature extraction and representation. Therefore, before starting graph data feature extraction, preprocessing work such as alignment must be performed. Given a set of graph data G:
[0058]
[0059] Among them, G i For example, the i-th graph data in n graph data; Figure 2 As shown, the preprocessing of graph data includes:
[0060] S101, If the input directed graph data (hereinafter referred to as the input graph) does not contain the incidence matrix B, then the incidence matrix B is constructed from the input directed graph data (hereinafter referred to as the input graph) G(A,X); if the input directed graph data contains the incidence matrix B, then this step can be omitted.
[0061] S102, calculate the size of the input directed graph data, i.e. the length of the node set |V|;
[0062] S103, calculate the size difference, which is the difference max(|V) between the largest directed graph data in the dataset and the largest data in the dataset. i |)-|V|, where |V i | indicates the largest directed graph in the dataset, with index i.
[0063] S104, perform a fill operation on the input graph data. For the node set, fill the nodes of type DUMMY (nodes of a specified type, to distinguish them from ordinary nodes). Fill the corresponding columns of the association matrix with all-zero vectors to achieve alignment with the largest graph data in the dataset.
[0064] S105: Check whether the input graph data has given information such as node attributes and categories. If it has, directly input the embedding function to perform feature transformation and return the initialization result. If it has not, use the topological structure information of the graph data to initialize the features of the nodes and edges, and then input the embedding function to return the final initialization result.
[0065] In the above preprocessing process, by performing an overall analysis of the dataset, the graph with the largest number of nodes among all graph data is obtained, i.e., the max graph is obtained. i∈[0,n] (|V(G i Next, for graphs smaller than the maximum size, alignment operations are performed, mainly involving two aspects: one is aligning the node set V(G)... i Fill the space to make its length reach the maximum. i∈[0,n] (|V(G i The type of the nodes to be filled should be set to a special type for subsequent pruning operations; another is to perform B(G) on the association matrix. i The columns of the graph are filled to ensure that the number of columns in the association matrix matches the length of the node set after filling. The filling content consists of all zero entries, which will not affect the information ultimately expressed by the graph data. Through the above preprocessing of graph data, the graph data can be standardized, giving it stronger expressive power and enabling its wide application in different task scenarios.
[0066] like Figure 3 As shown, step S2 in this embodiment includes:
[0067] S2.1, Generate node initialization features from the node set V. Based on the association matrix B and node initialization features Generate edge initialization features ε; common graph data is usually stored in the form of an adjacency matrix A and a feature matrix X. The adjacency matrix A stores the connection relationships between nodes, and the feature matrix X stores the attributes and category of each node, i.e., G(A,X). If the input graph data does not have a given adjacency matrix, the adjacency matrix needs to be converted into an adjacency matrix before proceeding with the subsequent feature extraction and representation of the graph data;
[0068] S2.2, Initialize node features Embedding is performed to obtain node feature vectors The edge initialization feature ε is embedded to obtain the edge feature vector ε′ in order to achieve sparsity reduction;
[0069] S2.3, use the correlation matrix B to extract the node feature vectors respectively. Encoded as node feature vector Z v The distribution of edge feature vectors, encoding edge feature vectors ε′ into edge feature vectors Z. eDistribution;
[0070] S2.4, respectively, for the node feature vector Z v The node feature vector Z is obtained by sampling the distribution. v , Eigenvectors of opposite sides Z e The edge feature vector Z is obtained by sampling the distribution. e .
[0071] See Figure 3 In the graph data encoding step of this embodiment, feature encoding is first performed on the node initialization feature vectors and edge feature vectors of the input graph data to obtain the feature distribution of nodes and edges, i.e. and p(Z) e |ε,B). Then, using the parameter reconstruction method, the specific feature vectors of the nodes and edges are sampled, i.e. and Finally, a regularization constraint is added to the sampled feature vectors so that structural information can be embedded into the feature vectors of nodes and edges, i.e., p(B|Z). v Z e ), returns the result of the regularization constraint.
[0072] In this embodiment, step S2.1 generates node initialization features from the node set V. If the input directed graph data contains node attribute information, then the node attribute information is directly used as the node initialization feature. Otherwise, the attribute information of the nodes is generated based on the topological information of the input directed graph data, and the attribute information of the nodes is directly used as the node initialization features. The features based on the association matrix B and node initialization The function expression for generating the edge initialization feature ε is:
[0073]
[0074] in, These are the weight parameters.
[0075] In this embodiment, step S2.2 initializes the node features. Embedding is performed to obtain node feature vectors The function expression for embedding the edge initialization feature ε to obtain the edge feature vector ε′ is:
[0076] ε′=ψ E (ε), (3)
[0077] In the above formula, ψ V To initialize node features The embedding function for embedding, ψ EThis is an embedding function that embeds the edge initialization feature ε. The key to this embodiment is to fully extract the features of the directed graph data by utilizing the relationship between the edges and nodes expressed by the association matrix, thereby enabling its continuously differentiable representation. Given a directed graph G, if node attributes, categories, and other information are not given, it needs to be initialized based on the topological structure information of the input graph data itself. Similarly, the edges also need to be initialized. There are two ways to initialize the edges: one is to use the nodes and the association matrix, i.e., equation (2), where These are learnable parameters. In addition, the initial features of nodes and edges in graph data are usually very sparse. In order to better extract the features of graph data, it is necessary to convert them into a relatively compact expression during data preprocessing. Here, an embedding function is introduced to achieve this operation, as shown in Equation (3).
[0078] Graph data describes the relationships between different objects; therefore, extracting the topological structure information of the graph is crucial in the feature extraction and representation process. Traditional graph convolutional neural network-based methods primarily extract structural information in two ways: one is by using the connectivity provided by the adjacency matrix to aggregate the features of neighboring nodes; the other is by using the adjacency matrix to construct paths (i.e., a group of related nodes) in the graph data and then using a message passing mechanism to extract the graph data's structural information. Unlike traditional methods, this embodiment primarily utilizes the association matrix to extract the structural information of the graph data. In step S2.3, the association matrix B is used to extract the node feature vectors... Encoded as node feature vector Z v The distribution of edge feature vectors, encoding edge feature vectors ε′ into edge feature vectors Z. e The functional expression for the distribution is:
[0079]
[0080]
[0081] In the above formula, Let represent the characteristic distribution of the nodes, and n be the number of nodes in the input directed graph. For the posterior probability of node features, For node v i The multivariate Gaussian distribution, z v,i For node v i The latent space random variable, μ v,i For node v i The mean of the Gaussian distribution, σ v,i For node v i Gaussian distribution variance, p(Z) e |ε,B) represents the feature distribution of the edges, m is the number of edges in the input directed graph, and p(z)e,i |ε,B) is an edge e i The posterior probability of the features, For edge e i The multivariate Gaussian distribution, z e,i For edge e i The latent space random variable, μ e,i For edge e i The mean of the Gaussian distribution, σ e,i For edge e i The Gaussian distribution variance; and the final node feature vector Z. v The distribution is Edge feature vector Z e The distribution is Where μ v σ is the variance of the node features. v μ is the mean of the node features. e Let σ be the variance of the edge features. e This represents the mean of the edge features. Unlike traditional methods, in this embodiment, the encoder encodes nodes and edges into a distribution, rather than a fixed vector, i.e. and Using this method, on the one hand, we can improve the diversity of coding, that is, we can obtain a coding suitable for the current application scenario for different tasks. On the other hand, we can obtain richer coding information, so as to express graph data more accurately.
[0082] In step S2.4 of this embodiment, the node feature vector Z is processed respectively. v The node feature vector Z is obtained by sampling the distribution. v , Eigenvectors of opposite sides Z e The edge feature vector Z is obtained by sampling the distribution. e In this context, sampling refers to sampling using a parameter reconstruction method, and the functional expression for sampling using the parameter reconstruction method is:
[0083] z i =∈ i ⊙σ i +μ i (6)
[0084] In the above formula, z i Z is the node feature vector obtained by sampling. v or edge feature vector Z e , A random vector obtained by sampling from a standard normal distribution, σ i μ is the mean of the node features or edge features. iLet ⊙ represent the variance of node or edge features. Since the encoding yields a distribution rather than a fixed vector, a concrete representation is needed instead of an uncertain distribution when calculating the relationship between nodes and edges. Therefore, this embodiment proposes a sampling strategy using parameter reconstruction. This strategy allows for obtaining a concrete representation vector from the encoded distribution while ensuring that the gradient persists during optimization and that backpropagation is successful.
[0085] In this embodiment, the functional expression for the regularization constraint in step S2 is:
[0086]
[0087] In the above formula, p(B|Z) e Let p(B, Zv) represent the input directed graph, where B is the incidence matrix of the input directed graph, m is the number of edges in the input directed graph, n is the number of nodes in the input directed graph, and p(B) is the number of nodes in the input directed graph. ij |z e,i ,z v,j ) is the element B of the correlation matrix ij The posterior probability, p(B) ij =1|z e,i ,z v,j ) is the element B of the correlation matrix ij The posterior probability when z = 1, where σ is the Sigmoid function, z e,i For edge e i The latent space random variable, z v,j For node v j The latent space random variable, Ψ(z) e,i ,z v,j ) for z e,i z v,jThe correlation between them. By mapping the graph data to a distribution through step S2.3, a certain feature vector can be obtained by sampling in the distribution through step S2.4, that is, the representation vectors of different nodes and different directed edges are obtained. However, since the topological structures of different graph data are different, the structural information should be converted into regularization constraints and added to the feature vector so that different graph data can have different representations, and the representation can fully reflect the characteristics of the graph data. Based on this, this embodiment makes full use of the relationship between nodes and directed edges described by the correlation matrix, and converts this relationship into regularization constraints, so that the structural information of the graph data can be extracted into the feature vector more fully, thereby providing a good foundation for the subsequent processing of the graph data. The specific regularization constraint is shown in Equation (7). The described regularization constraint uses the non-zero terms in the correlation matrix to enhance the correlation between the connected edges and nodes, thereby realizing the extraction of the structural information of the graph data. σ(·) is the Sigmoid function, which is used to limit the range of values of Ψ(·) output to the interval [0,1]. Ψ(e i ,v j ) is a correlation measurement function; the larger the output, the stronger the correlation between edges e. i and node v j The greater the correlation between them. Specifically, in this embodiment, any edge and node e i v j The function expression for calculating the correlation between them is:
[0088]
[0089] In the above formula, Let ω be the metric matrix. e ω is the correlation metric for edges. v This is the correlation metric for nodes.
[0090] To better extract and represent features from directed graph data, this embodiment presents an end-to-end automated feature extraction strategy. The main principle is to use gradient descent to train the entire system to obtain the final solution, including the previously mentioned learnable parameters. Specifically, this embodiment includes setting weight parameters before step S1. metric matrix As learnable parameters, the optimal learnable parameters are obtained by iteratively executing steps S1 to S3 based on directed graph data samples. The expression for the loss function used in iteratively executing steps S1 to S3 to obtain the optimal learnable parameters is as follows:
[0091]
[0092] In the above formula, Let ω be the loss function, and ω be all learnable parameters. For mathematical expectation, p ω (B|Z e Z v ) represents the posterior probability of the correlation matrix B; α and β are hyperparameters used to control the influence of the regularization constraint KL on the solution of the entire optimization problem, and their values range from [0,1]; KL[p ω (Z e |ε,B)||p(Z e )] indicates the calculation of p ω (Z e |ε,B) and p(Z) e The degree of correlation between the two, with a higher correlation value indicating a stronger correlation. Indicates calculation and p(Z) v The degree of correlation between ) and p ω (Z e |ε,B) represents the feature distribution under all learnable parameters ω, p(Z) e ) represents the true probability of the edge feature. p(Z) represents the feature distribution of the nodes under all learnable parameters ω. v ) represents the true probability of a node feature. The correlation between two distinct distributions p and q can be calculated as KL(p||q). The larger the value of KL(p||q), the more similar the distributions p and q are. Figure 4 This is a flowchart of the search process of the method in this embodiment, including: First, initializing the features of the input directed graph data G; then, encoding the initialized feature vectors using a graph data encoding module; next, applying regularization constraints to the encoded and sampled feature vectors; finally, inputting the regularization constraint result and the correlation matrix of the input graph data into the loss function shown in equation (9). In this process, the optimal solution to the optimization problem is calculated, and it is determined whether the current result is optimal. If it is optimal, the directed graph data feature representation obtained from the current calculation is returned; otherwise, the gradient of the current operation function is backpropagated using the gradient descent method to update the graph. Figure 1 To obtain the parameters of the network structure, repeat the above operation until the weight parameters are obtained. metric matrix The optimal solution is found, and training ends.
[0093] Furthermore, this embodiment also provides a directed graph data feature extraction and representation system based on an association matrix, including a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to execute the steps of the aforementioned directed graph data feature extraction and representation method based on an association matrix. See also Figure 1The system in this embodiment includes a feature initialization module, a directed graph data encoding module, a directed graph feature data regularization constraint module, and an objective function for the final automated feature extraction and expression. The main functions of each module are described as follows: The directed graph data initialization module is mainly used to embed and map sparse node features and edge features. For graph data without given node attributes, categories, or other information, the topological structure information of the input graph data itself is used to initialize the features of nodes and edges. The directed graph data encoding module takes the initial features of nodes and edges as input, encodes the features of nodes and edges of the graph data into a distribution, and then uses the parameter reconstruction method to sample and obtain a fixed feature vector for each node and each edge. The directed graph data feature regularization constraint module takes the feature encoding vectors of nodes and edges as input and performs regularization constraint operations on them so that the structural information of the directed graph, especially the direction information, can be extracted more fully into the feature vector. The objective function shown in Equation (9) is the mathematical optimization model of the automated feature extraction strategy in this embodiment, and is the optimization objective for solving the optimal solution of the optimization problem by the gradient descent method. Using this objective function, all parameters of the entire representation system can be solved, including the learnable parameters mentioned earlier: weight parameters. and metric matrix
[0094] Furthermore, this embodiment also provides a computer-readable storage medium storing a computer program, which is used to be programmed or configured by a microprocessor to perform the steps of the aforementioned method for extracting and representing directed graph data features based on an association matrix.
[0095] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0096] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for feature extraction and representation of directed graph data based on the correlation matrix, characterized in that, include: S1 is the set of nodes in the input directed graph data. V and the correlation matrix B Perform alignment operations; S2, using the correlation matrix B For each set of nodes in the input directed graph data V Sum of edges E Each node is encoded and sampled separately into feature vectors within the same feature space. and edge feature vectors ; S3, for node feature vectors and edge feature vectors Regularization constraints are applied to extract the structural information of the graph data into the feature vector obtained by the regularization constraints, and the feature vector obtained by the regularization constraints is output as the feature representation result. Step S2 includes: S2.1, set the nodes V Generate node initialization features Based on the association matrix B and node initialization features Generate edge initialization features ; S2.2, Initialize node features Embedding is performed to obtain node feature vectors Initialize the features of the edges Embedding is performed to obtain the edge feature vector. To achieve sparsity reduction; S2.3, using the correlation matrix respectively B node feature vectors Encoded as node feature vectors The distribution of edge feature vectors Encoded as edge feature vectors Distribution; S2.4, respectively, for the node feature vectors The node feature vector is obtained by sampling the distribution. , Eigenvectors of opposite sides The edge feature vector is obtained by sampling the distribution. ; The function expression for the regularization constraint in step S2 is: , In the above formula, express, The incidence matrix of the input directed graph, Given the number of edges in a directed graph, To input the number of nodes in a directed graph, For elements of the correlation matrix The posterior probability, For elements of the correlation matrix The posterior probability at time , For the Sigmoid function, For the edge Latent space random variables, For nodes Latent space random variables, for The correlation between them.
2. The method for feature extraction and representation of directed graph data based on the correlation matrix according to claim 1, characterized in that, In step S2.1, the node set V Generate node initialization features If the input directed graph data contains node attribute information, then the node attribute information is directly used as the node initialization feature. Otherwise, the attribute information of the nodes is generated based on the topological information of the input directed graph data, and the attribute information of the nodes is directly used as the node initialization features. ; The association matrix B and node initialization features Generate edge initialization features The function expression is: ,in As the weight parameters, the node features are initialized in step S2.
2. Embedding is performed to obtain node feature vectors Initialize the features of the edges Embedding is performed to obtain the edge feature vector. The function expression is: , In the above formula, To initialize node features The embedding function for embedding. To initialize the features of the edges The embedding function for performing the embedding.
3. The method for feature extraction and representation of directed graph data based on the correlation matrix according to claim 1, characterized in that, In step S2.3, the correlation matrix is used respectively. B node feature vectors Encoded as node feature vectors The distribution of edge feature vectors Encoded as edge feature vectors The functional expression for the distribution is: , , In the above formula, For the characteristic distribution of nodes, To input the number of nodes in a directed graph, For the posterior probability of node features, For nodes The multivariate Gaussian distribution, For nodes Latent space random variables, For nodes The mean of the Gaussian distribution. For nodes The variance of the Gaussian distribution. The characteristic distribution of the edges, Given the number of edges in a directed graph, For the edge The posterior probability of the features, For the edge The multivariate Gaussian distribution, For the edge Latent space random variables, For the edge The mean of the Gaussian distribution. For the edge The Gaussian distribution variance; and the final node feature vector. The distribution is Edge feature vector The distribution is ,in Let V be the variance of the node features. The mean of the node features. Let Variance be the variance of the edge features. The mean of the edge features.
4. The method for feature extraction and representation of directed graph data based on the correlation matrix according to claim 1, characterized in that, In step S2.4, the node feature vectors are processed respectively. The node feature vector is obtained by sampling the distribution. , Eigenvectors of opposite sides The edge feature vector is obtained by sampling the distribution. In this context, sampling refers to sampling using a parameter reconstruction method, and the functional expression for sampling using the parameter reconstruction method is: , In the above formula, The node feature vector obtained by sampling or edge feature vector , It is a random vector obtained by sampling from a standard normal distribution. This represents the mean of the node or edge features. The variance of node features or edge features. It represents the Hadamardi (or Hadama) stack.
5. The method for feature extraction and representation of directed graph data based on the correlation matrix according to claim 1, characterized in that, Arbitrary edges and nodes The function expression for calculating the correlation between them is: , In the above formula, For the metric matrix, For the correlation metric of edges, This is the correlation metric for nodes.
6. The method for feature extraction and representation of directed graph data based on the correlation matrix according to claim 5, characterized in that, Step S1 includes setting weight parameters. metric matrix As learnable parameters, the optimal learnable parameters are obtained by iteratively executing steps S1 to S3 based on directed graph data samples. The expression for the loss function used in iteratively executing steps S1 to S3 to obtain the optimal learnable parameters is as follows: , In the above formula, For loss function, For all learnable parameters, For mathematical expectation, Let B be the posterior probability of the correlation matrix. and The hyperparameter is used to control the influence of the regularization constraint KL on the solution of the entire optimization problem, and its value range is [value range missing]. ; Indicates calculation and The degree of correlation between them; a higher correlation value indicates a higher degree of correlation. Indicates calculation and The degree of correlation between them Represents all learnable parameters The following is a feature distribution. The true probability of the edge feature. Represents all learnable parameters Feature distribution of the next node This represents the true probability of a node's features.
7. A system for feature extraction and representation of directed graph data based on an association matrix, comprising a microprocessor and a memory interconnected, characterized in that, The microprocessor is programmed or configured to execute the method for feature extraction and representation of directed graph data based on the correlation matrix as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, The computer program is used to be programmed or configured by a microprocessor to execute the method for extracting and representing directed graph data features based on the association matrix as described in any one of claims 1 to 6.