Unbalanced graph data oversampling method and system based on topological structure, storage medium and equipment
By using topological structure-based methods in graph data to oversample unbalanced data, the problem of black box and resource consumption in the previous technology of graph data oversampling process is solved, and an interpretable graph data class imbalance is realized.
Patent Information
- Application Number
- CN202411673460.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art is difficult to effectively oversample unbalanced data in graph data, especially in methods such as graph neural networks. The oversampling process is black box, difficult to explain and consumes a lot of resources.
The topological structure-based method is used to oversample the unbalanced graph data, and the community structure of the graph is divided through the community detection algorithm, and feature representation and topological representation are performed for a few types of nodes. The synthetic nodes are generated and embedded in the graph until the desired node ratio is reached.
Implementing interpretable graph data class imbalance processing, avoiding dependence on machine learning models such as graph neural networks, reducing resource consumption, and simplifying the oversampling process.
Smart Images

Figure CN119537951A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data mining, and in particular to a method, system, storage medium and device for oversampling unbalanced graph data based on topological structure. Background Art
[0002] The problem of data imbalance has always been one of the research hotspots in the field of machine learning. For example, the number of fault samples in fault diagnosis is far less than the number of normal samples, which will cause the accuracy of machine learning classifiers to decrease and the fault diagnosis ability to continue to decline. At present, the class imbalance processing technology at the data level can be divided into oversampling technology and undersampling technology, and the synthetic minority oversampling technique (SMOTE) is a classic method, and various improved SMOTE methods have been derived. With the rise of machine learning methods for graph structured data such as graph neural networks, the imbalance problem on graph data has become increasingly prominent. Graph is a structured non-Euclidean data, which consists of a series of nodes and edges. Compared with non-graph structured data, when oversampling to solve the class imbalance problem, a huge challenge is how to determine the edges between the synthesized minority class and the original graph, that is, how to add the nodes corresponding to the minority labels to the original graph to generate a new graph. In this context, the classic SMOTE method cannot be directly applied.
[0003] The GraphSMOTE method applies the SMOTE principle to graph data. In the feature extraction and edge generation stages of graph nodes, a graph neural network model is used for feature extraction and edge prediction, respectively, solving the problem of graph imbalance. In addition to GraphSMOTE, a variety of oversampling methods on graph structures have been proposed. Among these methods, graph neural networks, generative adversarial networks, graph variational autoencoders, etc. are used to handle class imbalance on graph structures. However, the above methods all use machine learning methods for node feature prediction and edge prediction, which means that the oversampling process is a black box, and it is difficult to understand its internal logic and implementation process, and it often requires more resources to achieve model training and prediction. Summary of the invention
[0004] The purpose of the present invention is to overcome the technical problems existing in the prior art. The present invention proposes an oversampling scheme for unbalanced graph data based on topological structure. Specifically, the scheme realizes the synthesis of minority classes (i.e., nodes of the graph) completely based on the topological structure of the graph, including feature representation of nodes, topological representation, and node generation and edge generation of synthesized minority classes, and finally realizes interpretable graph data class imbalance processing.
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] In a first aspect, a method for oversampling unbalanced graph data based on a topological structure is provided, comprising the following steps:
[0007] S1. Obtaining and defining the imbalance graph;
[0008] S2. Community structure division: using a community detection algorithm to divide the unbalanced graph into communities, and recording the nodes to which each community belongs;
[0009] S3. Node representation of minority nodes: For minority nodes in the unbalanced graph, node representation is performed from two aspects: node feature representation and node local topological structure representation;
[0010] S4, synthetic node generation: Based on the node representation of the minority class node in step S3, an oversampling approach is used to generate a synthetic node, and the generated synthetic node is embedded in the unbalanced graph; wherein the oversampling approach is used to generate a synthetic node, including:
[0011] Generate a local topological structure of the synthetic node and determine the characteristics of the synthetic node;
[0012] S5. Repeatedly generate synthetic nodes: Repeat step S4, iteratively generate synthetic nodes and embed them into the unbalanced graph until the minority class nodes and the majority class nodes in the unbalanced graph maintain the required number ratio.
[0013] In some embodiments, step S1 specifically includes:
[0014] The unbalanced graph to be processed is represented as G(V,E), and V = {v 1 ,…,v i ,…,v n} represents the node set, n is the number of nodes; E = {e 1 ,…,e j ,…,e m} represents the set of edges, and m is the number of edges.
[0015] In some embodiments, the community detection algorithm uses the Louvain algorithm.
[0016] In some embodiments, step S3 specifically includes:
[0017] The minority class node v i It is expressed as:
[0018]
[0019] in, For node v i The node representation is The nodes v iThe outgoing neighbor node set, incoming neighbor node set and attribute set of , and there are:
[0020]
[0021] in, Represents node v i is a feature of , and z is the number of features.
[0022] In some embodiments, generating a local topological structure of a synthetic node includes:
[0023] Assume v j and v l are two minority class nodes in the unbalanced graph, and their node representations are and And there is and Synthesize Node v k The outgoing neighbor node set and the incoming neighbor node set are directly inherited from the existing minority class node v j and v l , its neighbor node set is:
[0024]
[0025] The set of incoming neighbor nodes is:
[0026]
[0027] Among them, w j and w l Respectively represent inheritance from node v j and v l The ratio of neighbor nodes, w j and w l The setting of is determined according to the community division result of step S2 and the following principles:
[0028] ①If v j and v l belong to the same community, then take w j =w l =0.5;
[0029] ②If v j and v l Not belonging to the same community, according to v j and v l The distance w is determined by j and w l The value of v j and v l Distance is the number of nodes between them, then:
[0030]
[0031] That is, from v j and v l The proportion of random selection in each outgoing neighbor node and incoming neighbor node is The node as v k The outgoing and incoming neighbor nodes;
[0032] According to the above principles, when there are already a few nodes v j and v l The proportion of random selection in the outgoing neighbor node and incoming neighbor node set is w j and w l The outgoing neighbor node and the incoming neighbor node are used as the synthetic node v k The set of outgoing neighbor nodes and incoming neighbor nodes constitutes the synthetic node v k The local topological structure representation of .
[0033] In some embodiments, determining the characteristics of the synthesized node includes:
[0034] Assume v j and v l The node characteristics are and There are two ways to calculate v: k Node features:
[0035] ① If the node feature is continuous data, then:
[0036]
[0037] in, v j and v l The i-th feature of v k The i-th feature of k The feature set
[0038] ②If the node feature is discrete data, then:
[0039]
[0040] Indicates from and Randomly select one as v k The characteristics of the synthetic node v are determined k The feature set So far, the synthesis node v is determined k Node representation
[0041] In some embodiments, embedding the generated synthetic node into the unbalanced graph includes:
[0042] From the synthesis node v k Connect directed edges to Each node in Each node in is connected with a directed edge to the composite node v k .
[0043] In a second aspect, a topology-based unbalanced graph data oversampling system is provided, comprising:
[0044] Unbalanced graph acquisition module, used for unbalanced graph acquisition and definition;
[0045] A community structure division module is used to divide the imbalanced graph into communities using a community detection algorithm and record the nodes to which each community belongs;
[0046] The node representation module for minority nodes is used to represent the minority nodes in the unbalanced graph from two aspects: node feature representation and node local topological structure representation;
[0047] A synthetic node generation module is used to generate synthetic nodes based on the node representation of the minority class nodes in the node representation module of the minority class nodes by adopting an oversampling idea, and embed the generated synthetic nodes into the unbalanced graph; wherein the generation of synthetic nodes by adopting the oversampling idea includes:
[0048] Generate a local topological structure of the synthetic node and determine the characteristics of the synthetic node;
[0049] The synthetic node generation module is repeatedly generated to control the synthetic node generation module to iteratively generate synthetic nodes and embed them into the unbalanced graph until the minority class nodes and the majority class nodes in the unbalanced graph maintain a required quantity ratio.
[0050] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the topology-based unbalanced graph data oversampling methods is implemented.
[0051] In a fourth aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, and when the processor executes the computer instructions, any one of the topology-based unbalanced graph data oversampling methods is executed.
[0052] It should be further explained that the technical features corresponding to the above options can be combined or replaced with each other to form a new technical solution if there is no conflict.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] The present invention realizes the synthesis of minority class nodes completely based on the topological structure of the graph, including the feature representation of the nodes, the topological representation, and the node generation and edge generation of the synthesized minority class, and finally realizes interpretable graph data class imbalance processing. The method performs oversampling based on the topological structure of the graph, does not rely on machine learning models such as graph neural networks, has good interpretability, and can realize simple and easy oversampling of unbalanced graph data to meet the needs of graph data oversampling. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A simplified flowchart of a method for oversampling unbalanced graph data based on a topological structure according to an embodiment of the present invention;
[0056] Figure 2 A specific flow chart of unbalanced graph data oversampling according to an embodiment of the present invention;
[0057] Figure 3 This is a schematic diagram of graph data oversampling according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The technical solution of the present invention is clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various configurations. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0059] It should be noted that the defects existing in the solutions in the above-mentioned prior art are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above-mentioned problems and the solutions proposed in the embodiments of the present application for the above-mentioned problems below should all be the contributions made by the inventor to the present application in the process of invention and creation, and should not be understood as technical contents known to technical personnel in this field.
[0060] In view of the technical problems pointed out in the background technology, the embodiments provided by the present invention are as follows:
[0061] Example 1
[0062] Reference Figure 1 In an exemplary embodiment, a method for oversampling unbalanced graph data based on a topological structure is provided, comprising the following steps:
[0063] S1. Obtaining and defining the imbalance graph;
[0064] S2. Community structure division: using a community detection algorithm to divide the unbalanced graph into communities, and recording the nodes to which each community belongs;
[0065] S3. Node representation of minority nodes: For minority nodes in the unbalanced graph, node representation is performed from two aspects: node feature representation and node local topological structure representation;
[0066] S4, synthetic node generation: Based on the node representation of the minority class node in step S3, an oversampling approach is used to generate a synthetic node, and the generated synthetic node is embedded in the unbalanced graph; wherein the oversampling approach is used to generate a synthetic node, including:
[0067] Generate a local topological structure of the synthetic node and determine the characteristics of the synthetic node;
[0068] S5. Repeatedly generate synthetic nodes: Repeat step S4, iteratively generate synthetic nodes and embed them into the unbalanced graph until the minority class nodes and the majority class nodes in the unbalanced graph maintain the required number ratio.
[0069] Specifically, step S1 includes:
[0070] For the unbalanced graph to be processed, the present invention represents it as G(V,E), and V = {v 1 ,…,v i ,…,v n} represents the node set, n is the number of nodes; E = {e 1 ,…,e j ,…,e m} represents the set of edges, and m is the number of edges. In graph G, the category ratio of nodes is unbalanced, and nodes of one category occupy the majority.
[0071] Step S2 includes:
[0072] The community detection algorithm such as Louvain algorithm is used to divide the graph G into communities and record the nodes to which each community belongs.
[0073] Step S3 includes:
[0074] For the minority nodes in the graph G, the node representation is performed from two aspects: node feature representation and node local topological structure representation. The node feature is the attribute set of the minority node, and the node local topological structure includes the node's outbound neighbor node set and inbound neighbor node set. i It is expressed as:
[0075]
[0076] in, For node v i The node representation is The nodes v i The outgoing neighbor node set, incoming neighbor node set and attribute set (i.e. feature set) of , and there are:
[0077]
[0078] in, Represents node v i is a feature of , and z is the number of features.
[0079] Step S4 includes:
[0080] (1) Generation of local topological structure of synthetic nodes: After obtaining the node representation of each minority class node, the node representation of a new node (called a synthetic node) is generated using an oversampling approach. First, the local topological structure of the synthetic node is generated. Assume that v j and v l are two minority class nodes in graph G, and their node representations are and And there is and In the present invention, the synthesis node v k The outgoing neighbor node set and the incoming neighbor node set are directly inherited from the existing minority class node v j and v l , its outgoing and incoming neighbor node sets are:
[0081]
[0082] Among them, w j and w l Respectively represent inheritance from node v j and v l The ratio of neighbor nodes. j and w l The setting of is determined according to the community division results in step 2 and the following principles:
[0083] ①If v j and v l Belonging to the same community means that the two have highly similar local structures, so we take w j =w l =0.5, that is, from v j and v l Randomly select half of the nodes from each of the outgoing and incoming neighbor nodes as The inbound and outbound neighbor nodes.
[0084] ②If v j and v l If they do not belong to the same community, it means that the local structure similarity between the two is not high. At this time, according to vj and v l The distance w is determined by j and w l The present invention defines v j and v l Distance is the number of nodes between them, then:
[0085]
[0086] That is, from v j and v l The proportion of random selection in the respective outgoing and incoming neighbor nodes is The node as v k The outgoing and incoming neighbor nodes. j and v l The greater the distance and the greater the structural difference, the fewer nodes will be selected.
[0087] According to the above principles, when there are already a few nodes v j and v l The proportion of random selection in the outgoing and incoming neighbor nodes is w j and w l The outgoing and incoming neighbor nodes are used as the synthetic node v k The set of outgoing and incoming neighbor nodes constitutes the synthetic node v k The local topological structure representation of .
[0088] (2) Synthetic node feature generation: To construct the node representation of the synthetic node, in addition to the local topological structure, the characteristics of the synthetic node must also be determined. Assume that v j and v l The node characteristics are and Depending on the feature type, v is calculated in two ways: k Node features.
[0089] ① If the node feature is continuous data, then:
[0090]
[0091] Among them, f i vj , v j and v l The i-th feature of v k The i-th feature of k The feature set
[0092] ②If the node feature is discrete data, then:
[0093]
[0094] Formula (7) shows that and Randomly select one as v k The characteristics of the synthetic node v are determined k The feature set
[0095] So far, the synthesis node v is determined k Node representation
[0096] (3) Synthetic Node Embedding:
[0097] After obtaining the synthesis node v k Based on the node representation of k Add to graph G. Specifically, by and Determine the edge, that is, from the synthetic node v k Connect directed edges to Each node in Each node in is connected with a directed edge to the composite node v k At this point, the synthesis node v k is added to the original graph G.
[0098] Example 2
[0099] Based on the inventive concept of Example 1, this example takes four unbalanced graph structures as examples to illustrate the implementation process of oversampling graph data using the present invention. Figure 2 As shown, the specific steps are as follows:
[0100] Steps 1-2: Obtaining and defining the imbalanced graph and dividing the community structure
[0101] Four graphs are generated using NetworkX, denoted as G1, G2, G3 and G4. All four graphs contain two types of nodes. The specific node types are shown in Table 1.
[0102] Table 1 Graph node types and quantities
[0103] Figure No. Total number of nodes Number of minority class nodes The number of majority class nodes G1 355 16 339 G2 388 9 379 G3 156 13 143 G4 77 12 65
[0104] Subsequently, the Louvain algorithm is used based on NetworkX to divide communities and record the nodes to which each community belongs.
[0105] Step 3: Node representation of minority class nodes
[0106] The nodes of G1, G2, G3 and G4 are represented from two aspects: node feature representation and node local topological structure representation.
[0107] Steps 4-6: Synthesis node generation
[0108] Based on the topological structure, the local topological structure representation and feature representation of the synthetic nodes are generated on the basis of the minority class nodes of the existing graph, and then added to the original graph.
[0109] Step 7: Repeat the generation of composite nodes
[0110] Repeat steps 4 to 6, iteratively generate synthetic nodes and add them to the original graph until the number ratio of minority class nodes to majority class nodes in the original graph is approximately 1:1. Figure 3 shown.
[0111] Example 3
[0112] Based on the same inventive concept as that of Embodiment 1, a topology-based unbalanced graph data oversampling system is provided, comprising:
[0113] Unbalanced graph acquisition module, used for unbalanced graph acquisition and definition;
[0114] A community structure division module is used to divide the imbalanced graph into communities using a community detection algorithm and record the nodes to which each community belongs;
[0115] The node representation module for minority nodes is used to represent the minority nodes in the unbalanced graph from two aspects: node feature representation and node local topological structure representation;
[0116] A synthetic node generation module is used to generate synthetic nodes based on the node representation of the minority class nodes in the node representation module of the minority class nodes by adopting an oversampling idea, and embed the generated synthetic nodes into the unbalanced graph; wherein the generation of synthetic nodes by adopting the oversampling idea includes:
[0117] Generate a local topological structure of the synthetic node and determine the characteristics of the synthetic node;
[0118] The synthetic node generation module is repeatedly generated to control the synthetic node generation module to iteratively generate synthetic nodes and embed them into the unbalanced graph until the minority class nodes and the majority class nodes in the unbalanced graph maintain a required quantity ratio.
[0119] It should be noted that each module of the system integrates the software and hardware corresponding to the functions of each step in the implementation method to achieve the same function, and the specific implementation method of each module will not be repeated here.
[0120] Example 4
[0121] Based on the same inventive concept as Example 1, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for oversampling unbalanced graph data based on topological structure provided in the embodiment of the present invention is implemented. Based on such an understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0122] Example 5
[0123] Based on the same inventive concept as Example 1, an electronic device is provided, including a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and when the processor executes the computer instructions, the topology-based unbalanced graph data oversampling method provided in the embodiment of the present invention is executed.
[0124] The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
[0125] Embodiments of the subject matter and functional operations described in this specification may be implemented in: tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode and transmit information to a suitable receiver device for execution by the data processing device.
[0126] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application-specific integrated circuits), and the apparatus can also be implemented as special purpose logic circuits.
[0127] Processors suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, just to name a few.
[0128] It should be understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The above specific implementation methods are detailed descriptions of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions and substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A method for oversampling unbalanced graph data based on topological structure, characterized in that: The following steps are involved: S1. Obtaining and defining the imbalance graph; S2. Community structure division: using a community detection algorithm to divide the unbalanced graph into communities, and recording the nodes to which each community belongs; S3. Node representation of minority nodes: For minority nodes in the unbalanced graph, node representation is performed from two aspects: node feature representation and node local topological structure representation; S4, synthetic node generation: Based on the node representation of the minority class node in step S3, an oversampling approach is used to generate a synthetic node, and the generated synthetic node is embedded in the unbalanced graph; wherein the oversampling approach is used to generate a synthetic node, including: Generate a local topological structure of the synthetic node and determine the characteristics of the synthetic node; S5. Repeatedly generate synthetic nodes: Repeat step S4, iteratively generate synthetic nodes and embed them into the unbalanced graph until the minority class nodes and the majority class nodes in the unbalanced graph maintain the required number ratio.
2. The method for oversampling unbalanced graph data based on topological structure according to claim 1, characterized in that: The step S1 specifically includes: The unbalanced graph to be processed is represented as G(V,E), and V = {v1,…,v i ,…,v n } represents the node set, n is the number of nodes; E = {e1,…,e j ,…,e m } represents the set of edges, and m is the number of edges.
3. The method for oversampling unbalanced graph data based on topological structure according to claim 1, characterized in that: The community detection algorithm adopts the Louvain algorithm.
4. The method for oversampling unbalanced graph data based on topological structure according to claim 1, characterized in that: The step S3 specifically includes: The minority class node v i It is expressed as: in, For node v i The node representation is The nodes v i The outgoing neighbor node set, incoming neighbor node set and attribute set of , and there are: in, Represents node v i is a feature of , and z is the number of features.
5. The method for oversampling unbalanced graph data based on topological structure according to claim 1, characterized in that: The generating of the local topological structure of the synthesis node comprises: Assume v j and v l are two minority class nodes in the unbalanced graph, and their node representations are and And there is and Synthesize Node v k The outgoing neighbor node set and the incoming neighbor node set are directly inherited from the existing minority class node v j and v l , its neighbor node set is: The set of incoming neighbor nodes is: Among them, w j and w l Respectively represent inheritance from node v j and v l The ratio of neighbor nodes, w j and w l The setting of is determined according to the community division result of step S2 and the following principles: ①If v j and v l belong to the same community, then take w j =w l =0.5; ②If v j and v l Not belonging to the same community, according to v j and v l The distance w is determined by j and w l The value of v j and v l Distance is the number of nodes between them, then: That is, from v j and v l The proportion of random selection in each outgoing neighbor node and incoming neighbor node is The node as v k The outgoing and incoming neighbor nodes; According to the above principles, when there are already a few nodes v j and v l The proportion of random selection in the outgoing neighbor node and incoming neighbor node set is w j and w l The outgoing neighbor node and the incoming neighbor node are used as the synthetic node v k The set of outgoing neighbor nodes and incoming neighbor nodes constitutes the synthetic node v k The local topological structure representation of .
6. The method for oversampling unbalanced graph data based on topological structure according to claim 5, characterized in that: The determining of the characteristics of the synthesis node includes: Assume v j and v l The node characteristics are and There are two ways to calculate v: k Node features: ① If the node feature is continuous data, then: in, v j and v l The i-th feature of v k The i-th feature of k The feature set ②If the node feature is discrete data, then: Indicates from and Randomly select one as v k The characteristics of the synthetic node v are determined k The feature set So far, the synthesis node v is determined k Node representation 7. The method for oversampling unbalanced graph data based on topological structure according to claim 6, characterized in that: The step of embedding the generated synthetic node into the unbalanced graph comprises: From the synthesis node v k Connect directed edges to Each node in Each node in is connected with a directed edge to the composite node v k .
8. A topology-based unbalanced graph data oversampling system, characterized in that: include: Unbalanced graph acquisition module, used for unbalanced graph acquisition and definition; A community structure division module is used to divide the imbalanced graph into communities using a community detection algorithm and record the nodes to which each community belongs; The node representation module for minority nodes is used to represent the minority nodes in the unbalanced graph from two aspects: node feature representation and node local topological structure representation; A synthetic node generation module is used to generate synthetic nodes based on the node representation of the minority class nodes in the node representation module of the minority class nodes by adopting an oversampling idea, and embed the generated synthetic nodes into the unbalanced graph; wherein the generation of synthetic nodes by adopting the oversampling idea includes: Generate a local topological structure of the synthetic node and determine the characteristics of the synthetic node; The synthetic node generation module is repeatedly generated to control the synthetic node generation module to iteratively generate synthetic nodes and embed them into the unbalanced graph until the minority class nodes and the majority class nodes in the unbalanced graph maintain a required quantity ratio.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for oversampling unbalanced graph data based on topological structure described in any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, wherein: When the processor runs the computer instructions, it executes the unbalanced graph data oversampling method based on topological structure described in any one of claims 1 to 7.