Out-of-distribution node detection method, device and equipment, computer storage medium and program product

By training the attribute and structure information of nodes in the graph data to be detected, the energy model is obtained, and the energy value of nodes in the graph data to be detected is solved, and the existing external node detection methods are low, so as to achieve the possession and non-existence of category information Accurate detection of graph data.

CN118965064APending Publication Date: 2024-11-15HONG KONG UNIV OF SCI & TECH (GUANGZHOU)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411005764.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing off-distribution node detection methods are less versatile, and the classification model has a low accuracy in detecting whether unknown nodes in graph data that do not have category information are off-distribution nodes.

Method used

The energy model is obtained by training the attribute information and structural information of the nodes in the graph data, and the energy value is calculated based on the attribute information and structural information of each node in the graph data to be detected, and whether the node is an external node is determined.

Benefits of technology

It improves the universality of the detection method of the external node, is applicable to graph data with category information and without category information, and enhances the accuracy of unknown nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965064A_ABST
    Figure CN118965064A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed external node detection method and device, equipment, a computer storage medium and a program product. The method comprises the steps of obtaining first attribute information and first structure information of each first node in to-be-detected graph data; the first structure information and the first attribute information are input into an energy model, a first energy value, output by the energy model, of each first node is obtained, and the energy model is obtained through training based on attribute information and structure information of a second node in training graph data; and determining a first node corresponding to the first energy value greater than a preset threshold value as a distributed external node. In the application, the detection of the distributed external nodes is suitable for the graph data with the category information and without the category information, so that the universality of the distributed external node detection method is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of distributed out-node detection, and in particular, relates to a distributed out-node detection method, device, equipment, computer storage medium and program product. Background Art

[0002] Graph data is widely present in our daily life, for example, in social networks and financial transaction networks. For some security-critical application scenarios, it is necessary to detect whether the nodes in the graph data are out-of-distribution nodes. Out-of-distribution nodes refer to nodes that are inconsistent with most nodes in the graph data.

[0003] In the exemplary technology, whether an unknown node in the graph data is an out-of-distribution node is detected by a classification model. The classification model is trained by classifying the nodes in the graph data.

[0004] From the above, we can see that the classification model training depends on the category information of the nodes in the graph data, which makes the classification model detect whether the unknown nodes in the graph data without category information are out-of-distribution nodes with low accuracy, that is, the existing out-of-distribution node detection methods have low universality. Summary of the invention

[0005] Embodiments of the present application provide a distributed node detection method, apparatus, device, computer storage medium, and program product to solve the problem of low versatility of existing distributed node detection methods.

[0006] On the one hand, an embodiment of the present application provides a method for detecting an out-of-distribution node, including:

[0007] Acquire first attribute information and first structure information of each first node in the graph data to be detected;

[0008] Inputting the first structural information and the first attribute information into an energy model to obtain a first energy value of each first node output by the energy model, wherein the energy model is trained based on the attribute information and structural information of the second node in the training graph data;

[0009] A first node corresponding to the first energy value greater than a preset threshold is determined as an out-of-distribution node.

[0010] In one embodiment, before inputting the first structural information and the first attribute information into the energy model, the method further includes:

[0011] Obtaining second attribute information and second structure information of each second node in the training graph data;

[0012] Constructing a plurality of training samples according to the second attribute information and the second structure information of each of the second nodes;

[0013] The preset model is trained according to each of the training samples to obtain the energy model.

[0014] In another embodiment, constructing a plurality of training samples according to the second attribute information and the second structure information of each second node includes:

[0015] Determine third attribute information of a third node to be generated on the training graph data according to each of the second attribute information, and determine third structural information of the third node according to the third attribute information;

[0016] Determine a fourth node among each of the second nodes, wherein the fourth node is the second node that is a node within the distribution;

[0017] A training sample of nodes within the distribution is constructed according to the second attribute information and the second structure information of the fourth node, and a training sample of nodes outside the distribution is constructed according to the third attribute information and the third structure information of the third node.

[0018] In another embodiment, the loss function of the preset model is updated according to the second energy value and the third energy value; the second energy value is determined based on the third attribute information and the third structure information; the third energy value is determined based on the second attribute information and the second structure information.

[0019] In another embodiment, the loss function is updated based on the regularized second energy value and the regularized second energy value.

[0020] In another embodiment, the second energy value or the third energy value is used as a target energy value, and the target energy value is determined as follows:

[0021] Determine, according to first target structure information of the first target node and second target structure information of the second target node, a connectivity parameter between the first target node and the second target node, wherein the connectivity parameter is used to indicate a probability of connection between the first target node and the second target node, and the first target node and the second target node are adjacent nodes on the training graph data;

[0022] Determine a linear parameter of the first target node according to the first target attribute information of the first target node;

[0023] Determine, according to the linear parameter and the connectivity parameter, a representation parameter corresponding to each network layer of the first target node in the graph neural network;

[0024] A target energy value corresponding to the first target node is determined according to each of the characterization parameters.

[0025] In another embodiment, determining the third attribute information of the third node to be generated on the training graph data according to each of the second attribute information includes:

[0026] Determine the initialization attribute information of the third node according to each of the second attribute information;

[0027] Based on the set noise parameter, the initialization attribute information is iterated to obtain the third attribute information.

[0028] In another embodiment, determining the initialization attribute information of the third node according to each piece of the second attribute information includes:

[0029] In response to each of the second nodes including a fifth node as a distributed out-node;

[0030] According to the attribute information of each of the fifth nodes, the initialization attribute information of the third node to be generated in the training graph data is determined.

[0031] In another embodiment, determining the initialization attribute information of the third node according to each piece of the second attribute information includes:

[0032] In response to the fact that the second nodes do not include a fifth node that is an out-of-distribution node;

[0033] According to the second attribute information of each of the second nodes, the initialization attribute information of the third node to be generated in the training graph data is determined.

[0034] In another embodiment, after inputting the first structural information and the first attribute information into the energy model, the method further includes:

[0035] A first node corresponding to the first energy value that is less than or equal to a preset threshold is determined as an in-distribution node.

[0036] On the other hand, an embodiment of the present application provides a distributed external node detection device, including:

[0037] An acquisition module, used to acquire first attribute information and first structure information of each first node in the graph data to be detected;

[0038] An input module, used for inputting the first structural information and the first attribute information into an energy model to obtain a first energy value of each first node output by the energy model, wherein the energy model is trained based on the attribute information and structural information of the second node in the training graph data;

[0039] The determination module is used to determine the first node corresponding to the first energy value greater than a preset threshold as an out-of-distribution node.

[0040] On the other hand, the embodiment of the present application provides a distributed external node detection device,

[0041] The distributed out-node detection device includes: a processor and a memory storing computer program instructions;

[0042] When the processor executes the computer program instructions, the method described above is implemented.

[0043] On the other hand, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0044] On the other hand, the embodiment of the present application provides a computer program product, and when the instructions in the computer program product are executed by the processor of the electronic device, the electronic device executes the method as described above.

[0045] The out-of-distribution node detection method, apparatus, device, computer storage medium and program product of the embodiments of the present application obtain an energy model that can calculate the energy value of the node by training the attribute information and structural information of the nodes in the training graph data, so that the energy model determines the energy value of each node based on the attribute information and structural information of each node in the graph data to be detected, thereby determining whether the node in the graph data to be detected is an out-of-distribution node through the energy value, that is, the detection of out-of-distribution nodes is applicable to graph data with category information and without category information, thereby improving the versatility of the out-of-distribution node detection method. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0047] Figure 1 It is a schematic diagram of the application scenario involved in the distributed out-node detection method of this application;

[0048] Figure 2 It is a flowchart of the first embodiment of the distributed node detection method of the present application;

[0049] Figure 3 It is a flowchart of the second embodiment of the distributed node detection method of the present application;

[0050] Figure 4It is a flowchart of the third embodiment of the distributed node detection method of the present application;

[0051] Figure 5 It is a schematic diagram of the energy values ​​of nodes in the graph data involved in this application;

[0052] Figure 6 It is a functional module diagram of the distributed external node detection device involved in the present application;

[0053] Figure 7 It is a structural diagram of the distributed external node detection device involved in this application. DETAILED DESCRIPTION

[0054] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0056] Graph data is widely present in our daily life, for example, in social networks and financial transaction networks. For some security-critical application scenarios, it is necessary to detect whether the nodes in the graph data are out-of-distribution nodes. Out-of-distribution nodes refer to nodes that are inconsistent with most nodes in the graph data.

[0057] In the exemplary technology, whether an unknown node in the graph data is an out-of-distribution node is detected by a classification model. The classification model is trained by classifying the nodes in the graph data.

[0058] The inventors of the present application discovered that the training of the classification model depends on the category information of the nodes in the graph data, which makes the classification model less accurate in detecting whether unknown nodes in the graph data without category information are out-of-distribution nodes. In other words, the existing out-of-distribution node detection methods have low universality.

[0059] The inventors of the present application therefore conceived of obtaining an energy model capable of calculating the energy value of a node by training the attribute information and structural information of nodes in training graph data, so that the energy model determines the energy value of each node based on the attribute information and structural information of each node in the graph data to be detected, thereby determining whether the node in the graph data to be detected is an out-of-distribution node through the energy value. That is, the detection of out-of-distribution nodes is applicable to graph data with and without category information, thereby improving the versatility of the out-of-distribution node detection method.

[0060] Reference Figure 1 , Figure 1 Schematic diagram of the scenario involved in the method for detecting an out-of-distribution node in the present application. An energy model 110 is provided in the out-of-distribution node detection device 100. The out-of-distribution node detection device 100 obtains the graph data to be detected, and obtains the structural information and attribute information of each node in the graph data to be detected, and inputs the structural information and attribute information into the energy model 110. The energy model 110 outputs the energy value of each node, so that the out-of-distribution node detection device 100 determines whether the corresponding node is an out-of-distribution node based on the energy value, that is, the out-of-distribution node detection device 100 outputs prompt information. The prompt information is used to indicate that each node in the graph data is an out-of-distribution node or an in-distribution node.

[0061] Combine the following Figure 1 The distributed external node detection method provided in the embodiment of the present application is introduced.

[0062] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the distributed node detection method of the present application. The distributed node detection method includes the following steps:

[0063] Step S201, obtaining first attribute information and first structure information of each first node in the graph data to be detected.

[0064] In this embodiment, the execution subject is a distributed node detection device. For ease of description, the term "device" is used below to refer to the distributed node detection device. The device can be any terminal device with graph data processing capabilities, such as a computer or a server.

[0065] The device obtains the graph data to be detected. The graph data to be detected includes multiple nodes, each of which can correspond to a data, and the data can be social data, financial data, object data, medical data, etc. When the data is social data, the graph data to be detected can be applied to the prediction of the user's friends, that is, to determine whether the user corresponding to the unknown data in the graph data is a friend of the user corresponding to the known data. The known data refers to the data identified as a friend or a non-friend. It can be seen that the out-of-distribution node detection can be applied to the social field; when the data is financial data, it can be determined whether the user corresponding to the financial data in the graph data is a dangerous user. A dangerous user refers to a user who is at risk of defrauding others' assets, that is, the out-of-distribution node detection can be applied to the financial field; the data is object data, it can be determined whether the object corresponding to the object data in the graph data is an obstacle, and the out-of-distribution node detection can be applied to the field of autonomous driving; the data is medical data, it can be determined whether the disease corresponding to the medical data in the graph data is an unknown disease, that is, the out-of-distribution node detection can be applied to the medical field. In addition, the out-of-distribution node detection can also be used in the field of bioinformatics, for example, predicting proteins and their interactions; the out-of-distribution node detection can also be used in the field of transportation networks, such as predicting cities and roads. It is understandable that the image data to be detected may be data consisting of financial data, social data, medical data, biological data, obstacle data or traffic data.

[0066] After obtaining the image data to be detected, the device obtains the attribute information and structure information of each node in the image data to be detected. The node is defined as a first node, the attribute information of the first node is defined as first attribute information, and the structure information of the first node is defined as first structure information.

[0067] The first attribute information includes but is not limited to the feature vector of the node, the category label of the node, and additional information, such as the degree of the node and the information of the node's neighbor nodes. The degree of the node refers to the number of neighbor nodes of the node. It should be noted that the first node may be an unknown node, so the first attribute information may not contain a category label. The feature vector may be a feature vector converted from the data corresponding to the node.

[0068] The first structural information indicates a connection relationship between the first nodes. For example, if two first nodes indicate two users who have a friend relationship, then there is a connection relationship between the two first nodes.

[0069] Step S202, input the first structural information and the first attribute information into the energy model to obtain the first energy value of each first node output by the energy model, and the energy model is trained based on the attribute information and structural information of the second node in the training graph data.

[0070] The device is provided with an energy model, which is trained based on the attribute information and structure information of the second node in the training graph data, and the trained energy model can calculate the energy value of the node. The energy value is used to indicate the probability that the corresponding node is an out-of-distribution node, and the larger the energy value, the greater the probability that the node corresponding to the energy value is an out-of-distribution node.

[0071] After obtaining the first attribute information and the first structure information of each first node, the device inputs the first attribute information and the first structure information of each node into the energy model. The energy model outputs the energy value corresponding to each first node, and the energy value is defined as the first energy value.

[0072] Step S203: determine the first node corresponding to the first energy value greater than the preset threshold as an out-of-distribution node.

[0073] The device is provided with an energy threshold, which is used as a preset threshold. After obtaining the first energy value of each first node, the device determines whether the first energy value is greater than the energy threshold. If the first energy value is greater than the preset threshold, the first node is determined as an out-of-distribution node.

[0074] Further, when the first energy value of the first node is less than or equal to a preset threshold, the first node is determined as an in-distribution node.

[0075] It should be noted that the energy model outputs the energy value of the first node as an unknown node. If the first attribute information of some first nodes in the graph data to be detected includes category information, then other first nodes without category information are unknown nodes. In addition, if the number corresponding to the nodes in the graph data to be detected is numerical data and the nodes do not have category information, then each first node is an unknown node, that is, the energy model outputs the first energy value of each first node.

[0076] In this embodiment, an energy model capable of calculating the energy value of a node is obtained by training the attribute information and structural information of the nodes in the training graph data, so that the energy model determines the energy value of each node based on the attribute information and structural information of each node in the graph data to be detected, thereby determining whether the node in the graph data to be detected is an out-of-distribution node through the energy value. That is, the detection of out-of-distribution nodes is applicable to graph data with and without category information, thereby improving the versatility of the out-of-distribution node detection method.

[0077] Reference Figure 3 , Figure 3 This is a flow chart of the second embodiment of the distributed node detection method of the present application. Based on the first embodiment, before step S202, it also includes:

[0078] Step S301, obtaining second attribute information and second structure information of each second node in the training graph data.

[0079] In this embodiment, the device can be used to train an energy model. Specifically, the device obtains training graph data, and each node of the training graph data is defined as a second node. The training graph data can be any type of graph data described above, and each second node in the training graph data includes an external distribution node and an internal distribution node. The device obtains second attribute information and second structure information of each second node in the training graph data. The parameters included in the second attribute information are the same as the parameters included in the first attribute information, and the parameters included in the second structure information are the same as the parameters included in the first structure information. Please refer to the above description for details, which will not be repeated here.

[0080] Step S302: construct multiple training samples according to the second attribute information and the second structure information of each second node.

[0081] In this embodiment, the second attribute information and the second structure information of the second node constitute a training sample, so a training sample corresponding to each second node can be obtained.

[0082] In addition, there may be multiple training graph data, and the attribute information and second structure information of each second node in the training graph data are constructed as training samples corresponding to the training graph data, so that the training samples corresponding to each training graph data can be obtained.

[0083] Step S303: training the preset model according to each training sample to obtain an energy model.

[0084] After obtaining each training sample, the device trains the preset model based on each training sample. When the network parameters of the preset model no longer converge, the training is completed. The preset model that has completed the training is the energy model. It should be noted that a graph neural network is set in the preset model. The graph neural network is a neural network suitable for processing graph structure data. It can aggregate the information of each node machine neighbor node through a multi-layer propagation mechanism, thereby learning the node representation, and the node energy value can be calculated through the representation.

[0085] In this embodiment, the device obtains the second attribute information and the second structure information of each second node in the training graph data, constructs multiple training samples through the second attribute information and the second structure information of the second nodes, and thus obtains an energy model based on the training of the multiple training samples.

[0086] Reference Figure 4 , Figure 4 This is a flow chart of the third embodiment of the distributed node detection method of the present application. Based on the second embodiment, step S302 includes:

[0087] Step S401, determining the third attribute information of the third node to be generated on the training graph data according to each piece of second attribute information, and determining the third structural information of the third node according to the third attribute information.

[0088] In this embodiment, each second node includes intra-distribution nodes but does not include extra-distribution nodes, or the number of extra-distribution nodes is small. Since the number of known extra-distribution nodes is small, when training the preset model, the prediction accuracy of the trained model will be low.

[0089] In this regard, the device generates easily confused nodes based on the existing second nodes, and the easily confused nodes can be regarded as out-of-distribution nodes. The number of easily confused nodes generated is set, and the number of easily confused nodes generated is sufficient for training the model, which is an empirical value.

[0090] The device determines the third attribute information of the third node to be generated on the training graph data through the second attribute information of the existing second node, and the third node is the easily confused node.

[0091] Specifically, the device determines the initialization attribute information of the third node based on each piece of second attribute information, and then iterates the initialization attribute information based on the set noise parameter to obtain the third attribute information of the third node.

[0092] In one example, the device determines whether the second node includes a fifth node based on each second attribute information, and the fifth node refers to a second node with a label of an out-of-distribution node, that is, the second node as an out-of-distribution node is the fifth node. When each second node includes a fifth node as an out-of-distribution node, the device determines the initialization attribute information of the third node based on the attribute information of each fifth node. For example, the attribute information of a fifth node is randomly used as the initialization attribute information of the third node.

[0093] In another example, when each second node does not include a fifth node as an out-of-distribution node, the device determines the initialization attribute information of the third node to be generated in the training graph data according to the second attribute information of each second node. Exemplarily, the device determines the third attribute information from each second attribute information in a uniform distribution manner, for example, numbers each second attribute information, randomly generates a number in a uniform distribution manner, and uses the second attribute information corresponding to the randomly generated number as the third attribute information.

[0094] After obtaining the initialization attribute information, the device can optimize the initialization information by the gradient direction of energy descent. Exemplarily, the initialization attribute information is expressed as: A noise term (set noise parameter) is introduced into the potential energy field, and the update iterative process of initializing the attribute information is:

[0095]

[0096] in, is the step size, ∈ is the Gaussian noise sampled from the multidimensional Gaussian distribution N(0,α), The attribute parameters are The specific calculation of the energy value is described below.

[0097] Further, after determining the third attribute information, the device determines the third structure information of the corresponding third node based on the third attribute information. In one example, a matrix U can be obtained based on each second structure information, and the matrix U represents the third attribute information. The product between is the representation of the third structural information, that is, the third structural information is represented as: U can be obtained by learning each second structural information through the model, that is, U is a learning matrix. In another exemplary embodiment, the Bernoulli probability can be used to perform structural sampling on the third node. For example, a Bernoulli test is performed on the third node and the second node of the third node in the training graph data to determine whether there is an edge. If the test result is 1, an edge is added between the third node and the second node; if the test result is 0, no edge is added. In this way, the third node can be generated in the training graph data to obtain the intermediate graph data, and then the structural information of the third node in the intermediate graph data can be identified to obtain the third structural information of the third node.

[0098] Step S402: determine a fourth node among the second nodes, where the fourth node is a second node that is a distributed internal node.

[0099] The third node is an easily confused node, and the device needs to train the model through the easily confused nodes and the existing distributed nodes. In this regard, the device determines the fourth node in each second node, and the fourth is the second node as the distributed node. For example, the category information contained in the second attribute information of the second node indicates that the second node is a distributed node, and the second node is used as the fourth node. For another example, if the data corresponding to each second node in the training graph data is numerical data, the distributed node can be determined as the fourth node by manual annotation.

[0100] Step S403, constructing training samples of nodes within the distribution according to the second attribute information and the second structure information of the fourth node, and constructing training samples of nodes outside the distribution according to the third attribute information and the third structure information of the third node.

[0101] After determining the fourth node, the device constructs training samples of nodes within the distribution based on the second attribute information and the second structure information of the fourth node, and then constructs training samples of nodes outside the distribution through the third attribute information and the third structure information of the third node.

[0102] In this embodiment, the device generates a third node equivalent to the out-of-distribution node based on the attribute information and structure information of the existing second node, thereby constructing enough positive and negative samples, and further training an energy model with higher prediction accuracy.

[0103] In one embodiment, the loss function of the preset model is updated based on the second energy value and the third energy value, and the second energy value is determined based on the third attribute information and the third structure information. Exemplarily, the loss function is:

[0104]

[0105] Among them, E θ (V i ) is the third energy value of the node (the fourth node) in the distribution, |V i ′ n | is the number of the fourth node, V i ′ n is a set containing all fourth nodes; E θ (V j ) is the second energy value of the third node, |V hal | is the number of the third node, V hal is a set containing all third nodes; L e is the loss function.

[0106] Reference Figure 5 , the amount of electricity represented in the battery in the figure represents the energy value, and the loss function L is set in this way e By comparing the divergence, the trained energy model can output the lowest possible energy value for the nodes within the distribution and the highest possible energy value for the easily confused nodes (third nodes), so that the energy model can predict the nodes outside the distribution more accurately. It can be understood that Figure 5 The nodes that increase energy are called external nodes, and the nodes that decrease energy are called internal nodes.

[0107] Furthermore, if there is a large gap between the energy values ​​output by the energy model, the model will be overfitted, so regularization is required, that is, the loss function is updated based on the second energy value after regularization and the third energy value after regularization. Specifically, the loss function obtained after regularization is:

[0108]

[0109] The final loss function of the preset model is L = L e +λL r, λ is the relative weight, which is a set value. It can be understood that the regularization of energy values ​​refers to squaring the energy values.

[0110] In addition, the second energy value is used as the third energy value as the target energy value, that is, the calculation process of the second energy value is the same as that of the third energy value. The specific process of determining the target energy value is as follows:

[0111] The device determines the connectivity parameters between the first target node and the target node through the first target structure information of the first target node and the second target structure information of the second target node. When the target energy value is the second energy value, the first target node refers to the third node; when the target energy value is the third energy value, the first target medium refers to the fourth node. The first target node and the second target node are adjacent nodes on the training graph data, and the connectivity parameter is used to indicate the probability of connection between the first target node and the second target node, that is, the connectivity parameter refers to the possibility that there is an edge between two adjacent connections. The connectivity parameters are specifically:

[0112]

[0113] Among them, cos refers to the similarity calculation between two feature vectors, Ux i is the feature vector of the structural information of the second target node, Ux i is a feature vector represented by the structural information of the first target node, and the first target node is the fourth node.

[0114] When the first target node is the third node, the connectivity parameter between the first target node and the second target node is:

[0115]

[0116] in, It is the feature vector representing the structural information of the third node.

[0117] The device firstly converts the target attribute information x of the first target node into i Convert to For example, through the linear layer conversion of the graph neural network, is the linear parameter of the first target node, W0 is the weight of the linear layer (the first network layer of the graph neural network), and b0 is the set value. The device then determines the representation parameters corresponding to each network layer of the first target node in the graph neural network through the linear parameters and connectivity parameters. The specific representation parameters are:

[0118]

[0119] Among them, γ (k) ∈Rf×f is a learnable parameter, d i is the degree of node i, d j is the degree of node j. k refers to the kth network layer in the graph neural network.

[0120] After obtaining the characterization parameters of the first target node at each network layer, the device can determine the target energy value corresponding to the first target node based on each characterization parameter. The target energy value is specifically:

[0121]

[0122] Among them, β k Refers to the weight of the k-layer network layer, W K ∈R 1×f , and W K are learnable parameters.

[0123] In this embodiment, the loss function of the preset model is updated based on the second energy value and the third energy value, thereby improving the prediction accuracy of the energy model.

[0124] Figure 6 A schematic diagram of the functional modules of the distributed external node detection device provided in an embodiment of the present application is shown.

[0125] Reference Figure 6 , the distributed external node detection device 600 includes:

[0126] An acquisition module 610 is used to acquire first attribute information and first structure information of each first node in the graph data to be detected;

[0127] An input module 620, configured to input the first structural information and the first attribute information into an energy model to obtain a first energy value of each first node output by the energy model, wherein the energy model is trained based on the attribute information and structural information of the second node in the training graph data;

[0128] The determination module 630 is used to determine the first node corresponding to the first energy value greater than a preset threshold as an out-of-distribution node.

[0129] In one embodiment, the distributed out-node detection device 600 is specifically used for:

[0130] Obtaining second attribute information and second structure information of each second node in the training graph data;

[0131] Constructing a plurality of training samples according to the second attribute information and the second structure information of each second node;

[0132] According to each training sample, the preset model is trained to obtain an energy model.

[0133] In another embodiment, the distributed out-node detection device 600 is specifically used for:

[0134] Determine third attribute information of a third node to be generated on the training graph data according to each piece of second attribute information, and determine third structural information of the third node according to the third attribute information;

[0135] Determine a fourth node among the second nodes, the fourth node being a second node that is a node within the distribution;

[0136] According to the second attribute information and the second structure information of the fourth node, a training sample of the node within the distribution is constructed, and according to the third attribute information and the third structure information of the third node, a training sample of the node outside the distribution is constructed.

[0137] In another embodiment, the loss function of the preset model is updated according to the second energy value and the third energy value; the second energy value is determined based on the third attribute information and the third structure information; the third energy value is determined based on the second attribute information and the second structure information.

[0138] In another embodiment, the loss function is updated based on the regularized second energy value and the regularized second energy value.

[0139] In another embodiment, the distributed out-node detection device 600 is specifically used for:

[0140] Determine a connectivity parameter between the first target node and the second target node according to the first target structure information of the first target node and the second target structure information of the second target node, wherein the connectivity parameter is used to indicate a probability of connection between the first target node and the second target node, and the first target node and the second target node are adjacent nodes on the training graph data;

[0141] Determine a linear parameter of the first target node according to the first target attribute information of the first target node;

[0142] According to the linear parameters and connectivity parameters, determine the representation parameters corresponding to each network layer of the first target node in the graph neural network;

[0143] The target energy value corresponding to the first target node is determined according to each characterization parameter.

[0144] In another embodiment, the distributed out-node detection device 600 is specifically used for:

[0145] Determine initialization attribute information of the third node according to each second attribute information;

[0146] Based on the set noise parameters, the initialized attribute information is iterated to obtain the third attribute information.

[0147] In another embodiment, the distributed out-node detection device 600 is specifically used for:

[0148] In response to the second nodes including a fifth node as a distributed out-node;

[0149] According to the attribute information of each fifth node, the initialization attribute information of the third node to be generated in the training graph data is determined.

[0150] In another embodiment, the distributed out-node detection device 600 is specifically used for:

[0151] In response to the fact that the second nodes do not include a fifth node that is a distributed out-node;

[0152] According to the second attribute information of each second node, the initialization attribute information of the third node to be generated in the training graph data is determined.

[0153] In another embodiment, the distributed out-node detection device 600 is specifically used for:

[0154] A first node corresponding to a first energy value that is less than or equal to a preset threshold is determined as an internal node of the distribution.

[0155] Reference Figure 7 , Figure 7 A schematic diagram of the hardware structure of a distributed external node detection device provided in an embodiment of the present application.

[0156] The distributed out-node detection device may include a processor 701 and a memory 702 storing computer program instructions.

[0157] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0158] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.

[0159] In certain embodiments, memory 702 includes a read-only memory (ROM). The ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of the above, where appropriate.

[0160] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.

[0161] The processor 701 implements any one of the distributed out-node detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .

[0162] In one example, the distributed node detection device may further include a communication interface 703 and a bus 310. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via the bus 310 and communicate with each other.

[0163] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0164] Bus 710 includes hardware, software or both, and the parts of the distributed outer node detection equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, bus 710 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0165] In addition, in combination with the distributed node detection method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the distributed node detection methods in the above embodiment is implemented.

[0166] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0167] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0168] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0169] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0170] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for detecting nodes outside a distribution, characterized in that: include: Acquire first attribute information and first structure information of each first node in the graph data to be detected; Inputting the first structural information and the first attribute information into an energy model to obtain a first energy value of each first node output by the energy model, wherein the energy model is trained based on the attribute information and structural information of the second node in the training graph data; A first node corresponding to the first energy value greater than a preset threshold is determined as an out-of-distribution node.

2. The method for detecting an out-of-distribution node according to claim 1, characterized in that: Before inputting the first structural information and the first attribute information into the energy model, the method further includes: Obtaining second attribute information and second structure information of each second node in the training graph data; Constructing a plurality of training samples according to the second attribute information and the second structure information of each of the second nodes; The preset model is trained according to each of the training samples to obtain the energy model.

3. The method for detecting an out-of-distribution node according to claim 2, characterized in that: The step of constructing a plurality of training samples according to the second attribute information and the second structure information of each second node includes: Determine third attribute information of a third node to be generated on the training graph data according to each of the second attribute information, and determine third structural information of the third node according to the third attribute information; Determine a fourth node among each of the second nodes, wherein the fourth node is the second node that is a node within the distribution; A training sample of nodes within the distribution is constructed according to the second attribute information and the second structure information of the fourth node, and a training sample of nodes outside the distribution is constructed according to the third attribute information and the third structure information of the third node.

4. The method for detecting an out-of-distribution node according to claim 3, characterized in that: The loss function of the preset model is updated according to the second energy value and the third energy value; the second energy value is determined based on the third attribute information and the third structure information; the third energy value is determined based on the second attribute information and the second structure information.

5. The method for detecting out-of-distribution nodes according to claim 4, characterized in that: The loss function is updated based on the regularized second energy value and the regularized second energy value.

6. The distributed node detection method according to claim 4, characterized in that: The second energy value or the third energy value is used as the target energy value, and the process of determining the target energy value is as follows: Determine, according to first target structure information of the first target node and second target structure information of the second target node, a connectivity parameter between the first target node and the second target node, wherein the connectivity parameter is used to indicate a probability of connection between the first target node and the second target node, and the first target node and the second target node are adjacent nodes on the training graph data; Determine a linear parameter of the first target node according to the first target attribute information of the first target node; Determine, according to the linear parameter and the connectivity parameter, a representation parameter corresponding to each network layer of the first target node in the graph neural network; A target energy value corresponding to the first target node is determined according to each of the characterization parameters.

7. The method for detecting out-of-distribution nodes according to claim 3, characterized in that: The step of determining the third attribute information of the third node to be generated on the training graph data according to each of the second attribute information includes: Determine the initialization attribute information of the third node according to each of the second attribute information; Based on the set noise parameter, the initialization attribute information is iterated to obtain the third attribute information.

8. The method for detecting out-of-distribution nodes according to claim 7, characterized in that: The determining the initialization attribute information of the third node according to each piece of the second attribute information includes: In response to each of the second nodes including a fifth node as a distributed out-node; According to the attribute information of each of the fifth nodes, the initialization attribute information of the third node to be generated in the training graph data is determined.

9. The method for detecting out-of-distribution nodes according to claim 7, characterized in that: The determining the initialization attribute information of the third node according to each piece of the second attribute information includes: In response to the fact that the second nodes do not include a fifth node that is an out-of-distribution node; According to the second attribute information of each of the second nodes, the initialization attribute information of the third node to be generated in the training graph data is determined.

10. The method for detecting an out-of-distribution node according to any one of claims 1 to 9, characterized in that: After the first structural information and the first attribute information are input into the energy model, the method further includes: A first node corresponding to the first energy value that is less than or equal to a preset threshold is determined as an in-distribution node.

11. A distributed external node detection device, characterized in that: include: An acquisition module, used to acquire first attribute information and first structure information of each first node in the graph data to be detected; An input module, used for inputting the first structural information and the first attribute information into an energy model to obtain a first energy value of each first node output by the energy model, wherein the energy model is trained based on the attribute information and structural information of the second node in the training graph data; The determination module is used to determine the first node corresponding to the first energy value greater than a preset threshold as an out-of-distribution node.

12. A distributed external node detection device, characterized in that: The distributed out-node detection device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.

14. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 10.