Graph-based network community discovery method, device, equipment, and storage medium
Through the graph-based network community discovery method, the neural network model is used to generate and train disturbance graphs, which solves the problem of difficulty in identifying dynamically changing network communities with existing technology and achieves more accurate network community identification.
Patent Information
- Application Number
- CN202011240466.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-09
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-11-09
AI Technical Summary
Existing network community classification methods are difficult to accurately identify dynamically changing network communities, especially in situations such as money laundering networks, and cannot effectively identify subtle changes.
A graph-based network community discovery method is adopted. By obtaining the initial neural network model and training data set, using the initial graph generation model and graph node classification model, the perturbation graph is generated and iteratively trained to determine the node category, thereby identifying the target network community.
It improves the accuracy and applicability of network community identification and can accurately identify different types of network communities in dynamically changing networks.
Smart Images

Figure CN112231592B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a graph-based network community discovery method, apparatus, device, and storage medium. Background Art
[0002] With the development of the Internet, people have found that community networks exist in many real networks, such as payment network communities, social network communities, etc. In recent years, people have divided network communities mainly based on the topological structure of the network, and also need the node's own attribute information.
[0003] Currently, the commonly used network community division methods are mainly divided into structure-based division methods and node-based division methods. However, since network communities often change dynamically, existing community division methods often cannot detect subtle changes in network communities and therefore cannot accurately identify the corresponding network communities. For example, for money laundering network communities in payment networks, gang members reduce transactions with internal members and conduct more transactions with normal users or merchants to change the structure of money laundering network communities, which makes existing network community division methods unable to identify money laundering network communities well.
[0004] Therefore, how to improve the accuracy of identifying online communities has become an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide a graph-based network community discovery method, apparatus, device, and storage medium, which can accurately discover network communities in a graph and have high applicability.
[0006] In a first aspect, an embodiment of the present application provides a graph-based network community discovery method, the method comprising:
[0007] Obtaining an initial neural network model and a training data set, wherein the initial neural network model includes an initial graph generation model and an initial graph node classification model that are cascaded in sequence, and the training data set includes each sample graph;
[0008] For each of the sample graphs, a perturbation parameter of the sample graph is obtained, and the sample graph and the perturbation parameter are input into the initial graph generation model to obtain a perturbation graph corresponding to the sample graph;
[0009] Based on each of the above perturbation graphs, the predicted category of each node in each of the above perturbation graphs is obtained through the above initial graph node classification model;
[0010] Based on the predicted category of each node in each of the perturbation graphs and the associated features corresponding to each of the sample graphs, a first training loss value is determined, wherein the first training loss value represents the difference between network communities corresponding to different categories;
[0011] The initial neural network model is iteratively trained according to the first training loss value and the training data set until the training end condition is met, so as to determine the category of each node in the to-be-processed graph based on the graph node classification model after the training is completed, and determine the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph.
[0012] In a second aspect, an embodiment of the present application provides a graph-based network community discovery method, the method comprising:
[0013] Get the graph to be processed;
[0014] Based on the above-mentioned graph to be processed, determining the category of each node in the above-mentioned graph to be processed through a graph node classification model, wherein the above-mentioned graph node classification model is trained based on the method provided in the first aspect of the embodiment of the present application;
[0015] Based on the categories of the nodes in the above-mentioned graph to be processed, a target network community in the above-mentioned graph to be processed is determined.
[0016] In a third aspect, an embodiment of the present application provides a network community discovery device based on a graph, the device comprising:
[0017] An acquisition module, used to acquire an initial neural network model and a training data set, wherein the initial neural network model includes an initial graph generation model and an initial graph node classification model cascaded in sequence, and the training data set includes each sample graph;
[0018] A graph generation module, for obtaining perturbation parameters of each sample graph, inputting the sample graph and the perturbation parameters into the initial graph generation model, and obtaining a perturbation graph corresponding to the sample graph;
[0019] A category determination module, used to obtain the predicted category of each node in each of the perturbation graphs based on the perturbation graphs and through the initial graph node classification model;
[0020] A loss determination module, configured to determine a first training loss value based on the predicted category of each node in each of the perturbation graphs and the associated features corresponding to each of the sample graphs, wherein the first training loss value represents the difference between network communities corresponding to different categories;
[0021] A training module is used to iteratively train the initial neural network model according to the first training loss value and the training data set until the training end condition is met, so as to determine the category of each node in the to-be-processed graph based on the graph node classification model after the training is completed, and determine the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph.
[0022] In a fourth aspect, an embodiment of the present application provides a network community discovery device based on a graph, the device comprising:
[0023] An acquisition module, used to acquire the graph to be processed;
[0024] A category determination module, used to determine the category of each node in the above-mentioned graph to be processed through a graph node classification model based on the above-mentioned graph to be processed, wherein the above-mentioned graph node classification model is trained based on the method provided in the first aspect of the embodiment of the present application;
[0025] The community determination module is used to determine the target network community in the above-mentioned graph to be processed based on the category of each node in the above-mentioned graph to be processed.
[0026] In a fifth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the processor and the memory are connected to each other;
[0027] The memory is used to store computer programs;
[0028] The processor is configured to execute the method provided by any optional implementation of the first aspect or the second aspect when calling the computer program.
[0029] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method provided by any possible implementation of the first aspect and / or the second aspect above.
[0030] In a seventh aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided by any possible implementation of the first aspect and / or the second aspect.
[0031] In an embodiment of the present application, a graph node classification module that can determine the category of a node can be obtained after the training is completed by training the initial graph generation model and the initial graph node classification model that are cascaded in sequence. Among them, the perturbation graph of each sample graph in the training data set can be obtained by the initial graph generation model, and then training based on the perturbation graph can improve the accuracy of determining the category of the node by the trained graph node classification model, thereby determining the category of each node in the to-be-processed graph based on the graph node classification model, and determining the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph, which has high applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 It is a flow chart of a graph-based network community discovery method provided by an embodiment of the present application;
[0034] Figure 2 is a schematic diagram of a scenario for determining a disturbance graph based on disturbance parameters provided in an embodiment of the present application;
[0035] Figure 3 It is a schematic diagram of a scenario of node category prediction provided by an embodiment of the present application;
[0036] Figure 4 This is a schematic diagram of a scenario for determining a training loss value provided by an embodiment of the present invention;
[0037] Figure 5 is another flow chart of the graph-based network community discovery method provided in an embodiment of the present application;
[0038] Figure 6 It is a structural schematic diagram of a network community discovery device based on a graph provided by an embodiment of the present application;
[0039] Figure 7 is another structural schematic diagram of a network community discovery device based on a graph provided by an embodiment of the present application;
[0040] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] The graph-based network community discovery method provided in the embodiment of the present application involves the fields of machine learning (ML) in artificial intelligence (AI) and computer vision (CV) technology. Among them, machine learning (ML) is a special study of how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Computer vision technology can use cameras and computers to replace human eyes to identify, track and measure targets, and further make maps for processing.
[0043] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. For example, the embodiment of this application can use computer vision technology to identify nodes in the graph, and then based on neural networks, through machine learning, the machine has the ability to discover network communities in the graph.
[0044] The graph-based network community discovery method provided in the embodiment of the present application also involves cloud computing (cloud computing) in cloud technology, artificial intelligence cloud services and other fields. In the embodiment of the present application, the computing tasks involved in the graph-based network community discovery method are distributed on a resource pool composed of a large number of computers through cloud computing to improve the efficiency of graph processing. In addition, the graph-based network community discovery method can also be used as an artificial intelligence service, and the corresponding graph-based network community discovery artificial intelligence cloud service is provided through the artificial intelligence platform.
[0045] The graph-based network community discovery method provided in the embodiment of the present application (hereinafter referred to as the method provided in the embodiment of the present application for convenience of description) can be executed by any terminal device or server. When the method provided in the embodiment of the present application is executed by a server, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. When the method provided in the embodiment of the present application is executed by a terminal device, the terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this.
[0046] See also Figure 1 , Figure 1Schematic diagram of a process of a graph-based network community discovery method provided by an embodiment of the present application. Figure 1 As shown, the graph-based network community discovery method provided in the embodiment of the present application may include the following steps:
[0047] Step S11, obtaining an initial neural network model and a training data set.
[0048] In some feasible implementations, the training data set in the embodiments of the present application can be obtained from existing data in a database or cloud storage, or training data for model training can be obtained based on big data technology. The specific method can be determined based on the actual application scenario requirements and is not limited here.
[0049] The training data set includes at least one sample graph, wherein any sample graph may include one or more network communities, such as social networks, information dissemination networks, payment networks, etc. Any sample graph may include different types of sub-network communities in the same type of network community, such as money laundering networks and normal payment networks in payment networks, etc. The specifics may be determined based on the actual application scenario requirements and are not limited here.
[0050] Among them, a network community in any sample graph can represent objects within a certain range and the relationship between them. The objects in the network community are called nodes, and the relationship between objects is described by edges. When in the sample graph, objects within a certain range and the relationship between objects can be determined, and then each object is used as a node, and the relationship between objects is mapped to the edge between objects, so as to form a sample graph based on each node and the edge between nodes.
[0051] In some feasible implementations, the initial neural network includes an initial graph generation module and an initial graph node classification model that are cascaded in sequence, wherein the initial graph generation module is used to determine the perturbation graph corresponding to each sample graph, and the initial graph node classification model is used to determine the category of each node in each perturbation graph.
[0052] Step S12: for each sample graph, obtain the perturbation parameters of the sample graph, input the sample graph and the perturbation parameters into the initial graph generation model, and obtain the perturbation graph corresponding to the sample graph.
[0053] In some feasible implementations, the initial graph generation model may be a model based on a variational autoencoder. Specifically, for each sample graph, the sample graph is encoded by the encoder of the initial graph generation model, i.e., the encoder of the variational autoencoder, to obtain the predicted probability distribution of the hidden layer features of the sample graph. in, is the model parameter of the encoder (encoder of the variational autoencoder) of the initial graph generation model, Z is the hidden layer feature corresponding to the sample graph, and G represents the sample graph. Among them, G=(A,X), A is the association feature corresponding to the sample graph, and the association feature is used to represent the edge relationship between the nodes in the sample graph, that is, the association relationship between the nodes in the sample graph, and X is the initial node feature corresponding to the sample graph.
[0054] Furthermore, based on the predicted probability distribution and perturbation parameters corresponding to the hidden features corresponding to the sample graph, the perturbation graph corresponding to the sample graph can be obtained through the decoder of the initial graph generation model, that is, the decoder of the variational autoencoder. Specifically, based on the predicted probability distribution of the hidden features corresponding to the sample graph, the hidden features corresponding to the sample can be determined. That is, the hidden features corresponding to the sample graph are obtained after encoding and sampling the sample graph based on the initial graph generation model. Among them, the predicted probability distribution of the hidden features corresponding to the sample graph obeys a Gaussian distribution.
[0055] Based on the hidden layer features corresponding to the sample graph, the hidden layer features corresponding to the sample graph can be decoded by the decoder of the initial graph generation model, that is, the decoder of the variational autoencoder, to obtain the predicted probability distribution of the perturbation graph generated based on the hidden layer features. Among them, the predicted probability distribution It can be used to represent the distribution of hidden features obtained after sampling the sample graph, and the predicted probability distribution of the new graph (perturbation graph) obtained after decoding. Among them, θ is the model parameter of the decoder of the initial graph generation model (decoder of the variational autoencoder), is the perturbation graph corresponding to the sample graph, and G represents the sample graph.
[0056] Furthermore, based on the hidden layer feature Z corresponding to the sample image, the predicted probability distribution of the perturbation image is generated based on the hidden layer feature And the predicted probability distribution of the hidden features of the sample graph The predicted probability distribution of the perturbation graph generated based on the sample graph can be determined Then, the predicted probability distribution of the perturbation graph is generated based on the sample graph. Determine the graph that may be generated based on the sample graph.
[0057] The corresponding graph with a higher prediction probability can be determined as the perturbation graph corresponding to the sample graph. The determined graph is used as a candidate perturbation graph, and the candidate perturbation graph is updated based on the perturbation parameter. The perturbation parameter is used to indicate the number of associated features between nodes in the candidate perturbation graph to be increased or decreased. That is, based on the perturbation parameter, edges with the same value as the perturbation parameter in the candidate perturbation graph can be increased and / or decreased to adjust the candidate perturbation graph, and the adjusted candidate perturbation graph is determined as the final perturbation graph corresponding to the sample graph.
[0058] Among them, by adjusting the candidate perturbation graph based on the perturbation parameters, the difference of the associated features (edges) between the nodes can be further improved without changing the nodes of the candidate perturbation graph, so as to achieve better training effect. At the same time, for nodes belonging to different network communities in the perturbation candidate graph (the categories of nodes in each network community are the same), adjusting the candidate perturbation graph by the perturbation parameters can change the structure of each network community, so that the graph node classification model trained based on the adjusted candidate perturbation graph can accurately predict the predicted category of each node in the graph when the graph contains different network communities.
[0059] like Figure 2 As shown, Figure 2 It is a schematic diagram of a scenario for determining a disturbance graph based on disturbance parameters provided in an embodiment of the present application. Figure 2 The candidate perturbation graph provided includes two network communities, such as the gray part is the money laundering network community, and the uncolored part is the normal payment network community. By deleting an edge of the normal payment network community in the candidate perturbation graph through the perturbation parameter, a new normal payment network community and a new money laundering network community are constructed.
[0060] It should be noted that, in the embodiment of the present application, for each sample graph, the number of nodes in the perturbation graph corresponding to the sample graph obtained based on the initial graph generation module is consistent with the number of nodes in the sample graph. In other words, the nodes in the perturbation graph corresponding to each sample graph correspond one-to-one to the nodes in the sample graph.
[0061] Step S13: Based on each disturbance graph, the predicted category of each node in each disturbance graph is obtained through the initial graph node classification model.
[0062] In some feasible implementations, the predicted category of each node in the perturbation graph corresponding to each sample graph can be obtained through the initial graph node classification model. Specifically, for each perturbation graph, the encoding features of each node in the perturbation graph can be obtained through the encoder of the initial graph node classification model. That is, the initial node features and associated features of the perturbation graph are determined, and the initial node features and associated features of the perturbation graph are input into the initial graph node classification model, and then the encoding features of each node in the perturbation graph are obtained based on the encoder of the initial graph node classification model. In other words, through the encoder of the initial graph node classification model, a new feature representation of each node in the sample graph can be obtained based on the initial node features and associated features of the perturbation graph.
[0063] Among them, the encoder of the above-mentioned initial graph node classification model can be based on a graph neural network, such as a graph convolutional neural network, and there is no limitation here.
[0064] Furthermore, the encoded features of each node in the perturbation graph are processed by the decoder of the initial graph node classification model to obtain the decoded features of each node in the perturbation graph. Specifically, the decoded features of each node in the perturbation graph can be fused through the fully connected layer, and the probability of each node in the perturbation graph belonging to each category can be obtained through the Softmax function. For each node, the category corresponding to the highest probability among the corresponding probabilities belonging to each node is determined as the predicted category of the node.
[0065] Based on this, the predicted category of each node in each perturbation graph can be obtained through the initial graph node classification model.
[0066] like Figure 3 As shown, Figure 3 Schematic diagram of a scenario for node category prediction provided by an embodiment of the present application. Figure 3 In the above example, it is assumed that the correlation features corresponding to the perturbation graph can be obtained by using the matrix A∈R N×N Represents that the associated feature is an N×N matrix, where N is the number of nodes in the sample graph. N×N Each element in represents the relationship between a node and another node, such as whether the nodes are connected by an edge. 12 Represents the association relationship between the nodes corresponding to the first row and the nodes corresponding to the second column. Assume that the initial node features corresponding to the perturbation graph can be obtained by matrix X∈R N×d Indicates that each row of the initial node feature X represents the initial node features of each node, and each column represents the initial features of each node in a feature dimension, where the number of feature dimensions of each node in the initial node feature X is d.
[0067] Furthermore, based on the association feature A∈R of the perturbation graph N×N And the initial node feature X∈R N×d, through the graph neural network, such as the convolutional network, each node in the perturbation graph is encoded to obtain the encoding features of each node in the perturbation graph. Then, through the fully connected layer and Softmax, the decoding features of each node in the perturbation graph are obtained. Among them, the decoding features of each node in the perturbation graph can be obtained through the matrix C∈R N×K Indicates that K is the number of categories of the node. Each row in the decoding feature C represents the predicted category of a node in the perturbation graph, that is, the probability that the category of the node is each category, and each column represents the probability that the category of each node is a certain category. For each node in the perturbation graph, the category corresponding to the highest probability among the probabilities of the node corresponding to each category can be determined as the predicted category of the node.
[0068] Optionally, the encoding features of each node in the perturbation graph can be obtained through the encoder of the initial graph node classification model, and the predicted category of each node in the perturbation graph can be further determined based on the encoding features of each node and other clustering methods, such as K-means. The above clustering method is only an example and can be determined based on the actual application scenario requirements, and is not limited here.
[0069] The classification method used by the initial graph node classification model in the iterative training process remains consistent. In addition, since the nodes in the perturbation graph corresponding to each sample graph correspond one-to-one to the nodes in the sample graph, the predicted category of each node in the perturbation graph corresponding to the sample graph can be regarded as the predicted category of the corresponding node in the sample graph.
[0070] Step S14: Based on the predicted category of each node in each perturbation graph and the associated features corresponding to each sample graph, the connection weights between each network community in each sample graph are determined, and the first training loss value is determined based on the connection weights.
[0071] In some feasible implementations, for each sample graph, the association feature corresponding to the sample graph may represent the edge between the nodes in the sample graph, that is, the association relationship between the nodes. The association feature corresponding to the sample graph may be represented by a matrix B, and each element in the association feature B corresponding to the sample graph represents the association relationship between one node and another node in the sample graph, that is, whether the node is connected to another node through an edge. For example, for a node in a payment network community, the node is connected to another node through an edge, indicating that there is a relationship such as transfer and payment between the two nodes.
[0072] Furthermore, based on the association features of the sample graph and the predicted categories of each node in each perturbation graph of the sample graph, the connection weights between the network communities corresponding to each category in the sample graph under the effect of the predicted categories of each node in the sample graph can be determined, that is, the weights corresponding to the association relationships (edges) between the network communities corresponding to each category and Tr(C TAC). For any network community corresponding to different categories, the smaller the weight sum is, the smaller the correlation between the two is, which means that the category prediction of the initial graph node classification model is more accurate. Therefore, the weight sum corresponding to each sample can be used as the first training loss value.
[0073] Among them, each element in the matrix C represents the probability that the category of a node in the perturbation graph is a certain category.
[0074] Optionally, to further reduce the above weight and Tr(C T AC), in order to more accurately measure the stability of the model during the model training process based on the first training loss, the number of categories corresponding to each node in the sample graph can be determined based on the predicted category of each node in the perturbation graph corresponding to each sample graph, that is, the number of network communities in the sample graph. Then, the above weights and Tr(C T AC) is further processed to obtain and will As the first training loss value in the model training process, K represents the number of categories and Tr represents the trace of the calculation matrix.
[0075] Optionally, the number of edges corresponding to each node in the sample graph may be determined based on the associated features corresponding to the sample graph, and then the weight and Tr(C T AC) is normalized. That is, the weights corresponding to the association relationships (edges) between the network communities corresponding to each category are normalized to obtain the normalized weights and Then, based on the number of categories K in the sample graph, the final first training loss value is obtained
[0076] For each sample graph, the number of edges corresponding to each node in the sample graph can be represented by matrix D, that is, the degree matrix corresponding to the sample graph. The degree matrix D is a diagonal matrix, and each element in the diagonal matrix represents the number of edges corresponding to a node. Represents the division of corresponding elements of two matrices. T DC represents the number of edges corresponding to each node in the sample graph based on the predicted categories of each node in the sample graph.
[0077] Step S15, iteratively train the initial neural network model according to the first training loss value and the training data set until the training end condition is met, so as to determine the category of each node in the to-be-processed graph based on the graph node classification model after the training is completed, and determine the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph.
[0078] In some feasible implementations, the first training loss value can be used as the total training loss value corresponding to the model training process, and the initial neural network model can be iteratively trained according to the total training loss value and the training data set. When the total training loss value meets the training end condition, the training can be stopped to obtain a trained graph node classification model. The above training end condition can be that the above training total loss value reaches a convergence state, or that the above training total loss value is lower than a preset threshold, etc., which can be determined based on the actual application scenario requirements and is not limited here.
[0079] Furthermore, based on the trained graph node classification module, the category of each node in the graph to be processed can be determined, and based on the category of each node in the graph to be processed, the target network community in the graph to be processed can be determined.
[0080] In some feasible implementations, in order to further ensure that the trained graph node classification model can stabilize the categories of each node in the graph to be processed, the total training loss value can be determined based on the first training loss value and other training loss values in the training process, and then the initial neural network model can be iteratively trained based on the total training loss value and the training data set.
[0081] The other training loss values include at least one of a second training loss value, a third training loss value, a fourth training loss value and a fifth training loss value.
[0082] Specifically, for the second training loss value, the prior probability distribution corresponding to each sample graph can be obtained in the process of determining the perturbation graph corresponding to the sample graph based on the initial graph generation model. For each sample graph, the prior probability distribution p(Z) corresponding to the sample graph represents the true probability distribution of the hidden layer features of the sample graph. If the prior probability distribution follows a normal distribution, we can further determine the prior probability distribution p(Z) corresponding to the sample graph and the predicted probability distribution of the hidden layer features of the sample graph: KL divergence And the prior probability distribution p(Z) and the predicted probability distribution KL divergence Determined as the second training loss value in the training process of the graph node classification model, that is, the second training loss value represents the prior probability distribution p(Z) and the predicted probability distribution The difference between.
[0083] Among them, the prior probability distribution p(Z) and the predicted probability distribution KL divergence The larger the value, the larger the predicted probability distribution of the hidden layer features corresponding to the sample graph. The closer it is to the prior probability distribution p(Z) corresponding to the sample graph. In other words, the prior probability distribution p(Z) and the predicted probability distribution KL divergence The larger it is, the closer the perturbation graph obtained based on the initial graph generation model is to the sample graph, the more stable the initial graph generation model is, and thus the output of the initial graph node classification model is more stable.
[0084] As an optional embodiment, when the neural network model is iteratively trained based on the first training loss value and the training data set, the total training loss value can be determined based on the first training loss value and the second training loss value, and then when the total training loss value meets the training end condition, the graph node classification model after the training is obtained.
[0085] Specifically, for the third training loss value, after determining the perturbation graph corresponding to each sample graph based on the initial graph generation model, the third training loss value can be determined based on each sample graph and the perturbation graph corresponding to each sample graph, and the third training loss value represents the difference between the sample graph and the corresponding perturbation graph. The difference (such as similarity) between the graph features of each sample graph and the graph features of the corresponding perturbation graph can be determined as the third training loss value.
[0086] As an optional embodiment, when the neural network model is iteratively trained based on the first training loss value and the training data set, the total training loss value can be determined based on the first training loss value, the second training loss value and the third training loss value, or the total training loss value can be determined based on the first training loss value and the third training loss value, and then when the total training loss value meets the training end condition, the graph node classification model after the training is obtained.
[0087] Specifically, for the fourth training loss value, the fourth training loss value can be determined by the coding features corresponding to each node in each perturbation graph obtained in the process of determining the predicted category of each node in the perturbation graph based on the initial graph node classification model (hereinafter referred to as the first coding feature for convenience of description), and the coding features corresponding to each node in the corresponding sample graph (hereinafter referred to as the second coding feature for convenience of description). For each sample graph, the second coding features of each node in the sample graph can be obtained based on the sample graph through the encoder of the initial graph node classification model.
[0088] Combination Figure 4 , Figure 4 This is a schematic diagram of a scenario for determining a training loss value provided by an embodiment of the present invention. Figure 4 As shown, for each sample graph, according to the second encoding features of each node in the sample graph, the second encoding features ENC(v i |G), according to the first coding feature of each node in the corresponding perturbation graph, the first coding feature of each node in the perturbation graph corresponding to the perturbation graph can be determined Among them, v irepresents the node i in the perturbation graph, represents the perturbation graph, and G is the corresponding sample graph. The second encoding feature ENC(v i |G) and the first encoding feature KL divergence And the KL divergence and corresponding to each node in the sample graph and the perturbation graph It is determined as the fourth training loss value in the training process of the graph node classification model, that is, the fourth training loss value represents the difference between each node in the sample graph and the corresponding perturbation graph.
[0089] Among them, the KL divergence and The larger it is, the smaller the difference between the nodes in the sample graph and the corresponding perturbation graph is, the closer the perturbation graph obtained based on the initial graph generation model is to the sample graph, the more stable the initial graph generation model is, and thus the output of the initial graph node classification model is more stable.
[0090] As an optional embodiment, when the neural network model is iteratively trained based on the first training loss value and the training data set, the total training loss value can be determined based on the first training loss value, the second training loss value, the third training loss value and the fourth training loss value, and then when the total training loss value meets the training end condition, the graph node classification model after the training is obtained.
[0091] Specifically, for the fifth training loss value, the encoding features corresponding to each node in each perturbation graph obtained in the process of determining the predicted category of each node in the perturbation graph based on the initial graph node classification model (hereinafter referred to as the third encoding features for convenience of description) can be further obtained through the decoder of the initial graph node model to obtain the decoding features of each node in each perturbation graph. For each perturbation graph, the probability of each node in the perturbation graph belonging to each category can be determined based on the decoding features of the perturbation graph, and then the predicted category of each node in the perturbation graph can be determined.
[0092] Furthermore, based on the predicted categories of each node in the perturbation graph, the target node whose category is the target category is determined, so as to determine the correlation of the decoding features of each target node based on the probability that each target node belongs to each category. The correlation can be expressed by the matrix C + Indicates that the correlation C + Each column in represents the probability that each target node is a certain category, and each row represents the probability that a target node is a category. The above target categories can also be specifically determined based on the actual application scenario requirements and are not limited here.
[0093] Since all target nodes belong to the same prediction category, the accuracy of the prediction category of each node in the perturbation graph based on the graph node classification model can be determined by the similarity between the category probability distributions corresponding to each target node (the category of the node is the probability of each category). Based on this, the KL divergence KL (C i,: ||C j,: ) to represent the similarity between the two, KL(C i,: ||C j,: ) is larger, the higher the similarity between the two. i,: represents the probability that the target node i is classified into each category, C j,: Represents the probability that the target node j is classified into each category, where j, i∈C + .
[0094] Furthermore, all KL(C i,: ||C j,: ) is taken as the fifth training loss value. Or, since KL(C i,: ||C j,: ) is larger, the higher the similarity is. Therefore, the KL divergence KL(C i,: ||C j,: ) in the minimum KL divergence as the fifth training loss value.
[0095] As an optional embodiment, when the neural network model is iteratively trained based on the first training loss value and the training data set, the total training loss value can be determined based on the first training loss value, the second training loss value, the third training loss value, the fourth training loss value and the fifth training loss value, and then when the total training loss value meets the training end condition, the graph node classification model after the training is obtained.
[0096] Furthermore, based on the trained graph node classification module, the category of each node in the to-be-processed graph can be determined, and the target network community in the to-be-processed graph can be determined based on the category of each node in the to-be-processed graph. The specific implementation method of determining the target network community in the to-be-processed graph based on the graph node classification module can be found in Figure 5 . Figure 5 5 is another flow chart of the method for discovering network communities based on a graph provided by an embodiment of the present application. As shown in FIG5 , the method for discovering network communities based on a graph provided by an embodiment of the present application may include the following steps:
[0097] Step S21, obtaining the graph to be processed.
[0098] In some feasible implementations, the method for obtaining the graph to be processed can be found in Figure 1 The implementation method shown in step S11 is not limited here.
[0099] Step S22: Based on the graph to be processed, determine the category of each node in the graph to be processed through a graph node classification model.
[0100] In some feasible implementations, before determining the category of each node in the to-be-processed graph through the graph node classification model, the initial node features of each node in the to-be-processed graph may be determined first. At the same time, based on the graph structure of the to-be-processed graph, the association features between the nodes in the to-be-processed graph may be determined, which may also be referred to as the association features corresponding to the to-be-processed graph.
[0101] Among them, each element in the association feature corresponding to the graph to be processed represents the association relationship between one node and another node in the graph to be processed, that is, whether the node is connected to another node through an edge. For example, for a node in a payment network community, the node is connected to another node through an edge, indicating that there is a transfer, payment and other relationship between the two nodes. Among them, the specific association relationship between the nodes in the graph to be processed can be determined based on the specific graph structure of the graph to be processed and the actual network community to which it corresponds, such as the above-mentioned payment relationship, or information dissemination relationship, etc., which is not limited here.
[0102] Furthermore, the associated features corresponding to the graph to be processed and the initial node features of each node in the graph to be processed are used as the model input of the graph node classification model, and the encoded features of each node in the graph to be processed are obtained through the encoder of the graph node classification model. In other words, through the encoder of the graph node classification model, a new feature representation of each node in the graph to be processed can be obtained based on the initial node features of each node in the graph to be processed and the corresponding associated features.
[0103] Among them, the encoder of the above-mentioned graph node classification model can be based on a graph neural network, such as a graph convolutional neural network, and there is no limitation here.
[0104] Furthermore, the decoder of the graph node classification model processes the encoded features of each node in the processed graph to obtain the decoded features of each node in the processed graph. Specifically, the decoded features of each node in the processed graph can be fused through the fully connected layer, and the probability of each node in the processed graph belonging to each category can be obtained through the Softmax function. For each node, the category corresponding to the highest probability among the corresponding probabilities of belonging to each node is determined as the category of the node.
[0105] Step S23: Determine the target network community in the graph to be processed based on the category of each node in the graph to be processed.
[0106] In some feasible implementations, based on the categories of each node in the graph to be processed, at least one network community contained in the graph to be processed can be determined. Each network community corresponds to a node category, that is, the graph structure corresponding to the nodes of the same category corresponds to a network community. Therefore, based on the category of the node to be processed, the graph structure corresponding to each node of the target category in the graph to be processed can be determined, and the graph structure is determined as the target network community in the graph to be processed.
[0107] Among them, the target category can be determined by the categories of each node in the processing graph and the actual application scenario requirements, and is not limited here.
[0108] For example, for a payment network, the graph to be processed can represent a complete payment network. Based on the method of step S21 and step S22, the category of each node in the graph to be processed can be determined as normal or abnormal. Among them, normal means that the payment behavior in which the node participates is normal behavior, and abnormal means that the payment behavior in which the node participates is abnormal behavior, such as money laundering behavior. If it is necessary to determine the money laundering network community in the graph to be processed to strengthen fund control, the abnormality can be used as the target category, and the graph structure corresponding to each node corresponding to the target category, that is, the network composed of each node corresponding to the target category and the connection relationship between each node is determined as the money laundering network community (target network community).
[0109] For another example, for a social network, the graph to be processed can represent a complete social network. Based on the method of step S21 and step S22, the categories of each node in the graph to be processed can be determined as a category indicating that the node is a rumor-spreading node, and a category indicating that the node is a rumor-free node. In the case of needing to control public opinion and refute information rumors, the graph structure corresponding to the rumor-spreading node can be determined as the target network community in the graph to be processed.
[0110] Optionally, based on the categories of each node in the graph to be processed, the graph structure corresponding to the nodes belonging to the same category in the graph to be processed can be determined, and then the network communities corresponding to each graph structure can be determined to complete the classification of the network communities, and different network community processing methods can be adopted for the network communities corresponding to each category.
[0111] For example, if the graph to be processed represents a type of network community, such as a money laundering network community, when the granularity of the categories of each node in the graph to be processed determined based on the graph node classification model is finer, if it is determined that the categories of each node in the graph to be processed can be used to represent the severity of the money laundering behavior of each node, then the money laundering network community can be further divided into network communities based on the categories of each node in the graph to be processed, so as to take different financial risk control measures based on the different divided network communities.
[0112] In an embodiment of the present application, a graph node classification module that can determine the category of a node can be obtained after the training is completed by training the initial graph generation model and the initial graph node classification model that are cascaded in sequence. Among them, the perturbation graph of each sample graph in the training data set can be obtained by the initial graph generation model, and then training based on the perturbation graph can improve the accuracy of determining the category of the node by the trained graph node classification model, thereby determining the category of each node in the to-be-processed graph based on the graph node classification model, and determining the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph, which has high applicability.
[0113] See also Figure 6 , Figure 6 1 is a schematic diagram of a structure of a network community discovery device based on a graph provided by an embodiment of the present application. The device 1 provided by an embodiment of the present application includes:
[0114] An acquisition module 11 is used to acquire an initial neural network model and a training data set, wherein the initial neural network model includes an initial graph generation model and an initial graph node classification model that are cascaded in sequence, and the training data set includes each sample graph;
[0115] A graph generation module 12 is used to obtain perturbation parameters of each sample graph, input the sample graph and the perturbation parameters into the initial graph generation model, and obtain a perturbation graph corresponding to the sample graph;
[0116] A category determination module 13, used to obtain the predicted category of each node in each of the above perturbation graphs based on the above perturbation graphs and through the above initial graph node classification model;
[0117] A loss determination module 14 is used to determine a first training loss value based on the predicted category of each node in each of the perturbation graphs and the associated features corresponding to each of the sample graphs, wherein the first training loss value represents the difference between network communities corresponding to different categories;
[0118] The training module 15 is used to iteratively train the above-mentioned initial neural network model according to the above-mentioned first training loss value and the above-mentioned training data set until the training end condition is met, so as to determine the category of each node in the to-be-processed graph based on the graph node classification model after the training is completed, and determine the target network community in the above-mentioned to-be-processed graph based on the category of each node in the above-mentioned to-be-processed graph.
[0119] In some feasible implementations, the loss determination module 14 is used to:
[0120] For each sample graph, based on the associated features corresponding to the sample graph, determine the number of edges corresponding to each node in the sample graph;
[0121] Determine the number of categories corresponding to each node in the sample graph based on the predicted category of each node in the perturbation graph corresponding to the sample graph;
[0122] A first training loss value is determined based on the associated features corresponding to each of the above sample graphs, the number of categories corresponding to each of the above sample graphs, and the number of edges corresponding to each node in each of the above sample graphs.
[0123] In some feasible implementations, the graph generation module 12 is used to:
[0124] For each of the sample images, based on the sample image, the predicted probability distribution of the hidden layer features of the sample image is obtained by using the encoder of the initial image generation model;
[0125] Based on the predicted probability distribution of the hidden layer features and the perturbation parameters, a perturbation graph is obtained by generating a decoder of the model through the initial graph;
[0126] The above-mentioned loss determination module 14 is also used for:
[0127] For each sample graph, obtain the prior probability distribution corresponding to the sample graph;
[0128] Determine a second training loss value based on the predicted probability distribution and the prior probability distribution corresponding to each of the above sample graphs;
[0129] The training module 15 is used to:
[0130] The initial neural network model is iteratively trained according to the first training loss value, the second training loss value and the training data set.
[0131] In some feasible implementations, the above-mentioned loss determination module 14 is further used to:
[0132] Determine a third training loss value based on each sample graph and a perturbation graph corresponding to each sample graph;
[0133] The training module 15 is used to:
[0134] The initial neural network model is iteratively trained according to the first training loss value, the third training loss value and the training data set.
[0135] In some feasible implementations, the category determination module 13 is used to:
[0136] For each perturbation graph, obtain the first encoding feature corresponding to each node in the perturbation graph through the encoder of the initial graph node classification model;
[0137] Based on the first encoded features of each node in the perturbation graph, a predicted category of each node in the perturbation graph is obtained through a decoder of the initial graph node classification model;
[0138] The above-mentioned loss determination module 14 is also used for:
[0139] For each sample graph, based on the sample graph, the encoder of the initial graph node classification model is used to obtain the second encoding feature of each node in the sample graph;
[0140] Calculate a fourth training loss value based on the first coding feature and the second coding feature corresponding to each node in each of the sample graphs;
[0141] The training module 15 is used to:
[0142] The initial neural network model is iteratively trained according to the first training loss value, the fourth training loss value and the training data set.
[0143] In some possible implementations,
[0144] The category determination module 13 is used to:
[0145] For each perturbation graph, the third encoding feature of each node in the perturbation graph is obtained through the encoder of the initial graph node classification model;
[0146] Based on the third encoded features of each node in the perturbation graph, a decoded feature of each node in the perturbation graph is obtained through a decoder of the initial graph node classification model;
[0147] Based on the decoding features of each node in the perturbation graph, a predicted category of each node in the perturbation graph is obtained;
[0148] The above-mentioned loss determination module 14 is also used for:
[0149] For each sample graph, determining the correlation of the decoding features of each node in the perturbation graph corresponding to the sample graph whose predicted category is the target category;
[0150] Determine a fifth training loss value based on the correlations corresponding to the sample graphs;
[0151] The training module 15 is used to:
[0152] The initial neural network model is iteratively trained according to the first training loss value, the fifth training loss value and the training data set.
[0153] In some feasible implementations, the graph generation module 12 is used to:
[0154] Determine the hidden layer features corresponding to the sample image based on the predicted probability distribution of the hidden layer features;
[0155] Based on the above hidden layer features, the decoder of the above initial graph generation model performs the following operations:
[0156] Determine a predicted probability distribution of a perturbation map generated based on the hidden layer features;
[0157] Determining a predicted probability distribution of a perturbation map generated based on the sample map based on the predicted probability of the hidden layer features, the hidden layer features, and the predicted probability distribution of the perturbation map generated based on the hidden layer features;
[0158] Based on the disturbance parameters and the predicted probability distribution of generating the disturbance map based on the sample map, a disturbance map corresponding to the sample map is generated.
[0159] In some feasible implementations, the graph generation module 12 is used to:
[0160] Determine a candidate perturbation graph corresponding to the sample graph according to a predicted probability distribution of a perturbation graph generated based on the sample graph;
[0161] Based on the perturbation parameters, the associated features corresponding to the candidate perturbation graph are adjusted;
[0162] The adjusted candidate perturbation graph is determined as the perturbation graph corresponding to the sample graph.
[0163] In a specific implementation, the above-mentioned device 1 can execute the above-mentioned functions through its built-in functional modules. Figure 1 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0164] See also Figure 7 , Figure 7 2 is another structural diagram of a network community discovery device based on a graph provided by an embodiment of the present application. The device 2 provided by an embodiment of the present application includes:
[0165] An acquisition module 21 is used to acquire a graph to be processed;
[0166] A category determination module 22, used to determine the category of each node in the above-mentioned graph to be processed through a graph node classification model based on the above-mentioned graph to be processed, wherein the above-mentioned graph node classification model is obtained by training the above-mentioned device 1;
[0167] The community determination module 23 is used to determine the target network community in the above-mentioned graph to be processed based on the category of each node in the above-mentioned graph to be processed.
[0168] In some feasible implementations, the category determination module 22 is used to:
[0169] Based on the graph to be processed, obtaining initial node features of each node in the graph to be processed and association features between the nodes;
[0170] The initial node features of each of the above nodes and the associated features between the above nodes are input into the above graph node classification model to obtain the category of each node in the above graph to be processed.
[0171] In some feasible implementations, the community determination module 23 is used to:
[0172] Determine the graph structure corresponding to each node of the target category in the above-mentioned graph to be processed;
[0173] The above graph structure is determined as the target network community in the above graph to be processed.
[0174] In a specific implementation, the device 2 can execute the above-mentioned functions through its built-in functional modules. Figure 5 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0175] See also Figure 8 , Figure 8 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 8 As shown, the electronic device 1000 in this embodiment may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned electronic device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1004 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 8 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0176] exist Figure 8In the electronic device 1000 shown, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the implementation method provided by any embodiment of the present application.
[0177] It should be understood that in some feasible implementations, the processor 1001 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0178] The present application also provides a computer-readable storage medium, which stores a computer program and is executed by a processor to implement Figure 1 and / or Figure 5 For the methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0179] The computer-readable storage medium may be an internal storage unit of the device or equipment provided in any of the aforementioned embodiments, such as a hard disk or memory of an electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device. The computer-readable storage medium may also include a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0180] The embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 and / or Figure 5 The methods provided in each step.
[0181] The terms "first", "second", etc. in the claims, specification and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or electronic device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or electronic devices. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. Displaying the phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" used in the present application specification and the attached claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations.
[0182] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0183] The above disclosure is only the preferred embodiment of the present application, which cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A graph-based network community discovery method, characterized in that: The method comprises: Acquire an initial neural network model and a training data set, wherein the initial neural network model includes an initial graph generation model and an initial graph node classification model that are cascaded in sequence, and the training data set includes each sample graph; For each of the sample images, based on the sample image, a predicted probability distribution of the hidden layer features of the sample image is obtained through an encoder of the initial image generation model; a perturbation parameter of the sample image is obtained, and based on the predicted probability distribution of the hidden layer features and the perturbation parameter, a perturbation image is obtained through a decoder of the initial image generation model; For each of the perturbation graphs, obtaining a first encoding feature corresponding to each node in the perturbation graph through an encoder of the initial graph node classification model; obtaining a predicted category of each node in the perturbation graph through a decoder of the initial graph node classification model based on the first encoding feature of each node in the perturbation graph; Determine the connection weights between the network communities in each of the sample graphs based on the predicted categories of the nodes in each of the perturbation graphs and the associated features corresponding to each of the sample graphs, and determine a first training loss value based on the connection weights, wherein the first training loss value represents the difference between the network communities corresponding to different categories; Iteratively training the initial neural network model according to the first training loss value and the training data set until a training end condition is met, so as to determine the category of each node in the to-be-processed graph based on the graph node classification model after the training is completed, and determine the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph; The nodes in each of the sample graphs and the graph to be processed are objects in the corresponding network community, and the edges between the nodes are used to characterize the relationship between the objects; the network community includes a social network or a payment network, the category or predicted category of each node in the payment network includes a normal category for normal payment behavior and an abnormal category for abnormal payment behavior, and the category and predicted category of each node in the social network include a category for indicating that the node is a rumor propagation node and a category for indicating that the node is a rumor-free node; The iterative training of the initial neural network model according to the first training loss value and the training data set includes: Iteratively training the initial neural network model according to the first training loss value, the second training loss value and the training data set, or iteratively training the initial neural network model according to the first training loss value, the fourth training loss value and the training data set; The second training loss value is determined based on the following method: For each of the sample graphs, obtaining a priori probability distribution corresponding to the sample graph; determining a second training loss value based on the predicted probability distribution and the priori probability distribution corresponding to each of the sample graphs; The fourth training loss value is determined based on the following method: For each of the sample graphs, based on the sample graph, a second encoding feature of each node in the sample graph is obtained through the encoder of the initial graph node classification model; based on the first encoding feature and the second encoding feature corresponding to each node in the sample graph, a fourth training loss value is calculated.
2. The method according to claim 1, characterized in that The determining of the first training loss value based on the predicted category of each node in each of the perturbation graphs and the associated features corresponding to each of the sample graphs includes: For each sample graph, based on the associated features corresponding to the sample graph, determine the number of edges corresponding to each node in the sample graph; Determine the number of categories corresponding to each node in the sample graph based on the predicted category of each node in the perturbation graph corresponding to the sample graph; A first training loss value is determined based on the associated features corresponding to each of the sample graphs, the number of categories corresponding to each of the sample graphs, and the number of edges corresponding to each node in each of the sample graphs.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Determine a third training loss value based on each sample graph and a perturbation graph corresponding to each sample graph; The iterative training of the neural network model according to the first training loss value and the training data set includes: The initial neural network model is iteratively trained according to the first training loss value, the third training loss value and the training data set.
4. The method according to claim 1 or 2, characterized in that: The step of obtaining the predicted category of each node in each of the perturbation graphs by using the initial graph node classification model based on each of the perturbation graphs includes: For each perturbation graph, obtaining a third encoding feature of each node in the perturbation graph through an encoder of the initial graph node classification model; Based on the third encoded features of each node in the perturbation graph, obtaining a decoded feature of each node in the perturbation graph through a decoder of the initial graph node classification model; Based on the decoding features of each node in the perturbation graph, a predicted category of each node in the perturbation graph is obtained; The method further comprises: For each sample graph, determining the correlation of the decoding features of each node in the perturbation graph corresponding to the sample graph whose predicted category is the target category; Determining a fifth training loss value based on the correlations corresponding to the sample graphs; The iterative training of the neural network model according to the first training loss value and the training data set includes: The initial neural network model is iteratively trained according to the first training loss value, the fifth training loss value, and the training data set.
5. The method according to claim 1, characterized in that The predicted probability distribution based on the hidden layer features and the perturbation parameters are generated by a decoder of the initial graph generation model to obtain a perturbation graph, comprising: Determine the hidden layer feature corresponding to the sample image based on the predicted probability distribution of the hidden layer feature; Based on the hidden layer features, the decoder of the initial graph generation model performs the following operations: Determining a predicted probability distribution of a perturbation map generated based on the hidden layer features; Determining a predicted probability distribution of a perturbation map generated based on the sample map based on the predicted probability of the hidden layer feature, the hidden layer feature, and the predicted probability distribution of the perturbation map generated based on the hidden layer feature; Based on the disturbance parameters and the predicted probability distribution of generating the disturbance map based on the sample map, a disturbance map corresponding to the sample map is generated.
6. The method according to claim 5, characterized in that The generating a disturbance graph corresponding to the sample graph based on the disturbance parameter and the predicted probability distribution of the disturbance graph generated based on the sample graph comprises: Determining a candidate disturbance graph corresponding to the sample graph according to the predicted probability distribution of generating the disturbance graph based on the sample graph; Based on the disturbance parameter, adjusting the associated features corresponding to the candidate disturbance graph; The adjusted candidate perturbation graph is determined as the perturbation graph corresponding to the sample graph.
7. A graph-based network community discovery method, characterized in that: The method comprises: Get the graph to be processed; Based on the graph to be processed, determining the category of each node in the graph to be processed by a graph node classification model, wherein the graph node classification model is trained based on the method according to any one of claims 1 to 6; Based on the category of each node in the graph to be processed, a target network community in the graph to be processed is determined.
8. The method according to claim 7, characterized in that The determining, based on the graph to be processed, the category of each node in the graph to be processed by a graph node classification model includes: Based on the graph to be processed, obtaining initial node features of each node in the graph to be processed and association features between the nodes; The initial node features of each of the nodes and the associated features between the nodes are input into the graph node classification model to obtain the category of each node in the graph to be processed.
9. The method according to claim 8, characterized in that The determining of the target network community in the graph to be processed based on the category of each node in the graph to be processed includes: Determine the graph structure corresponding to each node whose category is the target category in the graph to be processed; The graph structure is determined as a target network community in the graph to be processed.
10. A network community discovery device based on a graph, characterized in that: The device comprises: An acquisition module, used to acquire an initial neural network model and a training data set, wherein the initial neural network model includes an initial graph generation model and an initial graph node classification model that are cascaded in sequence, and the training data set includes each sample graph; A graph generation module is used to obtain, for each sample graph, a predicted probability distribution of hidden layer features of the sample graph through an encoder of the initial graph generation model based on the sample graph; obtain a perturbation parameter of the sample graph, and obtain a perturbation graph through a decoder of the initial graph generation model based on the predicted probability distribution of the hidden layer features and the perturbation parameter; A category determination module is used to obtain, for each of the perturbation graphs, a first encoding feature corresponding to each node in the perturbation graph through an encoder of the initial graph node classification model; based on the first encoding feature of each node in the perturbation graph, obtain a predicted category of each node in the perturbation graph through a decoder of the initial graph node classification model; A loss determination module, configured to determine a first training loss value based on the predicted category of each node in each of the perturbation graphs and the associated features corresponding to each of the sample graphs, wherein the first training loss value represents the difference between network communities corresponding to different categories; A training module, used for iteratively training the initial neural network model according to the first training loss value and the training data set until a training end condition is met, so as to determine the category of each node in the to-be-processed graph based on the graph node classification model after the training is completed, and determine the target network community in the to-be-processed graph based on the category of each node in the to-be-processed graph; The nodes in each of the sample graphs and the to-be-processed graphs are objects in the corresponding network community, and the edges between the nodes are used to characterize the relationship between the objects; the network community includes a social network or a payment network, the category or predicted category of each node in the payment network includes a normal category for normal payment behavior and an abnormal category for abnormal payment behavior, and the category and predicted category of each node in the social network include a category for indicating that the node is a rumor propagation node and a category for indicating that the node is a rumor-free node; When the training module performs iterative training on the initial neural network model according to the first training loss value and the training data set, it is used to: Iteratively training the initial neural network model according to the first training loss value, the second training loss value and the training data set, or iteratively training the initial neural network model according to the first training loss value, the fourth training loss value and the training data set; Wherein, the loss determination module is used to: For each of the sample graphs, obtaining a priori probability distribution corresponding to the sample graph; determining a second training loss value based on the predicted probability distribution and the priori probability distribution corresponding to each of the sample graphs; For each of the sample graphs, based on the sample graph, a second encoding feature of each node in the sample graph is obtained through the encoder of the initial graph node classification model; based on the first encoding feature and the second encoding feature corresponding to each node in the sample graph, a fourth training loss value is calculated.
11. A network community discovery device based on a graph, characterized in that: The device comprises: An acquisition module, used to acquire the graph to be processed; A category determination module, used to determine the category of each node in the graph to be processed based on the graph to be processed by a graph node classification model, wherein the graph node classification model is trained based on the method according to any one of claims 1 to 6; The community determination module is used to determine the target network community in the graph to be processed based on the category of each node in the graph to be processed.
12. An electronic device, characterized in that: comprising a processor and a memory, wherein the processor and the memory are connected to each other; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 or the method according to any one of claims 7 to 9 when calling the computer program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 6 or to implement the method according to any one of claims 7 to 9.
