Incremental learning methods, related devices, and storage media for graph neural network models
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-08-11
AI Technical Summary
传统的图神经网络模型通常在静态的历史数据上进行训练,在面对动态增量数据集时,面临着难以调和的两难选择:一方面,若对全量数据(历史数据+增量数据)重新进行训练,虽然能够保证模型性能,但会带来极高的计算和存储成本,无法满足实时性处理需求;另一方面,若仅简单微调模型以适应新增数据,则会导致模型快速遗忘已学习的历史知识,即出现“灾难性遗忘”问题,严重影响模型对历史数据相关任务的处理性能,导致图神经网络模型的推理准确度较低
[0013]相较于现有技术,本发明实施例中,获取增量数据集,增量数据集包括新增节点集、新增边集;基于增量数据集从历史快照图的多个历史节点中筛选多个目标边界节点;基于多个目标边界节点、历史快照图以及增量数据集构建知识图谱,生成增量子图,增量子图包括新增节点集中的新增节点、目标边界节点及节点之间的边连接;将增量子图输入增量学习网络,得到增量子图中各个节点的节点新表征;将历史快照图输入原始图神经网络模型,得到多个目标边界节点的节点历史表征,其中,原始图神经网络模型基于历史快照图训练得到;将多个目标边界节点的节点历史表征与增量子图中各个节点的节点新表征融合,得到增量子图中各个节点的最终节点表征;冻结原始图神经网络模型,基于最终节点表征迭代训练增量学习网络,至满足预设停止条件;获取待预测数据集,基于增量学习网络和原始图神经网络模型处理待预测数据集,得到目标节点表征,并基于目标节点表征进行推理,得到目标推理结果。本发明从历史快照图选取多个目标边界节点,然后根据历史快照图筛选的部分节点和新增节点共同构成增量子图,根据增量子图中各个节点的节点新表征和历史快照图中各个目标边界节点的节点历史表征融合得到增量子图中各个节点的最终节点表征,利用最终节点表征迭代更新增量学习网络,通过整合动态子图构建、历史模型冻结及表征融合,解决了动态图数据增量学习中避免全量重训练、防止灾难性遗忘并有效处理图结构动态变化的问题,避免了全量重训练的高计算开销,同时确保了对图结构动态变化的处理能力,能够避免全量重训练的情况下提高图神经网络模型的推理准确度。
Smart Images

Figure CN121581150B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and more specifically to an incremental learning method, related apparatus, and storage medium for a graph neural network model. Background Technology
[0002] Graph Neural Networks (GNNs), as a core technology for processing graph-structured data, have been widely applied in various fields such as social network analysis, recommender systems, and knowledge graphs due to their powerful modeling capabilities for graph topology and node attributes. However, real-world graph data generally exhibits dynamic evolutionary characteristics, with new nodes and edges continuously being generated, forming incremental datasets. Traditional GNN models are typically trained on static historical data. When faced with dynamic incremental datasets, they face an irreconcilable dilemma: on the one hand, retraining on the entire dataset (historical data + incremental data), while ensuring model performance, incurs extremely high computational and storage costs, failing to meet real-time processing requirements; on the other hand, simply fine-tuning the model to adapt to new data leads to the model rapidly forgetting previously learned historical knowledge, resulting in a "catastrophic forgetting" problem. This severely impacts the model's performance in processing tasks related to historical data, leading to low inference accuracy in GNN models. Summary of the Invention
[0003] This invention provides an incremental learning method, related apparatus, and storage medium for graph neural network models, which can improve the inference accuracy of graph neural network models without requiring full retraining.
[0004] In a first aspect, embodiments of the present invention provide an incremental learning method for a graph neural network model, the method comprising: Obtain the incremental dataset, which includes the newly added node set and the newly added edge set; Based on the incremental dataset, multiple target boundary nodes are selected from multiple historical nodes in the historical snapshot map; A knowledge graph is constructed based on multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, and an incremental subgraph is generated. The incremental subgraph includes newly added nodes in the newly added node set, the target boundary nodes, and edge connections between nodes. The incremental subgraph is input into the incremental learning network to obtain new node representations for each node in the incremental subgraph; The historical snapshot image is input into the original graph neural network model to obtain the node history representation of multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot image; The node history representations of multiple target boundary nodes are fused with the new node representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph. Freeze the original graph neural network model, and iteratively train the incremental learning network based on the final node representation until a preset stopping condition is met; The dataset to be predicted is obtained, and the dataset is processed based on the incremental learning network and the original graph neural network model to obtain the target node representation. Inference is then performed based on the target node representation to obtain the target inference result.
[0005] Secondly, embodiments of the present invention provide an incremental learning device for a graph neural network model, which has the function of implementing an incremental learning method corresponding to the graph neural network model provided in the first aspect above. The function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function, and the modules can be software and / or hardware.
[0006] In one embodiment, the incremental learning device for the graph neural network model includes: The acquisition module is configured to acquire an incremental dataset, which includes a newly added node set and a newly added edge set. The filtering module is configured to filter multiple target boundary nodes from multiple historical nodes in the historical snapshot map based on the incremental dataset; The construction module is configured to build a knowledge graph based on multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, and generate an incremental subgraph, wherein the incremental subgraph includes newly added nodes in the newly added node set, the target boundary nodes, and edge connections between nodes; The first representation module is configured to input the incremental subgraph into the incremental learning network to obtain new node representations for each node in the incremental subgraph. The second representation module is configured to input the historical snapshot image into the original graph neural network model to obtain the node history representations of multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot image; The fusion module is configured to fuse the node history representations of multiple target boundary nodes with the node new representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph. The training module is configured to freeze the original graph neural network model and iteratively train the incremental learning network based on the final node representation until a preset stopping condition is met. The inference module is configured to acquire the dataset to be predicted, process the dataset to be predicted based on the incremental learning network and the original graph neural network model to obtain the target node representation, and perform inference based on the target node representation to obtain the target inference result.
[0007] Thirdly, embodiments of the present invention provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform an incremental learning method for a graph neural network model as described in the first aspect.
[0008] Fourthly, embodiments of the present invention provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the incremental learning method of the graph neural network model described in the first aspect.
[0009] Fifthly, embodiments of the present invention provide a chip including a processor coupled to a transceiver of a terminal device, for executing the technical solution provided in the first aspect of the present invention.
[0010] In a sixth aspect, embodiments of the present invention provide a chip system including a processor for supporting a terminal device in implementing the functions involved in the first aspect above, such as generating or processing information involved in the incremental learning method of the graph neural network model provided in the first aspect above.
[0011] In one possible design, the aforementioned chip system also includes a memory for storing program instructions and data necessary for the terminal. The chip system can be composed of chips or may include chips and other discrete components.
[0012] In a seventh aspect, embodiments of the present invention provide a computer program product containing instructions that, when the computer program product is run on a computer, cause the computer to execute the incremental learning method of the graph neural network model provided in the first aspect.
[0013] Compared to existing technologies, in this embodiment of the invention, an incremental dataset is obtained, which includes a set of newly added nodes and a set of newly added edges. Multiple target boundary nodes are selected from multiple historical nodes in a historical snapshot graph based on the incremental dataset. A knowledge graph is constructed based on the multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, generating an incremental subgraph. The incremental subgraph includes newly added nodes from the set of newly added nodes, target boundary nodes, and edge connections between nodes. The incremental subgraph is input into an incremental learning network to obtain new node representations for each node in the incremental subgraph. The historical snapshot graph is input into an original graph neural network model to obtain historical node representations for multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot graph. The historical node representations of multiple target boundary nodes are fused with the new node representations for each node in the incremental subgraph to obtain the final node representation for each node in the incremental subgraph. The original graph neural network model is frozen, and the incremental learning network is iteratively trained based on the final node representations until a preset stopping condition is met. A dataset to be predicted is obtained, and the dataset to be predicted is processed based on the incremental learning network and the original graph neural network model to obtain target node representations. Inference is then performed based on the target node representations to obtain the target inference result. This invention selects multiple target boundary nodes from a historical snapshot image, and then constructs an incremental subgraph based on a subset of nodes selected from the historical snapshot image and newly added nodes. The final node representation of each node in the incremental subgraph is obtained by fusing the new node representation of each node with the historical node representation of each target boundary node in the historical snapshot image. The incremental learning network is then iteratively updated using these final node representations. By integrating dynamic subgraph construction, historical model freezing, and representation fusion, this invention solves the problems of avoiding full retraining, preventing catastrophic forgetting, and effectively handling dynamic changes in graph structure during incremental learning of dynamic graph data. It avoids the high computational overhead of full retraining while ensuring the ability to handle dynamic changes in graph structure, thus improving the inference accuracy of the graph neural network model without requiring full retraining. Attached Figure Description
[0014] The objects, features, and advantages of the present invention will become readily understood by reading the detailed description of the embodiments of the present invention with reference to the accompanying drawings. Wherein: Figure 1 This is a schematic diagram of an incremental learning system for a graph neural network model, which is an embodiment of the incremental learning method for graph neural network models in this invention. Figure 2 This is a flowchart illustrating an incremental learning method for a graph neural network model according to an embodiment of the present invention. Figure 3 This is a schematic diagram of another process for the incremental learning method of the graph neural network model in an embodiment of the present invention; Figure 4 This is a schematic diagram of the incremental learning device for a graph neural network model according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a computing device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a mobile phone structure in an embodiment of the present invention; Figure 7 This is a schematic diagram of a server structure in an embodiment of the present invention.
[0015] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0016] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules in the embodiments of this invention is merely a logical division; in actual applications, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be omitted or not performed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings between modules; and communication connections may be electrical or other similar forms, none of which are limited in the embodiments of this invention. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0017] The general-purpose big model is currently widely used in applications such as chat dialogue, text editing, artistic creation, coding, mathematical reasoning, and bioinformatics. Although it has created many new business models and has powerful capabilities, after the general-purpose big model was launched for users, there are mainly algorithmic risks, data risks, and application risks in the three types of applications: translation, chat, and collaboration.
[0018] This invention also provides an incremental learning method, related apparatus, and storage medium for a graph neural network model, which can be applied to an incremental learning system for a graph neural network model. The incremental learning system for the graph neural network model may include an incremental learning device for the graph neural network model, which can be deployed in an integrated manner or separately. The incremental learning device of this graph neural network model is used at least to acquire an incremental dataset, which includes a set of newly added nodes and a set of newly added edges; to select multiple target boundary nodes from multiple historical nodes in a historical snapshot graph based on the incremental dataset; to construct a knowledge graph based on the multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, generating an incremental subgraph, which includes newly added nodes in the set of newly added nodes, target boundary nodes, and edge connections between nodes; to input the incremental subgraph into the incremental learning network to obtain new node representations for each node in the incremental subgraph; to input the historical snapshot graph into the original graph neural network model to obtain historical node representations for multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot graph; to fuse the historical node representations of multiple target boundary nodes with the new node representations for each node in the incremental subgraph to obtain the final node representation for each node in the incremental subgraph; to freeze the original graph neural network model and iteratively train the incremental learning network based on the final node representations until a preset stopping condition is met; to acquire a dataset to be predicted, to process the dataset to be predicted based on the incremental learning network and the original graph neural network model to obtain target node representations, and to perform inference based on the target node representations to obtain the target inference result.
[0019] The solutions provided in this invention involve technologies such as Artificial Intelligence (AI) and Machine Learning (ML), and are specifically illustrated through the following embodiments: AI, or Artificial Intelligence, refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, Artificial Intelligence is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine capable of reacting in a manner similar to human intelligence. Artificial Intelligence studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0020] AI technology is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0021] Compared to existing technologies, in this embodiment of the invention, an incremental dataset is obtained, which includes a set of newly added nodes and a set of newly added edges. Multiple target boundary nodes are selected from multiple historical nodes in a historical snapshot graph based on the incremental dataset. A knowledge graph is constructed based on the multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, generating an incremental subgraph. The incremental subgraph includes newly added nodes from the set of newly added nodes, target boundary nodes, and edge connections between nodes. The incremental subgraph is input into an incremental learning network to obtain new node representations for each node in the incremental subgraph. The historical snapshot graph is input into an original graph neural network model to obtain historical node representations for multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot graph. The historical node representations of multiple target boundary nodes are fused with the new node representations for each node in the incremental subgraph to obtain the final node representation for each node in the incremental subgraph. The original graph neural network model is frozen, and the incremental learning network is iteratively trained based on the final node representations until a preset stopping condition is met. A dataset to be predicted is obtained, and the dataset to be predicted is processed based on the incremental learning network and the original graph neural network model to obtain target node representations. Inference is then performed based on the target node representations to obtain the target inference result.
[0022] In some implementations, reference is made to Figure 1 The incremental learning method for the graph neural network model provided in this embodiment of the invention can be based on... Figure 1 The diagram illustrates an incremental learning system implementation for a graph neural network model. This incremental learning system may include an electronic device 100 and a memory 200. The electronic device 100 may be a server or a terminal device.
[0023] It should be noted that the server involved in the embodiments of the present invention can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0024] The terminal devices involved in the embodiments of this invention can be devices that provide voice and / or data connectivity to users, handheld devices with wireless connectivity, or other processing devices connected to a wireless modem. Examples include mobile phones (or "cellular" phones) and computers with mobile terminals, such as portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile devices that exchange voice and / or data with a wireless access network. Examples include Personal Communication Service (PCS) phones, cordless phones, Session Initiation Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs), and other similar devices.
[0025] Reference Figure 2 , Figure 2 This is a flowchart illustrating an incremental learning method for a graph neural network model, provided in an embodiment of the present invention. The method can be executed by an incremental learning device for a graph neural network model. The method includes steps 101-108: Step 101: Obtain the incremental dataset.
[0026] Among them, the new dataset Including newly added node sets Adding edge sets .
[0027] In this embodiment of the invention, the incremental dataset is the most recently acquired dataset. New node set. This includes multiple new nodes, which can be users, product links, papers, etc. New nodes can be newly registered users, new product links, new papers, etc. (Adding edge sets) It includes edge connections between multiple nodes, such as friend connections between users. The new dataset also includes node features and edge features. Node features can be node attributes, such as age, interest, and other labels, while edge features are edge weights.
[0028] For example, in the incremental learning scenario of social networks, when a new user registers and establishes a friend relationship, the newly added node set specifically includes the newly registered user, and the newly added edge set specifically includes friend request connections between users. The dynamic subgraph construction operation selects old users directly interconnected with the new user as boundary nodes, forming a subgraph that only contains the new user, related boundary nodes, and their internal connections. The original graph neural network model is frozen to preserve historical social patterns, and the incremental learning network only updates the parameters for this subgraph. The fusion operation of the historical node representation and the new node representation of the boundary nodes generates the final node representation, which is used for real-time friend recommendation tasks.
[0029] Step 102: Select multiple target boundary nodes from multiple historical nodes in the historical snapshot map based on the incremental dataset.
[0030] Among them, the historical snapshot graph is a knowledge graph generated from historical datasets. A knowledge graph is a semantic network that describes the objective world using a graph structure (composed of nodes and edges). Essentially, it is a knowledge base that describes concepts, entities, and their relationships, and it is a major manifestation of knowledge engineering in the field of artificial intelligence.
[0031] The historical dataset consists of historical data between social users. Historical snapshots represent historical social networks, including friend relationships between multiple historical users. Historical users can be registered users.
[0032] In one specific embodiment, multiple target boundary nodes are selected from multiple historical nodes in a historical snapshot graph based on an incremental dataset, including: (1) Determine the number of multi-hop paths, common neighbors, and edge weights between each historical node and each new node in the new node set in the historical snapshot graph.
[0033] Specifically, regarding historical nodes And the newly added node v. Let the number of multi-hop paths be . The number of common neighbors is The edge weight is .
[0034] Among them, the number of multi-hop paths It can be understood as the total number of indirect connection paths established between nodes through intermediate nodes. It can be counted using breadth-first search or random walk algorithms, with the aim of capturing potential long-distance topological associations between nodes.
[0035] Number of common neighbors This refers to the number of adjacent nodes shared by two nodes. It can be quickly calculated using adjacency matrix multiplication or hash tables, and its purpose is to measure the local structural similarity between nodes.
[0036] edge weight It can be understood as a quantitative representation of the connection strength between nodes, which can be dynamically determined based on the interaction frequency, relationship type or time decay factor, with the aim of reflecting the actual importance of the connection.
[0037] (2) Determine the node topology intimacy of historical nodes and newly added nodes based on the number of multi-hop paths, the number of common neighbors and edge weights, and obtain the node topology intimacy of each historical node.
[0038] Among them, topological intimacy Refers to quantified historical snapshots The composite index of the topological association strength between historical nodes and newly added nodes can be implemented using a weighted function of the number of multi-hop paths, the number of common neighbors, and edge weights. The purpose is to comprehensively evaluate the direct and indirect connection relationships between nodes and avoid the limitations of relying solely on simple adjacency relationships.
[0039] Specifically, the node topological affinity of historical nodes and newly added nodes is obtained by weighting and summing the number of multi-hop paths, the number of common neighbors, and the edge weights based on preset weight coefficients.
[0040] Specifically, calculate historical snapshots. Sets of historical nodes and newly added nodes Topological intimacy of each newly added node as follows,
[0041] in, As a historical node The number of multi-hop paths between the newly added node v and the node v. As a historical node The number of common neighbors of the newly added node v. As a historical node And the edge weights of the newly added node v, These are preset weighting coefficients.
[0042] For example, . The sum is 1.
[0043] (3) The first preset number of historical nodes ranked first in descending order of node topological affinity are determined as multiple target boundary nodes.
[0044] In one specific embodiment, the first preset quantity is K, which can be set according to specific circumstances. For example, K represents historical snapshot images. The K value is typically set to 20% of the total number of historical nodes, depending on the specific circumstances. To improve computational efficiency and control the size of the subgraph, the K value is usually set to the top 20% of all nodes connected to the new node in the historical snapshot graph. This setting ensures that while covering the vast majority of critical interactions (>95%), the size of the subgraph nodes that need to be processed is reduced to 20%-30% of the total graph size (i.e., a reduction of 70%-80%).
[0045] Prioritize selecting the top K historical nodes (e.g., Top 20%) based on topological affinity as target boundary nodes. The set of multiple target boundary nodes is denoted as... .
[0046] In other embodiments, for each historical node in the historical snapshot graph, new nodes with direct edge connections to historical nodes are identified from the newly added node set and designated as edge-connecting nodes. When there are no other nodes on the edge between nodes, the edge connection between nodes is determined to be a direct edge connection. The number of multi-hop paths, the number of common neighbors, and the edge weights between historical nodes and edge-connecting nodes are determined. Based on the number of multi-hop paths, the number of common neighbors, and the edge weights, the node topological affinity between historical nodes and edge-connecting nodes is determined, resulting in the node topological affinity corresponding to each historical node. A first preset number of historical nodes with the highest node topological affinity are identified as multiple target boundary nodes.
[0047] Step 103: Construct a knowledge graph based on multiple target boundary nodes, historical snapshot graphs and incremental datasets, and generate an incremental subgraph. The incremental subgraph includes newly added nodes in the newly added node set, target boundary nodes and edge connections between nodes.
[0048] In this embodiment of the invention, the edge connection relationships of multiple target boundary nodes are extracted from the historical snapshot graph, and the edge connection relationships of multiple target boundary nodes are fused with the incremental dataset to generate an incremental subgraph.
[0049] The incremental subgraph is a knowledge graph, and the set of multiple target boundary nodes is denoted as . The newly added node set is ,Will Together with its internal connecting edges, they form an incremental subgraph. The incremental subgraph includes newly added nodes in the newly added node set, target boundary nodes, and edge connections between nodes.
[0050] Furthermore, a knowledge graph is constructed based on multiple target boundary nodes, historical snapshots, and incremental datasets, generating an incremental subgraph. The incremental subgraph includes newly added nodes in the newly added node set, target boundary nodes, and edge connections between nodes, including: (1) Determine the first-degree neighbor nodes of the target boundary node based on the historical snapshot map.
[0051] First-degree neighbor nodes refer to the target boundary node and the nodes that are directly connected to it.
[0052] (2) Determine the degree centrality index, proximity centrality index, and betweenness centrality index of the first-degree neighbor nodes.
[0053] (3) Determine the influence parameters of first-degree neighbor nodes based on the degree centrality index, proximity centrality index and betweenness centrality index of first-degree neighbor nodes.
[0054] Specifically, the influence parameter of a first-degree neighbor node is obtained by weighted summation of the degree centrality, proximity centrality, and betweenness centrality indices of the first-degree neighbor node.
[0055] (4) Construct a knowledge graph based on multiple target boundary nodes, the second preset number of first-degree neighbor nodes with influence parameters sorted from largest to smallest, historical snapshot graphs, and incremental datasets, and generate incremental subgraphs.
[0056] The second preset quantity is M, which is a preset ratio of the number of first-degree neighbor nodes. For example, the preset ratio is 10%, which can be set according to the specific situation.
[0057] Specifically, the second-preset number of first-degree neighbor nodes, sorted by influence parameter from largest to smallest, are considered high-influence nodes and recorded as follows: High-influence nodes are those that play a crucial role in the stability of the graph structure. They can be evaluated using metrics such as degree centrality, proximity centrality, or betweenness centrality, with the aim of ensuring that the subgraph contains globally key topological nodes.
[0058] by and Based on this, the M nodes with the highest degree centrality in the first-degree neighborhood of the historical snapshot graph are sampled as high-influence nodes. M represents 10% of the number of nodes. This ratio effectively introduces global topological key points and avoids the subgraph structure from becoming too localized.
[0059] Will Together with its internal connecting edges, they form an incremental subgraph. .
[0060] In social network scenarios, it can accurately capture the connection patterns between new users and historical user groups, enabling precise friend recommendations while avoiding misjudgments of historical user relationships due to model updates.
[0061] Step 104: Input the incremental subgraph into the incremental learning network to obtain the new node representations of each node in the incremental subgraph.
[0062] In this embodiment of the invention, the incremental subgraph Inputting the incremental learning network yields new node representations for each node in the incremental subgraph. .
[0063] Incremental learning networks have fewer layers than the original graph neural network models. For example, incremental learning networks consist of two-layer GAT networks, while the original graph neural network models consist of at least three-layer GAT networks.
[0064] Step 105: Input the historical snapshot image into the original graph neural network model to obtain the node history representation of multiple target boundary nodes.
[0065] The original graph neural network model was trained based on historical snapshot images.
[0066] In this embodiment of the invention, historical snapshot images are input into the original graph neural network model to obtain the node history representations of multiple target boundary nodes. .
[0067] Step 106: The node history representations of multiple target boundary nodes are fused with the new node representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph.
[0068] In one specific embodiment, the preset new representation weight and historical representation weight are obtained and the node's historical representation and new representation are fused to obtain the final node representation of the target boundary node.
[0069] For example, the new representation weight is (1 α), where the historical representation weight is α, for example, α=0.3. Final node representation. The calculation formula is as follows: .
[0070] in, This is the final node representation of the node. This is a new representation of the node. This represents the node's node history.
[0071] However, in its implementation, the fusion mechanism adopts a simple weighting or splicing method, lacking a fine mechanism to adaptively adjust the contribution of new and old knowledge according to the node context. This results in the inability to accurately capture the degree of dependence of different nodes on historical and new knowledge, which in turn leads to poor representation quality after fusion.
[0072] To address the aforementioned issues, in another specific embodiment, the historical node representations of multiple target boundary nodes are fused with the new node representations of each node in the incremental subgraph to obtain the final node representations of each node in the incremental subgraph, including: (1) Obtain the node characteristics and local topology information of the target boundary nodes.
[0073] The local topological information of the target boundary node includes, for example, the node degree centrality index and the attribute aggregation features of its first-degree neighbor nodes.
[0074] (2) Input the node characteristics and local topology information of the target boundary node into the gated fusion network to obtain the new representation weight and historical representation weight of the target boundary node.
[0075] The sum of the new representation weight and the historical representation weight is 1.
[0076] Specifically, the gated fusion network consists of two layers of perceptrons, with a hidden layer dimension of 128. The node features and local topology information of the target boundary nodes are input into the two layers of the gated fusion network to obtain the new representation weights and historical representation weights of the target boundary nodes.
[0077] (3) The node's historical representation and new representation are fused according to the new representation weight and the historical representation weight to obtain the final node representation of the target boundary node.
[0078] Furthermore, the node features and local topology information of the newly added nodes are obtained. These features and information are then input into the gated fusion network to obtain the new representation weights and historical representation weights for the new nodes. The sum of the new and historical representation weights is 1. The new representations of the new nodes are then weighted according to these new representation weights to obtain the final node representation.
[0079] Furthermore, the historical representation weight (α value) of the newly added node is less than the first preset value, for example, the first preset value is 0.3, and the historical representation weight (α value) of the target boundary node is greater than the second preset value, for example, the second preset value is 0.7.
[0080] Through this gating mechanism, the model can achieve differentiated fusion: for boundary nodes closely connected to historical snapshots, the learned α value is typically greater than 0.7, ensuring that their representations are primarily inherited from stable historical models; for newly added nodes, the α value is typically less than 0.3, ensuring that their representations are primarily derived from the incremental network learning new data. This adaptive, node-level fusion strategy, compared to a fixed weighted average, can bring a 5%-10% accuracy improvement in downstream node classification tasks.
[0081] For boundary nodes, the system has two strong signal sources: stable and reliable historical representations (from the frozen, well-performing original model) and new representations that are adapting to new data and may not yet be stable. The training process (through backpropagation) reveals a pattern: assigning higher weights (i.e., higher α) to the historical representations of boundary nodes often yields more stable and accurate final predictions. This is because historical representations carry well-validated knowledge that has established strong relationships with other parts of the graph. Therefore, to minimize the overall loss function, the gated fusion network automatically learns a strategy: when it determines a node is a boundary node closely connected to the historical graph based on input features (such as node degree and neighbor aggregation features), it tends to output a higher α value (e.g., >0.7) to incorporate more stable historical knowledge.
[0082] In practical applications, gated fusion networks refer to a dynamic representation integration mechanism based on learnable parameters. This can be implemented using fully connected neural network layers or convolutional units, aiming to generate differentiated fusion weights based on the contextual characteristics of nodes within the graph structure. Among these, multiple nodes... The α-gated vector composed of values can be understood as an adaptive coefficient representing the degree of retention of historical knowledge. It can be generated using a nonlinear mapping function between node features and local topological information. The purpose is to adapt the fusion process to the different nodes' dependence on historical knowledge. Specifically, the element-wise multiplication operation refers to independently weighting the node's historical representation and new representation in the feature dimension. It can be implemented using a tensor operation engine to avoid dimensional imbalance caused by global weighting and ensure the fusion accuracy of each feature channel.
[0083] Specifically, the solution of this invention receives the node history representations output by the original model through a gated fusion network. New node representations with the output of incremental learning networks The system dynamically generates node-related weight distributions using a learnable α-gated vector. This α-gated vector is calculated based on the node's local topological features (such as node degree and neighbor distribution) and node characteristics in the incremental subgraph. Boundary nodes, due to their strong association with historical snapshots, receive higher α values, thus prioritizing the preservation of the stability of historical node representations. Simultaneously, newly added nodes, lacking historical connections, trigger lower α values, allowing their new representations to dominate. Subsequently, α is multiplied by an element-wise multiplication operation. Multiply, and (1) α) and Multiply, and finally superimpose to generate This mechanism ensures that historical and new knowledge interact in a refined manner at the feature dimension level. It avoids the lack of adaptability caused by the fixed proportion in simple weighting and overcomes the information dilution problem caused by representation splicing. This allows the fused node representation to accurately match its actual needs in the dynamic evolution graph.
[0084] In the implementation, the gated vector α is generated by a two-layer perceptron in the gated fusion network. Its input includes the node degree centrality index and the attribute aggregation features of the first-degree neighbor nodes, and the output is normalized to the [0,1] interval by the sigmoid function. The perceptron is continuously optimized through backpropagation during the training phase, so that the fusion process adapts to the evolutionary characteristics of different nodes.
[0085] Through the above technical solution, this invention achieves a refined integration of historical and new node representations, enabling the fused node representation to dynamically adjust the contribution ratio of historical and new knowledge based on the node's actual role in the graph structure. In dynamic graph data processing, this mechanism effectively solves the problem of representation quality degradation caused by coarse fusion, ensuring that boundary nodes retain the stability of historical social relationships while allowing newly added nodes to fully absorb new interaction features, significantly improving the accuracy of node classification and link prediction in downstream tasks.
[0086] Step 107: Freeze the original graph neural network model, and iteratively train the incremental learning network based on the final node representation until the preset stopping condition is met.
[0087] In this embodiment of the invention, the incremental learning network is iteratively trained based on the final node representation until a preset stopping condition is met, including: (1) Input the final node representation of each node into the main task prediction module to obtain the prediction category of each node.
[0088] The main task prediction module can be a neural network used for classification.
[0089] In this embodiment of the invention, in a social network scenario, the node represents a social user, and the prediction category is the predicted friend recommendation list of the user. In an academic citation network scenario, the node represents a paper topic, and the prediction category is the predicted paper topic type. In an e-commerce scenario, the node represents a product link, and the prediction category is the predicted new product prediction link.
[0090] (2) Determine the main task loss based on the predicted category and category label of each node.
[0091] In this context, the prediction category is the category of each node in the main task prediction module, and the category label can be a pre-labeled label for each node. For example, the category label could be the actual friend recommendation list of a historical user, and the prediction category could be the predicted friend recommendation list of a historical user. Node features include the node's category label.
[0092] The cross-entropy loss function is used to determine the main task loss based on the predicted class and class label of each node. Specifically, the main task loss can be determined based on the predicted class and class label of each node in the incremental subgraph.
[0093] In one specific embodiment, a set of historical node representations is maintained, which includes a fixed number of key node representations. For example, the fixed number is 100.
[0094] Specifically, the node centrality index of each historical node in the historical graph snapshot is determined. A fixed number of historical nodes with the highest node centrality index are selected, and their historical characteristics are used as a fixed number of key node representations, resulting in a set of historical node representations. The set of historical node representations is dynamically updated.
[0095] Among them, nodes The node centrality metric uses degree centrality. The calculation is as follows: .
[0096] in, Represents a node. Represents a node The degree (i.e., the number of connected edges). This represents the total number of nodes in the historical snapshot graph. This formula is used to evaluate the importance of nodes; the higher the degree centrality, the more critical the node.
[0097] In each incremental training iteration, a third preset number of key node representations and their corresponding category labels are randomly selected from the historical node representation set. These third preset number of key node representations are input into the main task prediction module to obtain the predicted categories and category labels for these key node representations. The main task loss is determined based on the predicted categories and category labels of each node in the incremental subgraph, as well as the predicted categories and category labels of the third preset number of key node representations.
[0098] The third preset quantity is 20% of the total number of nodes in the historical node representation set. Of course, the third preset quantity can also be set according to specific circumstances, and this application does not limit it.
[0099] Specifically, the predicted categories and category labels of each node in the incremental subgraph are fused with the predicted categories and category labels of a third preset number of key nodes to obtain multiple predicted categories and category labels, and the main task loss is determined based on the multiple predicted categories and category labels.
[0100] The historical node representation set is stored in the historical node representation library. The historical node representation library is a fixed-capacity data structure used to store the historical representations of nodes. It can be implemented using in-memory caching or a distributed key-value database, with the aim of efficiently managing historical knowledge without consuming excessive storage resources.
[0101] The high-frequency constraint of knowledge distillation in each training round, along with the periodic review mechanism of replaying 20% of historical key nodes, together constitute the system's anti-forgetting defense. In experiments simulating 10 consecutive incremental learning iterations, this combined strategy ensured that the model's performance degradation on the historical test set was controlled within 3%, effectively resisting catastrophic forgetting.
[0102] (3) Add perturbation to the incremental subgraph to obtain the perturbation subgraph, and input the perturbation subgraph into the incremental learning network to obtain the node perturbation representation of each node in the perturbation subgraph.
[0103] Among them, node perturbation representation includes difficult negative samples and simple negative samples.
[0104] Specifically, the incremental subgraph is perturbed by edge deletion or random perturbation of node features to obtain a perturbed subgraph. The perturbed subgraph is then input into the incremental learning network to obtain the node perturbation representation of each node in the perturbed subgraph.
[0105] (4) Take the new node representation of each node in the incremental subgraph as positive samples and the node perturbation representation of each node in the perturbation subgraph as negative samples to determine the contrast loss.
[0106] Specifically, negative samples include hard negative samples and simple negative samples. The node perturbation representation of each node in the perturbation subgraph is taken as a hard negative sample. The neighboring nodes with at least three hops between the node and the node are determined. A node is randomly selected from the neighboring nodes, and the new node representation of the randomly selected node is determined as a simple negative sample.
[0107] Specifically, for incremental subgraphs For each node, create a new node representation. As positive samples Difficult negative samples are generated by randomly deleting 20% of their edges or adding Gaussian noise with a signal-to-noise ratio of 10dB to their node features. Randomly select nodes from its multi-hop (e.g., 3-hop) neighbors as simple negative samples. .
[0108] By using a contrastive loss function to narrow the distance between positive sample pairs and widen the distance between them and difficult and easy negative samples, the robustness of the model to graph structure perturbations is enhanced; among which, the contrastive loss... The calculation formula is as follows:
[0109] in, Represents a node New node representations Let represent a positive sample for node i. Positive samples can be new representations of node i or enhanced node features. Let i represent a simple negative sample at node i. Represents a difficult negative sample at node i. Represents the cosine similarity function. It's a temperature over-parameter. It represents the number of nodes.
[0110] This formula optimizes the representation space, bringing positive sample pairs closer together and negative sample pairs further apart. By introducing structural perturbations and feature noise of the aforementioned intensity to construct challenging negative samples and setting a sufficient number of negative samples, the contrastive learning task forces the model to ignore such local mutations and learn more robust representations. This reduces the volatility of the model's predictive performance by more than 15% compared to the baseline model without this loss when faced with noisy data common in real-world dynamic graphs.
[0111] (5) Determine the total loss based on the main task loss and the comparison loss, and iteratively update the incremental learning network based on the total loss until the preset stopping condition is met.
[0112] Specifically, the main task loss and the contrastive loss are weighted and summed to obtain the total loss. The incremental learning network is then iteratively updated based on the total loss until a preset stopping condition is met. The preset stopping condition can be that the total loss is less than a preset value.
[0113] Furthermore, the incremental learning network and the gated fusion network are iteratively updated based on the total loss until the preset stopping condition is met.
[0114] The training of incremental learning networks lacks an effective constraint mechanism on historical knowledge, which makes the model prone to catastrophic forgetting when adapting to new data. That is, the ability to represent historical data deteriorates significantly, and it is unable to efficiently learn new data distributions while retaining historical knowledge.
[0115] To address the above issues, the total loss is determined based on the main task loss and the contrastive loss. The incremental learning network is then iteratively updated based on this total loss until preset stopping conditions are met, including: (1) Input the final node representation of the target boundary node into the first activation function module to obtain the first classification probability vector of each node.
[0116] Specifically, the first classification probability vector for each node in the i-th classification category is: .
[0117] The incremental learning network and the gated fusion network are connected in series to form the student network. A softmax function with temperature T is added after its final output layer as the first activation function module to generate the softening probability distribution. .
[0118] (2) Input the node history representation of the target boundary node into the second activation function module to obtain the second classification probability vector.
[0119] Specifically, the second classification probability vector for each node in the i-th classification category is: .
[0120] The original graph neural network model and the second activation function module constitute the teacher network. A pre-trained and frozen original graph neural network model is loaded, and a Softmax function with a temperature parameter T (usually T>1, e.g., T=3) is added after its output layer as the second activation function module to generate the softening probability distribution. .
[0121] (3) Determine the distillation loss based on the first classification probability vector and the second classification probability of the target boundary node.
[0122] Specifically, distillation loss The calculation formula is as follows: .
[0123] in, The total number of categories, For category indexing, This represents the probability distribution of softening output from the second activation function module. The probability distribution of softening relative to the output of the first activation function module The KL divergence (Kullback-Leibler Divergence).
[0124] KL divergence, also known as relative entropy, is an asymmetric index in information theory and probability theory that measures the difference between two probability distributions. (4) Determine the total loss iteratively based on the main task loss, comparison loss, and distillation loss.
[0125] Specifically, the total loss is obtained by weighted summing of the main task loss, the comparison loss, and the distillation loss. .
[0126] Specifically, total loss The calculation formula is as follows: .
[0127] in, To compare the ratio of the loss to the primary task loss using the first weighting coefficient, This is the ratio of the second weighting coefficient of distillation loss to the primary task loss, with the primary task loss having a weighting coefficient of 1.
[0128] Furthermore, the ratio of the second weighting coefficient The value decreases sequentially during iterative training. Specifically, it decreases linearly from 0.8 to 0.2 as training progresses, to strongly constrain historical knowledge in the early stages of training and gradually release the model's ability to adapt to new data in the later stages.
[0129] (5) Iteratively update the incremental learning network based on the total loss until the preset stopping condition is met.
[0130] The high-frequency constraint of knowledge distillation in each training round, along with the periodic review mechanism of replaying 20% of historical key nodes, together constitute the system's anti-forgetting defense. In experiments simulating 10 consecutive incremental learning iterations, this combined strategy ensured that the model's performance degradation on the historical test set was controlled within 3%, effectively resisting catastrophic forgetting.
[0131] In the training loop of the incremental learning network, a meta-knowledge distillation process is initiated periodically (e.g., when the current iteration number is an integer multiple of a preset number). Boundary node data from the same batch of incremental subgraphs are input into the teacher network and the student network respectively. The teacher network generates soft labels based on its ingrained historical knowledge, while the student network generates soft labels based on the current incremental knowledge. By minimizing the divergence between the two, the student network is forced to align its output logic and decision boundaries with the historical patterns of the teacher network while adapting to new data. This distillation loss, together with the main task loss and contrastive loss, constitutes a multi-objective optimization function, and the student network parameters are updated uniformly through gradient descent.
[0132] In each incremental training iteration, the sampled historical node representations and the current incremental subgraph node representations are input together into the gating fusion network. This allows key historical knowledge and new data to interact in real time during training, ensuring that the gating mechanism can adaptively adjust the contribution of old and new representations based on the node context. Through joint training, the model periodically strengthens its memory of key historical nodes while learning new knowledge, effectively preventing the overwriting effect of new data on historical knowledge, fundamentally alleviating representation drift, and suppressing catastrophic forgetting.
[0133] Step 108: Obtain the dataset to be predicted, process the dataset to be predicted based on the incremental learning network and the original graph neural network model to obtain the target node representation, and perform inference based on the target node representation to obtain the target inference result.
[0134] In this embodiment of the invention, the dataset to be predicted includes a set of nodes and a set of edges. The dataset to be predicted does not include category labels.
[0135] In this embodiment of the invention, multiple target boundary nodes are selected from multiple historical nodes in a historical snapshot graph based on the dataset to be predicted; a knowledge graph is constructed based on the multiple target boundary nodes, the historical snapshot graph, and the dataset to be predicted, generating a new incremental subgraph. The new incremental subgraph includes newly added nodes in the dataset to be predicted, target boundary nodes, and edge connections between nodes; the new incremental subgraph is input into an incremental learning network to obtain new node representations for each node in the new incremental subgraph; the historical snapshot graph is input into the original graph neural network model to obtain historical node representations for multiple target boundary nodes; the historical node representations for multiple target boundary nodes are fused with the new node representations for each node in the new incremental subgraph to obtain the target node representations for each node in the new incremental subgraph.
[0136] In this embodiment of the invention, the target node representation is input into the main task prediction module to obtain the prediction category, and the prediction category is determined as the target inference result.
[0137] For example, in a social network scenario, nodes represent social users, and the target inference result is the predicted new user relationships.
[0138] The present invention has the following beneficial effects: Structure Awareness and Efficiency Improvement: By employing a dynamic subgraph construction method based on topological importance, and through calculating the topological affinity between nodes and implementing hierarchical sampling, the key interaction regions of graph structure evolution can be accurately captured. This method reduces the subgraph size by more than 70% and improves computational efficiency by 3 times, thus meeting the real-time processing requirements of large-scale dynamic graphs.
[0139] Enhanced fusion accuracy: By introducing an adaptive fusion mechanism based on learnable gating vectors, which can dynamically generate fusion weights according to the local topological context of nodes, the new and old representations are finely integrated in the feature dimension. Compared with fixed weight fusion, the classification accuracy of downstream task nodes is improved by 5%-10%.
[0140] Significantly improved resistance to forgetting: Employing a multi-layered anti-forgetting mechanism—combining knowledge anchor freezing, meta-knowledge distillation, and dynamic replay—the model systematically consolidates its long-term memory by freezing the original model to stabilize historical knowledge, utilizing divergence loss for knowledge distillation, and replaying key node historical representations based on node centrality. Therefore, after 10 consecutive incremental learning iterations, the model's performance degradation on historical data is less than 3%, effectively addressing the problem of catastrophic forgetting.
[0141] Robustness Enhancement: By introducing a topology-aware contrastive loss function during training, and constructing a contrastive learning task that includes difficult negative samples, the model is forced to learn representations that are insensitive to local structural perturbations such as edge deletion and feature noise. This reduces the performance fluctuation of the model under noisy data by 15%, significantly enhancing the model's stability and robustness.
[0142] Compared to existing technologies, in this embodiment of the invention, an incremental dataset is obtained, which includes a set of newly added nodes and a set of newly added edges. Multiple target boundary nodes are selected from multiple historical nodes in a historical snapshot graph based on the incremental dataset. A knowledge graph is constructed based on the multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, generating an incremental subgraph. The incremental subgraph includes newly added nodes from the set of newly added nodes, target boundary nodes, and edge connections between nodes. The incremental subgraph is input into an incremental learning network to obtain new node representations for each node in the incremental subgraph. The historical snapshot graph is input into an original graph neural network model to obtain historical node representations for multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot graph. The historical node representations of multiple target boundary nodes are fused with the new node representations for each node in the incremental subgraph to obtain the final node representation for each node in the incremental subgraph. The original graph neural network model is frozen, and the incremental learning network is iteratively trained based on the final node representations until a preset stopping condition is met. A dataset to be predicted is obtained, and the dataset to be predicted is processed based on the incremental learning network and the original graph neural network model to obtain target node representations. Inference is then performed based on the target node representations to obtain the target inference result. This invention selects multiple target boundary nodes from a historical snapshot image, and then constructs an incremental subgraph based on a subset of nodes selected from the historical snapshot image and newly added nodes. The final node representation of each node in the incremental subgraph is obtained by fusing the new node representation of each node with the historical node representation of each target boundary node in the historical snapshot image. The incremental learning network is then iteratively updated using these final node representations. By integrating dynamic subgraph construction, historical model freezing, and representation fusion, this invention solves the problems of avoiding full retraining, preventing catastrophic forgetting, and effectively handling dynamic changes in graph structure during incremental learning of dynamic graph data. It avoids the high computational overhead of full retraining while ensuring the ability to handle dynamic changes in graph structure, thus improving the inference accuracy of the graph neural network model without requiring full retraining.
[0143] For further details, please refer to [link / reference]. Figure 3The incremental learning method for graph neural network models includes: receiving incremental data streams, constructing dynamic subgraphs, calculating topological proximity, filtering candidate boundary nodes, sampling high-influence nodes, constructing structured incremental subgraphs, parallel model forward propagation, freezing the original GNN model, lightweighting the incremental model, generating historical representations, generating new representations, gated fusion networks, joint optimization training, calculating the main task loss, calculating the contrastive loss, calculating the distillation loss, dynamically replaying training, updating parameters, and outputting the final representation.
[0144] See Figure 4 ,like Figure 4 The diagram shows a schematic of an incremental learning device for a graph neural network model. The incremental learning device for the graph neural network model in this embodiment of the invention can achieve the above-described... Figure 2 The steps of the incremental learning method for the graph neural network model executed in the corresponding embodiments are described above. The functions implemented by the incremental learning device for the graph neural network model can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware. The incremental learning device 60 for the graph neural network model may include an acquisition module 601, a filtering module 602, a construction module 603, a first representation module 604, a second representation module 605, a fusion module 606, a training module 607, and an inference module 608. The functional implementation of the incremental learning device 60 for the graph neural network model can be found in [reference]. Figure 2 The operations performed in the corresponding embodiments will not be described in detail here.
[0145] In one embodiment, the incremental learning device 60 for the graph neural network model includes: The acquisition module 601 is configured to acquire an incremental dataset, which includes a newly added node set and a newly added edge set. The filtering module 602 is configured to filter multiple target boundary nodes from multiple historical nodes in the historical snapshot map based on the incremental dataset; The construction module 603 is configured to construct a knowledge graph based on multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, and generate an incremental subgraph, wherein the incremental subgraph includes newly added nodes in the newly added node set, the target boundary nodes, and edge connections between nodes; The first representation module 604 is configured to input the incremental subgraph into the incremental learning network to obtain new node representations for each node in the incremental subgraph. The second representation module 605 is configured to input the historical snapshot image into the original graph neural network model to obtain the node history representation of multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot image; The fusion module 606 is configured to fuse the node history representations of multiple target boundary nodes with the node new representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph. Training module 607 is configured to freeze the original graph neural network model and iteratively train the incremental learning network based on the final node representation until a preset stopping condition is met. The inference module 608 is configured to acquire the dataset to be predicted, process the dataset to be predicted based on the incremental learning network and the original graph neural network model to obtain the target node representation, and perform inference based on the target node representation to obtain the target inference result.
[0146] The incremental learning device 60 for the graph neural network model in this embodiment of the invention has been described above from the perspective of modular functional entities. The incremental learning device for the graph neural network model in this embodiment of the invention will be described below from the perspective of hardware processing.
[0147] Figure 4 The devices shown can all have the following characteristics: Figure 5 The structure shown, when Figure 4 The incremental learning device 60 of the graph neural network model shown has, for example, the following characteristics. Figure 5 When the structure shown is used, Figure 5 The processor and transceiver in the device can perform the same or similar functions as the modules provided in the aforementioned device embodiments. Figure 5 The memory storage processor in the memory needs to call computer programs when executing the incremental learning method of the above graph neural network model.
[0148] This invention also provides a terminal device, such as... Figure 6 As shown, for ease of explanation, only the parts related to the embodiments of the present invention are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. The terminal device can be any terminal device including mobile phones, tablet computers, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example: Figure 6 This is a block diagram illustrating a portion of the structure of a mobile phone related to the terminal device provided in an embodiment of the present invention. (Reference) Figure 6The mobile phone includes components such as a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art will understand that... Figure 6 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0149] The following is combined Figure 6 A detailed introduction to each component of a mobile phone: The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 1080; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).
[0150] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0151] The input unit 1030 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1031), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1080, and can also receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0152] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1040 may include a display panel 1041, which may optionally be configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar display. Further, a touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 based on the type of touch event. Although in Figure 6 In this embodiment, the touch panel 1031 and the display panel 1041 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0153] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0154] The audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the mobile phone. The audio circuit 1060 converts the received audio data into electrical signals and transmits them to the speaker 1061, where the speaker 1061 converts them into sound signals for output. On the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are then received by the audio circuit 1060, converted into audio data, and then processed by the processor 1080 before being transmitted via the RF circuit 1010 to, for example, another mobile phone, or the audio data can be output to the memory 1020 for further processing.
[0155] Wi-Fi is a short-range wireless transmission technology. Through the Wi-Fi module 1070, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 6 The Wi-Fi module 1070 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.
[0156] The processor 1080 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes software programs and / or modules stored in the memory 1020 and calls data stored in the memory 1020 to perform various functions and process data, thereby providing overall monitoring of the phone. Optionally, the processor 1080 may include one or more processing units; optionally, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 1080.
[0157] The mobile phone also includes a power supply 1090 (such as a battery) that supplies power to various components. Optionally, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0158] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0159] In this embodiment of the invention, the processor 1080 included in the mobile phone also has a process for controlling and executing the incremental learning method of the graph neural network model executed by the incremental learning device of the graph neural network model.
[0160] This invention also provides a server, please refer to [link / reference]. Figure 7 , Figure 7This is a schematic diagram of a server structure provided in an embodiment of the present invention. The server 1100 can vary considerably due to different configurations or performance. It may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing application programs 1142 or data 1144. The memory 1132 and storage media 1130 may be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations in the storage media 1130 on the server 1100.
[0161] Server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
[0162] The steps performed by the server in the above embodiments can be based on this Figure 7 The structure of server 1100 is shown. For example, central processing unit 1122 performs the following operations by calling instructions in memory 1132: Obtain an incremental dataset, which includes a set of newly added nodes and a set of newly added edges. Based on the incremental dataset, select multiple target boundary nodes from multiple historical nodes in the historical snapshot graph. Construct a knowledge graph based on the multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, generating an incremental subgraph. The incremental subgraph includes newly added nodes from the newly added node set, target boundary nodes, and edge connections between nodes. Input the incremental subgraph into an incremental learning network to obtain new node representations for each node in the incremental subgraph. Input the historical snapshot graph into the original graph neural network model to obtain historical node representations for multiple target boundary nodes, where the original graph neural network model is trained based on the historical snapshot graph. Fuse the historical node representations of multiple target boundary nodes with the new node representations of each node in the incremental subgraph to obtain the final node representation for each node in the incremental subgraph. Freeze the original graph neural network model and iteratively train the incremental learning network based on the final node representations until a preset stopping condition is met. Obtain the dataset to be predicted, process the dataset to be predicted based on the incremental learning network and the original graph neural network model to obtain target node representations, and perform inference based on the target node representations to obtain the target inference result.
[0163] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0164] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0165] In the embodiments provided in this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or modules, and may be electrical, mechanical, or other forms.
[0166] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0167] Furthermore, the functional modules in the various embodiments of this invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0168] According to one aspect of the present invention, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.
[0169] 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.
[0170] A computer program product includes one or more computer instructions. When a computer program is loaded and executed on a computer, it produces, in whole or in part, the flow or function according to embodiments of the present invention. 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, computer instructions may be transmitted from one website, computer, server, or data center to another 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 server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0171] The technical solutions provided by the embodiments of the present invention have been described in detail above. Specific examples have been used in the embodiments of the present invention to illustrate the principles and implementation methods of the embodiments of the present invention. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of the present invention. Therefore, the content of this specification should not be construed as a limitation on the embodiments of the present invention.
Claims
1. An incremental learning method for a graph neural network model, characterized in that, The incremental learning method of the graph neural network model is applied to the server, and the incremental learning method of the graph neural network model includes: Obtain an incremental dataset, which includes a set of newly added nodes and a set of newly added edges. The nodes are users, the set of newly added nodes includes multiple newly added nodes, the newly added nodes are newly registered users, and the set of newly added edges includes friend request connections between users. Based on the incremental dataset, multiple target boundary nodes are selected from multiple historical nodes in the historical snapshot graph, where the historical snapshot graph is a historical social network, including friend relationships between multiple historical nodes, and the historical nodes are registered users. The number of multi-hop paths, the number of common neighbors, and the edge weights between each historical node in the historical snapshot graph and each new node in the new node set are determined. Based on the number of multi-hop paths, the number of common neighbors, and the edge weights, the node topological intimacy between the historical nodes and the new nodes is determined, and the node topological intimacy corresponding to each historical node is obtained. A first preset number of historical nodes with the highest node topological intimacy are selected as multiple target boundary nodes. A knowledge graph is constructed based on multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, and an incremental subgraph is generated. The incremental subgraph includes newly added nodes in the newly added node set, the target boundary nodes, and edge connections between nodes. The incremental subgraph is input into the incremental learning network to obtain new node representations for each node in the incremental subgraph. The historical snapshot image is input into the original graph neural network model to obtain the node history representation of multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot image; The node history representations of multiple target boundary nodes are fused with the new node representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph. Freeze the original graph neural network model, and iteratively train the incremental learning network based on the final node representation until a preset stopping condition is met; A dataset to be predicted is obtained, and the dataset is processed based on the incremental learning network and the original graph neural network model to obtain a target node representation. Inference is then performed based on the target node representation to obtain a target inference result. The dataset to be predicted includes a node set and an edge set, but does not include category labels. The target inference result is a predicted new user relationship.
2. The incremental learning method for the graph neural network model according to claim 1, characterized in that, The process of constructing a knowledge graph based on multiple target boundary nodes, the historical snapshot image, and the incremental dataset, and generating an incremental subgraph, includes: The first-degree neighbor nodes of the target boundary node are determined based on historical snapshot images; Determine the degree centrality index, proximity centrality index, and betweenness centrality index of the first-degree neighbor nodes; The influence parameters of the first-degree neighbor nodes are determined based on their degree centrality, proximity centrality, and betweenness centrality. A knowledge graph is constructed based on multiple target boundary nodes, a second preset number of first-degree neighbor nodes sorted from largest to smallest by influence parameter, the historical snapshot graph, and the incremental dataset, and an incremental subgraph is generated.
3. The incremental learning method for the graph neural network model according to claim 1, characterized in that, The iterative training of the incremental learning network based on the final node representation until a preset stopping condition is met includes: The final node representation of each node is input into the main task prediction module to obtain the prediction category of each node; The main task loss is determined based on the predicted category and category label of each node. A perturbation is added to the incremental subgraph to obtain a perturbed subgraph, and the perturbed subgraph is input into the incremental learning network to obtain the node perturbation representation of each node in the perturbed subgraph; The new node representations of each node in the incremental subgraph are used as positive samples, and the perturbation representations of each node in the perturbation subgraph are used as negative samples to determine the contrast loss. The total loss is determined based on the main task loss and the contrast loss, and the incremental learning network is iteratively updated based on the total loss until the preset stopping condition is met.
4. The incremental learning method for the graph neural network model according to claim 3, characterized in that, The process of determining the total loss based on the main task loss and the contrastive loss, and iteratively updating the incremental learning network based on the total loss until a preset stopping condition is met, includes: The final node representation of the target boundary node is input into the first activation function module to obtain the first classification probability vector of each node; The node history representation of the target boundary node is input into the second activation function module to obtain the second classification probability vector; The distillation loss is determined based on the first classification probability vector and the second classification probability of the target boundary node; The total loss is determined iteratively based on the main task loss, comparison loss, and distillation loss. The incremental learning network is iteratively updated based on the total loss until the preset stopping condition is met.
5. The incremental learning method for the graph neural network model according to claim 1, characterized in that, The step of fusing the historical node representations of multiple target boundary nodes with the new node representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph includes: Obtain the node characteristics and local topology information of the target boundary nodes; The node features and local topology information of the target boundary node are input into the gated fusion network to obtain the new representation weight and historical representation weight of the target boundary node. The node's historical representation and new representation are fused based on the new representation weight and the historical representation weight to obtain the final node representation of the target boundary node.
6. An incremental learning device for a graph neural network model, characterized in that, The incremental learning device for the graph neural network model is applied to a server, and the incremental learning device for the graph neural network model includes: The acquisition module is configured to acquire an incremental dataset, which includes a newly added node set and a newly added edge set. The nodes are users, the newly added node set includes multiple newly added nodes, the newly added nodes are newly registered users, and the newly added edge set includes friend request connections between users. The filtering module is configured to filter multiple target boundary nodes from multiple historical nodes in a historical snapshot graph based on the incremental dataset. The historical snapshot graph represents a historical social network, including friend relationships between multiple historical nodes, where each historical node is a registered user. The module determines the number of multi-hop paths, the number of common neighbors, and the edge weights between each historical node in the historical snapshot graph and each new node in the new node set. Based on the number of multi-hop paths, the number of common neighbors, and the edge weights, the module determines the node topological affinity between the historical nodes and the new nodes, obtaining the node topological affinity corresponding to each historical node. A first preset number of historical nodes with the highest node topological affinity are selected as the multiple target boundary nodes. The construction module is configured to build a knowledge graph based on multiple target boundary nodes, the historical snapshot graph, and the incremental dataset, and generate an incremental subgraph, wherein the incremental subgraph includes newly added nodes in the newly added node set, the target boundary nodes, and edge connections between nodes; The first representation module is configured to input the incremental subgraph into the incremental learning network to obtain new node representations for each node in the incremental subgraph. The second representation module is configured to input the historical snapshot image into the original graph neural network model to obtain the node history representations of multiple target boundary nodes, wherein the original graph neural network model is trained based on the historical snapshot image; The fusion module is configured to fuse the node history representations of multiple target boundary nodes with the node new representations of each node in the incremental subgraph to obtain the final node representation of each node in the incremental subgraph. The training module is configured to freeze the original graph neural network model and iteratively train the incremental learning network based on the final node representation until a preset stopping condition is met. The inference module is configured to acquire a dataset to be predicted, process the dataset to be predicted based on the incremental learning network and the original graph neural network model to obtain a target node representation, and perform inference based on the target node representation to obtain a target inference result. The dataset to be predicted includes a node set and an edge set, but does not include category labels. The target inference result is a predicted new user relationship.
7. A computing device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It includes instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1-5.
9. A computer program product containing instructions, characterized in that, The computer program product includes program instructions that, when executed on a computer or processor, cause the computer or processor to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Bridge key position disease prediction method and system based on graph convolutional neural network
CN120105566A
Graph structure aware incremental learning for recommender system
US20230206076A1