Node Feature Extraction Method, Device and Storage Medium for Graph Structure
By extracting both supervised and unsupervised node features in graph structures, the method addresses the challenge of low accuracy in unlabeled nodes, enhancing data processing and model quality in graph structure analysis.
Patent Information
- Application Number
- CN202111404882.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-11-24
AI Technical Summary
In the prior art, there are many nodes in the graph structure data that do not carry label information, resulting in low data processing accuracy, and the existing semi-supervised learning models have high computational complexity in large graph structure data, and insufficient training stability and generalization capabilities.
By obtaining the pending graph structure, unsupervised node features and supervised node features are determined, semi-supervised node features are extracted in combination with a dual-channel encoder, and data processing is used to reduce the cost of obtaining tag information and improve model accuracy.
Accurate classification prediction of unlabeled nodes in graph structure data is realized, the cost of obtaining tag information is reduced, the accuracy and generalization ability of the semi-supervised learning model is improved, and the quality and efficiency of data processing are enhanced.
Smart Images

Figure CN114118410B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graph structures, and in particular, to a method, device, and storage medium for extracting node features of a graph structure. Background Art
[0002] Graph-structured data refers to various complex data objects described by the features of nodes and the connection relationships between nodes. For example, for the citation relationships between articles, each article can be used as a node to generate graph-structured data, and data processing is performed based on the graph-structured data to achieve information integration of the articles.
[0003] For graph-structured data, the graph-structured data can include multiple nodes, among which, the multiple nodes can include nodes carrying label information and nodes not carrying label information. When analyzing and processing the graph-structured data, data processing operations are often directly performed based on the feature information of the nodes carrying label information. However, since the graph-structured data includes nodes not carrying label information, and the number of nodes not carrying label information is generally large, the accuracy of data processing for the graph-structured data without considering the feature information corresponding to the nodes not carrying label information is relatively low. Summary of the Invention
[0004] Embodiments of the present invention provide a method, device, and storage medium for extracting node features of a graph structure, which effectively realizes accurately obtaining semi-supervised node features corresponding to the graph structure based on unsupervised node features and supervised node features, and then data processing operations can be performed based on the semi-supervised node features, improving the accuracy of data processing.
[0005] In a first aspect, an embodiment of the present invention provides a method for extracting node features of a graph structure, including:
[0006] Obtain a graph structure to be processed, where the graph structure to be processed includes multiple nodes, and some of the multiple nodes correspond to label information;
[0007] Process the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the nodes, where the supervised node features are related to the label information;
[0008] Based on the unsupervised node features and the supervised node features, determine semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0009] In a second aspect, an embodiment of the present invention provides a device for extracting node features of a graph structure, including:
[0010] A first acquisition module, configured to acquire a graph structure to be processed, where the graph structure to be processed includes a plurality of nodes, and label information corresponds to some of the plurality of nodes;
[0011] A first processing module, configured to process the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the nodes, where the supervised node features are related to the label information;
[0012] A first determination module, configured to determine semi-supervised node features corresponding to the nodes in the graph structure to be processed based on the unsupervised node features and the supervised node features.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor; where the memory is configured to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the method for extracting node features of a graph structure in the first aspect above is implemented.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, configured to store a computer program, where when the computer program is executed by a computer, the method for extracting node features of a graph structure in the first aspect above is implemented.
[0015] In a fifth aspect, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, enabling the processor to execute the steps in the method for extracting node features of a graph structure shown in the first aspect above.
[0016] In a sixth aspect, an embodiment of the present invention provides a method for training a semi-supervised learning model, including:
[0017] Acquiring a sample graph structure, where the sample graph structure includes a plurality of nodes, and label information corresponds to some of the plurality of nodes;
[0018] Determining unsupervised node features and supervised node features corresponding to the nodes;
[0019] Performing learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model, and the semi-supervised learning model is trained to predict label information corresponding to nodes in the graph structure to be processed.
[0020] In a seventh aspect, an embodiment of the present invention provides a training device for a semi-supervised learning model, including:
[0021] A second acquisition module, configured to acquire a sample graph structure, where the sample graph structure includes multiple nodes, and among them, some of the multiple nodes correspond to label information;
[0022] A second determination module, configured to determine unsupervised node features and supervised node features corresponding to the nodes;
[0023] A second processing module, configured to perform learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes, to obtain a semi-supervised learning model, and the semi-supervised learning model is trained to predict label information corresponding to nodes in the to-be-processed graph structure.
[0024] In an eighth aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor; wherein, the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the training method of the semi-supervised learning model in the above sixth aspect is implemented.
[0025] In a ninth aspect, an embodiment of the present invention provides a computer storage medium, configured to store a computer program, and when the computer program is executed by a computer, the training method of the semi-supervised learning model in the above sixth aspect is implemented.
[0026] In a tenth aspect, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, enabling the processor to execute the steps in the training method of the semi-supervised learning model shown in the above sixth aspect.
[0027] In an eleventh aspect, an embodiment of the present invention provides a method for determining traffic flow, including:
[0028] Acquire a to-be-processed graph structure, where the to-be-processed graph structure includes multiple traffic nodes, and some of the multiple traffic nodes correspond to label information;
[0029] Process the to-be-processed graph structure to determine unsupervised node features and supervised node features corresponding to the traffic nodes, and the supervised node features are related to the label information;
[0030] Based on the unsupervised node features and the supervised node features, determine semi-supervised node features corresponding to traffic nodes in the to-be-processed graph structure;
[0031] Based on the semi-supervised node features, determine traffic flow corresponding to the traffic nodes.
[0032] In a twelfth aspect, an embodiment of the present invention provides a device for determining traffic flow, including:
[0033] A third acquisition module, configured to acquire a graph structure to be processed, where the graph structure to be processed includes a plurality of traffic nodes, and label information corresponds to some of the plurality of traffic nodes;
[0034] A third processing module, configured to process the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the traffic nodes, where the supervised node features are related to the label information;
[0035] A third determination module, configured to determine semi-supervised node features corresponding to the traffic nodes in the graph structure to be processed based on the unsupervised node features and the supervised node features;
[0036] The third determination module is further configured to determine traffic flow corresponding to the traffic nodes based on the semi-supervised node features.
[0037] In a thirteenth aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor; where the memory is configured to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the method for determining traffic flow in the eleventh aspect above is implemented.
[0038] In a fourteenth aspect, an embodiment of the present invention provides a computer storage medium, configured to store a computer program, and when the computer program is executed by a computer, the method for determining traffic flow in the eleventh aspect above is implemented.
[0039] In a fifteenth aspect, an embodiment of the present invention provides a computer program product, including: a computer program, and when the computer program is executed by a processor of an electronic device, the processor is caused to execute the steps in the method for determining traffic flow shown in the eleventh aspect above.
[0040] The technical solution provided in this embodiment acquires a graph structure to be processed, and then processes the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the nodes. Among them, the supervised node features are related to the label information corresponding to the nodes, and the unsupervised node features are not related to the label information corresponding to the nodes. Then, based on the unsupervised node features and the supervised node features, the semi-supervised node features corresponding to the graph structure can be accurately obtained. The obtained semi-supervised node features can classify and predict the nodes in the graph structure to be processed that do not correspond to label information, so that a large amount of label information can be obtained. This not only reduces the cost of obtaining label information, but also helps to obtain a semi-supervised learning model with a relatively high accuracy rate based on a large amount of label information. This is conducive to improving the quality and requirements of analyzing and processing the graph structure using the obtained semi-supervised learning model, and further ensures the practicability of this method. Brief Description of the Drawings
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 It is a schematic diagram of the scenario of a method for extracting node features of a graph structure provided by an embodiment of the present invention;
[0043] Figure 2 It is a schematic flowchart of a method for extracting node features of a graph structure provided by an embodiment of the present invention;
[0044] Figure 3 It is a schematic flowchart of a method for obtaining a graph structure to be processed provided by an embodiment of the present invention;
[0045] Figure 4 It is a schematic flowchart of a method for training a semi-supervised learning model provided by an embodiment of the present invention;
[0046] Figure 5 It is a schematic flowchart of learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to the partial nodes to obtain a semi-supervised learning model provided by an embodiment of the present invention;
[0047] Figure 6 It is a schematic flowchart of a method for training a semi-supervised learning model provided by an embodiment of the present invention;
[0048] Figure 7 It is a schematic flowchart of a method for training a semi-supervised learning model provided by an application embodiment of the present invention;
[0049] Figure 8 It is a schematic structural diagram of a device for extracting node features of a graph structure provided by an embodiment of the present invention;
[0050] Figure 9 For Figure 8 It is a schematic structural diagram of an electronic device corresponding to the device for extracting node features of a graph structure shown in the embodiment;
[0051] Figure 10 It is a schematic structural diagram of a device for training a semi-supervised learning model provided by an embodiment of the present invention;
[0052] Figure 11 For Figure 10Schematic structural diagram of an electronic device corresponding to the training device of the semi-supervised learning model provided by the illustrated embodiment;
[0053] Figure 12 Flowchart of a method for determining traffic flow provided by an embodiment of the present invention;
[0054] Figure 13 Schematic structural diagram of a device for determining traffic flow provided by an embodiment of the present invention;
[0055] Figure 14 For Figure 13 Schematic structural diagram of an electronic device corresponding to the device for determining traffic flow provided by the illustrated embodiment. Detailed implementation manners
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention, but do not exclude the situation of including at least one. It should be understood that the terms "and / or" used herein are for describing the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0057] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the", and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. "Multiple" generally includes at least two. "And / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0058] Depending on the context, the words "if", "when" as used herein may be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" may be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".
[0059] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a commodity or system comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such commodity or system. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the commodity or system comprising said element.
[0060] Term Definition:
[0061] Semi-Supervised Learning (SSL for short): It is a learning method that combines supervised learning (fully labeled training data) with unsupervised learning (training data without any labels). Semi-Supervised Learning uses a large amount of unlabeled data and at the same time uses labeled data to perform machine learning tasks.
[0062] Generalization ability: It refers to the adaptability of a machine learning algorithm to new sample data and the ability of the model to accurately predict on a new data set.
[0063] Fitting ability: It refers to the adaptability of a machine learning algorithm to training data and the ability of the model to accurately predict on the training set.
[0064] Pre-train: It is to train a model through a large amount of data sets to obtain a set of model parameters, use this set of parameters to initialize the model, and then fine-tune the model on a similar data set according to specific tasks.
[0065] Sampling: Extract samples from a data set through certain rules or algorithms.
[0066] To facilitate the understanding of the specific implementation process and implementation effect of the technical solution in this application, the related technologies are briefly described below:
[0067] Graph-structured data refers to various complex data objects described by the features of nodes and the connection relationships between nodes. For example, for the citation relationships between articles, each article can be used as a node to generate graph-structured data, and data processing is performed based on the graph-structured data to achieve information integration of the articles.
[0068] For graph-structured data, the graph-structured data can include multiple nodes, among which, the multiple nodes can include nodes carrying label information and nodes not carrying label information. When analyzing and processing graph-structured data, data processing operations are often directly based on the feature information of the nodes carrying label information. However, since the graph-structured data includes nodes not carrying label information, and the number of nodes not carrying label information is generally large, the accuracy of data processing of the graph-structured data without considering the feature information corresponding to the nodes not carrying label information is relatively low.
[0069] In addition, semi-supervised learning based on graph-structured data (SSL-G) refers to combining ubiquitous unlabeled knowledge (such as graph topology, node attributes) with rarely available labeled knowledge (such as node class labels) to perform machine learning operations. The implementation methods of semi-supervised graph learning mainly include: semi-supervised learning of the complete graph based on graph neural networks (Graph Neural Network, abbreviated as GNN), semi-supervised learning based on sampled subgraphs. Specifically:
[0070] (1) Semi-supervised learning of the complete graph based on GNN: Using the overall graph-structured data as input to perform supervised learning operations to generate a semi-supervised learning network. However, the time complexity of the above semi-supervised learning network is high and it is difficult to apply to large-scale graph-structured data. At the same time, in the complete graph-structured data, the interconnected graph structure prevents parallel computing of the graph-structured data, making it difficult to perform the computing operations of a graph-structured data in parallel on multiple cards.
[0071] (2) Semi-supervised learning based on sampled subgraphs: Sampling the overall graph-structured data to obtain a sampled subgraph, and performing supervised learning operations through the sampled subgraph, so as to obtain a semi-supervised learning network model. Specifically, the sampling methods of graph-structured data can include: batch training algorithms (fast learning with Graph Convolutional Networks Via Importance Sampling, abbreviated as fastGCN), etc. When performing supervised learning operations through the sampled subgraph, the number of edges can be reduced to improve the learning quality and efficiency of the semi-supervised learning network. However, since the order of magnitude of the number of nodes remains unchanged, the problem cannot be fundamentally solved.
[0072] In addition, for graph-structured data, since labels are expensive, when the number of labels is small, the distribution of labels on a large graph may be sparse and uneven. Therefore, after obtaining the sampled subgraphs, some sampled subgraphs may retain very few labeled nodes or even no labeled nodes. At this time, when performing supervised learning operations based on the above-mentioned sampled subgraphs, the training stability of the semi-supervised learning network cannot be guaranteed. Additionally, when using labeled nodes as constraints for supervised training to obtain a semi-supervised learning network model, the labels of unlabeled samples can be obtained through the semi-supervised learning network model. However, the semi-supervised model obtained above is highly dependent on the prediction quality of the classification model. When the number of samples is small, it is prone to bias, and it has a strong label dependence on the labels of the training data, resulting in poor generalization and robustness of the semi-supervised model.
[0073] Generally speaking, there are still challenges in how to accurately obtain the feature information corresponding to graph-structured data, and how to effectively utilize a limited number of labeled data to train and obtain a semi-supervised learning model with a relatively high accuracy, while also balancing the generalization ability and fitting ability of the semi-supervised learning model.
[0074] To solve the above technical problems, this embodiment provides a method, device, and storage medium for extracting node features of a graph structure. Among them, the execution subject of the method for extracting node features of a graph structure is a device for extracting node features of a graph structure. The device for extracting node features of a graph structure is communicatively connected to a client / request end. Refer to the attached Figure 1 as shown:
[0075] Among them, the client can be any computing device with certain data transmission capabilities. Specifically, in implementation, the client can be a desktop computer, a tablet computer, a set application program, etc. In addition, the basic structure of the client can include: at least one processor. The number of processors depends on the configuration and type of the client. The client can also include a memory, which can be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or can also include both types at the same time. Generally, an operating system (OS), one or more application programs, and program data can be stored in the memory. In addition to the processing unit and the memory, the client also includes some basic configurations, such as a network card chip, an IO bus, a display component, and some peripheral devices. Optionally, some peripheral devices can include, for example, a keyboard, a mouse, a stylus, a printer, etc. Other peripheral devices are well known in the art and will not be elaborated here.
[0076] The node feature extraction device for graph structure refers to a device that can provide node feature extraction services for graph structure in a network virtual environment, usually referring to a device that uses the network for information planning and node feature extraction operations of graph structure. In terms of physical implementation, the node feature extraction device for graph structure can be any device that can provide computing services, respond to service requests, and perform processing. For example, it can be a cluster server, a conventional server, a cloud server, a cloud host, a virtual center, etc. The composition of the node feature extraction device for graph structure mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture.
[0077] In the above-mentioned embodiment of the present application, the client can establish a network connection with the node feature extraction device for graph structure, and this network connection can be a wireless or wired network connection. If the client is in communication connection with the node feature extraction device for graph structure, the network mode of this mobile network can be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), WiMax, 5G, etc.
[0078] In the embodiment of the present application, the client can obtain a graph structure to be processed for generation or acquisition. Specifically, it can obtain the graph structure to be processed based on the execution operation input by the user. The graph structure to be processed refers to a graph structure that needs to perform feature extraction operations. The graph structure to be processed can include multiple nodes, and some of the multiple nodes correspond to label information. After obtaining the graph structure to be processed, the graph structure to be processed can be sent to the node feature extraction device for graph structure, so that the node feature extraction device for graph structure can obtain the graph structure to be processed and analyze and process the graph structure to be processed to obtain semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0079] The node feature extraction device for graph structure is used to obtain the graph structure to be processed; then process the graph structure to be processed, and can determine unsupervised node features and supervised node features corresponding to the nodes in the graph structure to be processed. The above nodes can include nodes corresponding to label information and nodes not corresponding to label information; after obtaining the unsupervised node features and supervised node features, semi-supervised node features corresponding to the nodes in the graph structure to be processed can be generated based on the unsupervised node features and supervised node features, and the semi-supervised node features are used to classify and predict the nodes not corresponding to label information.
[0080] The technical solution provided in this embodiment analyzes and processes the obtained graph structure to be processed, determines unsupervised node features and supervised node features corresponding to nodes, where the supervised node features are related to the label information corresponding to the nodes, and the unsupervised node features are not related to the label information corresponding to the nodes. Then, the semi-supervised node features corresponding to the nodes in the graph structure can be accurately obtained based on the unsupervised node features and the supervised node features. The obtained semi-supervised node features can be used to classify and predict the nodes in the graph structure to be processed that do not have corresponding label information, so that a large amount of label information can be obtained. This not only reduces the cost of obtaining label information, but also helps to obtain a semi-supervised learning model with a relatively high accuracy based on a large amount of label information, and further helps to improve the quality and requirements of analyzing and processing the graph structure using the obtained semi-supervised learning model, further ensuring the practicability of this method.
[0081] The following will describe in detail some embodiments of the present invention with reference to the accompanying drawings. Without conflict between the embodiments, the embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and is not strictly limited.
[0082] Figure 2 It is a schematic flowchart of a method for extracting node features of a graph structure provided in an embodiment of the present invention; refer to the attached Figure 2 As shown, this embodiment provides a method for extracting node features of a graph structure. The execution subject of this method can be a device for extracting node features of a graph structure. The device for extracting node features of a graph structure can be implemented as software, or a combination of software and hardware. Specifically, the method for extracting node features of a graph structure can include the following steps:
[0083] Step S201: Obtain a graph structure to be processed, where the graph structure to be processed includes multiple nodes, and some of the multiple nodes correspond to label information.
[0084] Step S202: Process the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the nodes. The supervised node features are related to the label information.
[0085] Step S203: Based on the unsupervised node features and the supervised node features, determine semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0086] The following will describe each of the above steps in detail:
[0087] Step S201: Obtain a graph structure to be processed, where the graph structure to be processed includes multiple nodes, and some of the multiple nodes correspond to label information.
[0088] Among them, the graph structure to be processed may refer to the graph structure data for which feature extraction operations need to be performed. The graph structure to be processed may include multiple nodes, and some of the multiple nodes correspond to label information. That is, the graph structure to be processed includes two types of nodes, one type of node corresponds to label information, and the other type of node does not correspond to label information. For the convenience of understanding and explanation, the nodes corresponding to label information in the graph structure to be processed can be called labeled nodes, and the nodes not corresponding to label information in the graph structure to be processed can be called unlabeled nodes.
[0089] In some instances, for the graph structure to be processed, the graph structure to be processed may refer to the entire graph structure corresponding to the whole graph or may refer to the subgraph structure corresponding to the subgraph. When the graph structure to be processed is the entire graph structure, the graph structure to be processed can be used to express a complete data relationship, and moreover, the graph structure to be processed may include multiple subgraph structures, and different subgraph structures can be used to characterize different association relationships. Among them, the subgraph structure can be a part obtained by sampling or partitioning the entire graph structure.
[0090] In addition, in different application scenarios, the graph structure to be processed can be used to characterize different data relationships. For example: in the application scenario of social networking, the graph structure to be processed can be used to characterize the friendship, classmate relationship, colleague relationship, and transaction relationship between users, etc.; in the field of file citation, the graph structure to be processed can be used to characterize the citation relationship between files, etc.; in addition, the graph structure to be processed can also be a graph structure constructed based on the line relationship between various destinations on the map, or in other application scenarios, the graph structure to be processed can also characterize various relationships corresponding to pictures, sentences, etc., and this is not limited.
[0091] In addition, this embodiment does not limit the specific implementation manner of obtaining the graph structure to be processed. Those skilled in the art can set it according to specific application scenarios or application requirements. For example: the graph structure to be processed can be stored in a preset area, and the graph structure to be processed can be obtained by accessing the preset area; or, the graph structure to be processed can be stored in a third device, the third device is communicatively connected to the node feature extraction device, the node feature extraction device can send a request message to the third device, and the third device can send the graph structure to be processed to the node feature extraction device based on the request message, so that the node feature extraction device can stably obtain the graph structure to be processed. Or, an interaction interface can be set on the node feature extraction device, and the user can input configuration operations of the graph structure on the interaction interface, and the graph structure to be processed can be generated through the configuration operations of the graph structure.
[0092] Step S202: Process the graph structure to be processed to determine the unsupervised node features and supervised node features corresponding to the nodes. The supervised node features are related to the label information.
[0093] After obtaining the graph structure to be processed, the graph structure to be processed can be analyzed to determine the unsupervised node features and supervised node features corresponding to the nodes. The supervised node features are related to the label information corresponding to the nodes in the graph structure to be processed, and the unsupervised nodes are not related to the label information corresponding to the nodes in the graph structure to be processed.
[0094] It should be noted that the nodes in the graph structure to be processed include labeled nodes and unlabeled nodes. For both labeled nodes and unlabeled nodes, unsupervised node features and supervised node features will be obtained. For example, the nodes in the graph structure to be processed include: the first node (unlabeled node), the second node (labeled node), and the third node (unlabeled node). After obtaining the above graph structure to be processed, the graph structure to be processed can be analyzed to obtain the unsupervised node features and supervised node features corresponding to the first node, the unsupervised node features and supervised node features corresponding to the second node, and the unsupervised node features and supervised node features corresponding to the third node.
[0095] In some instances, processing the graph structure to be processed and determining the unsupervised node features and supervised node features corresponding to the nodes may include: obtaining a machine learning model for analyzing the graph structure to be processed, and using the machine learning model to analyze the graph structure to be processed, so as to determine the unsupervised node features and supervised node features corresponding to the nodes. Among them, the machine learning model is trained to determine the supervised node features and unsupervised node features of the nodes in the graph structure.
[0096] In other instances, processing the graph structure to be processed and determining the unsupervised node features and supervised node features corresponding to the nodes may include: obtaining a first processor and a second processor for analyzing the graph structure to be processed, using the first processor to analyze the graph structure to be processed to determine the unsupervised node features corresponding to the nodes; using the second processor to analyze the graph structure to be processed to determine the supervised node features corresponding to the nodes, so as to stably obtain the unsupervised node features and supervised node features.
[0097] In still other instances, the graph structure to be processed further includes node topology information for identifying the association relationship between nodes, and the above node topology information can be called an edge structure; at this time, processing the graph structure to be processed and determining the unsupervised node features and supervised node features corresponding to the nodes may include: processing the node topology information and nodes in the graph structure to be processed to determine the unsupervised node features corresponding to the nodes; processing the node topology information, nodes, and label information in the graph structure to be processed to determine the supervised node features corresponding to the nodes.
[0098] Specifically, a first data channel (or a first encoder) for analyzing and processing the node topology information and nodes in the graph structure to be processed and a second data channel (or a second encoder) for analyzing and processing the node topology information, nodes, and label information in the graph structure to be processed are pre-configured. After obtaining the graph structure to be processed, the node topology information and nodes in the graph structure to be processed can be input into the first data channel, so that the unsupervised node features corresponding to the nodes can be determined. At this time, the obtained unsupervised node features are independent of the label information. In addition, after obtaining the graph structure to be processed, the node topology information, nodes, and label information in the graph structure to be processed can be input into the second data channel, so that the supervised node features corresponding to the nodes can be determined. At this time, the obtained supervised node features are related to the label information. By processing the node topology information and nodes in the graph structure to be processed to determine the unsupervised node features corresponding to the nodes, and processing the node topology information, nodes, and label information in the graph structure to be processed, it effectively realizes the processing of the graph structure to be processed through a dual-channel, which can not only facilitate the parallel data processing operation of the graph structure to be processed, but also stably obtain the unsupervised node features and the supervised node features.
[0099] It should be noted that the first data channel and the second data channel can be used to analyze and process the graph structure to be processed synchronously or asynchronously, so that the unsupervised node features and the supervised node features corresponding to the nodes can be determined synchronously or asynchronously.
[0100] Step S203: Based on the unsupervised node features and the supervised node features, determine the semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0101] After obtaining the unsupervised node features and the supervised node features, the unsupervised node features and the supervised node features can be analyzed and processed to determine the semi-supervised node features corresponding to the nodes in the graph structure to be processed. The semi-supervised node features can be used for classification prediction operations on the nodes in the graph structure to be processed that do not correspond to label information. In some instances, determining the semi-supervised node features corresponding to the nodes in the graph structure to be processed based on the unsupervised node features and the supervised node features may include: obtaining the weight information corresponding to the unsupervised node features and the supervised node features respectively, and performing a weighted summation process on the unsupervised node features and the supervised node features using the weight information, so that the semi-supervised node features can be obtained.
[0102] In other instances, determining the semi-supervised node features corresponding to the nodes in the graph structure to be processed based on the unsupervised node features and the supervised node features may include: performing a fusion process on the unsupervised node features and the supervised node features to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0103] After obtaining the unsupervised node and supervised node features, the unsupervised node features and the supervised node features can be fused to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed. Specifically, fusing the unsupervised node features and the supervised node features to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed may include: taking the matrix rows as the basis, splicing the unsupervised node features and the supervised node features to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed. Alternatively, those skilled in the art can also take the matrix columns as the basis and splice the unsupervised node features and the supervised node features to accurately obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0104] In some other examples, after determining the semi-supervised node features corresponding to the nodes in the graph structure to be processed, the method in this embodiment may further include: determining the label information corresponding to the nodes in the graph structure to be processed that do not have corresponding label information based on the semi-supervised node features, thereby effectively improving the practicability of the method.
[0105] The method for extracting node features of the graph structure provided in this embodiment obtains the graph structure to be processed, and then processes the graph structure to be processed to determine the unsupervised node features and the supervised node features corresponding to the nodes. Among them, the supervised node features are related to the label information corresponding to the nodes, and the unsupervised node features are not related to the label information corresponding to the nodes. Then, based on the unsupervised node features and the supervised node features, the semi-supervised node features corresponding to the graph structure can be accurately obtained. The obtained semi-supervised node features can be used to classify and predict the nodes in the graph structure to be processed that do not have corresponding label information, so that a large amount of label information can be obtained. This not only reduces the cost of obtaining label information, but also helps to obtain a semi-supervised learning model with higher accuracy based on the obtained label information. This is beneficial to improving the quality and requirements of analyzing and processing the graph structure using the obtained semi-supervised learning model, further ensuring the practicability of the method, and facilitating the market promotion and application.
[0106] Figure 3 It is a schematic flowchart of a method for obtaining a graph structure to be processed provided by an embodiment of the present invention; refer to the appendix Figure 3 As shown, this embodiment provides an implementation manner for obtaining a graph structure to be processed. Specifically, obtaining the graph structure to be processed in this embodiment may include:
[0107] Step S301: Obtain the original graph structure.
[0108] Among them, the method for obtaining the original graph structure is similar to the method for obtaining the graph structure to be processed in step S201 above. For specific details, please refer to the above description and will not be elaborated here.
[0109] Step S302: Sample the original graph structure to obtain at least one graph structure to be processed corresponding to the original graph structure. The graph structure to be processed is at least a part of the original graph structure.
[0110] Specifically, in order to improve the quality and efficiency of feature extraction, the graph structure to be processed obtained above can be a sub-graph structure obtained by sampling the original graph structure. At this time, sampling the original graph structure to obtain at least one graph structure to be processed corresponding to the original graph structure may include: obtaining parameter information for sampling the original graph structure. Specifically, the parameter information can be input or configured by the user. In different application scenarios, the obtained parameter information for sampling the original graph structure is different. After obtaining the parameter information, sample the original graph structure based on the parameter information, so as to obtain at least one graph structure to be processed corresponding to the original graph structure. The graph structure to be processed can be at least a part of the original graph structure.
[0111] In some other examples, sampling the original graph structure to obtain at least one graph structure to be processed corresponding to the original graph structure may include: obtaining at least one node in the original graph structure; sampling at least one node and the adjacent nodes corresponding to each node to obtain at least one graph structure to be processed.
[0112] Specifically, the original graph structure may include multiple nodes, each node may have its own corresponding adjacent nodes, and the adjacent nodes corresponding to each node may be nodes within a preset distance range. Simply put, the adjacent nodes corresponding to a node refer to other nodes around the node. Among them, the number of adjacent nodes corresponding to each node can be one or more, and the number of adjacent nodes corresponding to different nodes can be different.
[0113] In order to implement the sampling operation on the original graph structure, after obtaining the original graph structure, at least one node in the original graph structure can be obtained, and then at least one node and the adjacent nodes corresponding to each node are sampled, so as to obtain at least one graph structure to be processed. The graph structure to be processed is the sub-graph structure corresponding to a certain node in the original graph structure. The graph structure to be processed includes the above node and the adjacent nodes corresponding to the above node, thus effectively ensuring the accuracy and reliability of obtaining the graph structure to be processed. It should be noted that the number of nodes included in different graph structures to be processed can be the same or different.
[0114] In this embodiment, by obtaining the original graph structure and then sampling the original graph structure, at least one graph structure to be processed corresponding to the original graph structure is obtained. The graph structure to be processed is at least a part of the original graph structure, effectively realizing that an original graph structure can be sampled into at least one graph structure to be processed. Then, by analyzing and processing the above-mentioned graph structure to be processed, and then obtaining the analysis and processing result of the original graph structure based on the analysis and processing result of the graph structure to be processed. This not only reduces the data volume corresponding to the original graph structure and the data processing resources required for analyzing and processing the original graph structure, but also can analyze and process different graph structures to be processed in parallel, effectively improving the quality and efficiency of analyzing and processing the original graph structure, and further improving the stability and reliability of the method.
[0115] Figure 4 It is a schematic flowchart of a method for training a semi-supervised learning model provided by an embodiment of the present invention; refer to the attached Figure 4 As shown, this embodiment provides a method for training a graph semi-supervised learning model. The execution subject of this method can be a training device for the semi-supervised learning model. The training device for the semi-supervised learning model can be implemented as software, or a combination of software and hardware. Specifically, the method for training the semi-supervised learning model can include the following steps:
[0116] Step S401: Obtain a sample graph structure, where the sample graph structure includes multiple nodes, and among them, some of the multiple nodes correspond to label information.
[0117] Step S402: Determine the unsupervised node features and supervised node features corresponding to the nodes.
[0118] Step S403: Perform learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model. The semi-supervised learning model is trained to predict the label information corresponding to the nodes in the graph structure to be processed.
[0119] The following is a detailed description of each of the above steps:
[0120] Step S401: Obtain a sample graph structure, where the sample graph structure includes multiple nodes, and among them, some of the multiple nodes correspond to label information.
[0121] Among them, the sample graph structure may refer to graph structure data with standard features. The sample graph structure may include multiple nodes, and some of the multiple nodes correspond to label information. That is, the sample graph structure includes two types of nodes. One type of node corresponds to label information, and the other type of node does not correspond to label information. For the convenience of representation, the nodes in the sample graph structure that correspond to label information can be marked nodes, and the nodes in the sample graph structure that do not correspond to label information can be unmarked nodes.
[0122] Step S402: Determine the unsupervised node features and supervised node features corresponding to the nodes.
[0123] In some instances, the implementation manners and implementation effects of the above steps S401 - S402 in this embodiment are similar to the specific implementation manners and implementation effects of steps S201 - S202 in the above embodiment. For specific references, please refer to the above statements and will not be elaborated here.
[0124] In other instances, the semi - supervised learning model may include a first sub - model and a second sub - model; the determination of the unsupervised node features and supervised node features corresponding to the nodes in this embodiment may include: using the first sub - model to process the node topology information and nodes in the sample graph structure to determine the unsupervised node features corresponding to the nodes; using the second sub - model to process the node topology information, nodes, and label information in the sample graph structure to determine the supervised node features corresponding to the nodes.
[0125] Specifically, a first sub - model for analyzing and processing the node topology information and nodes in the sample graph structure and a second sub - model for analyzing and processing the node topology information, nodes, and label information in the sample graph structure are pre - configured. After obtaining the sample graph structure, the node topology information and nodes in the sample graph structure can be input into the first sub - model, so as to determine the unsupervised node features corresponding to the nodes. At this time, the unsupervised node features are irrelevant to the label information. In addition, after obtaining the sample graph structure, the node topology information, nodes, and label information in the sample graph structure can be input into the second sub - model, so as to determine the supervised node features corresponding to the nodes. The supervised node features are related to the label information. By processing the node topology information and nodes in the sample graph structure, the unsupervised node features corresponding to the nodes are determined; by processing the node topology information, nodes, and label information in the sample graph structure, the extraction and processing of different features in the sample graph structure are effectively realized through two channels (i.e., the channel corresponding to the first sub - model and the channel corresponding to the second sub - model), and the unsupervised node features and supervised node features can be stably obtained.
[0126] It should be noted that the sample graph structure can be analyzed and processed synchronously or asynchronously using the first sub-model and the second sub-model, so that the unsupervised node features and supervised node features corresponding to the nodes can be determined synchronously or asynchronously.
[0127] Step S403: Perform learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model, which is trained to predict the label information corresponding to the nodes in the graph structure to be processed.
[0128] After obtaining the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes for learning and training, a semi-supervised learning model can be obtained, which is trained to predict the label information corresponding to the nodes in the graph structure to be processed that do not have corresponding label information.
[0129] In some examples, performing learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model may include: obtaining semi-supervised node features corresponding to the nodes in the sample graph structure based on the unsupervised node features and supervised node features; performing learning and training based on the sample graph structure, semi-supervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model.
[0130] Specifically, after obtaining the unsupervised node features and supervised node features, the unsupervised node features and supervised node features can be analyzed and processed to determine the semi-supervised node features corresponding to the nodes in the graph structure to be processed, and the semi-supervised node features can be used to perform classification prediction operations on the nodes in the graph structure to be processed that do not have corresponding label information. In some examples, determining the semi-supervised node features corresponding to the nodes in the graph structure to be processed based on the unsupervised node features and supervised node features may include: obtaining the weight information corresponding to the unsupervised node features and supervised node features respectively, and performing weighted summation processing on the unsupervised node features and supervised node features using the weight information, so that semi-supervised node features can be obtained.
[0131] In other examples, determining the semi-supervised node features corresponding to the nodes in the graph structure to be processed based on the unsupervised node features and supervised node features may include: performing fusion processing on the unsupervised node features and supervised node features to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0132] After obtaining the unsupervised node and supervised node features, the unsupervised node features and the supervised node features can be fused to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed. Specifically, fusing the unsupervised node features and the supervised node features to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed may include: based on the matrix rows, splicing the unsupervised node features and the supervised node features to obtain the semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0133] After obtaining the semi-supervised node features, the sample graph structure, the semi-supervised node features, the supervised node features, and the label information corresponding to some nodes can be used for learning and training to obtain a semi-supervised learning model.
[0134] The training method of the semi-supervised learning model provided in this embodiment effectively realizes the learning and training operation of the semi-supervised learning model by obtaining the sample graph structure, then determining the unsupervised node features and the supervised node features corresponding to the nodes, and performing learning and training based on the sample graph structure, the unsupervised node features, the supervised node features, and the label information corresponding to some nodes. After obtaining the semi-supervised learning model, the semi-supervised learning model can be used to perform label prediction operations on the nodes in the graph structure to be processed that do not have corresponding label information, thus effectively ensuring the practicability of this method.
[0135] Figure 5 It is a schematic flowchart of obtaining a semi-supervised learning model by performing learning and training based on the sample graph structure, the unsupervised node features, the supervised node features, and the label information corresponding to some nodes provided in the embodiment of the present invention; refer to the appendix Figure 5 As shown, this embodiment provides an implementation manner of learning and training a semi-supervised learning model. Specifically, the learning and training based on the sample graph structure, the unsupervised node features, the supervised node features, and the label information corresponding to some nodes in this embodiment to obtain a semi-supervised learning model may include:
[0136] Step S501: Obtain a first loss function corresponding to the unsupervised node features, a second loss function corresponding to the supervised node features, and a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features.
[0137] To ensure the training quality and effect of the semi-supervised learning model, the first loss function corresponding to the unsupervised node features, the second loss function corresponding to the supervised node features, and the relevant constraint loss function corresponding to the unsupervised node features and the supervised node features can be obtained respectively. In some instances, the first loss function can be obtained by comparing the unsupervised node features of the nodes in the sample graph structure with the actual unsupervised node features. In some other instances, obtaining the first loss function corresponding to the unsupervised node features may include: obtaining the first mutual information between the nodes without corresponding labeled information and their adjacent nodes and the second mutual information between the nodes without corresponding labeled information and their non-adjacent nodes; based on the first mutual information and the second mutual information, obtaining the first loss function corresponding to the unsupervised node features.
[0138] Among them, since the sample graph structure includes nodes with corresponding labeled information (labeled nodes) and nodes without corresponding labeled information (unlabeled nodes), and different nodes can correspond to different loss functions, and different loss functions have different degrees of influence on the learning and training operations of the semi-supervised learning model. Therefore, to ensure the learning and training guidelines and effects of the semi-supervised learning model, the first loss function corresponding to the unsupervised node features can be obtained. Specifically, the first mutual information between the nodes without corresponding labeled information and their adjacent nodes and the second mutual information between the nodes without corresponding labeled information and their non-adjacent nodes can be obtained, and then the first mutual information and the second mutual information can be analyzed and processed to obtain the first loss function corresponding to the unsupervised node features. In some instances, the first mutual information and the second mutual information are weighted and summed to obtain the first loss function corresponding to the unsupervised node features. In some other instances, the first mutual information is maximized to obtain the first processed mutual information, the second mutual information is minimized to obtain the second processed mutual information, and then the first processed mutual information and the second processed mutual information are accumulated to obtain the first loss function corresponding to the unsupervised node features.
[0139] Similarly, after obtaining the supervised node features, the supervised node features can be analyzed and processed to obtain the second loss function corresponding to the supervised node features. In some instances, obtaining the second loss function corresponding to the supervised node features may include: obtaining the actual labels of the supervised nodes and the distribution probabilities corresponding to the predicted labels, and determining the second loss function based on the distribution probabilities corresponding to the actual labels and the predicted labels of the supervised nodes, thus effectively ensuring the accuracy and reliability of determining the second loss function.
[0140] Similarly, after obtaining the unsupervised node features and the supervised node features, the unsupervised node features and the supervised node features can be analyzed and processed to obtain a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features. In some examples, a machine learning model for determining a loss function is pre-trained. After obtaining the unsupervised node features and the supervised node features, the unsupervised node features and the supervised node features can be input into the machine learning model, so that a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features can be obtained.
[0141] In other examples, obtaining a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features may include: obtaining the similarity between the unsupervised node features and the supervised node features; determining a first classification probability corresponding to the unsupervised node features and a second classification probability corresponding to the supervised node features; and determining a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features based on the similarity, the first classification probability, and the second classification probability.
[0142] Specifically, after obtaining the unsupervised node features and the supervised node features, a preset similarity calculation algorithm can be used to analyze and process the unsupervised node features and the supervised node features, so that the similarity between the unsupervised node features and the supervised node features can be obtained. In some examples, the similarity can be a cosine similarity. In addition, in order to accurately obtain the relevant constraint loss function, the unsupervised node features and the supervised node features can be analyzed and processed respectively to determine a first classification probability corresponding to the unsupervised node features and a second classification probability corresponding to the supervised node features, where the first classification probability and the second classification probability can be obtained by analyzing and processing the unsupervised node features and the supervised node features through a linear transformation function and a normalization function respectively.
[0143] After obtaining the similarity between the unsupervised node features and the supervised node features, the first classification probability corresponding to the unsupervised node features, and the second classification probability corresponding to the supervised node features, the similarity, the first classification probability, and the second classification probability can be analyzed and processed to determine a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features. In some examples, determining a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features based on the similarity, the first classification probability, and the second classification probability may include: obtaining a relevant classification probability corresponding to the unsupervised node and the supervised node based on the first classification probability and the second classification probability, and performing a product summation process on the relevant classification probability and the similarity, so that a relevant constraint loss function can be obtained.
[0144] Step S502: Based on the first loss function, the second loss function, and the relevant constraint loss function, learn and train the unsupervised node features, the supervised node features, and the label information corresponding to some nodes to obtain a semi-supervised learning model.
[0145] After obtaining the first loss function, the second loss function, and the relevant constraint loss function, it is possible to learn and train the unsupervised node features, the supervised node features, and the label information corresponding to some nodes based on the first loss function, the second loss function, and the relevant constraint loss function, so as to obtain a semi-supervised learning model. In some examples, learning and training the unsupervised node features, the supervised node features, and the label information corresponding to some nodes based on the first loss function, the second loss function, and the relevant constraint loss function to obtain a semi-supervised learning model may include: determining a target loss function based on the first loss function, the second loss function, and the relevant constraint loss function. Specifically, the target loss function may be obtained by performing a weighted sum of the first loss function, the second loss function, and the relevant constraint loss function. Then, with the minimum of the target loss function as a constraint, learn and train the unsupervised node features, the supervised node features, and the label information corresponding to some nodes, so as to obtain a semi-supervised learning model.
[0146] In this embodiment, by obtaining the first loss function corresponding to the unsupervised node features, the second loss function corresponding to the supervised node features, and the relevant constraint loss function corresponding to the unsupervised node features and the supervised node features, and then learning and training the unsupervised node features, the supervised node features, and the label information corresponding to some nodes based on the first loss function, the second loss function, and the relevant constraint loss function, a semi-supervised learning model can be stably obtained.
[0147] Figure 6 It is a flowchart of a method for training a semi-supervised learning model provided by an embodiment of the present invention; refer to the appendix Figure 6 As shown, in order to further improve the data processing quality and efficiency of the semi-supervised learning model, after obtaining the semi-supervised learning model, the method in this embodiment may further include:
[0148] Step S601: Optimize the first sub-model based on the first loss function and the relevant loss function to obtain an optimized first sub-model; and / or optimize the second sub-model based on the second loss function and the relevant loss function to obtain an optimized second sub-model.
[0149] Step S602: Obtain an optimized semi-supervised learning model based on the optimized first sub-model and / or the optimized second sub-model.
[0150] Among them, since the semi-supervised learning model includes a first sub-model and a second sub-model, the optimization operation of the semi-supervised learning model can be achieved by performing optimization processing through at least one of the first sub-model and the second sub-model. In some instances, the first sub-model is optimized through a first loss function and a related loss function to obtain an optimized first sub-model, and then an optimized semi-supervised learning model can be obtained based on the optimized first sub-model. In other instances, the second sub-model is optimized through a second loss function and a related loss function to obtain an optimized second sub-model, and then an optimized semi-supervised learning model can be obtained based on the optimized second sub-model. In still other instances, the first sub-model is optimized through a first loss function and a related loss function to obtain an optimized first sub-model; the second sub-model is optimized through a second loss function and a related loss function to obtain an optimized second sub-model, and then an optimized semi-supervised learning model is obtained based on the optimized first sub-model and the optimized second sub-model.
[0151] In this embodiment, by optimizing the first sub-model based on the first loss function and the related loss function to obtain an optimized first sub-model; and / or, optimizing the second sub-model based on the second loss function and the related loss function to obtain an optimized second sub-model, and then based on the optimized first sub-model and / or the optimized second sub-model, the optimization operations of the first sub-model and the second sub-model in the semi-supervised learning model are effectively realized by means of meta-learning. This not only ensures the flexible reliability of optimizing the semi-supervised learning model, but also improves the optimization effect of the semi-supervised learning model, which is beneficial to ensuring the accuracy of the semi-supervised model in analyzing and processing graph-structured data.
[0152] In specific applications, this application embodiment provides a training method for a semi-supervised learning model. This training method can efficiently determine the supervised information and unsupervised information corresponding to the nodes in the graph structure through a dual-channel, and then use the correlation between the supervised information and the unsupervised information to perform semi-supervised learning operations, so as to obtain a semi-supervised learning model that takes into account both generalization ability and fitting ability. Specifically, referring to the attached Figure 7 As shown, the model training method in this embodiment may include the following steps:
[0153] Step 1: Obtain a graph structure for learning and training. The graph structure includes nodes and edge structures, and some nodes in the graph structure correspond to label information, while other nodes do not correspond to label information.
[0154] Specifically, nodes in the graph structure can correspond to node information X, which is used to identify the attribute information corresponding to the nodes in the graph structure. The attribute information can include: node name, node value, node type, etc. The edge structure A is used to identify the association relationship between nodes.
[0155] Step 2: Train the dual-channel encoder.
[0156] Among them, the dual-channel encoder can include a first encoder corresponding to the supervised channel and a second encoder corresponding to the unsupervised channel. The first encoder is used to extract the supervised information in the graph structure, and then obtain the supervised representation vector of the nodes through the readout module. The second encoder is used to extract the unsupervised information in the graph structure, and then obtain the unsupervised representation vector of the nodes through the readout module.
[0157] Specifically, in order to construct the dual-channel encoder, learning and training can be performed on the node representations integrated with the unsupervised features and supervised features corresponding to the nodes, so as to obtain the first encoder f θ (θ; A, X) and the second encoder Among them, θ is the set of parameters corresponding to the first encoder, A is the topological information corresponding to the nodes in the graph, and X is used to identify the attribute information corresponding to each node. is the set of parameters corresponding to the second encoder. The first encoder f θ can extract the supervised information corresponding to the nodes from the graph structure under the guidance of the label set Y, and output the supervised representation matrix Z (S) corresponding to the nodes; the second encoder can extract the unsupervised information corresponding to the nodes from the graph structure, and output the unsupervised representation matrix Z (U) corresponding to the output nodes.
[0158] Since the semi-supervised learning model can include the first encoder and the second encoder, in order to learn and generate the semi-supervised learning model, the parameters of the first encoder and the second encoder can be learned and trained first. Specifically, the objective loss functions corresponding to the first encoder and the second encoder can be written as:
[0159]
[0160] Among them, θ * is the optimized parameter, is the optimized parameter, is the objective loss function corresponding to the first encoder and the second encoder, λ1 and λ2 are hyperparameters, is the supervised node feature corresponding to the nodes, is the unsupervised node feature corresponding to the nodes, is the relevant constraint loss function corresponding to the unsupervised node features and the supervised node features.
[0161] For the above objective loss function In order to accurately obtain the target loss function, the following three parameters can be obtained first: 1) The supervisory node loss corresponding to the node In some instances, the node corresponding to the supervised node loss can be a labeled node; 2) the unsupervised loss corresponding to the node 3) Related Constraint Loss
[0162] (1) Supervisory node loss It can be obtained by following the steps below:
[0163] The obtained supervision node features Input the linear transformation function Linear(.) and the normalization function softmax(.) to obtain the classification probability information corresponding to the supervision node features The specific formula is as follows:
[0164]
[0165] in, Representative node n i The corresponding classification probability distribution.
[0166] After obtaining the classification probability information, the supervision channel loss can be obtained based on the classification probability information and the actual label corresponding to the node. The specific formula is as follows:
[0167]
[0168] Among them, 1(.)→{0,1} is the indicator function, It is an index set of labeled nodes. Each node has an index number. This index set is used to find the labeled nodes. Then, only the labeled nodes need to be trained. By training the labeled nodes, the parameters of the supervision channel can be updated. Represents probability distribution and the cross entropy between the one-hot label y, y i ∈Y is n i The actual label.
[0169] (2) Using the contrastive learning objective based on mutual information (MI) as the unsupervised channel loss to obtain the unsupervised loss corresponding to the node You can obtain it by following the steps below:
[0170] Build the objective of training to make the identity of the central node close to that of its neighbor nodes, and perform negative sampling. Specifically, considering the strong correlation between the central node and all its adjacent nodes in the sampled subgraph, the aim is to maximize the mutual information between their representations. Therefore, on the node representations, a Corrupting function can be used to generate negative central node representations, denoted as:
[0171]
[0172] where, represents the node representation information for non-neighbor nodes, represents the node representation information for neighbor nodes.
[0173] After obtaining and , an unsupervised loss and can be obtained based on The specific formula is as follows:
[0174]
[0175] where MI(z, u) is a function for calculating the mutual information score between parameter z and parameter u, represents the mutual information between the node and its neighbor nodes, represents the mutual information between the node and non-neighbor nodes, is the corresponding hidden layer output of node n i in G j . Specifically, can be maximized, and can be minimized, and then the unsupervised loss
[0176] (3) Related constraint loss can be obtained through the following steps:
[0177] Given the unsupervised node representations of a batch of nodes to reconstruct the batch graph, and then based on the reconstructed batch graph, determine the similarity between the unsupervised node features and the supervised node features, which can be specifically obtained through the following formula:
[0178]
[0179] where, represents the similarity between the unsupervised node features and the supervised node features, It can be a kernel similarity function (e.g., cosine similarity), and α is a threshold for controlling the density of the reconstructed graph. For example, when there are 64 nodes in a graph structure, the similarity between the unsupervised node features and the supervised node features can then be obtained for each node. To ensure the quality and efficiency of the semi-supervised learning model training, those with relatively low similarity can be ignored, and those with relatively high similarity are obtained as the similarity representation.
[0180] After obtaining the similarity between the unsupervised node features and the supervised node features, the first classification probability corresponding to the unsupervised node features and the second classification probability corresponding to the supervised node can then be determined. Subsequently, the relevant constraint loss can be obtained based on the similarity, the first classification probability, and the second classification probability.
[0181]
[0182] Specifically, if n i is labeled, the hard label y i ∈Y can be used to replace the soft classification probability The relevant constraint is defined as: where L is the Laplacian operator for reconstructing the batch graph, defined as L = DS (μ) , and D is a diagonal matrix satisfying .
[0183] After obtaining the supervised node loss the unsupervised loss and the relevant constraint loss the objective loss function can be determined. Subsequently, after minimizing the objective loss function, the semi-supervised node representation Z corresponding to the final node can be obtained, specifically as follows:
[0184] Z (S) = f θ * = ψ(θ * ; A, X);
[0185]
[0186] Z = Merge(Z (S) , Z (μ) , axis = 1)
[0187] Among them, Merge(.) is a merging function that combines supervised and unsupervised node representations. Z is called the semi-supervised node representation. A lightweight classifier is trained using the representations of the labeled nodes and their label sets, so that a trained semi-supervised learning model can be obtained. Then, the trained semi-supervised learning model is used to predict the classes of the unlabeled nodes.
[0188] Step 3: Optimize the parameters of the semi-supervised learning model.
[0189] Based on the meta-learning optimization method, parameter optimization operations are performed on the dual-channel encoder included in the semi-supervised learning model. Specifically, the distance between the classification probabilities of different subgraphs can be constrained according to the similarity between the unsupervised representations, achieving the goal of using unsupervised information to improve the classification effect and generalization ability. Among them, meta-learning usually involves a two-layer optimization process, and the generalization ability of the model can be improved through meta-gradient parameter updates. In the inner learning stage of the t-th training step, assuming that θ t and are the parameters corresponding to the dual-channel encoder respectively, M (which can be 1, 16, 32, 64, etc., as long as there is more memory) batches of nodes can be sampled to obtain the inner learning data, denoted as Among them, Based on the above-obtained inner learning data, the parameters corresponding to the dual-channel encoder can be updated as follows:
[0190]
[0191]
[0192] Among them, α and β are the learning rates, are the updated parameters corresponding to the dual-channel encoder respectively, θ t 、 are the parameters corresponding to the dual-channel encoder respectively, is the gradient function. Then, in the meta-learning stage, other batches of nodes can also be sampled and input into the training parameters, and the final meta-gradient of the parameters can be calculated in the following way:
[0193]
[0194]
[0195] Finally, based on the obtained final meta-gradient, the parameters θ t and can be updated. Specifically, and Thus, the parameter update operation is effectively realized.
[0196] In some other instances, in order to improve the speed and efficiency of model optimization, the graph structure for learning and training in the embodiments of the present application may be a subgraph structure obtained by sampling a complete graph structure. At this time, the method in the embodiments of the present application may further include a subgraph sampling operation, that is, sampling the complete graph to obtain a sampled subgraph, and then the sampled subgraph can be subjected to a model training operation. Or, after model training, the sampled subgraph can be analyzed and processed using the trained semi-supervised learning model, that is, the sampled subgraph is input into a dual-channel encoder to obtain a corresponding subgraph representation.
[0197] Specifically, the subgraph sampling may include the following steps:
[0198] After obtaining the graph structure, a batch of nodes included in the graph structure can be identified, and for each node n i sample a subgraph G i ={A i , X i}, where is a symmetric adjacency matrix, N i is the number of nodes in G i , is the node feature matrix, d is the feature dimension, that is, by sampling the node and its corresponding adjacent nodes, a sampled subgraph corresponding to the node is obtained
[0199] Then, the sampled subgraph is fed into two encoder channels to generate two batches of node representations. B is the sampling quantity (the number of a batch of nodes), R is the space of N i ×N i . Since the graph structure may include one or more sampled subgraphs, when the graph structure includes multiple sampled subgraphs, the encoding process of the encoder for the entire graph data can be divided into multiple batches. For the graph structure, the sampling encoding on a specific batch can be written as:
[0200]
[0201]
[0202]
[0203] where SubgraphSampling(.) can be any sampling strategy, SubgraphEncoder(.) can be any graph neural network (generally an output matrix identifier), is G iThe matrix identification of the hidden layer output subgraph on, where h is the dimension of the hidden layer. Readout(.) is used to convert the matrix representation information of the subgraph into vector representation information, thus effectively implementing the sampling operation of the graph structure.
[0204] The technical solution provided by the embodiments of this application can extract unsupervised knowledge from unlabeled data, thereby improving the latent features of nodes and generalizing the learned model to supervised learning tasks (such as classification problems). At the same time, a subgraph sampling strategy is used to process scalable graphs for providing input information to the dual channels encoded in mini-batches, which can effectively improve the quality and efficiency of data processing. Additionally, due to the dependence relationship between the supervised learning objective and the unsupervised learning objective, and the dependence relationship between the categories of nodes and the structure of the graph, the connections between nodes with the same category are closer. Therefore, a meta-learning-based method is adopted to solve the double-layer optimization problem, further improving the generalization ability of the overall model while ensuring the quality and efficiency of training the semi-supervised learning model.
[0205] Figure 8 It is a schematic structural diagram of a node feature extraction device for a graph structure provided by an embodiment of the present invention; refer to the appendix Figure 8 As shown, this embodiment provides a node feature extraction device for a graph structure. This node feature extraction device is used to execute the above Figure 2 shown node feature extraction method for the graph structure. Specifically, this node feature extraction device may include:
[0206] The first acquisition module 11 is used to acquire the graph structure to be processed, where the graph structure to be processed includes multiple nodes, and some of the multiple nodes correspond to label information;
[0207] The first processing module 12 is used to process the graph structure to be processed to determine the unsupervised node features and supervised node features corresponding to the nodes. The supervised node features are related to the label information;
[0208] The first determination module 13 is used to determine the semi-supervised node features corresponding to the nodes in the graph structure to be processed based on the unsupervised node features and the supervised node features.
[0209] In some instances, the graph structure to be processed further includes node topology information for identifying the association relationships between nodes. When the first processing module 12 processes the graph structure to be processed to determine the unsupervised node features and supervised node features corresponding to the nodes, the first processing module 12 is used to execute: processing the node topology information and nodes in the graph structure to be processed to determine the unsupervised node features corresponding to the nodes; processing the node topology information, nodes, and label information in the graph structure to be processed to determine the supervised node features corresponding to the nodes.
[0210] In some examples, when the first determination module 13 determines semi-supervised node features corresponding to the nodes in the graph structure to be processed based on unsupervised node features and supervised node features, the first determination module 13 is configured to perform: fusing the unsupervised node features and the supervised node features to obtain semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0211] In some examples, when the first determination module 13 fuses the unsupervised node features and the supervised node features to obtain semi-supervised node features corresponding to the nodes in the graph structure to be processed, the first determination module 13 is configured to perform: taking the matrix row as a reference, concatenating the unsupervised node features and the supervised node features to obtain semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0212] In some examples, after determining the semi-supervised node features corresponding to the graph structure to be processed, the first processing module 12 in this embodiment is further configured to: determine label information corresponding to the nodes in the graph structure to be processed that do not have corresponding label information based on the semi-supervised node features.
[0213] In some examples, when the first acquisition module 11 acquires the graph structure to be processed, the first acquisition module 11 is configured to perform: acquiring the original graph structure; sampling the original graph structure to obtain at least one graph structure to be processed corresponding to the original graph structure, where the graph structure to be processed is at least a part of the original graph structure.
[0214] In some examples, when the first acquisition module 11 samples the original graph structure to obtain at least one graph structure to be processed, the first acquisition module 11 is configured to perform: acquiring at least one node in the original graph structure; sampling the at least one node and the adjacent nodes corresponding to each node to obtain at least one graph structure to be processed.
[0215] Figure 8 The illustrated device can execute Figures 1 - 3 、 Figure 7 the method of the illustrated embodiment. For parts not described in detail in this embodiment, reference can be made to the relevant descriptions of Figures 1 - 3 、 Figure 7 the illustrated embodiment. For the execution process and technical effects of this technical solution, refer to the descriptions in Figures 1 - 3 、 Figure 7 the illustrated embodiment, which will not be elaborated here.
[0216] In a possible design, Figure 8 the structure of the node feature extraction device of the illustrated graph structure can be implemented as an electronic device, and this electronic device can be various devices such as an electronic device or a server. As Figure 9As shown, the electronic device may include: a first processor 21 and a first memory 22. Among them, the first memory 22 is used to store a program for the corresponding electronic device to execute the node feature extraction method of the graph structure in the embodiments shown above Figures 1 - 3 , Figure 7 shown. The first processor 21 is configured to execute the program stored in the first memory 22.
[0217] The program includes one or more computer instructions. Among them, when the one or more computer instructions are executed by the first processor 21, the following steps can be implemented:
[0218] Obtain the graph structure to be processed, where the graph structure to be processed includes multiple nodes, and some of the multiple nodes correspond to label information;
[0219] Process the graph structure to be processed to determine the unsupervised node features and supervised node features corresponding to the nodes, and the supervised node features are related to the label information;
[0220] Based on the unsupervised node features and supervised node features, determine the semi-supervised node features corresponding to the nodes in the graph structure to be processed.
[0221] Furthermore, the first processor 21 is also used to execute all or part of the steps in the foregoing Figures 1 - 3 , Figure 7 shown embodiments.
[0222] Among them, the structure of the electronic device may further include a first communication interface 23 for the electronic device to communicate with other devices or communication networks.
[0223] In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the electronic device, which includes a program involved in the node feature extraction method of the graph structure in the method embodiments shown above Figures 1 - 3 , Figure 7 shown.
[0224] In addition, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by the processor of the electronic device, the processor is made to execute the steps in the node feature extraction method of the graph structure shown above Figures 1 - 3 , Figure 7 shown.
[0225] Figure 10 This is a schematic structural diagram of a training device for a semi-supervised learning model provided by an embodiment of the present invention; referring to the attached Figure 10 shown, this embodiment provides a training device for a semi-supervised learning model. The training device for the semi-supervised learning model is used to execute the above Figure 3The training method of the semi-supervised learning model shown. Specifically, the training device of the semi-supervised learning model may include:
[0226] A second acquisition module 31, configured to acquire a sample graph structure, where the sample graph structure includes a plurality of nodes, and among them, some of the plurality of nodes correspond to label information;
[0227] A second determination module 32, configured to determine unsupervised node features and supervised node features corresponding to the nodes;
[0228] A second processing module 33, configured to perform learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some of the nodes, to obtain a semi-supervised learning model, and the semi-supervised learning model is trained to predict the label information corresponding to the nodes in the graph structure to be processed.
[0229] In some instances, the semi-supervised learning model includes a first sub-model and a second sub-model; when the second determination module 32 determines the unsupervised node features and supervised node features corresponding to the nodes, the second determination module 32 is configured to perform: using the first sub-model to process the node topology information and nodes in the sample graph structure to determine the unsupervised node features corresponding to the nodes; using the second sub-model to process the node topology information, nodes, and label information in the sample graph structure to determine the supervised node features corresponding to the nodes.
[0230] In some instances, when the second processing module 33 performs learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some of the nodes to obtain a semi-supervised learning model, the second processing module 33 is configured to perform: based on the unsupervised node features and supervised node features, obtain semi-supervised node features corresponding to the nodes in the sample graph structure; perform learning and training based on the sample graph structure, semi-supervised node features, supervised node features, and label information corresponding to some of the nodes to obtain a semi-supervised learning model.
[0231] In some instances, when the second processing module 33 obtains semi-supervised node features corresponding to the nodes in the sample graph structure based on the unsupervised node features and supervised node features, the second processing module 33 is configured to perform: performing a fusion process on the unsupervised node features and supervised node features to obtain semi-supervised node features corresponding to the nodes in the sample graph structure.
[0232] In some examples, when the second processing module 33 performs learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model, the second processing module 33 is configured to perform: obtaining a first loss function corresponding to the unsupervised node features, a second loss function corresponding to the supervised node features, and a correlation constraint loss function corresponding to the unsupervised node features and the supervised node features; performing learning and training on the unsupervised node features, the supervised node features, and the label information corresponding to some nodes based on the first loss function, the second loss function, and the correlation constraint loss function to obtain a semi-supervised learning model.
[0233] In some examples, when the second processing module 33 obtains the first loss function corresponding to the unsupervised node features, the second processing module 33 is configured to perform: obtaining a first mutual information between nodes without corresponding label information and adjacent nodes, and a second mutual information between nodes without corresponding label information and non-adjacent nodes; obtaining the first loss function corresponding to the unsupervised node features based on the first mutual information and the second mutual information.
[0234] In some examples, when the second processing module 33 obtains the correlation constraint loss function corresponding to the unsupervised node features and the supervised node features, the second processing module 33 is configured to perform: obtaining a similarity between the unsupervised node features and the supervised node features; determining a first classification probability corresponding to the unsupervised node features and a second classification probability corresponding to the supervised node features; determining the correlation constraint loss function corresponding to the unsupervised node features and the supervised node features based on the similarity, the first classification probability, and the second classification probability.
[0235] In some examples, after obtaining the semi-supervised learning model, the second processing module 33 in this embodiment is configured to perform the following steps: optimizing the first sub-model based on the first loss function and the correlation loss function to obtain an optimized first sub-model; and / or optimizing the second sub-model based on the second loss function and the correlation loss function to obtain an optimized second sub-model; obtaining an optimized semi-supervised learning model based on the optimized first sub-model and / or the optimized second sub-model.
[0236] Figure 10 The illustrated apparatus can execute Figures 3 - 7 the method of the illustrated embodiment. For parts not described in detail in this embodiment, reference can be made to the relevant descriptions of the corresponding Figures 3 - 7 illustrated embodiment. For the execution process and technical effects of this technical solution, reference can be made to the descriptions in the Figures 3 - 7 illustrated embodiment and will not be elaborated here.
[0237] In a possible design, Figure 10The structure of the training device of the semi-supervised learning model shown can be implemented as an electronic device, which can be various devices such as a mobile phone, a tablet computer, an electronic device, a server, etc. As Figure 11 shown, the electronic device may include: a second processor 41 and a second memory 42. Among them, the second memory 42 is used to store the program for the corresponding electronic device to execute the training method of the semi-supervised learning model provided in the above Figures 3 - 7 shown embodiment, and the second processor 41 is configured to execute the program stored in the second memory 42.
[0238] The program includes one or more computer instructions, and when the one or more computer instructions are executed by the second processor 41, the following steps can be implemented:
[0239] Obtain a sample graph structure, where the sample graph structure includes multiple nodes, and among them, some of the multiple nodes correspond to label information;
[0240] Determine the unsupervised node features and supervised node features corresponding to the nodes;
[0241] Based on the sample graph structure, the unsupervised node features, the supervised node features, and the label information corresponding to some of the nodes, perform learning and training to obtain a semi-supervised learning model, and the semi-supervised learning model is trained to predict the label information corresponding to the nodes in the graph structure to be processed.
[0242] Furthermore, the second processor 41 is also used to execute all or part of the steps in the foregoing Figures 3 - 7 shown embodiment.
[0243] Among them, the structure of the electronic device may further include a second communication interface 43 for the electronic device to communicate with other devices or communication networks.
[0244] In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by an electronic device, which includes a program involved in the training method of the semi-supervised learning model in the above Figures 3 - 7 shown method embodiment.
[0245] In addition, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by the processor of the electronic device, enabling the processor to execute the steps in the training method of the semi-supervised learning model shown in the above Figures 3 - 7 shown.
[0246] Figure 12 It is a schematic flowchart of a method for determining traffic flow provided by an embodiment of the present invention; refer to the attached Figure 12As shown in the figure, this embodiment provides a method for determining traffic flow. The execution subject of this method can be a traffic flow determination device, which can be implemented as software, or a combination of software and hardware. Specifically, the method for determining traffic flow can include the following steps:
[0247] Step S1201: Obtain a to-be-processed graph structure, where the to-be-processed graph structure includes multiple traffic nodes, and some of the multiple traffic nodes correspond to label information.
[0248] Among them, the to-be-processed graph structure corresponds to road traffic. In some instances, the to-be-processed graph structure can be used to represent an urban rail transit network, a rail transit network in a certain area, etc.; the to-be-processed graph structure can include multiple traffic nodes, and the traffic node can refer to any one of the following: subway station, bus stop, crossroads, etc. Some of the traffic nodes in the traffic nodes can correspond to label information, and the label information can be traffic node flow characteristics obtained by analyzing and processing historical traffic data and / or real-time traffic data. For example, the label information can be obtained through image acquisition operations by cameras on the road, and the flow characteristics can include at least one of the following: vehicle flow characteristics, pedestrian flow characteristics.
[0249] Step S1202: Process the to-be-processed graph structure to determine unsupervised node features and supervised node features corresponding to the traffic nodes, where the supervised node features are related to the label information.
[0250] Step S1203: Based on the unsupervised node features and the supervised node features, determine semi-supervised node features corresponding to the traffic nodes in the to-be-processed graph structure.
[0251] Among them, the specific implementation manners and implementation effects of the above steps in this embodiment are similar to those of steps S202 - S203 in the above embodiment. For specific reference, please refer to the above description and will not be elaborated here.
[0252] Step S1204: Based on the semi-supervised node features, determine the traffic flow corresponding to the traffic nodes.
[0253] After obtaining the semi-supervised node features corresponding to the traffic nodes, the semi-supervised node features can be analyzed and processed, so as to determine the traffic flow of the road where the traffic node is located. The traffic flow is used to represent the vehicle flow and pedestrian flow that may appear at this traffic node during the current time period (or a certain future time period).
[0254] After determining the traffic flow corresponding to the traffic node, the method in this embodiment further includes: when the traffic flow is greater than the first threshold, it indicates that traffic congestion may occur at the traffic node during the current time period. At this time, a prompt message can be generated based on the traffic flow, and the prompt message can be displayed on the display screen in the area corresponding to the traffic node to implement the traffic flow adjustment operation; in some other examples, control information for traffic lights can also be generated based on the traffic flow, and the traffic lights in the area corresponding to the traffic node can be adjusted within the preset allowable range based on the control information for traffic lights. It should be noted that the adjustment at this time is a fine adjustment and within the preset allowable adjustment range, so as to adaptively adjust and control the traffic flow on the road, thereby reducing or even avoiding traffic congestion at the traffic node. When the traffic flow is less than or equal to the first threshold, it indicates that traffic congestion is not likely to occur at the traffic node during the current time period, and the existing road traffic conditions can be maintained.
[0255] In some other examples, when the traffic flow is greater than the first threshold, the traffic flow can be analyzed and compared with a preset threshold, and the preset threshold is greater than the first threshold. When the traffic flow is greater than the preset threshold, it indicates that the traffic flow at the traffic node is abnormal during the current time period. For example, there are traffic accidents, traffic control, etc. in the area corresponding to the traffic node. At this time, in order to enable traffic management personnel to timely understand the traffic conditions corresponding to the traffic node, a traffic anomaly prompt message corresponding to the traffic node can be generated based on the traffic flow, and the traffic anomaly prompt message can be reported to the traffic management center, so that traffic management personnel can view the traffic conditions corresponding to the traffic node based on the obtained traffic anomaly prompt message. When necessary, a traffic alarm operation can be performed to try to eliminate the traffic anomaly corresponding to the traffic node and ensure the safety of road traffic.
[0256] It should be noted that this embodiment may also include the methods of the above Figures 1 - 3 、 Figure 7 shown embodiments. For parts not described in detail in this embodiment, reference can be made to the relevant descriptions of the Figures 1 - 3 、 Figure 7 shown embodiments. The execution process and technical effects of this technical solution are referred to the descriptions in the Figures 1 - 3 、 Figure 7 shown embodiments and will not be elaborated here.
[0257] The traffic flow determination method provided in this embodiment determines the unsupervised node features and supervised node features corresponding to traffic nodes by obtaining the graph structure to be processed, processes the graph structure to be processed, determines the semi-supervised node features corresponding to the traffic nodes in the graph structure to be processed based on the unsupervised node features and supervised node features, and then determines the traffic flow corresponding to the traffic nodes based on the semi-supervised node features, thereby effectively realizing the accurate determination operation of the traffic flow corresponding to the traffic nodes. In addition, after obtaining the traffic flow, the traffic conditions corresponding to the traffic nodes can be determined based on the traffic flow, and then traffic regulation and control operations can be performed based on the traffic conditions corresponding to the traffic nodes, further improving the practicability of the method and facilitating market promotion and application.
[0258] Figure 13 is a schematic structural diagram of a traffic flow determination device provided by an embodiment of the present invention; refer to the appendix Figure 13 As shown, this embodiment provides a traffic flow determination device, and this traffic flow determination device is used to execute the above Figure 12 shown traffic flow determination method. Specifically, the determination device may include:
[0259] A third acquisition module 51, configured to acquire a graph structure to be processed, where the graph structure to be processed includes multiple traffic nodes, and some of the multiple traffic nodes correspond to label information;
[0260] A third processing module 52, configured to process the graph structure to be processed, and determine the unsupervised node features and supervised node features corresponding to the traffic nodes, and the supervised node features are related to the label information;
[0261] A third determination module 53, configured to determine the semi-supervised node features corresponding to the traffic nodes in the graph structure to be processed based on the unsupervised node features and supervised node features;
[0262] The third determination module 53 is further configured to determine the traffic flow corresponding to the traffic nodes based on the semi-supervised node features.
[0263] Figure 13 The device shown can execute the Figure 12 method of the embodiment shown. For parts not described in detail in this embodiment, reference may be made to the relevant descriptions of the Figure 12 shown embodiment. The execution process and technical effects of this technical solution are referred to the descriptions in the Figure 12 shown embodiment and will not be elaborated here.
[0264] In a possible design, Figure 13 the structure of the traffic flow determination device shown can be implemented as an electronic device, and this electronic device can be various devices such as an electronic device and a server. Such asFigure 14 As shown, the electronic device may include: a third processor 61 and a third memory 62. Among them, the third memory 62 is used to store a program for the corresponding electronic device to execute the method for determining traffic flow in the above Figure 12 shown embodiment, and the third processor 61 is configured to execute the program stored in the third memory 62.
[0265] The program includes one or more computer instructions. When the one or more computer instructions are executed by the third processor 61, the following steps can be implemented: obtaining a graph structure to be processed, where the graph structure to be processed includes a plurality of traffic nodes, and some of the plurality of traffic nodes correspond to label information; processing the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the traffic nodes, and the supervised node features are related to the label information; based on the unsupervised node features and the supervised node features, determining semi-supervised node features corresponding to the traffic nodes in the graph structure to be processed; based on the semi-supervised node features, determining the traffic flow corresponding to the traffic nodes.
[0266] Further, the third processor 61 is also used to execute all or part of the steps in the foregoing Figure 12 shown embodiment.
[0267] Among them, the structure of the electronic device may further include a third communication interface 63 for the electronic device to communicate with other devices or communication networks.
[0268] In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the electronic device, which includes a program involved in the method for determining traffic flow in the above Figure 12 shown method embodiment.
[0269] In addition, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, causing the processor to execute the steps in the method for determining traffic flow shown in the above Figure 12 shown.
[0270] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative labor.
[0271] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of adding a necessary general hardware platform. Of course, it can also be implemented by a combination of hardware and software. Based on such an understanding, the above technical solutions can be embodied in the form of a computer product in essence or the part that contributes to the prior art. The present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) that contain computer-usable program codes.
[0272] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable devices generate a device for implementing the functions specified in Figure 1 one or more flows and / or Figure 1 blocks.
[0273] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one or more flows and / or Figure 1 blocks.
[0274] These computer program instructions can also be loaded onto a computer or other programmable device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more flows and / or Figure 1 blocks.
[0275] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.
[0276] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash RAM. The memory is an example of computer-readable media.
[0277] Computer-readable media includes both permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transitory media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0278] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for extracting node features of a graph structure, characterized in that, Including: Obtain a graph structure to be processed, where the graph structure to be processed includes multiple nodes, the nodes are traffic nodes, and the multiple nodes include: marked nodes with corresponding label information and unmarked nodes without corresponding label information, and the label information is traffic node traffic characteristics obtained by analyzing historical traffic data and / or real-time traffic data; Process the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the nodes, and the supervised node features are related to the label information; Based on the unsupervised node features and the supervised node features, determine semi-supervised node features corresponding to the nodes in the graph structure to be processed; Based on the semi-supervised node features, determine label information corresponding to the nodes in the graph structure to be processed that do not have corresponding label information.
2. The method according to claim 1, characterized in that, The graph structure to be processed further includes node topology information for identifying the association relationship between nodes; Processing the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the nodes includes: Process the node topology information and nodes in the graph structure to be processed to determine unsupervised node features corresponding to the nodes; Process the node topology information, nodes, and label information in the graph structure to be processed to determine supervised node features corresponding to the nodes.
3. The method according to claim 1, wherein Based on the unsupervised node features and the supervised node features, determining semi-supervised node features corresponding to the nodes in the graph structure to be processed includes: Perform a fusion process on the unsupervised node features and the supervised node features to obtain semi-supervised node features corresponding to the nodes in the graph structure to be processed.
4. The method according to claim 1, characterized in that, Obtaining a graph structure to be processed includes: Obtain an original graph structure; Sample the original graph structure to obtain at least one graph structure to be processed corresponding to the original graph structure, and the graph structure to be processed is at least a part of the original graph structure.
5. The method according to claim 4, wherein Sampling the original graph structure to obtain at least one graph structure to be processed corresponding to the original graph structure includes: Obtain at least one node in the original graph structure; Sample the at least one node and the adjacent nodes corresponding to each node to obtain the at least one graph structure to be processed.
6. A training method for a semi-supervised learning model, characterized in that, Including: Obtain a sample graph structure, the sample graph structure includes multiple nodes, the nodes are traffic nodes, where the multiple nodes include: marked nodes with corresponding label information and unmarked nodes without corresponding label information, and the label information is traffic node traffic characteristics obtained by analyzing historical traffic data and / or real-time traffic data; Determine unsupervised node features and supervised node features corresponding to the nodes; Based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes, perform learning and training to obtain a semi-supervised learning model, and the semi-supervised learning model is trained to predict the label information corresponding to the nodes in the graph structure to be processed.
7. The method according to claim 6, wherein The semi-supervised learning model includes a first sub-model and a second sub-model; determining unsupervised node features and supervised node features corresponding to the node includes: Using the first sub-model to process the node topological information and nodes in the sample graph structure to determine the unsupervised node features corresponding to the node; Using the second sub-model to process the node topological information, nodes and label information in the sample graph structure to determine the supervised node features corresponding to the node.
8. The method according to claim 7, wherein Performing learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model, including: Obtaining semi-supervised node features corresponding to the nodes in the sample graph structure based on the unsupervised node features and the supervised node features; Performing learning and training based on the sample graph structure, semi-supervised node features, supervised node features, and label information corresponding to some nodes to obtain a semi-supervised learning model.
9. The method according to claim 8, wherein Obtaining semi-supervised node features corresponding to the nodes in the sample graph structure based on the unsupervised node features and the supervised node features, including: Performing fusion processing on the unsupervised node features and the supervised node features to obtain semi-supervised node features corresponding to the nodes in the sample graph structure.
10. The method according to claim 8, wherein Performing learning and training based on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to the partial nodes to obtain a semi-supervised learning model, including: Obtaining a first loss function corresponding to the unsupervised node features and a second loss function corresponding to the supervised node features; Obtaining the similarity between the unsupervised node features and the supervised node features; Determining a first classification probability corresponding to the unsupervised node features and a second classification probability corresponding to the supervised node features; Based on the similarity, the first classification probability, and the second classification probability, determining a relevant constraint loss function corresponding to the unsupervised node features and the supervised node features; Performing learning and training on the sample graph structure, unsupervised node features, supervised node features, and label information corresponding to some nodes based on the first loss function, the second loss function, and the relevant constraint loss function to obtain the semi-supervised learning model.
11. The method according to claim 10, characterized in that, Obtaining a first loss function corresponding to the unsupervised node features, including: Obtaining a first mutual information between nodes without corresponding label information and adjacent nodes and a second mutual information between nodes without corresponding label information and non-adjacent nodes; Based on the first mutual information and the second mutual information, obtaining a first loss function corresponding to the unsupervised node features.
12. The method according to claim 10, wherein After obtaining the semi-supervised learning model, the method further includes: Optimizing the first sub-model based on the first loss function and the relevant constraint loss function to obtain an optimized first sub-model; and / or, optimizing the second sub-model based on the second loss function and the relevant constraint loss function to obtain an optimized second sub-model; An optimized semi-supervised learning model is obtained based on the optimized first sub-model and / or the optimized second sub-model.
13. An electronic device, characterized in that, It includes: a memory and a processor; wherein, the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the method for extracting node features of the graph structure as described in any one of claims 1-5 is implemented.
14. A method for determining traffic flow, characterized in that, It includes: Obtain a graph structure to be processed, wherein the graph structure to be processed includes a plurality of traffic nodes, and the plurality of traffic nodes include: marked traffic nodes with partial corresponding label information and unmarked traffic nodes without corresponding label information, and the label information is the traffic flow characteristics of the traffic nodes obtained by analyzing and processing historical traffic data and / or real-time traffic data; Process the graph structure to be processed to determine unsupervised node features and supervised node features corresponding to the traffic nodes, and the supervised node features are related to the label information; Based on the unsupervised node features and the supervised node features, determine semi-supervised node features corresponding to the traffic nodes in the graph structure to be processed; Based on the semi-supervised node features, determine the traffic flow corresponding to the traffic nodes.
Citation Information
Patent Citations
Face recognition method based on semi-supervised training
CN110472533A
System and method for point-to-point traffic prediction
CN112470199A