System and method of connection information regularization, graph feature extraction and graph classification based on adjacency matrix
11461581 · 2022-10-04
Assignee
Inventors
- Zhiling Luo (Hangzhou, CN)
- Jianwei Yin (Hangzhou, CN)
- Zhaohui Wu (Hangzhou, CN)
- Shuiguang Deng (Hangzhou, CN)
- Ying Li (Hangzhou, CN)
- Jian Wu (Hangzhou, CN)
Cpc classification
G06V20/30
PHYSICS
G06V10/454
PHYSICS
G06V10/84
PHYSICS
G06F18/2415
PHYSICS
G06F18/2323
PHYSICS
G06N7/01
PHYSICS
G06V10/774
PHYSICS
G06F18/24143
PHYSICS
International classification
Abstract
Disclosed is system and method of connection information regularization, graph feature extraction and graph classification based on adjacency matrix. By concentrating the connection information elements in the adjacency matrix into a specific diagonal region of the adjacency matrix in order to reduce the non-connection information elements in advance. The subgraph structure of the graph is further extracted along the diagonal direction using the filter matrix. Then a stacked convolutional neural network is used to extract a larger subgraph structure. On the one hand, it greatly reduces the amount of computation and complexity, solving the limitations of the computational complexity and the limitations of window size. And on the other hand, it can capture large subgraph structure through a small window, as well as deep features from the implicit correlation structures at both vertex and edge level, which improves the accuracy and speed of the graph classification.
Claims
1. A connection information regularization system based on adjacency matrix in a computer environment, wherein the connection information regularization system is configured to reorder all vertices in a first adjacency matrix of a graph to obtain a second adjacency matrix; wherein connection information elements in the second adjacency matrix are mainly distributed in a diagonal region of the second adjacency matrix, the diagonal region having a size of n; where n is a positive integer, n≥2 and n is smaller than |V|; |V| is the number of rows or columns of the second adjacency matrix; wherein the diagonal region of the second adjacency matrix is composed of the following connection information elements: a positive integer i traverses from 1 to |V|; for i >max(n, |V|−n), elements from (i−n+1)-th to |V|-th columns in i-th row are selected; for i≤n, elements from 0-th to (i+n−1)-th columns in the i-th row are selected; for max(n, |V|−n)≥i≥min(|V|−n, n), elements from (i−n+1)-th to (i+n−1)-th columns in the i-th row are selected; wherein an element of the connection information elements is the corresponding element of an edge of the graph in the second adjacency matrix; the graph is a structure of objects in graph theory.
2. The system of claim 1, wherein when there is no weight on the edge of the graph, the value of the connection information element is 1 and the value of the non-connection information element is 0.
3. The system of claim 1, wherein when the edge of the graph has weight, the value of the connection information element is the weight of the edge, and the value of the non-connection information element is 0.
4. The system of claim 1, wherein the diagonal region refers to the diagonal region from the upper left corner to the lower right corner of a matrix.
5. The system of claim 1, wherein the diagonal region of the second adjacency matrix refers to a scanned area that is scanned diagonally by using a scanning rectangle with a size of n×n.
6. The system of claim 5, wherein the scanning process is described as follows: the upper left corner of the scanning rectangle is coincident with the upper left corner of the second adjacency matrix; then the scanning rectangle is moved by one grid down and to the right, until the lower right corner of the scanning rectangle coincides with the lower right corner of the second adjacency matrix.
7. The system of claim 1, wherein the connection information regularization system is configured to reorder all the vertices of the first adjacency matrix so that concentration of connection information elements in the diagonal region of the second adjacency matrix is maximized.
8. The system of claim 7, wherein the vertices of the first adjacency matrix are reordered by a greedy algorithm, which includes the following steps: (1) initial input: inputting the first adjacency matrix of the input graph as pending adjacency matrix; (2) counting swap pairs: calculating all possible vertex exchange pairs in the pending adjacency matrix; (3) row and column exchange: judging whether all possible vertex exchange pairs are in a processed state; when yes, outputting the pending adjacency matrix to obtain the second adjacency matrix, and the greedy algorithm ends; otherwise, selecting one vertex exchange pair as the current vertex exchange pair, and switching the corresponding two rows and two columns in the pending adjacent matrix to generate a new adjacency matrix and jump to Step (4); (4) exchange evaluation: calculating the concentration of connection information elements in new adjacency matrix; when the concentration of connection information elements in the new adjacency matrix is higher than before, accepting the exchange and replacing the pending adjacency matrix with the adjacency matrix and jumping to step (2); when the concentration of connection information elements in the new adjacency matrix is lower than or equal to before, abandoning the exchange, and marking the current vertex exchange pair as a processed state, and jumping the process to step (3).
9. The system of claim 7, wherein the vertices of the first adjacency matrix are reordered by a branch and bound algorithm, which includes the following steps: (1) initial input: inputting the first adjacency matrix of the input graph as pending adjacency matrix; (2) counting swap pairs: calculating all possible vertex exchange pairs in the pending adjacency matrix; (3) row and column exchange: judging whether all possible vertex exchange pairs are in a processed state; when yes, then outputting the pending adjacency matrix to obtain the second adjacency matrix, and ending the branch and bound algorithm; otherwise, performing an exchange operation for each of the unprocessed vertex exchange pairs and jumping to step (4); the exchange operation refers to simultaneous exchange of the two corresponding rows and columns in the pending adjacency matrix, and a new adjacency matrix is generated for each of said vertex exchange pairs performing the exchange operation; (4) exchange evaluation: calculating the concentration of connection information elements in each of the new adjacency matrixes, and when there is a new adjacency matrix in which the concentration of connection information elements is higher than before, selecting the newest adjacency matrix with the highest concentration and marking the vertex exchange pair as the processed state, and then going to step (3); when there is not a matrix whose concentration of elements is higher than before, outputting the current adjacency matrix to be processed to obtain the second adjacency matrix, and ending the branch and bound algorithm.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
DETAILED DESCRIPTION OF THE DISCLOSURE
(31) In order to make the objectives, technical solutions and advantages of the present disclosure clearer, we take the system and method of graph feature extraction and graph classification based on adjacency matrix in the computer environment described in the present disclosure as an example to further describe the technical scheme. The following examples are only for illustrating the present disclosure and are not intended to limit the scope of the present disclosure. In addition, it should be understood that after reading the teachings of the present disclosure, those skilled in the art can make various changes or modifications to the present disclosure, and these equivalent forms also fall within the scope defined by the appended claims of the present disclosure.
(32) One embodiment specifically implements a connection information regularization system in a computer environment provided by the present disclosure. The connection information regularization system reorders all the vertices in the first adjacency matrix of the graph to obtain a second adjacency matrix, and the connection information elements in the second adjacency matrix are mainly distributed in a diagonal area of n of second adjacency, where n is a positive integer, n≥2 and n<|V|, |V| is the number of rows or columns of the second adjacency matrix; preferably, said diagonal region refers to the diagonal region from the upper left corner to the lower right corner of the matrix. For example, the shaded region in
(33) The graphs and subgraphs mentioned are graphs in graph theory.
(34) The connection information element is the corresponding element of the edge of the graph in the adjacency matrix.
(35) The connection information regularization system concentrates the connection information elements in the adjacency matrix into a specific diagonal region with a width of n in the second adjacency matrix (n is the size of the subgraph represented by the extracted features, i.e. the window size. And n is a positive integer, and n≤|V|, the |V| is the number of rows or columns of the second adjacency matrix). And then a matrix of size n×n (that is, the window size is n) is used to traverse along the diagonal region to complete the extraction of the subgraph structure with the number of vertices n in the graph, and the required computational complexity and calculation amount are greatly reduced, solving the computational complexity limit.
(36) In the present disclosure, the vector refers to a quantity having a magnitude and a direction, and in mathematics, a 1×m matrix, where m is a positive integer greater than 1. The features described in the present disclosure all represent features of a graph.
(37) The adjacency matrix in the present disclosure refers to a matrix representing the adjacent relationship between the vertices of a graph. The basic properties of the adjacency matrix are that by switching the two columns of the adjacency matrix and the corresponding rows, another adjacency matrix representing the same graph can be got. Let G=(V, E) be a graph, V is the vertex set (vertex set), v.sub.i is the i-th vertex in V, |V| represents the number of vertices in V, i is positive integers and i≤|V|, E is an edge set. G's adjacency matrix is an n-order square matrix with the following properties:
(38) The adjacency matrix in the present disclosure refers to a matrix representing the adjacent relationship between the vertices of a graph. The basic properties of the adjacency matrix are that by switching the two columns of the adjacency matrix and the corresponding rows, another adjacency matrix representing the same graph can be got. Let G=(V, E) be a graph, V is the vertex set (vertex set), v.sub.i is the i-th vertex in V, |V| represents the number of vertices in V, i is positive integers and i≤|V|, E is an edge set. G's adjacency matrix is an n-order square matrix with the following properties: 1) For undirected graphs, the adjacency matrix must be symmetric, and the main diagonal must be zero (only undirected simple graphs are discussed here), the sub-diagonal is not necessarily zero, and directed graphs are not necessarily so; the main diagonal is the diagonal of the upper left corner to the lower right corner of the matrix; the sub-diagonal is the diagonal of the upper right corner of the matrix to the lower left corner of the matrix. 2) In a directed graph, the degree of any vertex v.sub.i is the number of all non-zero elements in the i-th column (or i-th row); the vertex i is represented as the i-th column (or i-th row) in the matrix. In a directed graph, the in-degree of vertex i is the number of all non-zero elements in the i-th row; the out-degree of the vertex is the the number of all non-zero elements in the i-th row; the degree of the vertex is the number of edges associated with the vertex; the out-degree of the vertex is the number of edges start from the vertex and point to other vertices; the in-degree of the vertex is the number of edges start from other vertices and point to the vertex. 3) The adjacency matrix method need |V|.sup.2 elements to represent a graph. Since the adjacency matrix of an undirected graph must be symmetric, only data in upper right or lower left triangle need to be stored except the zeros in diagonals. Therefore, only |V|×(|V|−1)/2 elements are needed; when the edges of the undirected graph are edges with weights, the values of the connected elements in the adjacency matrix are replaced by weights, and when there are no connected elements, use 0 instead.
(39) The connection information element of the present disclosure is the corresponding element of the edge of the graph in the adjacency matrix; in the undirected graph, the element value of the i-th row and the j-th column represents whether the connection of the vertex vi and the vertex v.sub.j exists and whether there are connection weights; the value of the element in the i-th row and the j-th column in the directed graph represents whether the connection of the vertex v.sub.i to the vertex v.sub.j exists and whether there is a connection weight. For example, if there is an edge between the vertex v.sub.i and the vertex v.sub.j in the undirected graph, then the element values of the corresponding i-th row, j-th column and j-th row i-th column in the adjacency matrix are all 1; if there are no edges, the corresponding element values of the i-th row, j-th column and the j-th row, the i-th column are all 0. If there are edges and the weight exists on the edge, they are all w; for another example, if there is an edge between vertex v.sub.i and vertex v.sub.j in a directed graph and there is an edge starting from vertex v.sub.i to vertex v.sub.j, then the element in i-th row and the j-th column of adjacency matrix is 1. If there is no edge pointing to the vertex v.sub.j from the vertex v.sub.i, the element value of the corresponding i-th row and j-th column is 0. If there is an edge from the vertex v.sub.i to the vertex v.sub.j, and there is a weight w on the edge, then the element value of the corresponding i-th row and j-th column is w; where i, j is a positive integer less than or equal to |V|, |V| is the number of vertices in the graph, w is any real number.
(40) Preferably, if there is no weight on the edge of the graph, the value of the connection information element is 1 and the value of the non-connection information element is 0. More preferably, if the edge of the graph is weighted. Then, the value of the connection information element is the edge weight value, and the value of the non-connection information element is 0.
(41) The first adjacency matrix of the present disclosure refers to the first adjacency matrix obtained by converting the graph into an adjacency matrix at the beginning, that is, the initial adjacency matrix before the exchange of the corresponding rows and columns. And the second adjacency matrix refers to the matrix obtained by performing the exchange corresponding rows and columns on first adjacency matrix to concentrate the connection information. The connection information elements in the second adjacency matrix are centrally distributed in a diagonal area of width n of the second adjacency matrix, where n is a positive integer, and n≤|V|, said |V| is the number of rows or columns of the second adjacency matrix. A schematic diagram of converting the first adjacency matrix to the second adjacency matrix is shown in
(42) Further, the diagonal region of the second adjacency matrix is composed of the following elements: a positive integer i traverses from 1 to |V|, and when i>max(n, |V|−n), the i-th row is selected. Element of (i−n+1) to |V| column; when i≤n, select elements from 0-th to i+n−1th columns in the i-th row; when max(n, |V|−n)≥I≥min(|V|−n,n), then in the i-th column, select elements from (i−n+1)-th column to (i+n−1)-th column;
(43) Preferably, the diagonal region of the second adjacency matrix refers to a scanned area that is scanned diagonally by using a scanning rectangle with a size n×n; more preferably, the scanning process is described as follows. First, the upper left corner of the scanning rectangle is coincident with the upper left corner of the second adjacency matrix; then each time the scanning rectangle is moved to the right and the down by one grid, until the lower right corner of the scanning rectangle coincides with the lower right corner of the second adjacency matrix.
(44) Further, the connection information regularization system is configured to reorder all the vertices of the first adjacency matrix so that concentration of connection information elements in the diagonal region of the second adjacency matrix is maximized; concentration of connection information elements refers to the ratio of non-zero elements in the diagonal area.
(45) Preferably, the reordering method is an integer optimization algorithm, which functions to concentrate the connection information elements in the matrix into the diagonal region and make the concentration of the connection information elements as high as possible; the integer optimization algorithm refers to an algorithm that makes the information elements of the matrix more concentrated by exchanging the corresponding two rows and columns in the matrix at the same time.
(46) Further, the reordering method is a greedy algorithm and includes the following steps:
(47) (1) Initial Input: Input the first adjacency matrix of the input graph as pending adjacency matrix.
(48) (2) Counting Swap Pairs: Calculate all possible vertex exchange pairs in the pending adjacency matrix.
(49) (3) Row and Column Exchange: It is judged whether all possible vertex exchange pairs are in a processed state. If yes, the pending adjacency matrix is output to obtain the second adjacency matrix, and the greedy algorithm ends; otherwise, one vertex exchange pair is selected as the current vertex exchange pair, and switch the corresponding two rows and two columns in the pending adjacent matrix to generate a new adjacency matrix and jump to Step (4);
(50) (4) Exchange Evaluation: Calculating the concentration of connection information elements in new adjacency matrix. If the concentration of connection information elements in the new adjacency matrix is higher than before, the exchange is accepted. The adjacency matrix replaces the pending adjacency matrix and jumps to step (2); if the concentration of connection information elements in the new adjacency matrix is lower than or equal to before. Then, the exchange is abandoned, and the current vertex exchange pair is marked as a processed state, and the process jumps to step (3).
(51) The flow diagram of the greedy algorithm refers to
(52) Further, the reordering method is a branch and bound algorithm and includes the following steps:
(53) (1) Initial Input: Input the first adjacency matrix of the input graph as pending adjacency matrix.
(54) (2) Counting Swap Pairs: Calculate all possible vertex exchange pairs in the pending adjacency matrix.
(55) (3) Row and Column Exchange: It is judged whether all possible vertex exchange pairs are in a processed state. If yes, then the pending adjacency matrix is output to obtain the second adjacency matrix, and the branch and bound algorithm ends; otherwise, perform an exchange operation for each of the unprocessed vertex exchange pairs and jump to step (4). The exchange operation refers to simultaneous exchange of the two corresponding rows and columns in the pending adjacency matrix, and a new adjacency matrix is generated for each of said vertex exchange pairs performing the exchange operation;
(56) (4) Exchange Evaluation: Calculating the concentration of connection information elements in each of the new adjacency matrixes, and if there is a new adjacency matrix in which the concentration of connection information elements is higher than before, select the newest adjacency matrix with the highest concentration and mark the vertex exchange pair as the processed state, and then go to step (3); If there is not a matrix whose concentration of elements is higher than before, the current adjacency matrix to be processed is output to obtain the second adjacency matrix, and the branch and bound algorithm ends.
(57) The flow diagram branch and bound algorithm refers to
(58) Further, the concentration of connection information elements in the diagonal region of the second adjacency matrix depends on the number of connection information elements and/or the number of non-connection information elements in the diagonal region.
(59) Further, the concentration of connection information elements in the diagonal region of the second adjacency matrix depends on the number of connection information elements outside the diagonal region and/or the number of non-connection information elements.
(60) Further, the concentration can be measured by the Loss value. The smaller the Loss value is, the higher the concentration is, and the method for calculating the Loss value is as follows:
(61)
(62) In the formula, LS(A, n) represents the Loss value, A denotes the second adjacency matrix, n denotes the width of diagonal region of the second adjacency matrix and A.sub.i, j denotes the i-th row and j-th column elements in the second adjacency matrix. Preferably, the LS(A, n) denotes the Loss value of the second adjacency matrix A when the filter matrix size is n×n. The smaller the Loss value is, the higher the concentration is.
(63) Further, the concentration can also be measured using the ZR value. The smaller the ZR value is, the higher the concentration is, and the method for calculating the ZR value is as follows:
(64)
(65) In the formula, A denotes the second adjacency matrix, C denotes the matrix with the same size of the A and all elements are connections information elements, A.sub.i, j denotes the elements of the i-th row and j-th column in A. Ci,j denotes the element of row i and column j in C. TC(A, n) and TC denotes the total number of elements in the diagonal region with width n in A. T1(A, n) and T1 denotes the number of connected information elements in the diagonal region with width n in A. ZR(A, n) denotes the ZR value, which means the proportion of non-connected information elements in the diagonal region with width n, and n denotes the number of rows or columns of the filter matrix. Preferably, the ZR(A, n) denotes the ZR value of the second adjacency matrix A when the filter matrix size is n×n. The smaller the ZR value is, the higher the concentration of the second adjacency matrix is.
(66) An embodiment implements a graph feature extraction system based on adjacency matrix in a computer environment provided by the present disclosure. The graph feature extraction system extracts features of a graph based on an adjacency matrix of the graph, and the features which correspond to the subgraph directly support the classification. The features are presented in the form of at least one vector, each vector corresponding to the distribution of a mixed state in the graph; the graph feature extraction system includes feature generation module and any form of connection information regularization system in a computer environment described above. The graph feature extraction system includes connection information regularization system and feature generation module, and they work together as a whole to effectively extract local patterns and connection features in a specific diagonal region with window size of n for datasets with different sizes and different structural complexity. The connection information system makes the computational complexity and calculation amount required by feature generation module reduce greatly, solving the limitation of computational complexity
(67) Preferably, the feature generation module generates a feature of the graph by using a filter matrix, and the filter matrix is a square matrix; more preferably, the feature generation module uses at least one filter matrix along the diagonal region of second adjacency matrix to obtain at least one vector corresponding to the features of the graph. The features which correspond to the subgraph directly support the classification and are presented in the form of at least one vector, and each vector corresponds to the distribution of a mixed state in the graph.
(68) Preferably, the distribution condition refers to the possibility that the subgraph structure in the mixed state appears in the graph; preferably, each of the mixed states represents a linear weight of an adjacency matrix corresponding to any of a plurality of subgraph structures. More preferably, the linear weighting refers to multiplying the adjacency matrix of each subgraph by the weight corresponding to the adjacency matrix, and then adding the bits together to obtain a matrix of the same size as the adjacency matrix of the subgraph. The sum of the weights corresponding to the adjacency matrix is 1; the calculation process is shown in
(69) Preferably, the filtering operation is to add the inner product of filter matrix and second adjacency matrix and get the value through an activation function. Filter matrix moves diagonally to obtain a set of values to form a vector corresponding to the distribution of a subgraph structure in the graph; more preferably, the activation function is a sigmoid function, a ReLU activation function, and a pReLU function.
(70) Preferably, the feature generation module uses the different filter matrix to perform the filtering operation.
(71) Preferably, the initial value of each element in the filter matrix is a value of a random variable taken from the Gaussian distribution, respectively. The Gaussian distribution is a probability distribution. The Gaussian distribution is the distribution of continuous random variables with two parameters μ and σ. The first parameter μ is the mean value of the random variable that obeys the normal distribution, and the second parameter σ is the variance of the random variable; when the value of a random variable is taken from a Gaussian distribution, the closer the value of the random variable taken to μ, the greater the probability, while the greater the distance from μ, the smaller the probability.
(72) Preferably, the elements in the filter matrix are real number greater than or equal to −1 and less than or equal to 1. More preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1.
(73) Preferably, the feature generation module participates in a machine learning process for adjusting the values of the elements of the filter matrix.
(74) Preferably, the machine learning process utilizes back propagation to calculate the gradient value by using the loss value and further adjust the values of each element in the filter matrix.
(75) The loss value refers to the error between the output of the machine learning process and the actual output that should be obtained; the gradient can be seen as the slope of a curved surface along a given direction, and the gradient of the scalar field is a vector field. The gradient at one point in the scalar field points to the fastest growing direction of the scalar field, and the gradient value is the largest rate of change in this direction.
(76) The machine learning process described consists of a forward propagation process and a backward propagation process. In the forward propagation process, input information is processed layer by layer from the input layer to the hidden layer and finally passed to the output layer. If the desired output value is not obtained in the output layer, the sum of the square error between output and the expected value is used as the objective function, and the back propagation is performed. The partial derivative of the target function for each neuron weight is calculated layer by layer adjust the values. The gradient of the weight vector of the function is used as a basis for modifying the weight value, and the machine learning process is completed during the weight value modification process. When the error converges to the desired value or reaches the maximum epochs of learnings, the machine learning process ends. The initial values of the elements in the filter matrix are the values of the random variables taken from the Gaussian distribution, which are then updated by back propagation in the machine learning process and are optimized at the end of the machine learning process.
(77) Preferably, the hidden layer refers to each layer other than the input layer and the output layer, and the hidden layer does not directly receive signals from the outside world and does not directly send signals to the outside world.
(78) Further, the size of the filter matrix is n×n, that is, the size of the filter matrix is the same as the width of the diagonal region in the second adjacency matrix. After the connection information elements concentrated into the diagonal region by the connection information regularization system, a filter matrix is used to perform diagonal convolution and it can extract the distribution of the subgraph structure of size n in the graph as much as possible under the premise of O(n) time complexity.
(79) An embodiment implements the graph classification system based on adjacency matrix in a computer environment provided by the present disclosure includes a class labeling module and any form of feature extraction based on adjacency matrix in a computer environment as described above. In the system, the class labeling module labels the graph based on the features extracted by the graph feature extraction system, and outputs the class of the graph; the graph is graph in graph theory.
(80) Preferably, the class labeling module calculates the possibility that the graph belongs to each class, and labels graph as the class with the highest possibility and completes the classification of the graph.
(81) Preferably, the class labeling module uses the classification algorithm to calculate the possibility that the graph belongs to each class, and labels the graph as the class with the highest possibility to complete the classification of the graph; more preferably, the classification algorithm is selected from any one of kNN, a linear classification algorithm, or any of a plurality of types.
(82) The kNN algorithm means that if most of the k nearest samples in a feature space belong to a certain class, the sample also belongs to this class and has the same characteristics of the samples in this class. This method determines the class based on the nearest one or several samples. The linear classification algorithm means that the data is classified using a straight line (or plane, hyperplane) in the feature space.
(83) Further, the graph classification system includes a stacked CNN module, and the stacked CNN module processes features generated by the graph feature extraction system and merges the subgraph structures features supporting the classification and generates the feature which represents larger subgraph structure in the graph. The larger subgraph structure refers to a subgraph structure with more than n vertices.
(84) Preferably, the stacked CNN module includes convolution submodule and pooling submodule.
(85) The convolution submodule uses at least one convolution layer to perform a convolution operation on features generated by the graph feature extraction system and merges the subgraph structures features supporting the classification to obtain at least one vector as a convolution result. The input of the first convolutional layer is the feature generated by any of the forms of the graph feature extraction system as described above. If there are multiple convolutional layers, the input of each convolutional layer is the result of the previous convolutional layer. The output of each convolutional layer is at least one vector. Each convolutional layer uses at least one filter matrix for the convolution operation, and result of the last convolutional layer is outputted to the pooling submodule.
(86) Further, the convolution operation refers to using a filter matrix to move on an adjacency matrix with some regularity, multiply bitwisely and sum up to get a value and the values obtained constitute a vector or a matrix.
(87) The filter matrix is a square matrix; the number of rows of the filter matrix in each of the convolution layers is the same as the number of vectors input to the convolution layer; preferably, the elements in the filter matrix are real numbers greater than or equal to −1 and less than or equal to 1; more preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1.
(88) The pooling submodule is configured to perform a pooling operation on the matrix obtained by the convolution submodule, obtain at least one vector as a pooling result and output to the class labeling module to label the graph. The pooling result includes features of a larger subgraph structure in the graph; the larger subgraph structure refers to a subgraph structure having more than n vertices; preferably, the pooling operation is selected from the group consisting of: max-pooling, average-pooling. The max-pooling refers to taking the maximum value among the neighborhood; the average-pooling refers to averaging the values among the neighborhood.
(89) Further, the pooling operation is based on the convolution operation and performs mathematical operations on each convolution result, thereby reducing the dimension of the convolution result. The mathematical operations include but are not limited to averaging and taking the maximum value.
(90) Preferably, a data flow diagram of the stacked CNN module is shown in
(91) The stacked CNN module extracts larger, deeper and more complex feature, which corresponds to larger, deeper and more complex subgraph in the graph, from the feature generated by feature generation module through a series of convolutional layers. The connection information regularization system, the feature generation module and the stacked CNN module in the graph classification system provided by the present disclosure work together to extract larger (the number of vertices is greater than n), deeper and complex features with a small window size n. First, it captures small subgraphs with small window of size n, and then larger, deeper and complex subgraphs with a number of vertices greater than n is extracted by the combination of small subgraphs. That is, it can capture large subgraph structure through a small window, as well as deep features from the implicit correlation structures at both vertex and edge level, which improves the accuracy and speed of the graph classification.
(92) Further, the graph classification system includes an independent pooling module and a convolution pooling module; the independent pooling module performs pooling operation on the feature extracted by graph feature extraction system to obtain at least one vector as the first pooling result and output to class labeling module. The convolution pooling module performs convolution and pooling operation on the input features extracted by any form of the graph feature extraction system as described above. It merges the subgraph structures features supporting the classification, generates a second pooling result representing a larger subgraph structure feature and output it to the class labeling module. The class labeling module classifies the graph and output the class label of graph according to the first pooling result and the second pooling result; the larger subgraph structure refers to a subgraph structure with more than n vertices.
(93) Preferably, the convolution pooling module includes a convolution submodule and a pooling submodule. The convolution submodule uses at least one filter matrix to perform convolution operation on the input merge the features which can support classification to obtain at least one vector as convolution result and output it to the pooling submodule. The pooling submodule performs the pooling operation on the convolution result to obtain at least one vector as the second pooling result and output it to class labeling module. The second pooling result contains features of a larger subgraph structure in the graph.
(94) The filter matrixes are square matrixes; the number of rows of the filter matrix in each of the convolution layers is the same as the number of vectors input to the convolution layer; preferably, the elements in the filter matrix are real numbers and greater than or equal to −1 and less than or equal to 1; more preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1. Preferably, the pooling operation is selected from the largest pooling operation, the average pooling operation.
(95) Preferably, the data flow diagram of the stacked CNN module including the independent pooling module and the convolutional pooling module is shown in
(96) Further, the graph classification system further includes an independent pooling module and multiple convolution pooling modules; the independent pooling module performs pooling operation on the feature extracted by graph feature extraction system to obtain at least one vector as the first pooling result and output to class labeling module. The convolution pooling module performs convolution and pooling operation on the input features in turn. Convolution operation is performed to merge the subgraph structures features supporting the classification and generate a convolution result. The pooling operation is performed on the convolution result to obtain at least a vector as pooling result which contains larger subgraph structure feature. The convolution result of previous convolution pooling module is output to the next convolution pooling module and the pooling result of each convolution pooling module is output to the class labeling module. The class labeling module classifies the graph and output the class label of graph according to the first pooling result and all the pooling result of convolution pooling module.
(97) Wherein, the input of the first convolution pooling module is the feature generated by any form of the graph feature extraction system as described above and the input of other convolution pooling module is the convolution result of the previous convolution pooling module. The last convolution pooling module only outputs the pooling result to the class labeling module; the larger subgraph structure refers to the subgraph structure with more than n vertices.
(98) Preferably, the convolution pooling module includes a convolution submodule and a pooling submodule. The convolution submodule uses at least one filter matrix to perform convolution operation on the input merge the features which can support classification to obtain at least one vector as convolution result and output it to the next convolution pooling module. The pooling submodule performs the pooling operation on the convolution result to obtain at least one vector as pooling result and output it to class labeling module. The pooling result contains features of a larger subgraph structure in the graph. Preferably, the number of convolution submodule and pooling submodule may be the same or different. Preferably, the number of convolution submodule and pooling submodule is one or more.
(99) The filter matrixes are square matrixes; the number of rows of the filter matrix in each of the convolution layers is the same as the number of vectors input to the convolution layer; preferably, the elements in the filter matrix are real numbers and greater than or equal to −1 and less than or equal to 1; more preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1.
(100) Preferably, the number of the convolution pooling modules is less than or equal to 10, and more preferably, the number of convolution pooling modules in the graph classification system is less than or equal to 5; more preferably, the number of the convolution pooling modules is less than or equal to 5. The number of convolution pooling modules in the graph classification system is less than or equal to 3;
(101) Preferably, the pooling operation is selected from the max pooling operation, the average pooling operation.
(102) Preferably, the data flow diagram of the stacked CNN module including the independent pooling module and the multiple convolution pooling modules is shown in
(103) Further, the element values of the vector of convolution result represent the possibility that the sub-graph structure appears at various positions on the graph. And the element values of the pooling result, the first pooling result, and the second pooling result represent the maximum or average probability that the subgraph structure appears in the graph.
(104) Further, the class labeling module includes a hidden layer unit, an activation unit, and a labeling unit.
(105) The hidden layer unit processes the received vector to obtain at least one mixed vector and output it to the activation unit, and the mixed vector contains information of all vectors received by the hidden layer unit. The hidden layer unit combines the input vectors as a combined vector and performs a linear weighted operation on the combined vector using at least one weighted vector to obtain at least one mixed vector. Preferably, the hidden layer refers to each layer other than the input layer and the output layer, and the hidden layer does not directly receive signals from the outside world and does not directly send signals to the outside world.
(106) The activation unit calculates a value for each mixed vector output by the hidden layer unit using an activation function, and outputs all the resulting values as a vector to the labeling unit; preferably, the activation functions performed are sigmoid function, ReLU activation function, pReLU function.
(107) The labeling unit is configured to calculate the possibility that the graph belongs to each class according to the result of the activation unit and labels the class with the highest possibility as the classification result of the graph to complete the classification. Preferably, the labeling unit calculates the probability that the graph belongs to each classification label based on the classification algorithm and labels the class with the highest possibility as the classification result of the graph to complete the classification. More preferably, the classification algorithm is any one or more than one of the kNN and the linear classification algorithm.
(108) The fourth object of the present disclosure is to provide a connection information regularization method in a computer environment, which includes the following steps:
(109) (1) Initial Input: convert the graph to the first adjacency matrix.
(110) (2) Connection Information Regularization: reorder all the vertices in the first adjacency matrix of the graph to obtain a second adjacency matrix, and the connection information elements in the second adjacency matrix are mainly distributed in a diagonal area of n of second adjacency, where n is a positive integer, n≥2 and n is much smaller than |V|, |V| is the number of rows or columns of the second adjacency matrix.
(111) The diagonal region of the second adjacency matrix is composed of the following elements: a positive integer i traverses from 1 to |V|, and when i>max(n, |V|−n), the i-th row is selected. Element of (i−n+1) to |V| column; when i≤n, select elements from 0-th to i+n−1th columns in the i-th row; when max(n, |V|−n)≥i≥min(|V|−n, n), then in the i-th column, select elements from (i−n+1)-th column to (i+n−1)-th column;
(112) The connection information element is the corresponding element of the edge of the graph in the adjacency matrix.
(113) the graph is graph in graph theory.
(114) Preferably, if there is no weight on the edge of the graph, the value of the connection information element is 1 and the value of the non-connection information element is 0; more preferably, if the edge of the graph is weighted Then, the value of the connection information element is the edge weight value, and the value of the non-connection information element is 0.
(115) Preferably, the diagonal region refers to the diagonal region from the upper left corner to the lower right corner of the matrix.
(116) Preferably, the diagonal region of the second adjacency matrix refers to a scanned area that is scanned diagonally by using a scanning rectangle with a size n×n.
(117) More preferably, the scanning process is described as follows. First, the upper left corner of the scanning rectangle is coincident with the upper left corner of the second adjacency matrix; then each time the scanning rectangle is moved to the right and the down by one grid, until the lower right corner of the scanning rectangle coincides with the lower right corner of the second adjacency matrix.
(118) Preferably, the reordering method is an integer optimization algorithm.
(119) Further, the reordering method is a greedy algorithm and includes the following steps:
(120) (1) Initial Input: Input the first adjacency matrix of the input graph as pending adjacency matrix.
(121) (2) Counting Swap Pairs: Calculate all possible vertex exchange pairs in the pending adjacency matrix.
(122) (3) Row and Column Exchange: It is judged whether all possible vertex exchange pairs are in a processed state. If yes, the pending adjacency matrix is output to obtain the second adjacency matrix, and the greedy algorithm ends; otherwise, one vertex exchange pair is selected as the current vertex exchange pair, and switch the corresponding two rows and two columns in the pending adjacent matrix to generate a new adjacency matrix and jump to Step (4);
(123) (4) Exchange Evaluation: Calculating the concentration of connection information elements in new adjacency matrix. If the concentration of connection information elements in the new adjacency matrix is higher than before, the exchange is accepted. The adjacency matrix replaces the pending adjacency matrix, and jumps to step (2); if the concentration of connection information elements in the new adjacency matrix is lower than or equal to before. Then, the exchange is abandoned, and the current vertex exchange pair is marked as a processed state, and the process jumps to step (3).
(124) Further, the reordering method is a branch and bound algorithm and includes the following steps:
(125) (1) Initial Input: Input the first adjacency matrix of the input graph as pending adjacency matrix.
(126) (2) Counting Swap Pairs: Calculate all possible vertex exchange pairs in the pending adjacency matrix.
(127) (3) Row and Column Exchange: It is judged whether all possible vertex exchange pairs are in a processed state. If yes, then the pending adjacency matrix is output to obtain the second adjacency matrix, and the branch and bound algorithm ends; otherwise, perform an exchange operation for each of the unprocessed vertex exchange pairs and jump to step (4). The exchange operation refers to simultaneous exchange of the two corresponding rows and columns in the pending adjacency matrix, and a new adjacency matrix is generated for each of said vertex exchange pairs performing the exchange operation;
(128) (4) Exchange Evaluation: Calculating the concentration of connection information elements in each of the new adjacency matrixes, and if there is a new adjacency matrix in which the concentration of connection information elements is higher than before, select the newest adjacency matrix with the highest concentration and mark the vertex exchange pair as the processed state, and then go to step (3); If there is not a matrix whose concentration of elements is higher than before, the current adjacency matrix to be processed is output to obtain the second adjacency matrix, and the branch and bound algorithm ends.
(129) Further, the concentration of connection information elements in the diagonal region of the second adjacency matrix depends on the number of connection information elements and/or the number of non-connection information elements in the diagonal region.
(130) Further, the concentration of connection information elements in the diagonal region of the second adjacency matrix depends on the number of connection information elements outside the diagonal region and/or the number of non-connection information elements.
(131) Further, the concentration can be measured by the Loss value. The smaller the Loss value is, the higher the concentration is, and the method for calculating the Loss value is as follows:
(132)
(133) In the formula, LS(A, n) represents the Loss value, A denotes the second adjacency matrix, n denotes the width of diagonal region of the second adjacency matrix, and Ai,j denotes the i-th row and j column elements in the second adjacency matrix.
(134) Further, the concentration can also be measured using the ZR value. The smaller the ZR value is, the higher the concentration is, and the method for calculating the ZR value is as follows:
(135)
(136) In the formula, A denotes the second adjacency matrix, C denotes the matrix with the same size of the A and all elements are connections information elements, A.sub.i, j denotes the elements of the i-th row and j-th column in A. C.sub.i,j denotes the element of row i and column j in C. TC(A, n) and TC denotes the total number of elements in the diagonal region with width n in A. T1(A, n) and T1 denotes the number of connected information elements in the diagonal region with width n in A. ZR(A, n) denotes the ZR value, which means the proportion of non-connected information elements in the diagonal region with width n.
(137) An embodiment implements the graph feature extraction method based on adjacency matrix in a computer environment, and the method extracts features of a graph based on adjacency matrix of the graph, the features which correspond to the subgraph directly support the classification. The features are presented in the form of at least one vector, and each vector corresponds to the distribution of a mixed state in the graph. The method includes the following steps: (1) Connection Information regularization: based on the first adjacency matrix of the graph, the second adjacency matrix is obtained using any connection information regularization method described above. (2) Diagonal filtering: Based on the second adjacency matrix obtained in step (1), the features of the graph are generated. the features which correspond to the subgraph directly support the classification, and each vector corresponds to the distribution of a mixed state in the graph.
(138) The graphs and subgraphs are graphs in graph theory.
(139) Preferably, the step (2) utilizes a filtering matrix to generate features of the graph and the filtering matrix is a square matrix. More preferably, the step (2) utilizes at least one filter matrix along the diagonal region of second adjacency matrix to obtain at least one vector corresponding to the features of the graph. The features which correspond to the subgraph directly support the classification and are presented in the form of at least one vector, and each vector corresponds to the distribution of a mixed state in the graph.
(140) Preferably, the step (2) uses different filter matrixes to perform the filtering operation.
(141) Preferably, the distribution condition refers to the possibility that the subgraph structure in the mixed state appears in the graph; preferably, each of the mixed states represents a linear weight of an adjacency matrix corresponding to any of a plurality of subgraph structures. More preferably, the linear weighting refers to multiply the adjacency matrix of each subgraph by the weight corresponding to the adjacency matrix, and then add bitwise together to obtain a matrix of the same size as the adjacency matrix of the subgraph.
(142) Preferably, the filtering operation is to add the inner product of filter matrix and second adjacency matrix and get the value through an activation function. Filter matrix moves diagonally to obtain a set of values to form a vector corresponding to the distribution of a subgraph structure in the graph; more preferably, the activation function is a sigmoid function, a ReLU activation function, and a pReLU function.
(143) Preferably, the initial values of each element in the filter matrix are the values of random variables taken from the Gaussian distribution respectively;
(144) Preferably, the elements in the filter matrix are real numbers greater than or equal to −1 and less than or equal to 1, more preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1.
(145) Preferably, the step (2) participates in a machine learning process for adjusting the values of the elements of the filter matrix.
(146) Preferably, the machine learning process utilizes back propagation to calculate the gradient value by using the loss value and further adjust the values of each element in the filter matrix. More preferably, the feature generation module can use different filter matrix to perform the filter operation.
(147) Preferably, the value of the connection information element is 1 and the value of the non-connection information element is 0; more preferably, if the edge of the graph is weighted Then, the value of the connection information element is the edge weight value, and the value of the non-connection information element is 0.
(148) Preferably, the diagonal region of the second adjacency matrix refers to a scanned area that is scanned diagonally by using a scanning rectangle with a size n×n.
(149) Further, the size of the filter matrix is n×n.
(150) An embodiment implements a method for classifying a graph based on adjacency matrix in a computer environment provided by the present disclosure. The method for classifying a graph includes the following steps:
(151) (1) Feature Extraction: Using the graph feature extraction method based on adjacency matrix of any form as described previously to extract the features of the graph.
(152) (2) Class Labeling: Based on the features extracted in step (1), classify the graph and output the class of the graph. The graph is the graph in graph theory. Preferably, the step (2) calculates the possibility that the graph belongs to each class, and labels graph as the class with the highest possibility and completes the classification of the graph. Preferably, the step (2) uses the classification algorithm to calculate the possibility that the graph belongs to each class, and labels the graph as the class with the highest possibility to complete the classification of the graph; more preferably, the classification algorithm is selected from any one of kNN, a linear classification algorithm, or any of a plurality of types.
(153) An embodiment implements a method for classifying a graph based on stacked CNN in a computer environment provided by the present disclosure. The method for classifying a graph includes the following steps:
(154) (1) Feature extraction: Using the graph feature extraction method based on adjacency matrix of any form as described previously to extract the features of the graph.
(155) (2) Convolution Operation: Using at least one convolutional layer to perform convolution operation on the features extracted in step (1) and merging the subgraph structures features which support the classification to obtain at least one vector as convolution result. The input of the convolutional layers is the feature extracted in step (1). If there are multiple convolution layers, the input of each convolutional layer is the result of the previous convolutional layer and the result of each convolutional layer is at least one vector, each convolution layer uses at least one filter matrix for convolution operation and the convolution result of the last convolution layer is output to step (3). The filter matrix is a square matrix. The number of rows of the filtering matrix in each convolution layer is the same as the number of vectors input to the convolution layer. Preferably, the elements in the filtering matrix are real numbers greater than or equal to −1 and less than or equal to 1. More preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1.
(156) (3) Pooling Operation: Pooling the result of the convolution operation in step (2) and obtaining at least one vector as a pooling result and outputting it to step (4). The pooling result contains larger subgraph structure of the graph with more than n vertices. Preferably, the pooling operation is selected from maximum pooling and average pooling.
(157) (4) Class Labeling: Labeling the graph and outputting the class of graph according to the pooling result obtained by step (3).
(158) An embodiment implements another method for classifying graph based on stacked CNN in computer environment provided by the present disclosure. The method for classifying a graph includes the following steps:
(159) (1) Feature Extraction: Using the graph feature extraction method based on adjacency matrix of any form as described previously to extract the features of the graph and output to the step (2) and (3).
(160) (2) Independent Pooling Operation: Pooling the features extracted in step (1) to obtain at least one vector as the first pooling result and outputting to step (4).
(161) (3) Convolution Pooling Operation: Using at least one convolutional layer to perform convolution operation on the features extracted in step (1) and merging the subgraph structures features which support the classification to obtain at least one vector as convolution result. Then the pooling operation is performed on it to obtain at least on vector as the second pooling result and output to step (4). The second pooling result contains the feature of larger subgraph structure with more than n vertices. The filter matrix is square matrix. The number of rows of the filtering matrix in each convolution layer is the same as the number of vectors input to the convolution layer. Preferably, the elements in the filtering matrix are real numbers greater than or equal to −1 and less than or equal to 1. More preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1. Preferably, the pooling operation is selected from maximum pooling and average pooling.
(162) (4) Class Labeling: Labeling the graph and outputting the class of graph according to the first pooling result and the second pooling result.
(163) An embodiment implements another method for classifying graph based on stacked CNN in computer environment provided by the present disclosure. The method for classifying a graph includes the following steps:
(164) (1) Feature Extraction: Using the graph feature extraction method based on adjacency matrix of any form as described previously to extract the features of the graph and output to the step (2).
(165) (2) Independent Pooling Operation: Pooling the features extracted in step (1) to obtain at least one vector as the first pooling result and outputting to step (3).
(166) (3) Convolution and Pooling Operation: Using at least one convolutional layer to perform convolution operation on the features extracted in step (1) and merging the subgraph structures features which support the classification to obtain at least one vector as convolution result. Then the pooling operation is performed on it to obtain at least on vector as pooling result which contains the feature of larger subgraph structure with more than n vertices. The convolution result of previous level is output to the next convolution and pooling operation and the pooling result of each level is output to the step (4). Wherein, the input of the first level convolution and pooling operation is the feature extracted in step (1). If there are multi-level convolution and pooling operation, the input of each level is the result of previous one, and only pooling result is output to the step (4) in the last level. The filter matrix is square matrix. The number of rows of the filtering matrix in each convolution layer is the same as the number of vectors input to the convolution layer. Preferably, the elements in the filtering matrix are real numbers greater than or equal to −1 and less than or equal to 1. More preferably, the elements in the filter matrix are real numbers greater than or equal to 0 and less than or equal to 1. Preferably, the pooling operation is selected from maximum pooling and average pooling.
(167) (4) Class Labeling: Labeling the graph and outputting the class of graph according to the first pooling result and all the pooling result in the step (3).
(168) Further, the element values of the vector of convolution result represent the possibility that the sub-graph structure appears at various positions on the graph. And the element values of the pooling result, the first pooling result, and the second pooling result represent the maximum or average probability that the subgraph structure appears in the graph.
(169) Further, the class labeling includes the following steps: (1) Feature Merging: The received vector is processed by the hidden layer and at least one mixed vector is obtained and output to step (2). The mixed vector contains information of all vectors received by the hidden layer. Preferably, the process described combines the input vectors into a combined vector and uses at least one weight vector to linearly weight the combined vector to obtain at least one mixed vector. (2) Feature Activation: Calculating a value for each mixed vector output by the hidden layer using an activation function, and outputting all the resulting values as a vector step (3); preferably, the activation functions performed are sigmoid function, ReLU activation function, pReLU function. (3) Class Labeling: The class labeling is configured to calculate the possibility that the graph belongs to each class according to the result of the activation and labels the class with the highest possibility as the classification result of the graph to complete the classification. Preferably, the class labeling calculates the probability that the graph belongs to each classification label based on the classification algorithm and labels the class with the highest possibility as the classification result of the graph to complete the classification. More preferably, the classification algorithm is any one or more than one of the kNN and the linear classification algorithm.
(170) One embodiment implements a graph classification system provided by the present disclosure. The vertex of the graph is an arbitrary entity, and an edge of the graph is a relationship between entities.
(171) Preferably, entity is any independent individual or set of individuals actual or virtual. Preferably, the entity may be one or combinations of person, thing, event, thing, concept. More preferably, any of said entities is selected from the group atoms in a compound or a single substance, any one or more of humans, commodities, events in a network.
(172) Preferably, the relationship is any relationship between entities. More preferably, the relationship is a chemical bond connecting atoms, a link between commodities, and a person-to-person relationship. More preferably, the relationship is the link between the commodities includes a causal relationship and an associated relationship of the purchased merchandise. More preferably, the person-to-person relationship includes an actual blood relationship, a friend relationship, a concern, transaction or message relationship in a virtual social network.
(173) One embodiment implements a network structure classification system provided by the present disclosure. The classification system implements a network structure classification based on any form of graph classification system as described above. The vertex of the graph is a node in the network. The edge of the graph is the relationship between nodes in the network. Preferably, the network is selected from the group consisting of electronic network, social network and logistics network. More preferably, the electronic network is selected from the group consisting of a local area network, a metropolitan area network, a wide area network, the Internet, 4G, 5G, CDMA, Wi-Fi, GSM, WiMax, 802.11, infrared, EV-DO, Bluetooth, GPS satellites, and/or any other communication scheme for wirelessly transmitting at least some of the information in at least a portion of a network of suitable wired/wireless technologies or protocols. Preferably, the node is selected from geographical position, mobile station, mobile device, user equipment, mobile user and network user. More preferably, the relationship between the nodes is selected from the information transmission relationship between the electronic network nodes, the transport relationship between geographical locations, the actual kinship between people, the friendship, attention, transaction or sending message relationship in the virtual social network. Preferably, the classification is selected from the network structure type. Structure type selected from the star, tree, fully connected and ring.
(174) One embodiment implements a compound classification system provided by the present disclosure. The classification system implements compound classification based on any form of a graph classification system as described before. The vertex of the graph is the atom of the compound. The edge is a chemical bond between the atoms. Preferably, the class is selected from the group consisting of activity, mutagenicity, carcinogenicity, catalytic activity etc. of the compound.
(175) One embodiment implements a social network classification system provided by the present disclosure. The classification system implements social network classification based on any form of a graph classification system as described above. The vertices of which are entities of social networks, including, but not limited to, people, institutions, events, geographic locations in social networks. The edges of the graph are relationships between entities, including, but not limited to, friends, concerns, Private letters, names, associations. The named name refers to a person who can use @.
(176) One embodiment implements a computer system provided by the present disclosure. The computer system includes any of graph feature extraction systems, graph classification system, the network structure classification system, the compound classification system, the social network classification system, or any of a plurality of types mentioned above.
(177) In addition, one embodiment takes a 6-vertex graph as an example to describe in detail the connection information regularization system and graph feature extraction system based on adjacency matrix in the computer environment of the present disclosure. For this 6-vertex graph, its vertices are denoted by a, b, c, d, e, f in alphabetical order, the six edges are (a, b), (a, c), (b, e), (b, f), (e, f) and (e, d) respectively. The graph structures and the its first adjacency matrix based on the order are shown in
(178) The connection information regularization system is configured to reorder all the vertices in the first adjacency matrix of the graph to obtain a second adjacency matrix, and the connection information elements in the second adjacency matrix are mainly distributed in a diagonal area of n of second adjacency, where n is a positive integer, n≥2 and n is much smaller than |V|, |V| is the number of rows or columns of the second adjacency matrix. The diagonal region of the second adjacency matrix is composed of the following elements: a positive integer i traverses from 1 to |V|, when n<i<|V|−n, select the elements from (i−n+1)-th to (i+n−1)-th columns in i-th row; when i≤n, select elements from 0-th to i+n−1th columns in the i-th row; when i≥|V|−n, select the elements from (i−n+1)-th to |V|-th columns in i-th row.
(179) The vertex reordering method may be a greedy algorithm including the following steps:
(180) (1) Initial Input: input the first adjacency matrix A of the input graph as pending adjacency matrix.
(181) (2) Counting Swap Pairs: calculate all possible vertex swap pairs in A. Label columns in A as 1 to 6, then all possible vertex swap pairs are pairs={(m, h)|1<=m<=5, m+1<=h<=6}. So
(182) Specially, the pending matrix will be relabeled each time it is updated, then all possible pairs are reinitialized to 15 pairs. Init i=1, j=2.
(183) (3) Row and Column Exchange: judge whether i is equal to 5, if yes, then output A to obtain the second adjacency matrix, the greedy algorithm ends; otherwise, select pairs (i, j) as the current vertex exchange pair, execute swap (i, j), generate a new adjacency matrix and skip to step (4).
(184) (4) Exchange Evaluation: calculate the concentration of connection information elements in new adjacency matrix. If the concentration of connection information elements in the new adjacency matrix is higher than before, the refresh(A) is performed to replace A with the new matrix and jumps to step (2); if the concentration of connection information elements in the new adjacency matrix is lower than or equal to before. Then, the exchange is abandoned and execute j=j+1. If j>5, then execute i=i+1, j=i+1 and jump to step (3). If j≤5, then jump to step (3).
(185) The specific flow chart is shown in
(186) The concentration of the connection information is measured by the Loss and ZR. The calculation method is shown in the following formula. For example, in
(187)
(188) Taking the graph mentioned in
(189) An important role of the connection information regularization system is that given a first adjacency matrix, there may be more than one way to reorder the vertices of the graph, and the concentrations are the lowest. Therefore, there is more than one second adjacency matrix, these second adjacency matrices are isomorphic. As shown in
(190) The second adjacency matrix is input into the feature generation module to calculate and obtain at least one vector that directly corresponds to the subgraph structure supporting the classification. The feature generation module uses filter matrixes with size n×n, and moves along the diagonal of the second adjacency matrix to perform a convolution operation as shown in
(191)
(192) Where α(.Math.) is the activation function, such as sigmoid. Therefore, the feature size obtained from diagonal convolution is n.sub.0×(|V|−n+1). In the following description, P.sup.0 is used to denote the feature {p.sub.i,j.sup.0] obtained by the feature generation module, and F.sub.0 is used to denote the filter parameter {F.sup.0,i].
(193) Also taking the graph shown in
(194) The main advantage of the connection information regularization system is that the connection information is concentrated in the diagonal area of the second adjacency matrix. The elements that do not contain the connection information do not contribute significantly to the classification of the graph, which results in a significant reduction in the amount of computation of the system. Specifically, without a connection information regularization system, when the feature generation module uses a filter matrix of size n×n to extract features, each filter matrix needs to perform calculations. After connection information regularization system, when using a filter matrix of size n×n to extract features, each filter matrix requires only calculations. Take
(195) In addition, an embodiment is provided to describe in detail a specific implementation of the graph classification system based on adjacency matrix in a computer environment according to the present disclosure, and the effect of such an implementation is verified by public datasets.
(196) For datasets with irregularly sized graphs, we need to find a suitable window size n for it. When n is too small, it may lead to the loss of the most connection information element after passing through the connection information regularization system. In addition, small n may cause overfit of the feature generation module, because less likely subgraph structure features are captured. First, we unified the sizes of the adjacency matrices of all graphs, and choose the largest number of vertices in the dataset |V|max as the size of the uniform adjacency matrix (number of rows or columns). For graphs with vertices less than |V|max, such as the graph of 3 vertices, we use the zero-padding operation (addition of 0) to make the number of rows and columns of the adjacency matrix equal to |V|max. At the same time, it also ensures that the existing connection information in the original graph is maintained, that is, the additional 0 does not destroy or change the original vertices and edges in the graph. The zero-padding operation is shown in
(197) When selecting n, a small number of graphs are sampled randomly from a given dataset. Then the connected information regularization system with different window sizes n is used to process the selected graphs and the Loss of the second adjacency matrices are compared. For the randomly selected graphs, the window size n that minimizes the average Loss of the second adjacency matrices is selected as the window size of the dataset.
(198) For each graph, after zero-padding is performed to get the first adjacency matrix, the first adjacency matrix is processed using the processing flow shown in
(199) Formally, for i-th convolution layer, we take feature in size of P.sup.i−1 in size of n.sub.i−1×(|V|−n+1) as input, extend it with zero-padding (s.sub.i−1)/2 on the left and zero-padding (s.sub.i−1)/2 on the right and get the {circumflex over (P)}.sup.i−1 in size of n.sub.i−1×(|V|−n+s.sub.i). Then we apply n.sub.i filters F.sup.i in size of (n.sub.i−1×s.sub.i), and get the feature. We define the elements of as follows:
P.sub.j,k.sup.i=α(F.sup.i,j,{circumflex over (P)}.sub.[1:n.sub.
)
(200) In the formula, α(.Math.) denotes an activation function, such as sigmoid. And j, k denotes the position of the element in P.sup.j, j-th row and the k-th column. S.sub.i denotes the width of the filter matrix in the i-th convolution layer, and n.sub.i denotes the number of filter matrixes in the i-th convolution layer.
(201) TABLE-US-00001 TABLE 1 Configuration and Feature Size in Each Layer of Graph Classification System Number of Filter Zero- Schema Filters size padding Feature size Input |V| × |V Diagonal n.sub.f.sub.
(202) After going deeper through the m convolution layers with system supplied parameter m, we obtain the deep feature set P.sup.0, . . . , P.sup.m. Pooling submodule is applied to perform pooling operation on each convolution result and max-pooling is taken here. We add the pooling layer for each deep feature set P.sup.j where i from 0 to m. For P.sup.j whose size is n.sub.i−1×(|V|−n+1), we take max-pooling on each row. Therefore, we get a vector of size n.sub.i−1×1.
(203)
(204) In the classification unit, we perform multinomial logistic regression through another full connection on weight parameter W.sub.s, bias parameter b.sub.s and softmax function. The softmax function computes the probability distribution over the vector x of class labels and labels the graph with the label corresponding to highest probability in the result.
(205) The neural network training in the system is achieved by minimizing the cross-entropy loss. Its formula is:
(206)
(207) Where |R| is the total number of graphs in the training set R, A.sub.i denotes the adjacency matrix of the i-th graph in R, y.sub.i denotes the i-th class label in x. The parameters are optimized with stochastic gradient descent (SGD). The backpropagation algorithm is employed to compute the gradients.
(208) In order to evaluate the effect of the present disclosure, five open graph datasets were used for testing. Three bioinformatics datasets: MUTAG, PTC and PROTEINS are used in our experimental evaluation. MUTAG is a dataset with 188 nitro compounds where classes indicate whether the compound has a mutagenic effect on a bacterium. PTC is a dataset of 344 chemical compounds that reports the carcinogenicity for male and female rat. PROTEINS is a collection of graphs, in which nodes are secondary structure elements and edges indicate neighborhood in the amino-acid sequence or in 3D space. In addition, two social network datasets, IMDB-BINARY and IMDB-MULTI, are also used in our experimental comparison. IMDB-BINARY is a movie collaboration dataset where actor/actress and genre information of different movies are collected on IMDB. For each graph, nodes represent actors/actress and the edge connected between them if they appear in the same movie. The collaboration network and ego-network for each actor/actress are generated. The ego-network is labeled with that the genre it belongs to. IMDB-MULTI is the multi-class version since a movie can belong to several genres at the same time. IMDB-BINARY is the binary class version which has the set of ego-networks derived from Comedy, Romance and Sci-Fi genres.
(209) Based on the above data sets, two different implementations of the stacked CNN-based graph classification system of the present disclosure are used for verification. The first implementation uses one independent pooling module and one convolution pooling module; The second graph classification system uses an independent pooling module and 4 convoluted submodules. We set a parameter n from 3 to 17. Also the filter size s.sub.i used at each convolution layer is tuned from {3, 5, 7, 9, 11, 13, 15, 17, 19}. The number of convolution filters is tuned from {20, 30, 40, 50, 60, 70, 80} at each layer. The convergence condition is set to the accuracy difference of less than 0.3% from the previous iteration at the training phase or the number of iterations exceeding 30. The test set and training set are randomly sampled based on the ratio of 3:7 in each experiment.
(210) Given the test collection of graphs in size of N, each graph G.sub.i with class label y, and predicted class ŷ.sub.i by classifier, the accuracy measure is formalized as follows:
(211)
(212) where the indicator function δ(.Math.) gets value “1” if the condition is true, and gets value “0” otherwise.
(213) Comparing the present disclosure with three representative methods: DGK(Deep graph kernels, Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 2015: 1365-1374), PSCN(Learning convolutional neural networks for graphs, Proceedings of the 33 rd International Conference on Machine Learning, New York, N.Y., USA, 2016, 2014-2023) and MTL(Joint structure feature exploration and regularization for multi-task graph classification, IEEE Transactions on Knowledge and Data Engineering, 2016, 28(3): 715-728). Table 2 shows the characteristics of the five datasets used and summarizes the average accuracy and standard deviation of the comparison results. All the examples were run ten times in the same setup.
(214) TABLE-US-00002 TABLE 1 Properties of the datasets and accuracy for disclosure and 3 state-of-the-art approaches IMDB- IMDB- Datasets MUTAG PTC PROTEINS BINARY MULTI Number of 188 344 1113 1000 1500 Graphs Number of 2 2 2 2 3 classes Max Vertices 28 109 620 136 89 Number Avg Vertices 17.9 25.5 39.1 19.77 13 Number DGK 82.94 ± 2.68 59.17 ± 1.56 73.30 ± 0.82 66.96 ± 0.56 44.55 ± 0.52 (5 s) (30 s) (143 s) PSCN 92.63 ± 4.21 60.00 ± 4.82 75.89 ± 2.76 71.00 ± 2.29 45.23 ± 2.84 (3 s) (6 s) (30 s) MTL 82.81 ± 1.22 54.46 ± 1.61 59.74 ± 2.11 59.50 ± 3.23 36.53 ± 3.23 (0.006 s) (0.045 s) (0.014 s) The First 92.32 ± 4.10 62.50 ± 4.51 74.99 ± 2.13 63.43 ± 2.50 46.22 ± 1.15 Graph (0.01 s) (0.10 s) (0.39 s) Classification System The Second 94.99 ± 5.63 68.57 ± 1.72 75.96 ± 2.98 71.66 ± 2.71 50.66 ± 4.10 Graph (0.01 s) (0.08 s) (0.60 s) Classification System
For dataset MUTAG, compared to the best result of PSCN at 92.63%, the second graph classification system (5 convolution layers) obtained the accuracy of 94.99%, higher than PSCN. the first graph classification system achieved the accuracy of 92.32%, very similar to PSCN. For PTC dataset, DGK and PSCN obtained similar accuracy measure of around 60%. The first graph classification system achieved 62.50% and the second graph classification system achieved 64.99%, which is the best accuracy to date on this dataset, with the best of our knowledge. For dataset PROTEINS, the second graph classification system achieved the highest accuracy of 75.96%, which is slightly higher than the best result of 75.89% by PSCN. For the two social network datasets, the present disclosure has a competitive accuracy result of 71.66% for IMDB-BINARY, higher than the best of PSCN at 71.00% and has achieved the highest accuracy of 50.66% for IMDB-MULTI, compared to the best of PSCN at 45% and the best of DGK at 44%.
(215) Study the impact of parameter configuration on the accuracy of the classification result and the time complexity performance of the present disclosure.
(216) Window Size n:
(217) This is the key parameter for determining how good the system of the present disclosure can cover the most significant subgraph patterns in the given graph dataset. Because a small n may result in the fact that most graphs would fail to concentrate all connection information into the diagonal area with width n. Consequently, we may loss more structural connectivity information, which can be critical for classification of graph dataset. On the other hand, a big n will lead to high computation cost and time complexity.
(218) Stacked Convolution Filter Width s.sub.i:
(219) For convenience, we set the same width for all layers to simply the discussion. Setting a larger width s.sub.i means that each filter can capture more complex subgraph structure features. Also, the complex subgraph structure features have higher possibility in combination. However, it is also hard to determine the filter width to cover all the possible combinations. In this embodiment, we set n=7, filter number by 50 and vary filter width from 3 to 15. Note that due to zero-padding, we can only use the filter with odd value, namely 3, 5, 7, 9, 11, 13, 15. We also performed 10 runs for each measurement collected under the same setting and take the average value in accuracy and executing time.
(220) Filter Number n.sub.f.sub.
(221) Similar to filter width, we set the same filter number for all convolution layers, including diagonal convolution layer and stacked convolution layers. In this experiment, we set n by 7, filter width by 7 and vary filter number from 20 to 80. Each measurement is collected by 10 runs and the average value of accuracy and running time are reported.
(222) Convolution Layer Number
(223) For better observing the efficiency and effectively of the present disclosure on different convolution layer number, the number of convolution layers on the MUTAG, PTC, and PROTEINS is set to 1 to 5 in this embodiment.
(224) Dropout Ratio
(225) The previous embodiments have shown that increasing the filter matrix width, filter matrix size and number and number of convolution layers may not improve performance. The next set of embodiments investigates the effect of overfitting by using the dropout ratio in batch normalization. The batch normalization is a technique for maintaining the same distribution of input of each layer of the neural network during the deep neural network training process, which can help the neural network to converge.
(226) The present disclosure proposes a graph feature extraction system based on adjacency matrix, concentrating the connection information elements in an adjacency matrix and extracting features. The system is compared here with common CNN without connection information regularization system. For naïve CNN, a 2-dimension convolution layer is applied on adjacency matrix and the pooling layers are 2-dimension pooling. The configuration of the embodiment is n=7, filter width as 7 and filter number as 50, for both the present disclosure and common version. The results are reported in
(227) Convergence
(228)
(229) Feature Training
(230) This embodiment is performed on the MUTAG dataset, with n set to 7, filter width set to 7 and filter number set to 20.
(231) Feature Visualization
(232)
(233) Finally, an embodiment is provided to mainly explain the important feature of the graph classification system based on adjacency matrix proposed by the present disclosure: Capturing a large multi-vertex subgraph structure using a smaller window.
(234) Taking a graph consisting of ten vertices (|V|=10) as an example,
(235) More specifically,
(236) The graph classification system based on adjacency matrix proposed by the present disclosure can capture the large multi-vertex subgraph structure and the deep features of the implicit correlation structure from the vertices and edges through a smaller window, thereby improving the classification accuracy.