Heterogeneous graph anomaly detection method based on adaptive selection of multi-channel neighborhood nodes

By adopting multi-path neighborhood node adaptive selection and multi-agent reinforcement learning methods in heterogeneous graphs, the problem of abnormal node detection in heterogeneous graphs is solved, the representation learning performance of graph neural networks is improved, and the detection of abnormal nodes is realized. High-quality representation of quality images.

CN118540239APending Publication Date: 2024-08-23YANSHAN UNIV
View PDF 0 Cites 7 Cited by

Patent Information

Application Number
CN202410621742.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In heterogeneous graphs, the abnormal existence of high-order homogeneous peer nodes makes neighborhood nodes unreliable, destroys the assumption of homogeneity, and affects the representation learning performance of graph neural networks. It is difficult for existing methods to fine-grainedly detect spatial and semantic differences. Abnormal node.

Method used

A heterogeneous graph anomaly detection method based on adaptive selection of multi-path neighborhood nodes is adopted. By constructing a multi-dimensional graph, the sampling probability of neighborhood nodes is dynamically adjusted, and multi-agent reinforcement learning and relationship-aware neighborhood aggregation are used to adaptively select matching Nodes, filter abnormal information and improve the quality of representation learning.

Benefits of technology

It achieves fine-grained selection of neighborhood nodes in heterogeneous graphs, enhances the reliability of information aggregation, improves the performance of heterogeneous graph neural networks in representation learning and downstream tasks, and reduces the impact of abnormal information on the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540239A
    Figure CN118540239A
Patent Text Reader

Abstract

The invention discloses a heterogeneous graph anomaly detection method based on adaptive selection of multipath neighborhood nodes, which belongs to the technical field of deep learning and graph data mining, and comprises the following steps: giving a meta-path mode, and constructing a multi-dimensional graph with multi-dimensional semantic information; expanding the sampling range of multiple paths of neighborhoods, dynamically adjusting the sampling probability of neighborhood nodes, and sampling a proper amount of neighborhood nodes; basic environment elements in the reinforcement learning task are simulated according to the dependency, the dynamic nature and the complexity of the sampling node sequence; deploying multiple agents in the multi-dimensional graph, and adaptively and sequentially selecting matched nodes from the multi-dimensional sampling node sequence; comprehensive node representation embedding is learned by utilizing relation perception neighborhood aggregation; and embedding and transmitting the representation of the target node into a downstream task to carry out heterogeneous graph representation learning. According to the method, fine-grained selection of the neighborhood nodes in the heterogeneous graph can be realized, the reliability of the central node in the information aggregation process is enhanced, and the performance of the heterogeneous graph in the aspect of representation learning is also improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning and graph data mining, and in particular to a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection. Background Art

[0002] Network data in real-world scenarios can be modeled as heterogeneous graphs consisting of multiple entities and relationships, and has been deeply explored and widely used in many research fields. In the new era of the Internet, the emergence of massive knowledge data is undoubtedly a huge challenge. When faced with large-scale graph data, people often face the problems of incompleteness and unreliability of information, which makes it challenging to effectively select and process these uncertain knowledge resources.

[0003] Although graph neural networks perform well in processing various types of structured graph data, their representation learning process is often based on the assortativity assumption, which means that neighborhood nodes in the graph tend to have similar features or categories as the central node. This phenomenon has been widely observed and verified in real-world graph data. However, the quality of graph data varies, and challenges such as outliers, noise, sparsity, bias, and long-tail distribution may be encountered when modeling graphs. The existence of these abnormal data may undermine the assortativity assumption and make neighborhood-based information unreliable. If information is aggregated from such a neighborhood environment, misleading factors may be introduced, thereby damaging the performance of the graph learning algorithm and causing the learned graph representation to be distorted. In homogeneous graphs, assortativity is not yet ubiquitous, and heterogeneity is more common. In heterogeneous graphs, homogeneous peer nodes need to go through multi-hop relationship paths to establish connections, which further enhances the heterogeneity between nodes.

[0004] Recent research has pointed out that in general real-world business scenarios, when applied to graph neural networks, not all neighbor nodes have a positive effect on message aggregation. In fact, some neighbor nodes may also pass interference information that has a negative impact on the representation learning of the central node. They use manual or heuristic methods to specify the number or threshold of beneficial neighbors that need to be retained to alleviate the negative impact of harmful nodes on the target central node. However, these works only roughly judge the quality of nodes based on the distance measurement indicators between neighbor nodes and central nodes, and do not adaptively detect node anomalies that are spatially and semantically adjacent to the central node in a more fine-grained manner.

[0005] Therefore, it is necessary to propose a heterogeneous graph anomaly detection method based on adaptive selection of multi-way neighborhood nodes to help graph neural networks more effectively capture the multi-dimensional structure and feature information in graph data, so as to complete high-quality heterogeneous graph representation learning. Summary of the invention

[0006] The present invention aims at the problem that anomalies existing in high-order homogeneous peer nodes in heterogeneous graphs may make the observed neighborhood unreliable and lead to misleading information aggregation in node representation learning. A heterogeneous graph anomaly detection method based on multi-way neighborhood node adaptive selection is provided, which realizes fine-grained selection of neighborhood nodes in heterogeneous graphs, which not only enhances the reliability of central nodes in the information aggregation process, but also improves the performance of heterogeneous graphs in representation learning.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0008] A heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection includes the following steps:

[0009] S1, given a meta-path pattern, construct a multi-dimensional graph with multi-dimensional semantic information;

[0010] S2, expand the sampling range of multi-path neighborhood, dynamically adjust the sampling probability of neighborhood nodes, and sample an appropriate number of neighborhood nodes;

[0011] S3, simulates the basic environment elements in the reinforcement learning task according to the dependency, dynamics and complexity of the sampled node sequence;

[0012] S4, deploys multiple agents in a multidimensional graph and adaptively selects homogeneous nodes from a multidimensional sampling node sequence;

[0013] S5, learning comprehensive node representation embeddings using relation-aware neighborhood aggregation;

[0014] S6, passes the representation embedding of the target node to the downstream task for heterogeneous graph representation learning.

[0015] A further improvement of the technical solution of the present invention is that: in S1, specifically, given n different meta-path patterns According to each meta-path pattern, corresponding continuous matrix multiplication calculations are performed to construct a multi-dimensional graph with n-dimensional relationship path semantic information. The process includes the following steps:

[0016] S11, different downstream graph mining tasks may have specific requirements on the number of target node types, and a multidimensional graph is constructed for each target node type;

[0017] S12, along the pre-designed metapath The adjacency matrix of the graph based on the meta-path is constructed by continuously multiplying the adjacency matrices corresponding to all relations in The expression is as follows:

[0018]

[0019] Among them, e l Represents the node type, It's a relationship <e l ,e l+1 >The corresponding adjacency matrix; for n different meta-path patterns Perform similar calculations to construct an adjacency matrix corresponding to a set of homogeneous graphs Convert heterogeneous graphs into n-dimensional multidimensional graphs.

[0020] The further improvement of the technical solution of the present invention is that: in S2, the sampling range of the node neighborhood is expanded from the perspective of multi-path sampling inspiration, the context multi-armed bandit is used to dynamically adjust the sampling probability of the neighborhood nodes under each dimensional relationship path, and T neighborhood nodes are sampled for each node from each dimension according to the probability, so as to construct a neighborhood sampling pool NSP; the process includes the following steps:

[0021] S21, for the Φ(v) Dimension node attribute X v The node v uses the linear transformation matrix and the bias vector Transform node attributes into a specific d-dimensional latent embedding space In the above example, we get the initial representation embedding H of the node v , expressed as follows:

[0022] H v =W Φ(v) X v +b Φ(v) (2)

[0023] S22, for the central node of each dimension, a multi-way representative neighborhood sampling heuristic strategy is adopted;

[0024] S23, use Q k To represent the probability matrix of the k-th neighborhood sampling heuristic strategy, in round ep, combined with the sampling probability of the K-way neighborhood sampling heuristic strategy, calculate the central node v i For neighboring node v j The weighted multi-way sampling probability

[0025]

[0026] in, is the probability of the neighborhood sampling heuristic strategy granularity, Q k Satisfy row normalization

[0027] S24, calculate the probability of strategy granularity is the probability matrix Q of the kth neighborhood sampling heuristic strategy kThe comprehensive selection of neighborhood sampling heuristic strategies can be regarded as an adversarial problem in the contextual multi-armed bandit. The strategy granularity probability is used as a gambling action for multi-way neighborhood sampling, adaptively adjusting the sampling probability of each way and updating it with the iteration of the model training round:

[0028]

[0029] Among them, the initial value And p min ≥0 is a controllable constant used to constrain the lower limit of the sampling probability; w k is the weight of the k-th strategy. According to the contextual multi-armed bandit reinforcement learning algorithm with supervised learning guarantee, the iterative update rule is as follows:

[0030]

[0031] in, is the update cycle, and is an adjustable hyperparameter representing the regret rate of the contextual multi-armed bandit when selecting actions; is the weighted reward value of the sampling node under the k-th strategy in the ep-th round, expressed as follows:

[0032]

[0033] in, is node v i Select a set of neighborhood nodes; is node v i and v j The average multi-head attention score of

[0034] S25, after each round, for each node v, in each dimension relationship path Next, according to the sampling probability From the node set Sample T neighborhood nodes and add these center node and neighborhood node pairs to the neighborhood sampling pool:

[0035]

[0036] in, is the sampling probability.

[0037] A further improvement of the technical solution of the present invention is that: in S22, the multi-channel representative neighborhood sampling heuristic strategy includes: a one-hop neighbor strategy, a two-hop neighbor strategy, a nearest neighbor strategy and a random walk neighbor strategy; specifically:

[0038] The one-hop neighbor strategy: From the normalized adjacency matrix The directly connected nodes sampled in , where is the adjacency matrix with self-loops added, is satisfied The diagonal matrix of ;

[0039] The two-hop neighbor strategy: From the power of the normalized adjacency matrix Indirectly connected nodes sampled in;

[0040] The nearest neighbor strategy: From the probability matrix S based on the cosine similarity of node attributes KNN The nodes sampled in, where node v i and v j The similarity score between

[0041] The random walk neighbor strategy: From the random walk weight matrix S PPR The nodes sampled in , where the personalized PageRank algorithm is used to generate the walk weights scalar coefficient c∈[0,1], Represents a column-normalized adjacency matrix.

[0042] A further improvement of the technical solution of the present invention is that: in S3, specifically for each central node in the neighborhood sampling pool, the sampling neighborhood node set is arranged in order according to their sampling probability, and the basic environmental elements in the reinforcement learning task are simulated according to the dependency, dynamic characteristics and complexity of the sampling neighborhood node sequence; the process includes the following steps:

[0043] S31, in order to meet the dependency in the enhanced environmental elements, when selecting the order of neighboring nodes, the neighboring nodes are sorted according to the sampling probability of the neighboring nodes. Neighboring nodes with similar arrangements are semantically associated. As the agent moves forward in the neighboring node sequence along the time step, the close neighboring nodes will produce sequential dependency. The expression of the dependency process is as follows:

[0044] o t+1 =τo t +(1-τ)o t+1 (8)

[0045] Among them, t is the state of the environment at time step t, and τ is a small hyperparameter;

[0046] S32, in order to meet the dynamics of the enhanced environmental elements, the skip rate p is set for the neighborhood node sequence. s , the agent with probability p s Randomly skip the evaluation of a neighboring node and move directly to the next neighboring node. The length and content of the state sequence will change significantly in each round.

[0047] S33, in order to meet the complexity of the enhanced environmental elements, the neighborhood nodes are sorted in descending order according to the sampling probability of the neighborhood nodes. The agent starts to select and judge from the simple neighborhood nodes with higher sampling probability, and uses a higher skip rate to avoid more difficult neighborhood nodes. The skip rate p s Updated as the model training cycle iterates:

[0048]

[0049] Among them, p s is the basic skip rate, is the minimum skip rate to ensure dynamic characteristics; d t Represents the neighborhood node v at time step t t The normalized complexity measure of is expressed as follows:

[0050]

[0051] in, That is, select the node number with the maximum multi-path sampling probability from T sampling nodes; t ∈[0,1] is the node v and v t The normalized confidence of the same match is related to the reward value of the choice decision in the agent's behavior; κ is the balance between the central node v and the neighboring node v t Hyperparameters for homogametic and heterogametic features between .

[0052] The further improvement of the technical solution of the present invention is that: in S4, specifically in one round, the intelligent agent sequentially judges the heterogeneity of the central node and its corresponding up to T sampled neighboring nodes, and the process is regarded as a T-round decision process; in the multidimensional graph, a homogeneous graph constructed for the n-dimensional relationship path is deployed with n kinds of intelligent agents, and they learn how to select homogeneous nodes in the Markov game of the semantics of the n-dimensional relationship path to achieve a cooperative equilibrium of multi-dimensional selection, thereby constructing a neighborhood selection pool NCP; the process includes the following steps:

[0053] S41, using the latest central node representation H v , the neighborhood node representation H of the current time step vt and the sampled neighborhood node set NSP(v) together as the observable state o at the current time t t , expressed as follows:

[0054]

[0055] S42, the action space of each agent It is defined as a discrete scheme consisting of selecting and not selecting nodes of similarity, expressed as follows:

[0056]

[0057] S43, at time step t, a linear layer is used to represent the central node H v and neighborhood node representation Combined, we can get the information of the integrated center node and the neighboring nodes of the current time step. The estimated expression is as follows:

[0058]

[0059] Among them, σ(·) is the activation function, (·||·) is the concatenation operation, and W h and b h They are the learnable weight matrix and bias vector in linear mapping; drawing on the theory of contrastive predictive coding, the mutual information between the central node and the neighborhood node set is estimated to obtain higher-order information The estimated expression is as follows:

[0060]

[0061] Among them, W d is a learnable linear transformation matrix; concatenate the above two estimates to perform a learnable linear transformation W p And the Softmax layer output normalization step to obtain the action probability distribution The expression is as follows:

[0062]

[0063] S44, at time step t, according to the data characteristics of the graph structure, an unsupervised approach is used to assign rewards r to the actions of the agent. t+1(v) , expressed as follows:

[0064]

[0065] Among them, σ(·) is the Sigmoid activation function, Ω is the set of positive node pairs observed on the heterogeneous graph, and Ω - is the set of negative node pairs sampled from all unobserved node pairs, ω1 and ω2 are adjustable hyperparameters, representing the reward weight of positive samples and the penalty weight of negative samples respectively;

[0066] S45, at time step t, agent α observes node state o t , according to the strategy Execute action u t , get feedback t+1 , record the completed state done, and enter the next time step t+1, and continue to observe the new node state o t+1, establish an experience replay buffer pool for each agent α Store the empirical trajectory τ at each time step α =(o t ,u t ,r t+1 ,o t+1 ,done);

[0067] S46, uses a multi-actor attention critic algorithm to achieve the learning and optimization of the above multi-agent behavior. In a multi-agent reinforcement learning environment, it trains decentralized strategies, dynamically selects important information of each agent through a multi-head attention mechanism, and centralizes the evaluation of learning strategies;

[0068] S47, after each round, for each dimension relationship path For the central node v under the circumstance, the agent iteratively selects candidate nodes from the neighborhood sampling pool along the time series and adds these central node and selected node pairs to the neighborhood selection pool:

[0069]

[0070] A further improvement of the technical solution of the present invention is that in S46, the specific process includes the following steps:

[0071] S461, Agent α i The state action value function of is expressed as follows:

[0072]

[0073] Among them, gi(·) is the multi-layer perceptron embedding function for different modules, W s is a learnable linear transformation matrix, in other agents α j The contribution function g ou (o,u) is shared and used. is the attention weight of the contribution value;

[0074] S462, the value function optimization of all agents can be approximately regarded as a multi-task regression problem, and their joint regression loss function is as follows:

[0075]

[0076] Among them, θ and are the parameters of the critic network and the target critic network, respectively; is the target value function, expressed as follows:

[0077]

[0078] where γ is the discount factor, τ is the temperature hyperparameter that balances maximizing entropy and reward, are the parameters of the target policy network;

[0079] S463, the policy network of each agent is updated by gradient ascent, and their respective gradients are expressed as follows:

[0080]

[0081] Among them, A i (o|u)=Q i (o,u;θ)-b i (o,u) is the advantage function, is the counterfactual baseline, φ is the parameter of the policy network, and ρ is the learnable policy logarithmic adjustment coefficient; the parameters of all target networks are synchronized through the soft update mechanism.

[0082] A further improvement of the technical solution of the present invention is that: in S5, specifically: in order to obtain comprehensive node representation embedding, relationship-aware neighborhood aggregation is adopted, and neighborhood aggregation is divided into aggregation within the relationship path and aggregation between the relationship paths; the process includes the following steps:

[0083] S51, in the aggregation within the relationship path, the attention mechanism is used to dynamically adjust the weight of the neighborhood selection to obtain the aggregation representation embedding within the relationship path The expression is as follows:

[0084]

[0085] Among them, W h and W t are the linear transformation matrices for the central node and the neighboring nodes, respectively, which are shared in all relationship paths; a v,u Represents node v j v i The importance score is expressed as follows:

[0086]

[0087] Among them, W a is the attention transformation matrix, and the tanh activation function can further distinguish the abnormal information brought to the central node by the neighboring nodes;

[0088] S52, in the aggregation between relation paths, the semantic representation embedding information under all relation paths is spliced ​​together for joint learning to obtain the aggregated representation embedding Z between relation paths. v :

[0089]

[0090] Among them, MLP(·) is the multi-layer perceptron function for the final graph task.

[0091] A further improvement of the technical solution of the present invention is that in S6, the final representation of the target central node is embedded into Z as output and passed to the downstream task for representation learning of the heterogeneous graph. The process includes the following steps:

[0092] S61, during training, for the graph node classification task, first set the output layer dimension of the graph neural network to be the same as the number of node types, then for the single-label classification scenario, normalize it through the Softmax function, and optimize the algorithm performance by minimizing the cross entropy loss function; for the multi-label classification scenario, use the Sigmoid function to handle the independent binary classification problem of each label, and optimize the algorithm performance by minimizing the binary cross entropy loss function;

[0093] S62, during training, for the graph link prediction task, it is first necessary to perform inner product operations on the predicted node pairs or process them through the DistMult decoder, and then combine the minimization of the binary cross entropy loss function to optimize the algorithm performance;

[0094] S63, based on the label supervision signal of the downstream task, the model is learned and optimized. The loss function of the heterogeneous graph neural network is as follows:

[0095]

[0096] in, is the loss term of the relation-aware neighborhood aggregation module, λ * is the regularization weight, θ is the set of model parameters, and ||θ||2 is the L2 regularization norm of the model parameters.

[0097] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is:

[0098] The present invention designs a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection. Aiming at the problem that heterogeneous graph neural network aggregates abnormal information due to the heterogeneity of high-order homogeneous peer nodes in heterogeneous graphs, a contextual multi-armed bandit is firstly used to dynamically expand the range of neighborhood node sampling, and then multi-agent reinforcement learning is used to adaptively select neighborhood nodes that are homogeneous with target nodes, and abnormal neighborhood nodes are filtered out to the greatest extent, thereby realizing fine-grained selection of neighborhood nodes in heterogeneous graphs. Finally, a relationship-aware neighborhood aggregation module is used to fuse the selected neighborhood information under multiple relationship paths, further reducing the impact of potential abnormal information on heterogeneous graph neural networks. The present invention realizes an adaptive anomaly detection method for heterogeneous graphs and improves the performance of heterogeneous graph neural networks in graph node classification and graph link prediction tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0099] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.

[0100] Figure 1 It is a flow chart of a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection provided in an embodiment of the present invention;

[0101] Figure 2 It is an architecture diagram of a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0102] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.

[0103] Explanation of some professional terms in this invention:

[0104] Heterogeneous graph: A heterogeneous graph is defined as in is a node set, ε is an edge set, E is an entity type set, R is a relationship type set, and χ is an entity attribute set. In addition, two mapping functions are defined, namely, Φ(·) represents the mapping function from node to entity type, and Ψ(·) represents the mapping function from edge to relationship type.

[0105] Multi-dimensional graph: A multi-dimensional graph is a special case of a heterogeneous graph, which follows |E|=1 and |R|>1, where |E| represents the number of entity types and |R| represents the number of relationship types.

[0106] Heterogeneous graph neural network: Heterogeneous graph neural network aggregates information from neighbor nodes of the central node in different relationships to embed graph structure data, and then fuses graph information between relationships; the representation embedding of the central node v in the lth layer is: Where σ is the activation function, is an operator that combines the information of node v with its neighboring information by concatenation or summation. AGG(.) represents an aggregation function that maps neighborhood information from different relations into a vector;

[0107] Heterophilic node: Given an attribute graph containing n node instances, there are b nodes that are different from regular nodes (b<<n), and their attributes, connections or behaviors are different from most other normal nodes; the goal of heterophilic node detection is to learn a model that can identify and distinguish abnormal nodes that are significantly different from the central node.

[0108] The present invention is further described in detail below with reference to the accompanying drawings and embodiments:

[0109] like Figure 1 As shown, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection includes the following steps:

[0110] S1, given n different meta-path patterns According to each meta-path pattern, corresponding continuous matrix multiplication calculations are performed to construct a multi-dimensional graph with n-dimensional relationship path semantic information.

[0111] The specific process is:

[0112] S11, Different downstream graph mining tasks may have specific requirements on the number of target node types. Usually, a multi-dimensional graph is constructed for each target node type;

[0113] S12, along the pre-designed metapath The adjacency matrix of the graph based on the meta-path is constructed by continuously multiplying the adjacency matrices corresponding to all relations in It is expressed as follows:

[0114]

[0115] Among them, e l Represents the node type, It's a relationship <e l ,e l+1 >The corresponding adjacency matrix; for n different meta-path patterns By performing similar calculations, we can construct an adjacency matrix corresponding to a set of homogeneous graphs. Convert heterogeneous graphs into n-dimensional multidimensional graphs;

[0116] S2, expands the sampling range of the node neighborhood from the perspective of multi-path sampling inspiration, uses the contextual multi-armed bandit to dynamically adjust the sampling probability of the neighborhood nodes under each dimension of the relationship path, and samples appropriate T neighborhood nodes for each node from each dimension according to the probability, thereby constructing the neighborhood sampling pool NSP;

[0117] The specific process is:

[0118] S21, for the Φ(v) Dimension node attribute X v The node v uses the linear transformation matrix and the bias vector Transform node attributes into a specific d-dimensional latent embedding space In the above example, we get the initial representation embedding H of the node v , which is expressed as follows:

[0119] H v =W Φ(v) X v +b Φ(v) (2)

[0120] S22, for the central node of each dimension, a multi-way representative neighborhood sampling heuristic strategy is adopted, which includes: one-hop neighbor strategy, two-hop neighbor strategy, nearest neighbor strategy and random walk neighbor strategy;

[0121] Specifically:

[0122] One-hop neighbor strategy: From the normalized adjacency matrix The directly connected nodes sampled in , where is the adjacency matrix with self-loops added, is satisfied The diagonal matrix of ;

[0123] Two-hop neighbor strategy: From the power of the normalized adjacency matrix Indirectly connected nodes sampled in;

[0124] Nearest neighbor strategy: From the probability matrix S based on the cosine similarity of node attributes KNN The nodes sampled in, where node v i and v j The similarity score between

[0125] Random walk neighbor strategy: From the random walk weight matrix S PPR The nodes sampled in , where the personalized PageRank algorithm is used to generate the walk weights Here the scalar coefficient c∈[0,1], represents the column-normalized adjacency matrix;

[0126] S23, use Q k To represent the probability matrix of the k-th neighborhood sampling heuristic strategy, in round ep, combined with the sampling probability of this K-way neighborhood sampling heuristic strategy, calculate the central node v i For neighboring node v j The weighted multi-way sampling probability

[0127]

[0128] in, is the neighborhood sampling heuristic strategy granularity probability, Q k Satisfy row normalization

[0129] S24, calculate the probability of strategy granularity It is the probability matrix Q of the kth neighborhood sampling heuristic strategy k The comprehensive selection of multi-way sampling inspiration strategy can be regarded as an adversarial problem in the contextual multi-armed bandit. The strategy granularity probability is used as a gambling action for multi-way neighborhood sampling. The sampling probability of each way is adaptively adjusted and updated with the iteration of the model training round:

[0130]

[0131] Among them, the initial value And p min ≥0 is a controllable constant used to constrain the lower limit of the sampling probability; w k is the weight of the k-th strategy. According to the contextual multi-armed bandit reinforcement learning algorithm with supervised learning guarantee, its iterative update rule is as follows:

[0132]

[0133] in, is the update cycle, and is an adjustable hyperparameter representing the regret rate of the contextual multi-armed bandit when selecting actions; is the weighted reward value of the sampling node under the k-th strategy in the ep-th round, which is expressed as follows:

[0134]

[0135] in, is node v i Select a set of neighborhood nodes; is node v i and v j The average multi-head attention score of

[0136] S25, after each round, for each node v, in each dimension relationship path Next, according to the sampling probability From the node set Sample T neighborhood nodes and add these center node and neighborhood node pairs to the neighborhood sampling pool:

[0137]

[0138] S3, for each central node in the neighborhood sampling pool, the sampling neighborhood node set is arranged in order according to its sampling probability, and the basic environmental elements in the reinforcement learning task are simulated according to the dependency, dynamic characteristics and complexity of the sampling neighborhood node sequence;

[0139] The specific process is:

[0140] S31, in order to meet the dependency in the enhanced environmental elements, when selecting the order of neighboring nodes, the neighboring nodes are sorted according to the sampling probability of the neighboring nodes. Neighboring nodes with similar arrangements are semantically associated. As the agent moves forward in the neighboring node sequence along the time step, the close neighboring nodes will produce sequential dependency. The expression of the dependency process is as follows:

[0141] o t+1 =τo t +(1-τ)o t+1 (8)

[0142] Among them, t is the state of the environment at time step t, and τ is a small hyperparameter;

[0143] S32, in order to meet the dynamics of the enhanced environmental elements, the skip rate p is set for the neighborhood node sequence. s , the agent with probability p s Randomly skip the evaluation of a neighboring node and move directly to the next neighboring node. The length and content of the state sequence will change significantly in each round.

[0144] S33, in order to meet the complexity of the enhanced environmental elements, the neighborhood nodes are sorted in descending order according to the sampling probability of the neighborhood nodes. The agent starts to select and judge from the simple neighborhood nodes with higher sampling probability, and uses a higher skip rate to avoid more difficult neighborhood nodes. The skip rate p s Updated as the model training cycle iterates:

[0145]

[0146] Among them, p s is the basic skip rate, is the minimum skip rate to ensure dynamic characteristics; d t Represents the neighborhood node v at time step t t The normalized complexity measure of is expressed as follows:

[0147]

[0148] in, That is, select the node number with the maximum multi-path sampling probability from T sampling nodes; t ∈[0,1] is the node v and v t The normalized confidence of the same match is related to the reward value of the choice decision in the agent's behavior; κ is the balance between the central node v and the neighboring node v t Hyperparameters for homogametic and heterogametic traits between ;

[0149] S4, in one round, the agents make heterogeneity judgments on the central node and its corresponding up to T sampled neighboring nodes in turn, and this process is regarded as a T-round decision-making process; n types of agents are deployed in the homogeneous graph constructed for the n-dimensional relationship path in the multidimensional graph, and they learn how to select homogeneous nodes in the Markov game of the n-dimensional relationship path semantics to achieve a cooperative equilibrium of multi-dimensional selection, thereby constructing a neighborhood selection pool NCP;

[0150] The specific process is:

[0151] S41, using the latest central node representation H v , the neighborhood node representation H of the current time step vt and the sampled neighborhood node set NSP(v) together as the observable state o at the current time t t , which is expressed as follows:

[0152] o t(v) =[H v ,H vt ,H NSP(v) ] (11)

[0153] S42, the action space of each agent It is defined as a discrete scheme consisting of selecting and unselecting nodes of similarity, which is expressed as follows:

[0154]

[0155] S43, at time step t, a linear layer is used to represent the central node H v and neighborhood node representation Combined, we can get the information of the integrated center node and the neighboring nodes of the current time step. The estimated expression is as follows:

[0156]

[0157] Among them, σ(·) is the activation function, (·||·) is the concatenation operation, and W h and b h They are the learnable weight matrix and bias vector in linear mapping; drawing on the theory of contrastive predictive coding, the mutual information between the central node and the neighborhood node set is estimated to obtain higher-order information The estimated expression is as follows:

[0158]

[0159] Among them, W d is a learnable linear transformation matrix; concatenate the above two estimates to perform a learnable linear transformation W p And the Softmax layer output normalization step to obtain the action probability distribution It is expressed as follows:

[0160]

[0161] S44, at time step t, according to the data characteristics of the graph structure, an unsupervised approach is used to assign rewards r to the actions of the agent. t+1(v) , which is expressed as follows:

[0162]

[0163] Among them, σ(·) is the Sigmoid activation function, Ω is the set of positive node pairs observed on the heterogeneous graph, and Ω - is the set of negative node pairs sampled from all unobserved node pairs, ω1 and ω2 are adjustable hyperparameters, representing the reward weight of positive samples and the penalty weight of negative samples respectively;

[0164] S45, at time step t, agent α observes node state o t , according to the strategy Execute action u t , get feedback t+1 , record the completed state done, and enter the next time step t+1, and continue to observe the new node state o t+1 , establish an experience replay buffer pool for each agent α Store the empirical trajectory τ at each time step α =(o t ,u t ,r t+1 ,o t+1 ,done);

[0165] S46, uses a multi-actor attention critic algorithm to achieve the learning and optimization of the above multi-agent behavior. In a multi-agent reinforcement learning environment, it trains decentralized strategies, dynamically selects important information of each agent through a multi-head attention mechanism, and centralizes the evaluation of learning strategies;

[0166] The specific process is:

[0167] S461, Agent α i The state action value function of is expressed as follows:

[0168]

[0169] Among them, gi(·) is the multi-layer perceptron embedding function for different modules, W s is a learnable linear transformation matrix that is used in other agents α j The contribution function g ou (o,u) is shared and used. is the attention weight of the contribution value;

[0170] S462, the value function optimization of all agents can be approximately regarded as a multi-task regression problem, and their joint regression loss function is as follows:

[0171]

[0172] Among them, θ and are the parameters of the critic network and the target critic network, respectively; is the target value function, which is expressed as follows:

[0173]

[0174] where γ is the discount factor, τ is the temperature hyperparameter that balances maximizing entropy and reward, are the parameters of the target policy network;

[0175] S463, the policy network of each agent is updated by gradient ascent, and their respective gradients are expressed as follows:

[0176]

[0177] Among them, A i (o|u)=Q i (o,u;θ)-b i (o,u) is the advantage function, is the counterfactual baseline, φ is the parameter of the policy network, and ρ is the learnable policy logarithmic adjustment coefficient; all target network parameters are synchronized through the soft update mechanism;

[0178] S47, after each round, for each dimension relationship path For the central node v under the circumstance, the agent iteratively selects candidate nodes from the neighborhood sampling pool along the time series and adds these central node and selected node pairs to the neighborhood selection pool:

[0179]

[0180] S5, in order to obtain comprehensive node representation embedding, relation-aware neighborhood aggregation is adopted, and neighborhood aggregation is divided into aggregation within relation paths and aggregation between relation paths;

[0181] The specific process is:

[0182] S51, in the aggregation within the relationship path, the attention mechanism is used to dynamically adjust the weight of the neighborhood selection to obtain the aggregation representation embedding within the relationship path It is expressed as follows:

[0183]

[0184] Among them, W h and W t are the linear transformation matrices for the central node and the neighboring nodes, respectively, which are shared in all relationship paths; a v,u Represents node v j v i The importance score is expressed as follows:

[0185]

[0186] Among them, W a is the attention transformation matrix, and the tanh activation function can further distinguish the abnormal information brought to the central node by the neighboring nodes;

[0187] S52, in the aggregation between relation paths, the semantic representation embedding information under all relation paths is spliced ​​together for joint learning to obtain the aggregated representation embedding Z between relation paths. v :

[0188]

[0189] Among them, MLP(·) is the multi-layer perceptron function for the final graph task;

[0190] S6, embeds the final representation of the target central node into Z as output and passes it to the downstream task for representation learning of heterogeneous graphs;

[0191] The specific process is:

[0192] S61, during training, for the graph node classification task, first set the output layer dimension of the graph neural network to be the same as the number of node types, then for the single-label classification scenario, normalize it through the Softmax function, and optimize the algorithm performance by minimizing the cross entropy loss function; for the multi-label classification scenario, use the Sigmoid function to handle the independent binary classification problem of each label, and optimize the algorithm performance by minimizing the binary cross entropy loss function;

[0193] S62, during training, for the graph link prediction task, it is first necessary to perform inner product operations on the predicted node pairs or process them through the DistMult decoder, and then combine the minimization of the binary cross entropy loss function to optimize the algorithm performance;

[0194] S63, based on the label supervision signal of the downstream task, the model is learned and optimized. The loss function of the heterogeneous graph neural network is as follows:

[0195]

[0196] in, is the loss term of the relation-aware neighborhood aggregation module, λ * is the regularization weight, θ is the set of model parameters, and ||θ||2 is the L2 regularization norm of the model parameters.

[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A heterogeneous graph anomaly detection method based on adaptive selection of multi-path neighborhood nodes, Features: The following steps are involved: S1, given a meta-path pattern, construct a multi-dimensional graph with multi-dimensional semantic information; S2, expand the sampling range of multi-path neighborhood, dynamically adjust the sampling probability of neighborhood nodes, and sample an appropriate number of neighborhood nodes; S3, simulates the basic environment elements in the reinforcement learning task according to the dependency, dynamics and complexity of the sampled node sequence; S4, deploys multiple agents in a multidimensional graph and adaptively selects homogeneous nodes from a multidimensional sampling node sequence; S5, learning comprehensive node representation embeddings using relation-aware neighborhood aggregation; S6, passes the representation embedding of the target node to the downstream task for heterogeneous graph representation learning.

2. According to claim 1, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S1, specifically given n different meta-path patterns According to each meta-path pattern, corresponding continuous matrix multiplication calculations are performed to construct a multi-dimensional graph with n-dimensional relationship path semantic information. The process includes the following steps: S11, different downstream graph mining tasks may have specific requirements on the number of target node types, and a multidimensional graph is constructed for each target node type; S12, along the pre-designed metapath The adjacency matrix of the graph based on the meta-path is constructed by continuously multiplying the adjacency matrices corresponding to all relations in The expression is as follows: Among them, e l Represents the node type, It's a relationship <e l ,e l+1 >The corresponding adjacency matrix; for n different meta-path patterns Perform similar calculations to construct an adjacency matrix corresponding to a set of homogeneous graphs Convert heterogeneous graphs into n-dimensional multidimensional graphs.

3. According to claim 1, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S2, the sampling range of the node neighborhood is expanded from the perspective of multi-path sampling inspiration, and the context multi-armed bandit is used to dynamically adjust the sampling probability of the neighborhood nodes under each dimensional relationship path, and T neighborhood nodes are sampled for each node from each dimension according to the probability, so as to construct the neighborhood sampling pool NSP; the process includes the following steps: S21, for the Φ(v) Dimension node attribute X v The node v uses the linear transformation matrix and the bias vector Transform node attributes into a specific d-dimensional latent embedding space In the above example, we get the initial representation embedding H of the node v , expressed as follows: H v =W Φ(v) X v +b Φ(v) (2) S22, for the central node of each dimension, a multi-way representative neighborhood sampling heuristic strategy is adopted; S23, use Q k To represent the probability matrix of the k-th neighborhood sampling heuristic strategy, in round ep, combined with the sampling probability of the K-way neighborhood sampling heuristic strategy, calculate the central node v i For neighboring node v j The weighted multi-way sampling probability in, is the probability of the neighborhood sampling heuristic strategy granularity, Q k Satisfy row normalization S24, calculate the probability of strategy granularity is the probability matrix Q of the kth neighborhood sampling heuristic strategy k The comprehensive selection of neighborhood sampling heuristic strategies can be regarded as an adversarial problem in the contextual multi-armed bandit. The strategy granularity probability is used as a gambling action for multi-way neighborhood sampling, adaptively adjusting the sampling probability of each way and updating it with the iteration of the model training round: Among them, the initial value And p min ≥0 is a controllable constant used to constrain the lower limit of the sampling probability; w k is the weight of the k-th strategy. According to the contextual multi-armed bandit reinforcement learning algorithm with supervised learning guarantee, the iterative update rule is as follows: in, is the update cycle, and is an adjustable hyperparameter representing the regret rate of the contextual multi-armed bandit when selecting actions; is the weighted reward value of the sampling node under the k-th strategy in the ep-th round, expressed as follows: in, is node v i Select a set of neighborhood nodes; is node v i and v j The average multi-head attention score of S25, after each round, for each node v, in each dimension relationship path Next, according to the sampling probability From the node set Sample T neighborhood nodes and add these center node and neighborhood node pairs to the neighborhood sampling pool: in, is the sampling probability.

4. According to claim 3, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S22, the multi-path representative neighborhood sampling heuristic strategy includes: one-hop neighbor strategy, two-hop neighbor strategy, nearest neighbor strategy and random walk neighbor strategy; specifically: The one-hop neighbor strategy: From the normalized adjacency matrix The directly connected nodes sampled in , where is the adjacency matrix with self-loops added, is satisfied The diagonal matrix of ; The two-hop neighbor strategy: From the power of the normalized adjacency matrix Indirectly connected nodes sampled in; The nearest neighbor strategy: From the probability matrix S based on the cosine similarity of node attributes KNN The nodes sampled in, where node v i and v j The similarity score between The random walk neighbor strategy: From the random walk weight matrix S PPR The nodes sampled in , where the personalized PageRank algorithm is used to generate the walk weights scalar coefficient c∈[0,1], Represents a column-normalized adjacency matrix.

5. According to claim 1, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S3, specifically, the set of sampled neighborhood nodes for each central node in the neighborhood sampling pool is arranged in order according to their sampling probabilities, and the basic environmental elements in the reinforcement learning task are simulated according to the dependencies, dynamic characteristics and complexity of the sampled neighborhood node sequence; the process includes the following steps: S31, in order to meet the dependency in the enhanced environmental elements, when selecting the order of neighboring nodes, the neighboring nodes are sorted according to the sampling probability of the neighboring nodes. Neighboring nodes with similar arrangements are semantically associated. As the agent moves forward in the neighboring node sequence along the time step, the close neighboring nodes will produce sequential dependency. The expression of the dependency process is as follows: the t+1 =the t +(1-t)o t+1 (8) Among them, t is the state of the environment at time step t, and τ is a small hyperparameter; S32, in order to meet the dynamics of the enhanced environmental elements, the skip rate p is set for the neighborhood node sequence. s , the agent with probability p s Randomly skip the evaluation of a neighboring node and move directly to the next neighboring node. The length and content of the state sequence will change significantly in each round. S33, in order to meet the complexity of the enhanced environmental elements, the neighborhood nodes are sorted in descending order according to the sampling probability of the neighborhood nodes. The agent starts to select and judge from the simple neighborhood nodes with higher sampling probability, and uses a higher skip rate to avoid more difficult neighborhood nodes. The skip rate p s Updated as the model training cycle iterates: Among them, p s is the basic skip rate, is the minimum skip rate to ensure dynamic characteristics; d t Represents the neighborhood node v at time step t t The normalized complexity measure of is expressed as follows: in, That is, select the node number with the maximum multi-path sampling probability from T sampling nodes; t ∈[0,1] is the node v and v t The normalized confidence of the same match is related to the reward value of the choice decision in the agent's behavior; κ is the balance between the central node v and the neighboring node v t Hyperparameters for homogametic and heterogametic features between .

6. According to claim 1, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S4, specifically, in one round, the agent makes heterogeneity judgments on the central node and its corresponding up to T sampling neighborhood nodes in turn, and the process is regarded as a T-round decision process; Deploy n kinds of agents in a homogeneous graph constructed for n-dimensional relationship paths in a multidimensional graph. They learn how to select nodes with similarity in the Markov game of n-dimensional relationship path semantics to achieve cooperative equilibrium of multi-dimensional selection, thereby constructing a neighborhood selection pool NCP. The process includes the following steps: S41, using the latest central node representation H v , the neighborhood node representation H of the current time step vt and the sampled neighborhood node set NSP(v) together as the observable state o at the current time t t , expressed as follows: S42, the action space of each agent It is defined as a discrete scheme consisting of selecting and not selecting nodes of similarity, expressed as follows: S43, at time step t, a linear layer is used to represent the central node H v and neighborhood node representation Combined, we can get the information of the integrated center node and the neighboring nodes of the current time step. The estimated expression is as follows: Among them, σ(·) is the activation function, (·||·) is the concatenation operation, and W h and b h They are the learnable weight matrix and bias vector in linear mapping; drawing on the theory of contrastive predictive coding, the mutual information between the central node and the neighborhood node set is estimated to obtain higher-order information The estimated expression is as follows: Among them, W d is a learnable linear transformation matrix; concatenate the above two estimates to perform a learnable linear transformation W p And the Softmax layer output normalization step to obtain the action probability distribution The expression is as follows: S44, at time step t, according to the data characteristics of the graph structure, an unsupervised approach is used to assign rewards r to the actions of the agent. t+1(v) , expressed as follows: Among them, σ(·) is the Sigmoid activation function, Ω is the set of positive node pairs observed on the heterogeneous graph, and Ω - is the set of negative node pairs sampled from all unobserved node pairs, ω 1 and ω 2 are adjustable hyperparameters, representing the reward weight of positive samples and the penalty weight of negative samples respectively; S45, at time step t, agent α observes node state o t , according to the strategy Execute action u t , get feedback t+1 , record the completed state done, and enter the next time step t+1, and continue to observe the new node state o t+1 , establish an experience replay buffer pool for each agent α Store the empirical trajectory τ at each time step α =(o t ,u t ,r t+1 ,o t+1 ,done); S46, uses a multi-actor attention critic algorithm to achieve the learning and optimization of the above multi-agent behavior. In a multi-agent reinforcement learning environment, it trains decentralized strategies, dynamically selects important information of each agent through a multi-head attention mechanism, and centralizes the evaluation of learning strategies; S47, after each round, for each dimension relationship path For the central node v under the circumstance, the agent iteratively selects candidate nodes from the neighborhood sampling pool along the time series and adds these central node and selected node pairs to the neighborhood selection pool:

7. According to claim 6, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S46, the specific process includes the following steps: S461, Agent α i The state action value function of is expressed as follows: Among them, g i (·) is the multi-layer perceptron embedding function for different modules, W s is a learnable linear transformation matrix, in other agents α j The contribution function g ou (o,u) is shared and used. is the attention weight of the contribution value; S462, the value function optimization of all agents can be approximately regarded as a multi-task regression problem, and their joint regression loss function is as follows: Among them, θ and are the parameters of the critic network and the target critic network, respectively; is the target value function, expressed as follows: where γ is the discount factor, τ is the temperature hyperparameter that balances maximizing entropy and reward, are the parameters of the target policy network; S463, the policy network of each agent is updated by gradient ascent, and their respective gradients are expressed as follows: Among them, A i (o|u)=Q i (o,u;θ)-b i (o,u) is the advantage function, is the counterfactual baseline, φ is the parameter of the policy network, and ρ is the learnable policy logarithmic adjustment coefficient.

8. According to claim 1, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S5, specifically: in order to obtain comprehensive node representation embedding, relationship-aware neighborhood aggregation is adopted, and neighborhood aggregation is divided into aggregation within the relationship path and aggregation between the relationship paths; the process includes the following steps: S51, in the aggregation within the relationship path, the attention mechanism is used to dynamically adjust the weight of the neighborhood selection to obtain the aggregation representation embedding within the relationship path The expression is as follows: Among them, W h and W t are the linear transformation matrices for the central node and the neighboring nodes, respectively, which are shared in all relationship paths; a v,u Represents node v j v i The importance score of is expressed as follows: Among them, W a is the attention transformation matrix, and the tanh activation function can further distinguish the abnormal information brought to the central node by the neighboring nodes; S52, in the aggregation between relation paths, the semantic representation embedding information under all relation paths is spliced ​​together for joint learning to obtain the aggregated representation embedding Z between relation paths. v : Among them, MLP(·) is the multi-layer perceptron function for the final graph task.

9. According to claim 1, a heterogeneous graph anomaly detection method based on multi-path neighborhood node adaptive selection, Features: In S6, the final representation of the target central node is embedded into Z as output and passed to the downstream task for representation learning of heterogeneous graphs; The process includes the following steps: S61, during training, for the graph node classification task, first set the output layer dimension of the graph neural network to be the same as the number of node types, then for the single-label classification scenario, normalize it through the Softmax function, and optimize the algorithm performance by minimizing the cross entropy loss function; for the multi-label classification scenario, use the Sigmoid function to handle the independent binary classification problem of each label, and optimize the algorithm performance by minimizing the binary cross entropy loss function; S62, during training, for the graph link prediction task, it is first necessary to perform inner product operations on the predicted node pairs or process them through the DistMult decoder, and then combine the minimization of the binary cross entropy loss function to optimize the algorithm performance; S63, based on the label supervision signal of the downstream task, the model is learned and optimized. The loss function of the heterogeneous graph neural network is as follows: in, is the loss term of the relation-aware neighborhood aggregation module, λ * is the regularization weight, θ is the set of model parameters, ||θ|| 2 is the model parameter L 2 Regularization norm.

Citation Information

Cited By

  • Virtual currency wallet address anomaly detection method and system based on adaptive disparate message aggregation

    CN119130652A

  • Virtual Currency Wallet Address Anomaly Detection Method and System Based on Adaptive Assortative Message Aggregation

    CN119130652B

  • Self-supervised medical image segmentation method and system based on random walk path

    CN119477961A

  • Load-aware multi-micro-service replica elastic scaling method in computing power network

    CN119512759A

  • A Method for Elastic Scaling of Multiple Microservice Replicas with Load Awareness in a Computing Power Network

    CN119512759B