A graph processing method and related apparatus

By calculating the simplification sensitivity of each edge in the network structure graph, selecting edges that have a smaller impact on information propagation, and merging nodes to reduce the network size, the computational challenges of large-scale graph data for graph neural networks are solved, enabling efficient training in industrial scenarios.

CN115345291BActive Publication Date: 2026-05-29HUAWEI TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2022-07-05
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Large-scale graph data poses a computational challenge to the information extraction and analysis of graph neural networks, making them difficult to apply in industrial scenarios. Existing graph segmentation methods result in significant loss of subgraph information, affecting training performance.

Method used

By calculating the simplification sensitivity of each edge in the network structure graph, edges with less impact on information propagation are selected for simplification. Nodes are merged to reduce the network size while retaining information. The simplified network structure graph is then used to train the graph neural network.

Benefits of technology

While reducing the network size, we can retain as much information as possible, ensuring the training effect of graph neural networks and improving training efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115345291B_ABST
    Figure CN115345291B_ABST
Patent Text Reader

Abstract

The application discloses a graph processing method applied to the field of artificial intelligence and used for training a graph neural network. The graph processing method determines the influence of simplifying each edge on information propagation in a network structure graph by calculating the simplification sensitivity of each edge in the network structure graph, so that edges with less influence on information propagation are selected for simplification, thereby reducing the size of the network structure graph and reducing information loss caused by the size reduction of the network structure graph. Moreover, the simplification of the network structure graph is realized based on the simplification sensitivity of the edges in the present scheme, so that the information in the network structure graph can be preserved to the greatest extent, thereby guaranteeing the training effect of the graph neural network trained based on the network structure graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a graph processing method and related apparatus. Background Technology

[0002] In recent years, research and applications of graph data have become a hot research area in artificial intelligence and data science. How to efficiently perform network analysis on network datasets to complete tasks such as node classification, link prediction, and network reconstruction has always been a key research focus in the field of graph data. Currently, Graph Neural Networks (GNNs) are the main research tool in graph data research and have been widely used in various scenarios containing graph data. Despite the significant success of GNNs, as the scale of graph data grows larger, large-scale graph data poses a significant computational challenge for information extraction and analysis, making it difficult to apply GNNs in large-scale industrial scenarios.

[0003] To address the issue of excessively large graph data sizes, a graph neural network training method based on graph segmentation has been proposed. Specifically, this method divides large graph data into multiple subgraphs using graph segmentation techniques, and then uses these subgraphs to train the graph neural network.

[0004] However, current graph segmentation methods primarily rely on randomly sampling nodes from the graph data based on its structure to partition the graph into subgraphs. This random sampling method, based on the graph data structure, leads to significant information loss in the resulting subgraphs, resulting in poor performance of the trained graph neural networks. Summary of the Invention

[0005] This application provides a graph processing method that can effectively reduce the size of the network structure graph while preserving the information in the network structure graph, thereby ensuring the training effect of the graph neural network.

[0006] This application provides a graph processing method for processing network structure graphs to reduce the size of the network structure graph, enabling graph neural networks to be trained using a smaller network structure graph. The graph processing includes: firstly, obtaining a first network structure graph, which includes multiple nodes and multiple edges, and each edge in the first network structure graph connects two nodes with a connection relationship. Furthermore, all or some nodes in the first network structure graph are labeled with a corresponding type. For example, the first network structure graph is a product network graph in a product management scenario, where nodes represent products and are labeled with product types. Alternatively, the first network structure graph is a social network graph in a social recommendation scenario, where nodes represent users and are labeled with user types.

[0007] Then, the simplification sensitivity of each edge in the first network structure graph is obtained, where the simplification sensitivity indicates the degree of difference between the types of nodes in the second and third network structure graphs. Specifically, the second network structure graph is obtained by predicting the types of all nodes in the first network structure graph based on the labeled node types. Furthermore, the third network structure graph is obtained by predicting the types of all nodes in the fourth network structure graph based on the labeled node types, and the fourth network structure graph is obtained by merging the two nodes connected on the same side in the first network structure graph. In simple terms, the edge simplification sensitivity measures the impact of simplifying an edge in the first network structure graph on information propagation within the network structure graph. The higher the edge simplification sensitivity, the greater the impact on information propagation after simplifying that edge in the first network structure graph; conversely, the lower the edge simplification sensitivity, the smaller the impact on information propagation after simplifying that edge in the first network structure graph.

[0008] Secondly, based on the simplification sensitivity of each edge in the first network structure graph, multiple target edges in the first network structure graph are simplified to obtain a simplified first network structure graph. Simplifying a target edge in the first network structure graph means merging the two nodes connected by the target edge, while retaining the connection relationships between the merged node and other nodes. For example, in the process of simplifying target edges, edges with less impact on information propagation in the first network structure (i.e., edges with low simplification sensitivity) can be selected for simplification to minimize the impact of simplified edges on the first network structure graph.

[0009] In this scheme, the simplification sensitivity of each edge in the network structure graph is calculated to determine the impact of simplifying each edge on information propagation within the network structure graph. Edges with minimal impact on information propagation are then selected for simplification, thus reducing the information loss caused by the reduction in network structure graph size. Since the graph neural network trained using the simplified network structure graph is essentially a process of information propagation during training—that is, predicting global connections or node features based on the original network structure graph's connections and node features—this scheme, based on edge simplification sensitivity, maximizes the preservation of information within the network structure graph, thereby ensuring the training effectiveness of the graph neural network.

[0010] In one possible implementation, simplification sensitivity is also used to indicate the differences between the structures of the second and third network structure graphs. That is, simplification sensitivity simultaneously indicates the differences in structure and node types between the two network structure graphs.

[0011] In one possible implementation, the target edges are the edges with the lowest simplification sensitivity in the first network structure graph. The simplification sensitivity is positively correlated with the degree of difference between the types of nodes in the second and third network structure graphs. That is, the greater the difference between the types of nodes in the second and third network structure graphs, the higher the simplification sensitivity; conversely, the smaller the difference between the types of nodes in the second and third network structure graphs, the lower the simplification sensitivity.

[0012] In this scheme, by selecting the edges with the lowest simplification sensitivity in the simplified first network structure graph, the impact of the simplified edges on the first network structure graph can be minimized as much as possible, thereby effectively preserving the information in the first network structure graph and ensuring the training effect of the graph neural network.

[0013] In one possible implementation, multiple target edges in the first network structure graph are simplified based on the simplification sensitivity of each edge. Specifically, this includes: first, simplifying the edge with the lowest simplification sensitivity in the first network structure graph based on the simplification sensitivity of each edge, resulting in an updated first network structure graph; then, performing multiple updates on the updated first network structure graph to obtain a simplified first network structure graph. Each update of the updated first network structure graph includes simplifying the edge with the lowest simplification sensitivity obtained in the previous update. In other words, during the simplification of the first network structure graph, it needs to be updated multiple times, with each update simplifying the edge with the lowest simplification sensitivity, and the edge with the lowest simplification sensitivity is re-determined after each update.

[0014] In this scheme, after simplifying one edge in the first network structure graph each time, the edge with the lowest simplification sensitivity in the first network structure after simplification is re-determined. This ensures that the edge with the lowest actual simplification sensitivity is selected in each simplification, thus guaranteeing the simplification effect.

[0015] In one possible implementation, the method further includes: predicting the types of all nodes in the first network structure graph based on the labeled node types and connections between nodes using a label propagation method to obtain a second network structure graph; wherein the structure of the second network structure graph is the same as that of the first network structure graph, but the types of some nodes in the second network structure graph are different from the corresponding node types in the first network structure graph. The two nodes connecting the first edge in the first network structure graph are merged to obtain a fourth network structure graph, where the first edge is any edge in the first network structure graph; based on the labeled node types and connections between nodes in the fourth network structure graph, predicting the types of all nodes in the fourth network structure graph using a label propagation method to obtain a third network structure graph.

[0016] In this scheme, the label propagation method is used to predict the type of the network structure graph, realize information propagation in the network structure graph, and obtain the network structure graph after performing information propagation. This is to determine the difference in information propagation after simplifying the edges of the network structure graph, thereby realizing the simplification sensitivity of each edge in the network structure graph.

[0017] In one possible implementation, the above method further includes: obtaining a network structure original graph, which includes multiple nodes and multiple edges, and each edge in the network structure original graph is used to connect two nodes with a connection relationship, and the nodes in the network structure original graph are labeled with corresponding types; then, based on the labeled node types in the network structure original graph, predicting the type of all nodes in the network structure original graph; secondly, based on the predicted node types in the network structure original graph, extracting multiple subgraphs from the network structure original graph, wherein the predicted types of nodes in each of the multiple subgraphs are the same; wherein, the first network structure graph is a subgraph to be simplified among the multiple subgraphs.

[0018] In this scheme, when the original network structure graph is large, subgraph extraction is performed on the original network structure graph based on the structure and node type information in the original network structure graph. This can effectively reduce the size of the original network structure graph while preserving the information of the original network structure graph.

[0019] In one possible implementation, different subgraphs in multiple subgraphs include some of the same nodes.

[0020] In this scheme, by ensuring that there are duplicate nodes between different extracted subgraphs during the subgraph extraction process, the loss of interaction information caused by subgraph extraction can be effectively reduced, and the influence of the original graph structure of the segmented network can be minimized as much as possible, thereby ensuring the performance of the graph neural network trained subsequently.

[0021] In one possible implementation, based on the node types predicted in the original network structure graph, multiple subgraphs are extracted from the original network structure graph. This includes: determining the multiple nodes with the highest probabilities for each type based on the probabilities predicted in the original network structure graph to obtain multiple sets of nodes. Each set of nodes corresponds to a different type, and each set of nodes includes multiple nodes. Then, multiple subgraphs are constructed based on the multiple sets of nodes, where each subgraph consists of a set of nodes from the multiple sets of nodes.

[0022] In one possible implementation, a simplified first network structure graph is used to train the graph neural network.

[0023] A second aspect of this application provides a graph processing apparatus, comprising: an acquisition unit, configured to acquire a first network structure graph, the first network structure graph including multiple nodes and multiple edges, each edge connecting two nodes with a connection relationship, the nodes in the first network structure graph being labeled with corresponding types; the acquisition unit further configured to acquire a simplification sensitivity of each edge in the first network structure graph, the simplification sensitivity indicating the degree of difference between the types of nodes in a second network structure graph and the types of nodes in a third network structure graph, the second network structure graph being obtained by predicting the types of all nodes in the first network structure graph based on the labeled node types, the third network structure graph being obtained by predicting the types of all nodes in the fourth network structure graph based on the labeled node types, the fourth network structure graph being obtained by merging two nodes connected to the same edge in the first network structure graph; and a processing unit configured to simplify multiple target edges in the first network structure graph according to the simplification sensitivity of each edge in the first network structure graph, to obtain a simplified first network structure graph.

[0024] In one possible implementation, simplification sensitivity is also used to indicate the differences between the structures of the second and third network structure graphs.

[0025] In one possible implementation, the target edges are the edges with the lowest simplification sensitivity in the first network structure graph, where the simplification sensitivity is positively correlated with the degree of difference between the types of nodes in the second network structure graph and the types of nodes in the third network structure graph.

[0026] In one possible implementation, the processing unit is specifically used to: simplify the edge with the lowest simplification sensitivity in the first network structure graph based on the simplification sensitivity of each edge in the first network structure graph, to obtain an updated first network structure graph; perform multiple updates on the updated first network structure graph to obtain a simplified first network structure graph; wherein each update process on the updated first network structure graph includes simplifying the edge with the lowest simplification sensitivity in the first network structure graph obtained from the previous update.

[0027] In one possible implementation, the processing unit is further configured to: predict the type of all nodes in the first network structure graph based on the labeled node types and the connection relationships between nodes in the first network structure graph, thereby obtaining a second network structure graph; merge the two nodes connected by the first edge in the first network structure graph to obtain a fourth network structure graph, wherein the first edge is any edge in the first network structure graph; and predict the type of all nodes in the fourth network structure graph based on the labeled node types and the connection relationships between nodes in the fourth network structure graph, thereby obtaining a third network structure graph.

[0028] In one possible implementation, the acquisition unit is further configured to acquire the original network structure graph, which includes multiple nodes and multiple edges, and each edge in the original network structure graph is used to connect two nodes with a connection relationship. The nodes in the original network structure graph are labeled with corresponding types. The processing unit is further configured to predict the type of all nodes in the original network structure graph based on the labeled node types. The processing unit is further configured to extract multiple subgraphs from the original network structure graph based on the predicted node types in the original network structure graph, wherein the predicted types of nodes in each of the multiple subgraphs are the same. The first network structure graph is a subgraph to be simplified from the multiple subgraphs.

[0029] In one possible implementation, different subgraphs in multiple subgraphs include some of the same nodes.

[0030] In one possible implementation, the processing unit is further configured to: determine the multiple nodes with the highest probability under each type from the original network structure graph based on the predicted probability of nodes belonging to each type, so as to obtain multiple sets of nodes, each set of nodes corresponding to a different type, and each set of nodes including multiple nodes; construct multiple subgraphs based on the multiple sets of nodes, wherein each subgraph in the multiple subgraphs is composed of a set of nodes from the multiple sets of nodes.

[0031] In one possible implementation, a simplified first network structure graph is used to train the graph neural network.

[0032] A third aspect of this application provides an electronic device that may include a processor and a memory coupled together. The memory stores program instructions, which, when executed by the processor, implement the method described in the first aspect or any implementation thereof. For details regarding the steps of the various possible implementations of the first aspect executed by the processor, please refer to the first aspect; further details will not be repeated here.

[0033] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method described in the first aspect or any implementation thereof.

[0034] The fifth aspect of this application provides a circuit system including a processing circuit configured to perform the method described in the first aspect or any implementation thereof.

[0035] The sixth aspect of this application provides a computer program product that, when run on a computer, causes the computer to perform the method described in the first aspect or any implementation thereof.

[0036] A seventh aspect of this application provides a chip system including a processor for supporting a server or threshold acquisition device in implementing the functions involved in the first aspect or any implementation thereof, such as transmitting or processing data and / or information involved in the above methods. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the server or communication device. This chip system may be composed of chips or may include chips and other discrete devices.

[0037] The beneficial effects of the second to seventh aspects mentioned above can be referred to the introduction of the first aspect above, and will not be repeated here. Attached Figure Description

[0038] Figure 1 A schematic diagram of a network structure provided in an embodiment of this application;

[0039] Figure 2 A simplified schematic diagram provided for an embodiment of this application;

[0040] Figure 3 A schematic flowchart of an image processing method provided in an embodiment of this application;

[0041] Figure 4 A schematic diagram illustrating a method for obtaining the simplified sensitivity of edges in a first network structure graph, provided as an embodiment of this application;

[0042] Figure 5 This is a schematic diagram illustrating the extraction of multiple subgraphs from the original network structure graph, as provided in an embodiment of this application.

[0043] Figure 6 This is a schematic diagram illustrating another method for extracting multiple subgraphs from the original network structure graph, as provided in an embodiment of this application.

[0044] Figure 7 A schematic flowchart of an image processing method provided in an embodiment of this application;

[0045] Figure 8 A schematic diagram of an image processing procedure provided in an embodiment of this application;

[0046] Figure 9 A flowchart illustrating the processing of a product network diagram is provided as an embodiment of this application.

[0047] Figure 10 A schematic diagram of a construction subgraph provided in an embodiment of this application;

[0048] Figure 11 A schematic diagram of an edge-based simplified sensitivity subgraph provided in an embodiment of this application;

[0049] Figure 12 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application;

[0050] Figure 13 A schematic diagram of the structure of the execution device provided in the embodiments of this application;

[0051] Figure 14 A schematic diagram of the structure of a chip provided in an embodiment of this application;

[0052] Figure 15 This is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0053] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0054] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0055] For ease of understanding, the technical terms involved in the embodiments of this application will be introduced below.

[0056] Network diagram: A network diagram is a graphical representation of a network, typically composed of nodes and edges. Generally, a network diagram includes multiple nodes, each representing a different entity, and related nodes are connected by edges. For example... Figure 1 As shown, Figure 1 This is a schematic diagram of a network structure provided in an embodiment of this application.

[0057] For example, when a network structure graph is used to describe a product network, each node in the graph can represent a different product, and nodes corresponding to products that have been jointly purchased are connected by an edge. Furthermore, in some cases, nodes in the network structure graph also have corresponding label information to indicate the type of the node. For instance, when a network structure graph is used to describe a product network, the types of nodes in the graph can be daily necessities, clothing, home appliances, food, and cosmetics, etc.

[0058] Graph simplification: Graph simplification refers to simplifying some nodes and edges in the original network structure graph to obtain a smaller network structure graph. Specifically, in the graph simplification process, two connected nodes are merged into one node, while retaining the connections between the merged node and its other neighbors, thereby simplifying the nodes and edges. For an example, please refer to [link to example graph simplification]. Figure 2 , Figure 2 This is a simplified schematic diagram provided for an embodiment of this application. For example... Figure 2 As shown, in the original network structure graph, nodes 1 and 2 on the lower right are nodes to be simplified, and there is an edge connecting nodes 1 and 2. Furthermore, nodes 1 are connected to nodes 3 and 4, and nodes 2 are connected to nodes 5. During the simplification process, nodes 1 and 2 are merged to obtain a new node A. Node A retains the connections between nodes 1 and 2 and their other neighbors; that is, node A is connected to nodes 3, 4, and 5 respectively. Figure 2 As can be seen, after simplifying the original network structure diagram, the simplified network structure diagram has one less node and one less edge compared to the original network structure diagram.

[0059] Graph Neural Networks (GNNs) are neural network models that use neural networks to learn graph-structured data. They extract and discover features and patterns within the graph-structured data to meet the needs of graph learning tasks such as clustering, classification, prediction, segmentation, and generation. Simply put, a GNN is a framework that uses deep learning to directly learn from graph-structured data. GNNs transform graph-structured data into a standardized representation by establishing specific strategies for nodes and edges in the network structure graph. This representation is then fed into various neural networks for training to perform tasks such as node classification, edge information propagation, and graph clustering.

[0060] Kullback-Leibler divergence (KL divergence): KL divergence, often referred to as relative entropy or information divergence, is an asymmetric measure of the difference between two probability distributions. In information theory, KL divergence is equivalent to the difference in information entropy between the two probability distributions.

[0061] Euclidean distance: Also known as the Euclidean metric, Euclidean distance is a commonly used definition of distance, referring to the true distance between two points in m-dimensional space, or the natural length of a vector. In two-dimensional and three-dimensional space, Euclidean distance is simply the actual distance between two points.

[0062] Label propagation methods, also known as label propagation algorithms (LPA), are graph-based semi-supervised learning methods. The basic idea is to use the label information of labeled nodes to predict the label information of unlabeled nodes. A complete graph model is built using the relationships between samples. In this model, nodes include both labeled and unlabeled data, and edges represent the similarity between two nodes. A node's label is propagated to other nodes according to their similarity. Labeled data acts as a source, labeling unlabeled data; the greater the similarity between nodes, the easier it is for the label to propagate. Traditional label propagation algorithms are the earliest label-based algorithms and form the foundation of all label-based algorithms. Besides traditional label propagation algorithms, current label propagation methods include improved versions such as COPRA and SLPA. COPRA is a community detection algorithm based on label propagation, with its biggest improvement being its ability to detect overlapping communities. SLPA is a community monitoring algorithm, an extension of label propagation algorithms.

[0063] The graph processing method provided in this application can be applied to process network structure graphs to reduce the size of the network structure graph, so that the graph neural network can be trained using a smaller network structure graph. The graph neural network trained using the network structure graph can be, for example, a task for classifying nodes in the network structure graph or a task for predicting connections between nodes. This embodiment does not limit the tasks performed by the graph neural network.

[0064] For example, the network structure graphs involved in the embodiments of this application can be network structure graphs constructed in various scenarios. For instance, when a graph neural network trained based on a network structure graph is used to perform a node classification task, the network structure graph can be a product network graph constructed in a product management scenario to indicate the relationships between various types of products; the network structure graph can also be a user transaction network graph constructed in a financial transaction scenario to indicate the relationships between users of various risk types; the network structure graph can also be a protein interaction network graph in a biological research scenario to indicate the relationships between proteins of various attributes. As another example, when a graph neural network is used to perform a task of predicting connections between nodes, the network structure graph can be a device network graph constructed in a data communication scenario to indicate the connection relationships between various types of communication devices; the network structure graph can also be a social network graph constructed in a social recommendation scenario to indicate the friend relationships between users.

[0065] Taking product management as an example, with the rise of the Internet of Things and the rapid development of e-commerce, online shopping has become an indispensable part of human life. In online shopping scenarios, effective classification and retrieval of products based on their characteristic information and the relationships between them has significant application value. In a product network graph, each node represents a product, and products that have been jointly purchased by the same user are linked by an edge. The type of each product is a keyword description. The task performed by the graph neural network is to predict the labels of unlabeled products based on the product connections, known partial product labels, and product attributes, thereby better classifying and managing products to facilitate product recommendations and user queries.

[0066] Taking social recommendation as an example, with the development of network communication technology, most users typically establish friendships and connect with other users online through social media. In this scenario, social media platforms often need to leverage the relationships between users who have already established friendships to recommend other users that the user might be interested in, or users who might be the user's friends in real life. In a social network graph, each node represents a user, and there is an edge connecting users who have already established friendships. Each user's attributes are keyword descriptions of the user. The task performed by graph neural networks is to predict the possible connections between users based on their connections and the known attributes of some users, in order to recommend other users that the user might be interested in.

[0067] Specifically, the graph processing method provided in this application embodiment can be applied to electronic devices. The electronic device applying the graph processing method and the electronic device training based on the graph obtained by the graph processing method can be different electronic devices or the same electronic device; no specific limitation is made here.

[0068] For example, electronic devices that apply graph processing methods may be servers, wireless electronic devices in industrial control, mobile phones, personal computers (PCs), laptops, wireless electronic devices in self-driving vehicles, wireless electronic devices in smart grids, wireless electronic devices in logistics warehousing, wireless electronic devices in transportation safety, wireless electronic devices in smart cities, etc.

[0069] The above describes the scenarios and devices in which the graph processing method provided in the embodiments of this application is applied. The specific flow of the graph processing method provided in the embodiments of this application will be described below. Please refer to... Figure 3 , Figure 3 This is a schematic flowchart illustrating an image processing method provided in an embodiment of this application. Figure 3 As shown, the image processing method specifically includes the following steps 301-303.

[0070] Step 301: Obtain the first network structure graph, which includes multiple nodes and multiple edges. Each edge is used to connect two nodes with a connection relationship. The nodes in the first network structure graph are labeled with their corresponding types.

[0071] In this embodiment, the first network structure graph can be a network structure graph constructed in any of the above-mentioned scenarios, such as a product network graph in a product management scenario, or a social network graph in a social recommendation scenario. The specific form of the first network structure graph is not limited here. The first network structure graph includes multiple nodes, with different nodes representing different things. Furthermore, any node in the first network structure graph is connected to one or more other nodes through edges.

[0072] Optionally, the first network structure graph may only have some nodes labeled with the corresponding type. For example, in the case of a product network graph, some nodes in the product network graph are labeled with the corresponding product type, while other nodes in the product network graph are not labeled with the corresponding product type. Alternatively, all nodes in the first network structure graph may be labeled with the corresponding type. For example, in the case of a product network graph, all nodes in the product network graph are labeled with the corresponding product type.

[0073] Furthermore, nodes in the first network structure graph can be labeled with only one type, and the type labeled by the node is the type corresponding to the node in the first network structure graph. For example, in the case of a product network graph, nodes in the product network graph can be labeled with any one of the types such as clothing, food, daily necessities, or cosmetics. Nodes in the first network structure graph can be labeled with multiple types and the probability of the node belonging to each of the multiple types, and the type with the highest probability is taken as the type corresponding to the node. For example, a node in the product network graph can be labeled with the probabilities of belonging to the four types of clothing, food, daily necessities, and cosmetics as [0.1, 0.2, 0.5, 0.2], and the type corresponding to this node is daily necessities.

[0074] Step 302: Obtain the simplification sensitivity of each edge in the first network structure graph. The simplification sensitivity is used to indicate the degree of difference between the types of nodes in the second network structure graph and the types of nodes in the third network structure graph. The second network structure graph is obtained by predicting the types of all nodes in the first network structure graph based on the labeled node types in the first network structure graph. The third network structure graph is obtained by predicting the types of all nodes in the fourth network structure graph based on the labeled node types in the fourth network structure graph. The fourth network structure graph is obtained by merging two nodes connected to the same side in the first network structure graph.

[0075] In this embodiment, the sensitivity of edge simplification is determined by comparing the difference between the second network structure graph obtained after information propagation of the first network structure graph and the third network structure graph obtained after edge simplification of the first network structure graph and subsequent information propagation. Specifically, performing information propagation on the network structure graph refers to predicting the information of all nodes in the network structure graph based on the original node information and the connections between nodes.

[0076] In simple terms, this embodiment measures the impact of simplifying an edge in the first network structure graph on information propagation in the network structure graph by using the simplification sensitivity of the edges. The higher the simplification sensitivity, the greater the impact on information propagation after simplifying that edge in the first network structure graph, and therefore the greater the difference between the types of nodes in the second and third network structure graphs. Conversely, the lower the simplification sensitivity, the smaller the impact on information propagation after simplifying that edge in the first network structure graph, and therefore the smaller the difference between the types of nodes in the second and third network structure graphs. In other words, simplification sensitivity is positively correlated with the degree of difference between the types of nodes in the second and third network structure graphs. The greater the difference between the types of nodes in the second and third network structure graphs, the higher the simplification sensitivity; conversely, the smaller the difference between the types of nodes in the second and third network structure graphs, the lower the simplification sensitivity.

[0077] Optionally, simplification sensitivity is also used to indicate the differences between the structures of the second and third network structure graphs. That is, simplification sensitivity simultaneously indicates the differences in structure and node types between the two network structure graphs.

[0078] Specifically, based on the node types already marked in the first network structure graph and the connection relationships between each node, the type corresponding to all nodes in the first network structure graph can be predicted, thus obtaining the second network structure graph. The node connection relationships in the second network structure graph are the same as those in the first network structure graph, but the types corresponding to the nodes in the second network structure graph are all predicted based on the existing node types in the first network structure graph.

[0079] Furthermore, by simplifying a certain edge in the first network structure graph—that is, merging the two nodes connecting that edge—a fourth network structure graph is obtained. This fourth network structure graph has one fewer node and one fewer edge than the first network structure graph. Similarly, after performing the aforementioned information propagation on the simplified fourth network structure graph, a third network structure graph with re-predicted node types can be obtained.

[0080] After obtaining the second and third network structure graphs, this embodiment can determine the degree of difference between the second and third network structure graphs based on the node connection relationships and node types in the network structure graphs to obtain the simplification sensitivity. That is, the simplification sensitivity obtained based on the second and third network structure graphs is related to the node connection relationships and node types in these two network structure graphs. For example, in this embodiment, the degree of difference between the second and third network structure graphs can be calculated using the KL divergence function or the Euclidean distance metric function to obtain the simplification sensitivity. This embodiment does not limit the specific method for calculating the degree of difference between the two network structure graphs.

[0081] Step 303: Based on the simplification sensitivity of each edge in the first network structure graph, simplify multiple target edges in the first network structure graph to obtain the simplified first network structure graph.

[0082] After determining the simplification sensitivity of each edge in the first network structure graph, the impact of each edge on information propagation can be determined. Therefore, edges with lower simplification sensitivity (those with less impact on information propagation) are selected for simplification to minimize the impact of simplified edges on the first network structure graph. Optionally, after obtaining the simplified first network structure graph, this embodiment uses the simplified first network structure graph to train the graph neural network.

[0083] In this embodiment, the simplification sensitivity of each edge in the network structure graph is calculated to determine the impact of simplifying each edge on information propagation within the network structure graph. Edges with minimal impact on information propagation are then selected for simplification, thus reducing the information loss caused by the reduction in network structure graph size. Since the graph neural network trained using the simplified network structure graph is essentially an information propagation process during training—that is, predicting global connections or node features based on the original network structure graph's connections and node features—this approach simplifies the network structure graph based on edge simplification sensitivity, preserving as much information as possible and ensuring the training effect of the graph neural network.

[0084] To facilitate understanding, the following will describe in detail, with reference to the accompanying drawings, the specific process of obtaining the simplification sensitivity of the edges in the first network structure graph in step 302 and the simplification of multiple target edges in step 303.

[0085] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating a method for obtaining simplified sensitivity of edges in a first network structure graph, as provided in an embodiment of this application. Figure 4As shown, step 302 above includes the following steps 3021-3024.

[0086] Step 3021: Based on the labeled node types and the connection relationships between nodes in the first network structure graph, predict the types of all nodes in the first network structure graph using the label propagation method to obtain the second network structure graph.

[0087] like Figure 4 As shown, the first network structure graph includes nodes 1-7. Solid nodes 1, 2, 4, and 5 are nodes with labeled types, while hollow nodes 3, 6, and 7 are nodes without labeled types. Based on the connections between nodes in the first network structure graph and the types corresponding to the labeled nodes, the types of nodes 3, 6, and 7 are predicted using a label propagation method, thus obtaining the second network structure graph. In the second network structure graph, all nodes are labeled with their corresponding types.

[0088] It is worth noting that, Figure 4 The diagram illustrates predicting the type of all nodes in the first network structure graph based on nodes already labeled with types. Alternatively, if all nodes in the first network structure graph are already labeled with types, the type of all nodes in the first network structure graph can be re-predicted using a label propagation method.

[0089] For example, the tag propagation method involved in this embodiment can be a traditional tag propagation method, or an algorithm such as the COPRA algorithm and the SLPA algorithm. This embodiment does not specifically limit it.

[0090] Step 3022: Merge the two nodes connecting the first edge in the first network structure graph to obtain the fourth network structure graph, where the first edge is any edge in the first network structure graph.

[0091] like Figure 4 As shown, the edge connecting node 6 and node 7 in the first network structure graph is the first edge. By merging node 6 and node 7 in the first network structure graph, a new node A is obtained, and the first edge connecting node 6 and node 7 is simplified.

[0092] Step 3023: Based on the labeled node types and the connection relationships between nodes in the fourth network structure graph, predict the types of all nodes in the fourth network structure graph using the label propagation method to obtain the third network structure graph.

[0093] In this embodiment, step 3023 is similar to step 3021 described above. After obtaining the fourth network structure graph after simplifying the first network structure graph, the type of all nodes in the fourth network structure graph is predicted based on the same label propagation method. For example... Figure 4 As shown, based on the connection relationships between nodes in the fourth network structure graph and the types corresponding to the labeled nodes, the types of nodes 3 and A are predicted using the label propagation method, thus obtaining the third network structure graph. In the third network structure graph, all nodes are labeled with their corresponding types.

[0094] Step 3024: Calculate the degree of difference between the second network structure diagram and the third network structure diagram to obtain the simplification sensitivity corresponding to the first side.

[0095] It should be noted that steps 3021-3024 above describe the process of obtaining the simplification sensitivity corresponding to a certain edge (i.e., the first edge) in the first network structure graph. In practical applications, the running device can calculate the simplification sensitivity of each edge in the first network structure graph by executing steps 3021-3024 above multiple times, which will not be elaborated here.

[0096] Optionally, in step 303 above, there are several ways to select the multiple target edges that need to be simplified.

[0097] Implementation Method 1: The multiple target edges are the edges with the lowest simplification sensitivity in the first network structure graph.

[0098] In implementation method 1, for each edge in the first network structure graph, the electronic device calculates the simplification sensitivity of each edge only once. After calculating the simplification sensitivity of each edge in the first network structure graph, the electronic device determines the multiple edges with the lowest simplification sensitivity as the multiple target edges to be simplified, and then simplifies these multiple target edges one by one.

[0099] The number of target edges to be simplified can be determined based on the size and simplification level of the first network structure graph. For example, if the first network structure graph includes 10,000 nodes and the simplification level is 50%, the number of nodes and edges to be simplified in the first network structure graph is 5,000, and the number of nodes remaining after simplification is also 5,000.

[0100] Implementation method 2 involves updating the first network structure graph multiple times. Each update simplifies the edge with the lowest simplification sensitivity, and after each update, the edge with the lowest simplification sensitivity is redefined.

[0101] Specifically, after calculating the simplification sensitivity of each edge in the first network structure graph, the electronic device simplifies the edge with the lowest simplification sensitivity in the first network structure graph based on the simplification sensitivity of each edge, thus obtaining an updated first network structure graph. Then, the electronic device performs multiple updates on the updated first network structure graph to obtain a simplified first network structure graph. Each update process of the electronic device on the updated first network structure graph includes simplifying the edge with the lowest simplification sensitivity obtained in the previous update.

[0102] In simple terms, during the simplification of the first network structure graph, the electronic device iteratively executes the following steps: [determine the edge with the lowest simplification sensitivity in the current network structure graph → simplify the edge with the lowest simplification sensitivity → determine the edge with the lowest simplification sensitivity in the network structure graph after simplifying one edge → simplify the edge with the lowest simplification sensitivity → simplify the edge with the lowest simplification sensitivity…], until the number of simplified edges in the first network structure graph reaches the termination condition.

[0103] It's understandable that simplifying an edge in the network graph results in a new merged node, and the type information of this new merged node may change. Therefore, simplifying one edge can alter the simplification sensitivity of other edges in the network graph, potentially changing the order of simplification sensitivity. Thus, by re-identifying the edge with the lowest simplification sensitivity after each simplification of an edge in the first network graph, we can ensure that each simplification selects the edge with the lowest actual simplification sensitivity, guaranteeing the effectiveness of the simplification.

[0104] Optionally, since simplifying an edge in the network graph usually only significantly affects the simplification sensitivity of edges near the merging node, while the impact on the simplification sensitivity of most other edges is minimal, the electronic device can simply recalculate the simplification sensitivity of edges near the merging node (e.g., edges connected to or adjacent to the merging node) after simplifying an edge in the first network graph, instead of recalculating the simplification sensitivity of all edges in the entire first network graph, thus improving computational efficiency.

[0105] The above describes reducing the size of a network structure graph by simplifying its edges. However, in cases where the network structure graph is particularly large, simply simplifying the edges may not be sufficient to effectively reduce its size. Therefore, this embodiment provides another method for reducing the size of the network structure graph, building upon steps 301-303 above, to achieve effective reduction through two different approaches.

[0106] For example, before the electronic device performs steps 301-303 as described above, the electronic device may first perform the following multiple steps.

[0107] First, the electronic device acquires the original network structure graph, which includes multiple nodes and multiple edges. Each edge in the original network structure graph is used to connect two nodes with a connection relationship. The nodes in the original network structure graph are labeled with their corresponding types.

[0108] In this embodiment, the original network structure graph acquired by the electronic device is larger than the first network structure graph described above; that is, the original network structure graph includes more nodes and more edges than the first network structure graph. Furthermore, the original network structure graph may have only some nodes labeled with the corresponding type, or all nodes may be labeled with the corresponding type.

[0109] Then, based on the node types already labeled in the original network structure graph, the types of all nodes in the original network structure graph are predicted.

[0110] In this embodiment, the electronic device can predict the types of all nodes in the original network structure graph based on the labeled node types in the original network structure graph using the tag propagation method described above. The method for predicting the types of all nodes in the original network structure graph is the same as the method for predicting the second network structure graph described in the above embodiments; for details, please refer to the above embodiments, which will not be repeated here.

[0111] Secondly, the electronic device extracts multiple subgraphs from the original network structure graph based on the predicted node types in the original graph. The nodes in each of these subgraphs are predicted to be of the same type.

[0112] For example, if the nodes in the original network structure graph correspond to three different types, the electronic device can extract three subgraphs from the original network structure graph. In each subgraph, the nodes are predicted to belong to the same type in the original network structure graph; that is, the nodes in the three subgraphs correspond to three different types. Each subgraph extracted from the original network structure graph is smaller in size than the original graph, and the connections between nodes in each subgraph remain unchanged compared to the original graph.

[0113] For example, please refer to Figure 5 , Figure 5 This is a schematic diagram illustrating the extraction of multiple sub-graphs from the original network structure graph, as provided in an embodiment of this application. Figure 5 As shown, the original network structure graph includes 9 nodes, numbered 1 through 9. Furthermore, in the original network structure graph, nodes 1 through 5 are predicted to be of type 1, and nodes 6 through 9 are predicted to be of type 2. Therefore, based on the predicted node types in the original network structure graph, the original network structure graph can be extracted into two subgraphs, one containing nodes 1 through 5. Figure 1 and its sub-nodes, including nodes 6 through 9. Figure 2 .

[0114] Specifically, the electronic device can determine the multiple nodes with the highest probabilities for each type from the original network structure graph based on the predicted probabilities of nodes belonging to each type, thus obtaining multiple sets of nodes. Each set of nodes corresponds to a different type, and each set includes multiple nodes. Then, the electronic device constructs multiple subgraphs based on these multiple sets of nodes, where each subgraph consists of one set of nodes from the multiple sets of nodes.

[0115] For example, suppose the original network structure graph contains 3000 nodes, and there are three types corresponding to the nodes in the original network structure graph: clothing, food, and daily necessities. The electronic device first predicts the probability that each of the 3000 nodes in the original network structure graph belongs to each of these types. Then, the electronic device selects the 1000 nodes with the highest probability of belonging to the clothing type, the 1000 nodes with the highest probability of belonging to the food type, and the 1000 nodes with the highest probability of belonging to the daily necessities type from the 3000 nodes. Finally, the electronic device constructs a sub-system based on the 1000 nodes with the highest probability of belonging to the clothing type. Figure 1 A sub-system is constructed based on the 1000 nodes with the highest probability of belonging to the food type. Figure 2 A sub-structure is constructed based on the 1000 nodes with the highest probability of belonging to the daily necessities category. Figure 3 .

[0116] Furthermore, after extracting multiple subgraphs from the original network structure graph, the electronic device can determine which subgraphs require further simplification. The first network structure graph mentioned above is one of the subgraphs that needs simplification.

[0117] Optionally, when extracting subgraphs based on the predicted probability of each node's type in the original network structure graph, the electronic device can extract subgraphs based on a pre-set number of nodes, thus ensuring that the extracted subgraphs include a specific number of nodes. If the pre-set number of nodes is large, different subgraphs extracted by the electronic device may contain some identical nodes.

[0118] For example, taking a network structure graph containing 3000 nodes as an example, assume that the types corresponding to the nodes in the original network structure graph are decorations, food, and daily necessities. After predicting the probability of each node belonging to each of the above types among the 3000 nodes in the original network structure graph, the electronic device selects the 1500 nodes with the highest probability of belonging to the decoration type, the 1500 nodes with the highest probability of belonging to the food type, and the 1500 nodes with the highest probability of belonging to the daily necessities type from the 3000 nodes. Finally, the electronic device constructs a sub-system based on the 1500 nodes with the highest probability of belonging to the decoration type. Figure 1 A sub-system is constructed based on the 1500 nodes with the highest probability of belonging to the food type. Figure 2 A sub-class is constructed based on the 1500 nodes with the highest probability of belonging to the daily necessities category. Figure 3 This approach ensures that the three subgraphs share some nodes, minimizing the loss of interactive information caused by the original graph segmentation. For example, a lighter with a unique design could be categorized as either a daily necessity or a decorative item. Extracting only the node corresponding to the lighter's type into a single subgraph might result in information loss regarding the lighter's multiple classifications; however, extracting the node corresponding to the decorative item type into a separate subgraph would mitigate this risk. Figure 1 And subcategories corresponding to daily necessities Figure 2 In this way, information about whether a lighter belongs to multiple types can be retained.

[0119] For example, please refer to Figure 6 , Figure 6 This is another schematic diagram illustrating the extraction of multiple subgraphs from the original network structure graph, as provided in an embodiment of this application. For example... Figure 6 As shown, Figure 6 The original network structure diagram and Figure 5 Similarly, the original network structure graph includes 9 nodes, numbered 1 through 9. Furthermore, in the original network structure graph, the 6 nodes with the highest probability of being predicted as type 1 are nodes 1 through 6, and the 6 nodes with the highest probability of being predicted as type 2 are nodes 4 through 9. Therefore, based on the predicted node types in the original network structure graph, the original network structure graph can be extracted into two subgraphs, one containing nodes 1 through 6. Figure 1 and its sub-nodes, including nodes 4 through 9. Figure 2 Among them, sub Figure 1 Kazuko Figure 2 The identical nodes included in the text are nodes 4 through 6.

[0120] In this scheme, by ensuring that there are duplicate nodes between different extracted subgraphs during the subgraph extraction process, the loss of interaction information caused by subgraph extraction can be effectively reduced, and the influence of the original graph structure of the segmented network can be minimized as much as possible, thereby ensuring the performance of the graph neural network trained subsequently.

[0121] The above describes the execution process of the graph processing method provided in the embodiments of this application. For ease of understanding, the graph processing method provided in the embodiments of this application will be described in detail below with examples.

[0122] Please see Figure 7 , Figure 7 This is a schematic flowchart illustrating an image processing method provided in an embodiment of this application. Figure 7 As shown, in this embodiment, the graph processing method mainly includes three steps: graph decomposition, graph simplification, and graph network training. Graph decomposition refers to decomposing the original graph of the network structure into multiple subgraphs. Graph simplification refers to simplifying the multiple subgraphs obtained from the decomposition to obtain simplified subgraphs. Graph network training refers to using the simplified subgraphs as training data for the graph neural network to perform training. Figure 8 As shown, Figure 8 This is a schematic diagram illustrating an image processing procedure provided in an embodiment of this application. Figure 8 In this process, a large original network structure is transformed into multiple smaller subgraphs through graph decomposition and graph simplification. These subgraphs are then used as training data for the graph neural network to achieve its training.

[0123] In this embodiment, the main goal of the graph processing method is to reduce the difficulty of model training by utilizing graph decomposition and graph simplification techniques, enabling learning on large-scale graph datasets to meet the needs of real-world scenarios. The following description will use product type prediction in a product network as an example.

[0124] Specifically, in a product network, each node represents a type of product. Products that have been jointly purchased are linked by an edge, and each product's attributes are its keyword descriptions. The goal of a graph neural network is to predict the labels of labeled products based on the product connections, known partial product labels, and product attributes, thereby improving product classification and management, facilitating product recommendations and user queries. Assume the graph data in the product network is represented by G = (V, E, X, Y), where V represents the vertex set, E represents the edge set, X represents the feature matrix, the i-th row of X represents the feature of the i-th node in the vertex set, and Y represents the label information of each node (i.e., the node type mentioned above). It is important to note that in many real-world scenarios, the labels and features of some nodes are unknown. Taking a publicly available product network dataset (ogb-products) as an example, the statistics of this product network dataset are shown in Table 1.

[0125] Table 1

[0126] Data Name Number of nodes Number of edges Feature Dimension Node type Product Network 2,449,029 61,859,076 100 47

[0127] Please see Figure 9 , Figure 9 This is a schematic flowchart illustrating the processing of a product network diagram, provided as an embodiment of this application. Figure 9 As shown, the process for processing the product network diagram includes the following steps 901-905.

[0128] Step 901: Perform node information propagation in the product network graph.

[0129] In the scenario of product attribute prediction, the category label of most nodes is unknown (i.e., the type of some products is unknown). Therefore, in this step, the label propagation method is first used to propagate node information in the product network graph and calculate the probability that each node v belongs to each type t.

[0130] Step 902, subgraph extraction.

[0131] After predicting the probability of each node belonging to various types in the product network graph, for each type t, the k nodes with the highest probability values ​​are selected to form a new subgraph. This makes it more likely that nodes of the same type will appear in the same subgraph. Generally, the type corresponding to a node refers to the type with the highest probability of belonging to that type. When the value of k is large, for a subgraph corresponding to a certain type, even if the type corresponding to node u in that subgraph is not the type of the subgraph, that node still has a high correlation with that type label. For example, if the probabilities of a node belonging to the three types are [0.5, 0.4, 0.1], that node is very likely to appear simultaneously in the subgraph corresponding to type 1 and the subgraph corresponding to type 2.

[0132] Furthermore, for some datasets, the number of nodes of different types is extremely unbalanced, and some types may have very few nodes. In such datasets, it is difficult to construct subgraphs of the same size based on each type. Therefore, in this case, for multiple types with a small number of nodes, it is advisable to merge the nodes of each type into a subgraph of the same size.

[0133] Please see Figure 10 , Figure 10 This is a schematic diagram of a construction subgraph provided in an embodiment of this application. For example... Figure 10 As shown, steps 901-902 above are steps for implementing graph decomposition, which can decompose a large graph into multiple smaller subgraphs.

[0134] Step 903: Calculate the simplification sensitivity of each edge in the subgraph.

[0135] When the number of nodes in the product network graph is too large, even after graph decomposition, the subgraphs may still be too large, thus requiring further simplification. This method simplifies the graph through steps 903-904, reducing the number of nodes in the subgraphs through a series of operations, thereby reducing the size of the subgraphs.

[0136] In step 903, a simplification sensitivity is calculated for each edge based on the structure and type information of the nodes in the subgraph, thereby improving the graph simplification process. Simply put, in the scenario of product category prediction, calculating the simplification sensitivity of edges is actually based on the product type and products that have been jointly purchased. Since measuring the impact of subgraph simplification on graph neural network training is a difficult optimization problem, this step replaces the impact of simplified subgraphs on the graph neural network with the impact of simplified subgraphs on label propagation, and provides a simplification sensitivity metric based on label propagation.

[0137] Specifically, when calculating the simplification sensitivity of each edge in the subgraph, the impact of the simplified edge on the model can be determined by calculating the difference in label propagation before and after simplifying an edge. The specific definition of simplification sensitivity is as follows: for an edge (v... a v b The coarsening sensitivity is Dist(LPA(G), LPA(G')), where Dist is the KL divergence or Euclidean distance metric; LPA(G) represents the graph obtained after performing label propagation on subgraph G, and LPA(G') represents the graph obtained after performing label propagation on simplified subgraph G'.

[0138] Step 904: Simplify the subgraph based on edge simplification sensitivity.

[0139] In this step, a greedy heuristic simplification strategy is used to simplify the subgraph. Specifically, each time, the edge with the lowest simplification sensitivity is selected to simplify the edges in the subgraph, allowing the subgraph G to reach a pre-specified size through continuous edge simplification. After simplifying an edge in the subgraph G, the simplification sensitivity of the edges in the subgraph G can be updated by calculating the simplification sensitivity of all edges or by recalculating the simplification sensitivity of some edges near the already simplified edge.

[0140] Please see Figure 11 , Figure 11 This is a schematic diagram of an edge-based simplified sensitivity subgraph provided in an embodiment of this application. For example... Figure 11 As shown, the subgraph to be simplified includes five nodes and five edges. The simplification sensitivities calculated for each edge using the label propagation method are 0.5, 0.2, 0.5, 0.4, and 0.4, respectively. Clearly, the edge with the lowest simplification sensitivity is 0.2. Therefore, the edge with a simplification sensitivity of 0.2 is simplified (i.e., the two nodes connecting the edge with a simplification sensitivity of 0.2 are merged), thus simplifying the subgraph.

[0141] Step 905: Train a graph neural network based on the simplified subgraph.

[0142] In this step, after obtaining the simplified subgraphs, each simplified subgraph is treated as a batch of data and input into an existing graph neural network for training, in order to obtain a trained graph neural network.

[0143] The above describes in detail the image processing method provided in the embodiments of this application. Next, the device for performing the above method provided in the embodiments of this application will be introduced.

[0144] Please see Figure 12 , Figure 12 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application. Figure 12As shown in the embodiment of this application, a graph processing apparatus includes: an acquisition unit 1201, configured to acquire a first network structure graph, the first network structure graph including multiple nodes and multiple edges, each edge of the multiple edges being used to connect two nodes with a connection relationship, and the nodes in the first network structure graph being labeled with corresponding types; the acquisition unit 1201 is further configured to acquire the simplification sensitivity of each edge in the first network structure graph, the simplification sensitivity being used to indicate the degree of difference between the types of nodes in a second network structure graph and the types of nodes in a third network structure graph, the second network structure graph being obtained by predicting the types of all nodes in the first network structure graph based on the labeled node types in the first network structure graph, the third network structure graph being obtained by predicting the types of all nodes in the fourth network structure graph based on the labeled node types in the fourth network structure graph, the fourth network structure graph being obtained by merging two nodes connected to the same side in the first network structure graph; and a processing unit 1202, configured to simplify multiple target edges in the first network structure graph according to the simplification sensitivity of each edge in the first network structure graph, to obtain a simplified first network structure graph.

[0145] In one possible implementation, simplification sensitivity is also used to indicate the differences between the structures of the second and third network structure graphs.

[0146] In one possible implementation, the multiple target edges are the multiple edges with the lowest simplification sensitivity in the first network structure graph, wherein the simplification sensitivity is positively correlated with the degree of difference between the types of nodes in the second network structure graph and the types of nodes in the third network structure graph.

[0147] In one possible implementation, the processing unit 1202 is specifically configured to: simplify the edge with the lowest simplification sensitivity in the first network structure graph based on the simplification sensitivity of each edge in the first network structure graph, to obtain an updated first network structure graph; perform multiple updates on the updated first network structure graph to obtain the simplified first network structure graph; wherein each update process of the updated first network structure graph includes simplifying the edge with the lowest simplification sensitivity in the first network structure graph obtained in the previous update.

[0148] In one possible implementation, the processing unit 1202 is further configured to: predict the type of all nodes in the first network structure graph based on the labeled node types and the connection relationships between nodes in the first network structure graph, thereby obtaining a second network structure graph; merge the two nodes connected to the first edge in the first network structure graph to obtain the fourth network structure graph, wherein the first edge is any edge in the first network structure graph; and predict the type of all nodes in the fourth network structure graph based on the labeled node types and the connection relationships between nodes in the fourth network structure graph, thereby obtaining the third network structure graph.

[0149] In one possible implementation, the acquisition unit 1201 is further configured to acquire a network structure original graph, which includes multiple nodes and multiple edges. Each edge in the network structure original graph is used to connect two nodes with a connection relationship. The nodes in the network structure original graph are labeled with corresponding types. The processing unit 1202 is further configured to predict the type of all nodes in the network structure original graph based on the labeled node types. The processing unit 1202 is further configured to extract multiple subgraphs from the network structure original graph based on the predicted node types in the network structure original graph. The predicted types of nodes in each of the multiple subgraphs are the same. The first network structure graph is a subgraph to be simplified from the multiple subgraphs.

[0150] In one possible implementation, different subgraphs in the plurality of subgraphs include partially identical nodes.

[0151] In one possible implementation, the processing unit 1202 is further configured to: determine, based on the predicted probability of a node belonging to each type in the original network structure graph, multiple nodes with the highest probability under each type from the original network structure graph to obtain multiple sets of nodes, each set of nodes corresponding to a different type, and each set of nodes including multiple nodes; construct the multiple subgraphs based on the multiple sets of nodes, wherein each subgraph in the multiple subgraphs is composed of a set of nodes from the multiple sets of nodes.

[0152] In one possible implementation, the simplified first network structure graph is used to train a graph neural network.

[0153] Please see Figure 13 , Figure 13This is a schematic diagram of an execution device provided in an embodiment of this application. The execution device 1300 can specifically be a mobile phone, tablet, laptop, smart wearable device, server, etc., and is not limited thereto. Specifically, the execution device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303, and a memory 1304 (wherein the execution device 1300 may have one or more processors 1303). Figure 13 (Taking a processor as an example), processor 1303 may include application processor 13031 and communication processor 13032. In some embodiments of this application, receiver 1301, transmitter 1302, processor 1303 and memory 1304 may be connected via bus or other means.

[0154] Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303. A portion of memory 1304 may also include non-volatile random access memory (NVRAM). Memory 1304 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0155] Processor 1303 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0156] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1303. The processor 1303 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1303 or by instructions in software form. The processor 1303 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1303 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1304. Processor 1303 reads the information in memory 1304 and, in conjunction with its hardware, completes the steps of the above method.

[0157] Receiver 1301 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1302 can be used to output digital or character information through the first interface; transmitter 1302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1302 may also include a display device such as a display screen.

[0158] The electronic device provided in this application embodiment can specifically be a chip, which includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip in the execution device to execute the model hyperparameter selection method described in the above embodiments, or to cause the chip in the training device to execute the model hyperparameter selection method described in the above embodiments. Optionally, the storage unit is a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0159] For details, please refer to Figure 14 , Figure 14 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1400. The NPU 1400 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1403, which is controlled by a controller 1404 to retrieve matrix data from the memory and perform multiplication operations.

[0160] In some implementations, the arithmetic circuit 1403 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1403 is a two-dimensional pulsating array. The arithmetic circuit 1403 can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1403 is a general-purpose matrix processor.

[0161] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1402 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1401 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1408.

[0162] Unified memory 1406 is used to store input and output data. Weight data is directly transferred to weight memory 1402 via Direct Memory Access Controller (DMAC) 1405. Input data is also transferred to unified memory 1406 via DMAC.

[0163] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1409.

[0164] The Bus Interface Unit (BIU) 1414 is used by the instruction fetch memory 1409 to fetch instructions from external memory, and also by the memory access controller 1405 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0165] The DMAC is mainly used to move input data from external memory DDR to unified memory 1406, or to weight data to weight memory 1402, or to input data to input memory 1401.

[0166] The vector computation unit 1407 includes multiple processing units that further process the output of the computation circuit 1403 when needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.

[0167] In some implementations, the vector computation unit 1407 can store the processed output vector in the unified memory 1406. For example, the vector computation unit 1407 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1403, such as performing linear interpolation on feature planes extracted from a convolutional layer, or, for example, accumulating a vector of values ​​to generate activation values. In some implementations, the vector computation unit 1407 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as activation input to the computation circuit 1403, for example, for use in subsequent layers of the neural network.

[0168] The instruction fetch buffer 1409 connected to the controller 1404 is used to store the instructions used by the controller 1404;

[0169] Unified memory 1406, input memory 1401, weighted memory 1402, and instruction fetch memory 1409 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0170] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0171] Please refer to Figure 15 , Figure 15 This is a schematic diagram of a computer-readable storage medium provided in an embodiment of this application. This application also provides a computer-readable storage medium in some embodiments, wherein the above-described... Figure 3 The disclosed method can be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of art.

[0172] Figure 15 A conceptual partial view of an example computer-readable storage medium arranged according to at least some of the embodiments shown herein is illustrated schematically. The example computer-readable storage medium includes a computer program for executing computer processes on a computing device.

[0173] In one embodiment, the computer-readable storage medium 1500 is provided using a signal bearer medium 1501. The signal bearer medium 1501 may include one or more program instructions 1502, which, when executed by one or more processors, can provide the above-mentioned... Figure 6 The described function or part of the function. Therefore, for example, refer to... Figure 6 In the embodiment shown, one or more features of steps 601-604 can be provided by one or more instructions associated with the signal carrying medium 1501. Furthermore, Figure 15 The program instruction 1502 in the document also describes example instructions.

[0174] In some examples, the signal carrying medium 1501 may include a computer-readable medium 1503, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video disc (DVD), a digital magnetic tape, a memory, ROM, or RAM, etc.

[0175] In some embodiments, the signal-bearing medium 1501 may include a computer-recordable medium 1504, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, etc. In some embodiments, the signal-bearing medium 1501 may include a communication medium 1505, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.). Therefore, for example, the signal-bearing medium 1501 may be transmitted by a wireless communication medium 1505 (e.g., a wireless communication medium conforming to the IEEE 802.15 standard or other transmission protocols).

[0176] One or more program instructions 1502 may be, for example, computer-executable instructions or logical implementation instructions. In some examples, the computing device may be configured to provide various operations, functions, or actions in response to one or more program instructions 1502 conveyed to the computing device via a computer-readable medium 1503, a computer-recordable medium 1504, and / or a communication medium 1505.

[0177] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0178] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0179] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0180] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A graph processing method, characterized in that, include: Obtain a first network structure graph, which includes multiple nodes and multiple edges. Each edge is used to connect two nodes with a connection relationship. The nodes in the first network structure graph are labeled with corresponding types. The simplification sensitivity of each edge in the first network structure graph is obtained. The simplification sensitivity is used to indicate the degree of difference between the types of nodes in the second network structure graph and the types of nodes in the third network structure graph. The second network structure graph is obtained by predicting the types of all nodes in the first network structure graph based on the labeled node types in the first network structure graph. The third network structure graph is obtained by predicting the types of all nodes in the fourth network structure graph based on the labeled node types in the fourth network structure graph. The fourth network structure graph is obtained by merging two nodes connected to the same edge in the first network structure graph. Based on the simplification sensitivity of each edge in the first network structure graph, multiple target edges in the first network structure graph are simplified to obtain a simplified first network structure graph.

2. The method according to claim 1, characterized in that, The simplification sensitivity is also used to indicate the differences between the structures of the second network structure graph and the third network structure graph.

3. The method according to claim 1 or 2, characterized in that, The multiple target edges are the edges with the lowest simplification sensitivity in the first network structure graph, and the simplification sensitivity is positively correlated with the degree of difference.

4. The method according to claim 1 or 2, characterized in that, The step of simplifying multiple target edges in the first network structure graph based on the simplification sensitivity of each edge in the first network structure graph includes: Based on the simplification sensitivity of each edge in the first network structure graph, the edge with the lowest simplification sensitivity in the first network structure graph is simplified to obtain the updated first network structure graph. The simplification sensitivity is positively correlated with the degree of difference. The updated first network structure diagram is updated multiple times to obtain the simplified first network structure diagram. Each update process for the updated first network structure graph includes simplifying the edge with the lowest simplification sensitivity in the first network structure graph obtained from the previous update.

5. The method according to claim 1 or 2, characterized in that, The method further includes: Based on the labeled node types and the connection relationships between nodes in the first network structure graph, the type of all nodes in the first network structure graph is predicted by the label propagation method to obtain the second network structure graph. The two nodes connecting the first edge in the first network structure graph are merged to obtain the fourth network structure graph, where the first edge is any edge in the first network structure graph. Based on the labeled node types and the connection relationships between nodes in the fourth network structure graph, the type of all nodes in the fourth network structure graph is predicted by the label propagation method to obtain the third network structure graph.

6. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the original network structure graph, which includes multiple nodes and multiple edges. Each edge in the original network structure graph is used to connect two nodes with a connection relationship. The nodes in the original network structure graph are labeled with corresponding types. Based on the node types already marked in the original network structure graph, predict the types of all nodes in the original network structure graph; Based on the predicted node types in the original network structure graph, multiple subgraphs are extracted from the original network structure graph, and the predicted node types in each of the multiple subgraphs are the same; The first network structure diagram is a subgraph to be simplified from the plurality of subgraphs.

7. The method according to claim 6, characterized in that, Different subgraphs in the multiple subgraphs include some of the same nodes.

8. The method according to claim 6, characterized in that, Based on the node types predicted in the original network structure graph, multiple subgraphs are extracted from the original network structure graph, including: Based on the predicted probability of a node belonging to each type in the original network structure graph, the multiple nodes with the highest probability under each type are determined from the original network structure graph to obtain multiple groups of nodes. Each group of nodes corresponds to a different type, and each group of nodes includes multiple nodes. The plurality of subgraphs are constructed based on the plurality of sets of nodes, wherein each subgraph in the plurality of subgraphs is composed of a set of nodes from the plurality of sets of nodes.

9. The method according to claim 1 or 2, characterized in that, The simplified first network structure diagram is used to train the graph neural network.

10. An image processing apparatus, characterized in that, include: The acquisition unit is used to acquire a first network structure graph, which includes multiple nodes and multiple edges. Each edge in the multiple edges is used to connect two nodes with a connection relationship. The nodes in the first network structure graph are marked with corresponding types. The acquisition unit is further configured to acquire the simplification sensitivity of each edge in the first network structure graph. The simplification sensitivity is used to indicate the degree of difference between the types of nodes in the second network structure graph and the types of nodes in the third network structure graph. The second network structure graph is obtained by predicting the types of all nodes in the first network structure graph based on the labeled node types in the first network structure graph. The third network structure graph is obtained by predicting the types of all nodes in the fourth network structure graph based on the labeled node types in the fourth network structure graph. The fourth network structure graph is obtained by merging two nodes connected to the same side in the first network structure graph. The processing unit is configured to simplify multiple target edges in the first network structure graph based on the simplification sensitivity of each edge in the first network structure graph, thereby obtaining a simplified first network structure graph.

11. The apparatus according to claim 10, characterized in that, The simplification sensitivity is also used to indicate the differences between the structures of the second network structure graph and the third network structure graph.

12. The apparatus according to claim 10 or 11, characterized in that, The multiple target edges are the edges with the lowest simplification sensitivity in the first network structure graph, and the simplification sensitivity is positively correlated with the degree of difference.

13. The apparatus according to claim 10 or 11, characterized in that, The processing unit is specifically used for: Based on the simplification sensitivity of each edge in the first network structure graph, the edge with the lowest simplification sensitivity in the first network structure graph is simplified to obtain the updated first network structure graph. The simplification sensitivity is positively correlated with the degree of difference. The updated first network structure diagram is updated multiple times to obtain the simplified first network structure diagram. Each update process for the updated first network structure graph includes simplifying the edge with the lowest simplification sensitivity in the first network structure graph obtained from the previous update.

14. The apparatus according to claim 10 or 11, characterized in that, The processing unit is also used for: Based on the labeled node types and the connection relationships between nodes in the first network structure graph, the type of all nodes in the first network structure graph is predicted by the label propagation method to obtain the second network structure graph. The two nodes connecting the first edge in the first network structure graph are merged to obtain the fourth network structure graph, where the first edge is any edge in the first network structure graph. Based on the labeled node types and the connection relationships between nodes in the fourth network structure graph, the type of all nodes in the fourth network structure graph is predicted by the label propagation method to obtain the third network structure graph.

15. The apparatus according to claim 10 or 11, characterized in that, The acquisition unit is further configured to acquire the original network structure graph, which includes multiple nodes and multiple edges. Each edge in the original network structure graph is used to connect two nodes with a connection relationship. The nodes in the original network structure graph are marked with corresponding types. The processing unit is further configured to predict the type of all nodes in the original network structure graph based on the node types already marked in the original network structure graph; The processing unit is further configured to extract multiple subgraphs from the original network structure graph based on the predicted node types in the original network structure graph, wherein the predicted node types in each of the multiple subgraphs are the same; The first network structure diagram is a subgraph to be simplified from the plurality of subgraphs.

16. The apparatus according to claim 15, characterized in that, Different subgraphs in the multiple subgraphs include some of the same nodes.

17. The apparatus according to claim 15, characterized in that, The processing unit is further configured to: Based on the predicted probability of a node belonging to each type in the original network structure graph, the multiple nodes with the highest probability under each type are determined from the original network structure graph to obtain multiple groups of nodes. Each group of nodes corresponds to a different type, and each group of nodes includes multiple nodes. The plurality of subgraphs are constructed based on the plurality of sets of nodes, wherein each subgraph in the plurality of subgraphs is composed of a set of nodes from the plurality of sets of nodes.

18. The apparatus according to claim 10 or 11, characterized in that, The simplified first network structure diagram is used to train the graph neural network.

19. An image processing apparatus, characterized in that, The device includes a memory and a processor; the memory stores code, and the processor is configured to execute the code, wherein when the code is executed, the graph processing apparatus performs the method as described in any one of claims 1 to 9.

20. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed by the computer, cause the computer to perform the method according to any one of claims 1 to 9.

21. A computer program product, characterized in that, The computer program product stores instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 9.