Geographic network analysis method based on feature and structure distribution offset

By using causal attention sampling weight and HSIC sample reweighting technology in the geographical network, the problem of insufficient generalization ability caused by data distribution offset is solved, the accuracy and stability of traffic flow data prediction is improved, and the invariant characterization is enhanced study.

CN119202781AInactive Publication Date: 2024-12-27CHINA RAILWAY DESIGN GRP CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411101953.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the data in the geographic network is offset in the distribution of features and structures, the existing models are insufficient in generalization capabilities, resulting in a degradation in prediction performance, especially in complex traffic flow data, where the pseudo-correlation relationship between background characterization and label affects the model. stability.

Method used

Using a method based on causal attention sampling weight, by obtaining causal attention sampling weight and single-head attention mechanism, important similar and heterogeneous neighbor nodes are screened, combined with HSIC's sample reweighting technology, the dependence on background representation is reduced, and the Change the learning of representations and optimize the independence of node representations.

Benefits of technology

It improves the generalization ability of the model under the distribution offset, reduces the dependence on background characterization, improves the accuracy and stability of traffic flow data prediction, and significantly improves the prediction performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202781A_ABST
    Figure CN119202781A_ABST
Patent Text Reader

Abstract

The invention discloses a geographic network analysis method based on feature and structure distribution offset. The method comprises the following steps: S1, obtaining a traffic flow data set; s2, acquiring a causal attention sampling weight; s3, acquiring a target node; s4, performing sample reweighting; and S5, outputting a predicted traffic flow data set. According to the method disclosed by the invention, the attention mechanism and the causal-guided sampling technology are fused, the node sampling process is optimized, and the dependence of the model on background characterization is reduced. According to the method, an attention mechanism and a causal theory are combined, the sampling weights of target node neighbors of the same type and the sampling weights of target node neighbors of the different types are obtained respectively, and the purpose is that a model recognizes nodes having a strong causal relationship with labels or recognizes nodes more similar to the target nodes. In this way, the invariant characterization is significantly improved, and the dependence on the background characterization in accidental or specific modes is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of geographic network technology, and in particular relates to a geographic network analysis method based on feature and structure distribution offset. Background Art

[0002] Geographic networks often involve numerous entities and their relationships, containing a wealth of attributes and interaction information. These entities can be geographic locations, groups of people, or other geography-related factors, and their relationships include spatial connections. This complexity often makes traditional data analysis methods inadequate. Therefore, graph structures are needed to model geographic networks, as the core value of graph data lies in its ability to effectively capture and represent complex spatial relationships.

[0003] Current graph models are mainly established under the independent and identically distributed assumption (IID assumption), that is, the training set and test set data are independently extracted from the same distribution. However, geospatial data are often affected by multiple factors during the collection and processing process, such as temporal dynamics, spatial heterogeneity, human activities and policy changes, which cause the data to shift. For example: in the data collection stage, data collection is often based on the actual situation in the real world. During this process, it may be affected by factors such as human behavior and technical limitations, resulting in a certain deviation in the data, which is offset from the data distribution in actual applications and violates the IID assumption. Therefore, when the present invention applies the trained model to data that does not meet the IID assumption, it will encounter the problem of performance degradation. This is because the model is lacking in performance on new data outside the training data distribution (that is, the distribution of data seen during training). This situation is called insufficient out-of-distribution generalization ability.

[0004] To address this issue, it is crucial to learn GNNs that have the ability to generalize out of distribution and achieve relatively stable performance when the distribution shifts. Distribution shifts on geographic networks can exist at both the feature level and the topology level. The geographic network representations obtained by GNNs based on the message passing mechanism can be divided into invariant representations (C) and background representations (S). In the face of distribution shifts, the invariant representations are those that always maintain a stable relationship with the labels. tr (Y=y|C=c)=P te (Y=y|C=c); What changes in relationship with the label is the background representation, P tr (Y=y|S=s) will P te (Y=y|S=s). Under the influence of specific environments / selection biases, specific confounding factors are over-represented or under-represented in the sample, resulting in a spurious correlation between the invariant representation and the background representation. For example, in the context of geospatial data, these confounding factors include time, geographic location, etc. These factors affect both the invariant variable and the background variable, thus generating a spurious correlation. In this case, Ptr (Y=y|C=c,S=s)>P tr (Y=y|C=c), which causes the model to learn the background representation prediction label. However, when the environment / selection bias changes, the distribution (features / structure) shifts and the background representation changes. At this time, P te (Y=y|C=c,S=s) <P te (Y=y|C=c), which results in the original prediction relationship based on background representation no longer being applicable.

[0005] Recent research has found that underlying causal mechanisms are invariant across domains. Therefore, causal models are particularly effective in addressing OOD generalization issues. For feature distribution shift, structural causal models can be considered, or by removing spurious correlations between representations, to learn invariant representations that are causally related to the label. However, given the complexity of geographic networks, which stems from the diversity and instability of relationships between nodes, specifically, nodes in geographic networks exhibit the following two characteristics: a) a large number of neighbors; and b) unstable / uncertain neighbor properties. These characteristics mean that when acquiring node representations, the present invention, without prioritizing neighbors, can introduce noise due to the influence of neighbors, impairing the model's generalization ability. Therefore, in geographic networks, in addition to the target node's features, its first-order neighbors also contain important information, which can impact representation learning and prediction tasks. For example, due to environmental or selection bias, the target node's first-order neighbors may have similar features / structures. The model may amplify these similar features / structures, over-relying on them. Consequently, changes in the structural distribution can lead to degraded prediction results. Therefore, changes in the background representation are simultaneously caused by both feature distribution shift and structural distribution shift of the target node.

[0006] Due to selection bias and environmental influences, there is a spurious correlation between the invariant representation and the background representation, making it easier for the model to learn the background representation in extreme cases. Existing methods focus on the changes in the background representation, which are determined by the shift in the feature distribution of nodes in the training and test data, while ignoring the changes in the distribution of the proportions of heterogeneous and homogeneous neighboring nodes (structural distribution shift). Summary of the Invention

[0007] In order to solve the problems existing in the existing technology when predicting traffic flow, the present invention provides a geographic network analysis method based on feature and structural distribution shift, which reduces the dependence on background representation and enhances generalization ability.

[0008] To this end, the present invention adopts the following technical solutions:

[0009] A geographic network analysis method based on feature and structure distribution shift includes the following steps:

[0010] S1, obtain the traffic flow dataset and represent it as a graph dataset, where the node set V = {v1, v2...v i ...v N}, N is the total number of nodes in the node set V, i is the node number, i∈[1,N]; N(v i ) is the node v i The set of neighbor nodes, N(v i )={v1, v2...v n ...v o}, n is the node v i The number of the neighbor node, o is the node v i The total number of neighbor nodes; each node has a corresponding label, which is used to distinguish each node v i The neighbor nodes of are of the same type or different types;

[0011] S2, obtains the causal attention sampling weight, including the following steps:

[0012] Distinguish node v by the label corresponding to the node in S1 i The neighbor nodes of the same type and the neighbor nodes of different types; the neighbor nodes of the same type are v h , h is the number of the same type of neighbor node; the heterogeneous neighbor node is v j , j is the number of the neighboring node of the same type; j∈[1,o], h∈[1,o]; integration obtains the causal attention sampling weight

[0013]

[0014] in, N(v n ) indicates v n Neighbor nodes, v i,n is the nth neighbor node of the i-th node, x i and x j For node v i Characterization and heterogeneous neighbor points v j W is the weight matrix in the fully connected layer, and softmax represents the normalization process; W is initialized by the Kaiming uniform initialization method;

[0015] S3, get the target node:

[0016] S31, the causal attention sampling weights of all neighbor nodes obtained in S24 Sort from largest to smallest and select the first a largest neighbor nodes;

[0017] S32, using the pooling aggregation function to embed the representation of the target node corresponding to the neighbor node obtained in S31;

[0018] Set the node corresponding to the neighbor node in S31 as the target node v m ;

[0019] First, the representation of the neighbor nodes in S31 is nonlinearly transformed, and the result is combined with the target node v through the pooling operation. m Finally, a nonlinear transformation is used to obtain the target node v m Representation of all dimensions, and all the obtained target nodes v m Combined into the target node set V ′ , M is the total number of target nodes, m∈[1,M];

[0020] S4, perform sample reweighting:

[0021] S41, construct a model for the independence of unbiased estimation of the representation of the target node in different dimensions:

[0022]

[0023] Among them, X *,p Represents the p-dimensional representation of all the target nodes, X *,q Represents the q-dimensional representation of all the target nodes, p,q∈[1,d],p≠q, d is the total number of representation dimensions; is an M*M symmetric matrix, Tr represents the trace of the matrix, 1 represents an M×M all-one matrix, J=I-1 / M, I is the M-order identity matrix;

[0024] S42, using reweighting to achieve independence of variables in representation:

[0025] Using loss weights To make the variables represented in the independence model in S41 independent, we have:

[0026]

[0027] in, The W 2 Use uniform initialization to initialize each variable to the same value 1 / num, where num is the total number of target nodes for this iteration and is determined based on the actual situation.

[0028] S43, the loss weight Applied to the cross entropy loss function, the optimizer is used to update W and To minimize the loss function; optimize W and Until the loss function converges, W is obtained;

[0029] S5, output the predicted traffic flow dataset:

[0030] Input W obtained by S4 and the traffic flow dataset in S1 into the GraphSAGE graph model, and output the predicted traffic flow dataset.

[0031] S2 includes the following steps:

[0032] S21, determine the neighboring nodes v of the same type h and heterogeneous neighbor nodes v j ;

[0033] S22, obtain similar neighbor nodes v h causal weight;

[0034] First, the do operator is applied to estimate the intervention distribution p(y i |do(v i )),have:

[0035] p(y i |do(p i ))=∫p(y i |v i ,N(v i ))p(N(v i ))dN(v i );

[0036] Then, the intervention distribution is obtained by kernel density estimation (KDE):

[0037]

[0038] where K|·| represents a kernel density estimate (KDE) obtained by a joint and edge-reproducing kernel Hilbert space (RKHS) function;

[0039] Finally, integration gives v i The intervention distribution, v i,n is the nth neighbor node of the i-th node:

[0040]

[0041] S23, obtain the attention sampling weights of heterogeneous neighbor nodes:

[0042] For node v i The heterogeneous neighbor node v j , use the single-head attention mechanism to obtain the attention sampling weight There is the following formula:

[0043]

[0044] Among them, x i and x j For node v i and heterogeneous neighbor point v j W is the weight matrix in the fully connected layer, and W is initialized by the Kaiming uniform initialization method; softmax represents the normalization of the calculation results.

[0045] S24, Merge and Get each node v i Neighbor node v i,n Causal attention sampling weights for intervention distributions to self-labels

[0046] The a in S31 is ≥10.

[0047] The model in S41 is obtained by the following formula:

[0048]

[0049] Since the above formula is a biased estimate, 1 / M 2 Replace it with 1 / (M-1) 2 , obtaining unbiased estimates of the independence of the model.

[0050] Preferably, in S42, the obtained The independence model is minimized to eliminate the dependencies between the representation dimensions, as follows:

[0051]

[0052] Will get Enter S43 for optimization.

[0053] Preferably, the optimizer in S43 is an Adam optimizer.

[0054] The beneficial effects of the present invention are as follows:

[0055] 1. The method of the present invention comprehensively considers the structural and feature distribution shifts, and achieves OOD generalization by enhancing invariant representation and removing pseudo-correlation.

[0056] 2. To address structural distribution shift, this paper adopts a fusion of attention mechanism and causal bootstrapping sampling technology to optimize the node sampling process and reduce the model's dependence on background representation.

[0057] 3. To address feature distribution shift, the present invention uses a decorrelation method based on HSIC sample reweighting. This method can encourage the model to eliminate pseudo-correlations between representations, ignore background representations, learn invariant representations, and improve the generalization ability of the model.

[0058] 4. The method of the present invention combines the attention mechanism and causal theory, and can obtain the sampling weights of the neighbors of similar and heterogeneous target nodes respectively, allowing the model to identify nodes with strong causal relationships with labels, or identify nodes that are more similar to the target node, thereby highlighting the invariant representation and weakening the dependence on background representation under accidental or specific patterns. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 is a flow chart of the geographic network analysis method of the present invention;

[0060] Figure 2 It is the structural causal model of the present invention. DETAILED DESCRIPTION

[0061] The following methods are involved in the following embodiments:

[0062] 1. Models based on hybrid balance: DGNN proposes a debiased graph neural network (DGNN) framework to address the out-of-order (OOD) problem in node classification tasks. It uses a differential decorrelation regularizer to obtain sample weights and eliminate spurious correlations in representations. The sample weights are then used to improve the stability of predictions on unknown test nodes. OODGNN considers that dependencies between representations are the primary cause of model performance degradation under OOD conditions. To eliminate statistical dependencies between all representation dimensions in the graph encoder, it uses a nonlinear graph of random Fourier features to represent the solution and eliminate spurious correlations. Considering that sample reweighting methods are computationally expensive on large graphs, the authors propose a scalable global-local weight calculator to learn and optimize sample weights for each graph. CMRL demonstrates robustness to distributional shifts in molecular relationship learning by detecting core substructures causally related to chemical reactions. They first hypothesize causal relationships based on molecular science domain knowledge and construct a structural causal model (SCM) that reveals the relationships between variables.

[0063] 2. Methods based on structural causal models: The OOD effect, as a confounding factor, is the main reason for the spurious correlation between the importance of subgraphs and the model prediction results. For this reason, the Deconfused Subgraph Evaluation (DSE) is proposed to evaluate the causal effect of the explanatory subgraph on the model prediction. At the same time, studies have found that models usually use non-causal features for prediction. However, if the data distribution is inconsistent, such as the lack of non-causal features in the test set, the generalization of the model will be affected. Therefore, in order to make the model unaffected by shortcut features and to correctly learn the relationship between causal features and predictions, the Causal Attention Learning (CAL) method is proposed. The CAL method draws on the backdoor adjustment of causal theory and reduces the impact of confounding by using do-calculus to cut off the backdoor path.

[0064] 3. Counterfactual Reasoning-Based Approaches: CFLP (Counterfactual Linking) starts with the counterfactual question, "If the graph structure differs from the observations, would this connection still exist?" It argues that counterfactual links can enhance graph data for representation learning. Therefore, a causal model is employed to create counterfactual links and learn representations from observed and counterfactual links. CAF (Corrective Action Fission) investigates the problem of fair graph learning from a causal perspective and proposes a novel CAF framework. This framework selects counterfactuals from training data to learn fair node representations for node classification tasks.

[0065] The aforementioned methods based on causal learning-based invariant representations all explore the problem from the perspective of input features. However, graph data has irregular topological structures and complex connectivity. Therefore, the present invention not only considers feature distribution shifts but also focuses on the impact of structural distribution shifts.

[0066] like Figure 1 As shown, the geographic network analysis method based on feature and structure distribution offset of the present invention includes the following steps:

[0067] S1, obtain a traffic flow dataset, such as the Mirror-Traffic dataset, and represent it as a graph dataset G = (V, E), where the node set V = {v1, v2...v i ...v N}, N is the total number of nodes in the node set V, E represents the set of edges in the graph; node v i Represents a node in V, i is the node number, i∈[1,N]. Let N(v i ) is the node v i The set of neighbor nodes, N(v i )={v1, v2...v n ...v o}, n is the node v i The number of the neighbor node, o is the node v iThe total number of neighbor nodes of each node v i There are corresponding labels y i ,y i The sample space is ΩY, label y i Used to distinguish each node v i The neighbor nodes of are of the same or different types, and the neighbor nodes are also included in the node set V. The representation space of the node set V is X∈R N*d , where d is the total number of dimensions represented and R represents a real number.

[0068] S2, obtains the causal attention sampling weight, including the following steps:

[0069] S21, distinguish node v by the label corresponding to the node in S1 i The neighbor nodes of the same type and the neighbor nodes of different types; the neighbor nodes of the same type are v h , h is the number of the same type of neighbor node; the heterogeneous neighbor node is v j , j is the number of the neighboring node of the same type, j∈[1,o], h∈[1,o].

[0070] S22, obtain similar neighbor nodes v h The causal weight of:

[0071] First, we construct SCM to determine the causal relationship and analyze the node v. i Point to label y i Outside the causal path, node v i There is also a neighbor node set N(v i ) caused by spurious correlation;

[0072] Secondly, since the causal graph satisfies the conditions of the backdoor criterion, the do operator is applied to estimate the intervention distribution p(y i |do(v i )),have:

[0073] p(y i |do(p i ))=∫p(y i |v i ,N(v i ))p(N(v i ))dN(v i );

[0074] The do operator is a symbol used in statistics and causal inference to indicate intervention on one or more variables.

[0075] Then, the intervention distribution p(y i |do(v i)):

[0076]

[0077] in, K|·| represents the kernel density estimation (KDE), which is obtained by joint and edge-reproducing kernel Hilbert space (RKHS) functions;

[0078] Finally, integration gives v i The intervention distribution, v i,n is the nth neighbor node of the i-th node:

[0079]

[0080] in,

[0081] S23, obtain the attention sampling weights of heterogeneous neighbor nodes:

[0082] For node v i The heterogeneous neighbor node v j , use the single-head attention mechanism to obtain the attention sampling weight There is the following formula:

[0083]

[0084] Among them, x i and x j For node v i and heterogeneous neighbor point v j W is the weight matrix in the fully connected layer, and W is initialized by the Kaiming uniform initialization method; softmax represents the normalization of the calculation results.

[0085] S24, Merge and Get each node v i Neighbor node v i,n Causal attention sampling weights for intervention distributions to self-labels

[0086]

[0087] S3, get the target node:

[0088] S31, the causal attention sampling weights of all neighbor nodes obtained in S24 Sort from largest to smallest and select the first a largest neighbor nodes, where a≥10;

[0089] S32, using the pooling aggregation function to embed the representation of the target node corresponding to the neighbor node obtained in S31;

[0090] Set the node corresponding to the neighbor node in S31 as the target node v m ;

[0091] First, the representation of the neighbor nodes in S31 is nonlinearly transformed, and the result is combined with the target node v through the pooling operation. m Finally, a nonlinear transformation is used to obtain the target node v m Representation of all dimensions, and all the obtained target nodes v m Combined into the target node set V ′ , M is the total number of target nodes, m∈[1,M].

[0092] S4, perform sample reweighting;

[0093] S41, build a model for the independence of target node representation in different dimensions:

[0094] First, integrate S32 to get V ′ The representation of the target node in , uses the Hilbert-Schmidt independence criterion (HSIC) to calculate the independence of representations of different dimensions, which is as follows:

[0095]

[0096] Among them, X *,p Represents the p-dimensional representation of all target nodes, X *,q Represents the q-dimensional representation of all target nodes, p,q∈[1,d],p≠q; and is an M*M symmetric matrix, Tr represents the trace of the matrix, 1 represents an M×M matrix of all ones, where J = I-1 / M, and I is the M-order identity matrix;

[0097] Since the above formula is a biased estimate, 1 / M 2 Replace it with 1 / (M-1) 2 , we obtain an unbiased estimate of the independence of the model:

[0098]

[0099] S42, using reweighting to achieve independence of variables in representation:

[0100] Reweighting is one of the traditional RCM methods, which is used to eliminate confounding variables and ensure randomized trials. Specifically, the present invention introduces loss weights in the calculation of HISC in the above formula:

[0101]

[0102] in, Uniform initialization is used to initialize each variable to the same value 1 / num, where num is the total number of target nodes input in the current batch. num is determined based on actual conditions.

[0103] By minimizing HISC, the dependencies between representation dimensions are eliminated to the greatest extent possible. The weight values ​​are then obtained:

[0104]

[0105] S43, the loss weight Applied to the cross entropy loss function, the optimizer is used to update W and To minimize the loss function; the optimizer can choose Adam optimizer. Optimize W and Until the loss function converges, W is obtained.

[0106] Through the weight matrix W and loss weight in the fully connected layer A robust representation is obtained, and then the statistical dependencies of all dimensions in the representation are eliminated, so as to remove the spurious correlation between the invariant representation and the background representation, so that satisfactory generalization performance can be obtained when predicting labels.

[0107] S5, output the predicted traffic flow dataset:

[0108] Input W obtained by S4 and the traffic flow dataset in S1 into the GraphSAGE graph model, and output the predicted traffic flow dataset.

[0109] Comparative Example

[0110] This paper integrates structural distribution shift and feature distribution shift, combines causal theory with graph neural network technology, and proposes a feature-structure mixed invariant representation learning model (FSM-IRL). This model improves the accuracy of dataset prediction by applying the weight matrix obtained by the method of this paper to the GraphSAGE graph model.

[0111] To address the problem of structural distribution shift, this paper introduces a sampling method based on causal attention, which assigns different sampling weights to nodes of the same or different types: (1) For nodes of the same type: a causal guidance method is used to estimate the causal effect between neighboring nodes of the same type and the label; (2) For nodes of different types: a single-headed attention mechanism is used to evaluate the importance of neighbors of different types. This method obtains sampling weights and selects nodes with higher weight coefficients for aggregation, thereby strengthening the model's recognition of invariant representations and reducing its reliance on background representations caused by chance or specific environments / selection biases. To address the problem of feature distribution shift, the HSIC method is applied to adjust the sample weights, aiming to ensure the independence of all representations and eliminate pseudo-correlations between representations, so that the model can focus on invariant representations that have a more stable relationship with the label.

[0112] The present invention uses the Mirror-Traffic dataset for testing:

[0113] The Mirror-Traffic dataset, jointly released by Tsinghua University's Suzhou Automotive Research Institute and the Jiangsu Intelligent Connected Vehicle Innovation Center, draws on real-world road traffic data from China. Using image recognition and tracking technology, the dataset identifies and tracks traffic participants in real-world road images. The extracted trajectories are then filtered and selected to ultimately generate trajectory data for various vehicles, pedestrians, and other objects. The dataset covers a variety of road types (ramps, straights, curves, intersections, etc.) and traffic flow conditions (light, moderate, congested, etc.), including a variety of vehicle types and pedestrians. The trajectories are accurate to the centimeter level, making it ideal for research in driving scenario extraction and generation, the development of driving behavior and intention prediction models, imitation learning of natural driving behavior, the development and verification of autonomous driving prediction and planning algorithms, traffic flow (speed, density) analysis, and microscopic traffic model simulation.

[0114] In the node classification task, this comparative example selected GCN, Planetoid, IRM, GraphSAGE and the latest C-GraphSAGE models as baselines for comparison. Planetoid, GCN and GraphSAGE are all widely recognized and used methods in the field of graph neural networks. IRM is a stable learning method for processing domain data, and C-GraphSAGE is a graph neural network model combined with causal reasoning. They respectively represent different mechanisms for graph neural networks to process graph data, thus providing a solid performance benchmark for the research of this invention. By using these models as baselines, the present invention can comprehensively evaluate and demonstrate the performance of the method of the present invention. The specific introduction of the model is as follows:

[0115] GCN: GCN updates the representation of each node by applying convolution operations on its neighboring nodes, thereby effectively capturing the relationship between nodes.

[0116] Planetoid: It is a classic semi-supervised graph embedding method that learns node representations by combining node neighborhood information to perform effective graph node classification. In this paper, we use its inductive variant.

[0117] GraphSAGE: GraphSAGE samples neighbor nodes and aggregates their features to learn node representations. It uses random walks or sampling methods to obtain neighbor information. It can be applied to large-scale graph data and effectively capture the local structural features of nodes.

[0118] C-GraphSAGE: C-GraphSAGE captures the weights between the target node's neighbors and their labels based on the Causal Bootstraping method, and samples neighboring nodes based on the weights to make up for the shortcomings of GraphSAGE's random sampling, such as sampling bias and information loss, thereby improving classification robustness.

[0119] IRM: is an invariant learning method that aims to achieve robust generalization across environments. This method learns environment-independent features by finding data representations or features that ensure that the best classifier trained on these representations can adapt to all environments.

[0120] FSM-IRL is a feature-structure hybrid invariant representation learning model, specifically a combination of the method of the present invention and the GraphSAGE graph model.

[0121] The experiments in the embodiments uniformly restrict the model parameters. During the model training process, the present invention sets the Epoch number of the social network dataset to 20 and the batch size to 20. For the geographic network dataset, the present invention sets its Epoch to 110 and 150, and the batch size to 40. At the same time, for the Citeseer dataset, the present invention sets its learning rate lr to 0.1 on models other than SRDO, sets GOOD-Arxiv to 0.001, and uniformly sets the learning rate of other datasets to 0.01. The present invention sets the L2 regularization constant of all datasets to 1e-3, and uses Adam optimization to update the weights of the neural network. The neural network K has two layers, the hidden layer dimension d of pubmed is 256, and the other datasets are all set to 128. The dimension of the output layer is equal to the number of labels. The update cycle of the learning loss weight is 100 Epochs. Regarding the training set, validation set and test set of the social network, the present invention follows the experimental settings of the original text, extracts 20 samples from each category as the training set, and selects 1000 nodes as the test set to evaluate the classification performance. For geographic networks, we uniformly partitioned the dataset into 70% for training, 20% for validation, and 10% for testing. The experiments were run using Python 3.7 and PyTorch 1.12.1. All experiments were run using two deep learning stations: a DGX A100 with 4 x 80GB RAM and an A6000 with 3 x 48GB RAM. We ensured that the validation and training sets had different distributions, and calculated the mean and standard deviation of three replicates.

[0122] The present invention evaluates GCN, Planetoid, GraphSAGE, IRM, and FSM-IRL on the geographic network dataset. The results of each model on the geographic network dataset are shown in Table 1.

[0123] Table 1 shows that FSM-IRL consistently outperforms the other models in all three scenarios. When trained and predicted on the original graph structure, FSM-IRL outperformed the other models by 4.93% to 44.44%. When trained and predicted on the graph structure after edge pruned, FSM-IRL outperformed the other models by 14.81% to 47.32%. When trained on the original graph structure and then tested on the graph structure after edge pruned, FSM-IRL outperformed the other models by 9.05% to 43.62%. These results demonstrate the effectiveness of the FSM-IRL model on geographic network datasets. The results on the IRM model are lower than those of FSM-IRL, demonstrating the advantages of our method over traditional machine learning methods for invariant representation learning. We also observed that GCN performed well on social network datasets, but performed poorly on geographic network datasets, consistently achieving around 30%. We analyze this because GCN learns node representations by aggregating information about a node's neighbors. For social network datasets, their neighbor nodes are usually few and the connections between nodes are very close. However, in the geographic network dataset established by this invention, each node has a large number of neighbors and the neighbors contain a lot of "noise", so GCN will learn a lot of useless information when learning representations on geographic network datasets. Therefore, the results of GCN on social network datasets will be better. In addition, models such as GraphSAGE, C-GraphSAGE, and FSM-IRL that learn representations by sampling neighbor nodes will also have higher classification accuracy than the GCN model.

[0124] Table 1 Prediction results of different models on the dataset before and after setting the structural distribution shift (acc is accuracy ± standard deviation % and Macro-f1 ± standard deviation %)

[0125]

[0126] For the Mirror-Traffic dataset, we constructed a structural shift by perturbing the original graph structure. We planned to randomly delete 50% of the edges from the original graph to create a new graph structure. To comprehensively evaluate the model, we set up a structural shift method: training on the original graph and then selecting the graph structure with 50% of the edges deleted as the test structure.

[0127] Original: Use the original graph structure for training and testing;

[0128] De-50: Use the graph structure with 50% of the edges removed for training and the graph structure with 50% of the edges removed for testing;

[0129] Bias: Use the original graph structure for training and the graph structure after pruning 50% of the edges for testing.

Claims

1. A geographic network analysis method based on feature and structural distribution shift, characterized in that: The following steps are involved: S1, obtain the traffic flow dataset and represent it as a graph dataset, where the node set V = {v1, v2...v i ...v N }, N is the total number of nodes in the node set V, i is the node number, i∈[1,N]; N(v i ) is the node v i The set of neighbor nodes, N(v i )={v1、v2...v n ...v o }, n is the node v i The number of the neighbor node of node v, o is the number of the neighbor node of node v i The total number of neighbor nodes; each node has a corresponding label, which is used to distinguish each node v i The neighbor nodes of are of the same or different types; S2, obtains the causal attention sampling weight, including the following steps: Distinguish node v by the label corresponding to the node in S1 i The neighbor nodes of the same type and the neighbor nodes of different types; the neighbor nodes of the same type are v h , h is the number of the same type of neighbor node; the heterogeneous neighbor node is v j , j is the number of similar neighbor nodes; j∈[1,o], h∈[1,o]; integration to obtain the causal attention sampling weight in, N(v n ) indicates v n Neighbor nodes, v i,n is the nth neighbor node of the ith node, x i and x j For node v i Characterization and heterogeneous neighbor points v j , W is the weight matrix in the fully connected layer, and softmax represents normalization processing; W is initialized by Kaiming uniform initialization method; S3, get the target node: S31, the causal attention sampling weights of all neighbor nodes obtained in S24 Sort from large to small and select the first a largest neighbor nodes; S32, using a pooling aggregation function to embed the representation of the target node corresponding to the neighbor node obtained in S31; Set the node corresponding to the neighbor node in S31 as the target node v m ; First, the representation of the neighbor nodes in S31 is nonlinearly transformed, and the result is combined with the target node v through a pooling operation. m Finally, a nonlinear transformation is used to obtain the target node v m The representation of all dimensions of , and all the obtained target nodes v m Combined into the target node set V ′ , M is the total number of target nodes, m∈[1,M]; S4, perform sample reweighting: S41, constructs a model for the independence of unbiased estimates of the representation of target nodes in different dimensions: Among them, X *,p represents the p-dimensional representation of all the target nodes, X *,q represents the q-dimensional representation of all the target nodes, p,q∈[1,d],p≠q, d is the total number of representation dimensions; is a symmetric matrix of size M*M, Tr represents the trace of the matrix, 1 represents an all-1 matrix of size M×M, J=I-1 / M, I is the unit matrix of order M; S42, using reweighting to achieve independence of variables in representation: Using loss weights To make the variables represented in the independence model in S41 independent, we have: in, The W 2 Use uniform initialization to initialize each variable to the same value 1 / num, where num is the total number of target nodes for this iteration and is determined based on actual conditions. S43, loss weight Applied to the cross entropy loss function, the optimizer is used to update W and To minimize the loss function; optimize W and Until the loss function converges, we get W; S5, output the predicted traffic flow dataset: Input W obtained in S4 and the traffic flow dataset in S1 into the GraphSAGE graph model, and output the predicted traffic flow dataset.

2. The geographic network analysis method based on feature and structure distribution shift according to claim 1, characterized in that: S2 includes the following steps: S21, determine the same type of neighbor node v h and heterogeneous neighbor nodes v j ; S22, obtain similar neighbor nodes v h The causal weight of First, the do operator is used to estimate the intervention distribution p(y i |do(v i )),have: p(y i |do(v i ))=∫p(y i |v i ,N(v i ))p(N(v i ))dN(v i ); Then, the intervention distribution is obtained by kernel density estimation (KDE): where K|·| represents a kernel density estimate (KDE), which is obtained by combining and edge-reproducing kernel Hilbert space (RKHS) functions; Finally, integration gives v i The intervention distribution, v i,n is the nth neighbor node of the ith node: S23, obtain the attention sampling weights of heterogeneous neighbor nodes: For node v i The heterogeneous neighbor node v j , use the single-head attention mechanism to obtain the attention sampling weight There is the following formula: Among them, x i and x j For node v i and heterogeneous neighbor point v j , W is the weight matrix in the fully connected layer, and W is initialized by the Kaiming uniform initialization method; softmax means normalizing the calculation results; S24, Merge and Get each node v i Neighbor node v i,n Causal attention sampling weights for intervention distribution to own labels 3. The geographic network analysis method based on feature and structure distribution shift according to claim 1, characterized in that: a≥10 in S31.

4. The geographic network analysis method based on feature and structure distribution shift according to claim 1, characterized in that: The model in S41 is obtained by the following formula: Since the above formula is a biased estimate, 1 / M 2 Replace it with 1 / (M-1) 2 , obtaining unbiased estimates of the independence of the model.

5. The geographic network analysis method based on feature and structure distribution shift according to claim 1, characterized in that: In S42, the obtained The independence model is minimized to eliminate the dependencies between the representation dimensions, and the following formula is obtained: Will get Enter S43 for optimization.

6. The geographic network analysis method based on feature and structure distribution shift according to claim 1, characterized in that: The optimizer in S43 is the Adam optimizer.

Citation Information

Cited By

  • Individual brain health prediction method, device, equipment, medium and product

    CN120632825A

  • Multi-traffic participant modeling method and system fusing intention reasoning and density gradient

    CN121920248A