Adaptive Trusted Sampling Method for Time Series Data Based on Graph Neural Network

By adopting the adaptive trusted sampling method in the graph neural network, the problem of uniform sampling ignoring important information and insufficient timing characteristics is solved, and the performance and time series prediction accuracy of the graph neural network are improved.

CN114819070BActive Publication Date: 2024-09-17CHONGQING KANGZHOU TECH TRADE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210378197.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2024-09-17
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

In the application of existing graph neural networks in recommendation systems, there are problems that uniform sampling ignores important information and does not consider timing characteristics and shallow structural features, resulting in limited performance.

Method used

Adopting an adaptive credible sampling method based on time series data, by constructing a graph neural network, extracting the two-layer tree topological connection structure of nodes, calculating similarity and credibility, adjusting the sampling strategy, using the attention mechanism to predict scores, and ensuring that nodes accuracy of representation.

Benefits of technology

The credibility of neighbor nodes is analyzed through the normalized timestamp information of time series to achieve accurate sampling of data features, which improves the accuracy of time series prediction and the performance of graph neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114819070B
    Figure CN114819070B
Patent Text Reader

Abstract

The present invention discloses a time series data adaptive trusted sampling method based on a graph neural network, including: constructing a graph neural network G based on time series data; extracting a two-layer tree topological connection structure of each node; calculating the similarity between all nodes of the same type; calculating the credibility of the connected leaf nodes in the two-layer tree topological connection structure of all root nodes; making the credibility of all root nodes higher than a threshold; randomly sampling from the data of the leaf nodes of the root nodes according to the proportion of credibility, and using the sampling results as state information; inputting the state information into the graph neural network to realize state update and aggregation to output the final node representation; splicing the node representations generated by the graph neural network G, realizing score prediction using an attention mechanism, and calculating the MSE loss in combination with the real score. The present invention analyzes the credibility of the neighbor nodes of the graph neural network through the normalized timestamp information of the time series, and at the same time, uses the topological structure of the sampling nodes to adaptively adjust according to the credibility, so as to realize accurate prediction of the time series.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of deep learning, and specifically relates to an adaptive trusted sampling method for time series data based on graph neural networks. Background Art

[0002] Graph Neural Network (GNN) is a deep learning model for graph data structure. It performs well in many graph-based machine learning tasks and has high interpretability. In recent years, it has become a widely used graph representation learning method. For example, GNN can learn effective user and item representations from user-item interaction networks for recommendation systems. GNN refers to all neural networks that take graph structures as input. The core idea is to learn a mapping that maps the features of nodes and their neighboring nodes in the graph structure to low-dimensional latent feature representations of the node, which involves sampling nodes.

[0003] In many existing methods, uniform sampling may ignore important neighbor nodes, which may cause some important structural features of the graph to be eliminated during sampling, and the data source of the graph neural network cannot be guaranteed. In addition, most of these methods do not consider the temporal characteristics of the structure itself, and ignore the shallow structural features of the output of the intermediate layer of the graph neural network, which limits the application effect of the graph neural network to a certain extent.

[0004] In recent years, there have been many research results on the application of graph neural networks in recommendation systems, but many of these methods still have the following problems: 1. The uniform sampling method for neighbor nodes may ignore the information provided by important neighbors and important information of other nodes such as secondary neighbor nodes; 2. No suitable learnable parameters are provided for rating prediction, which limits the performance of graph neural networks; 3. There is no temporal characteristics of the existence of neighbor structures; 4. The shallow structural characteristics of the output of the intermediate layer of the graph neural network are ignored. Summary of the invention

[0005] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a time series data adaptive trusted sampling method based on graph neural network to solve at least one defect in the prior art.

[0006] To achieve the above objectives and other related objectives, the present invention provides a time series data adaptive trusted sampling method based on a graph neural network, comprising:

[0007] Step 1: Construct a graph neural network G based on time series data; in the graph neural network G, there are no edges between nodes of the same type, and there are weights between nodes of different types;

[0008] Step 2: Extract the two-layer tree topological connection structure of each node;

[0009] Step 3: Calculate the similarity between all nodes of the same type;

[0010] Step 4: Using the normalized timestamp information of the time series data, calculate the credibility of the connected leaf nodes in the two-layer tree topological connection structure of all root nodes;

[0011] Step 5: If the credibility of all leaf nodes of a certain root node is less than or equal to the threshold, select the leaf nodes of nodes similar to the certain root node according to the similarity and merge them into the leaf nodes of the certain root node, and return to step 4 until the credibility of all root nodes is higher than the threshold;

[0012] Step 6: Randomly sample the data of the leaf nodes of the root node according to the proportion of credibility, and use the sampling result as the state information; wherein the proportion of credibility refers to the ratio of the credibility of the leaf node to the credibility of the root node to which the leaf node belongs, and the credibility of the root node is equal to the sum of the credibility of all leaf nodes under the root node;

[0013] Step 7: Input the state information into the graph neural network to update and aggregate the state, so as to output the final node representation;

[0014] Step 8: Concatenate the root node and leaf node representations generated by the graph neural network G, use the attention mechanism to realize score prediction, and calculate the MSE loss based on the actual score.

[0015] Optionally, calculating the similarity between all nodes of the same type includes:

[0016]

[0017] Among them, I i ,I j They are the historical record vectors of the interactions between nodes i and j of the same type.

[0018] Optionally, the normalized timestamp information of the time series data is ij It is: normalize the time when leaf node j occurs on the time scale of root node i.

[0019] Optionally, the credibility is calculated as follows: the credibility c of the score connected to the root node i and the leaf node j of the node i i,j for:

[0020]

[0021] Among them, d i is the degree of the root node i; λ is the adjustment factor, and its value range is [0,1).

[0022] Optionally, the sampling probability p(i|j) of the data of the leaf node j of the root node i is:

[0023] Where N i is the set of all leaf nodes j of the root node i, c i,j For credibility.

[0024] Optionally, the state updating and aggregation are respectively updating and aggregating the states of nodes of different types;

[0025] The aggregation formula for the state representation of all leaf nodes j for node i at the lth layer is:

[0026]

[0027] l-1 represents the lth layer node, k∈N i , is the number corresponding to the set of all leaf nodes j of the root node i;

[0028] For the l-th layer node i, the aggregated state representation is used to update the final node representation:

[0029]

[0030] Among them, || is the splicing operation, W (l) and W' (l) are the parameter matrices to be learned, σ(·) is the sigmoid activation function, is the state information input, l∈[0,L] is the number of layers, and L is a parameter to be determined.

[0031] Optionally, the score between node i and its leaf node j is implemented using the attention mechanism:

[0032] in SOFTMAX is a normalized exponential function, W1, W2, W r is the parameter matrix to be learned.

[0033] Optionally, the MSE loss is:

[0034] Among them, ||E train || is the training set E train The size of r i,j is the score of the root node i and the leaf node j of the root node i.

[0035] As described above, the time series data adaptive trusted sampling method based on graph neural network of the present invention has the following beneficial effects:

[0036] The present invention analyzes the credibility of neighbor nodes of the graph neural network through the normalized timestamp information of the time series, and adaptively adjusts the topological structure of the sampling nodes according to the credibility to ensure the credibility of the nodes, so as to better sample the data features accurately and achieve accurate prediction of the time series. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flow chart of a method for adaptive trusted sampling of time series data based on a graph neural network according to an embodiment of the present invention;

[0038] Figure 2 This is a flowchart of a method for adaptive trusted sampling of time series data based on a graph neural network according to another embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0040] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0041] like Figure 1 As shown, an embodiment of the present application provides a time series data adaptive trusted sampling method based on a graph neural network, comprising the following steps:

[0042] Step 1: Construct a graph neural network G based on time series data; in the graph neural network G, there are no edges between nodes of the same type, and there are weights between nodes of different types;

[0043] Step 2: Analyze the topological structure of the graph neural network G and extract the two-layer tree topological connection structure of each node;

[0044] Step 3: Calculate the similarity between all nodes of the same type through similarity analysis;

[0045] Step 4: Using the normalized timestamp information of the time series data, calculate the credibility of the connected leaf nodes in the two-layer tree topological connection structure of all root nodes;

[0046] Step 5: If the credibility of all leaf nodes of a certain root node is less than or equal to the threshold, select the leaf nodes of nodes similar to the certain root node according to the similarity and merge them into the leaf nodes of the certain root node, and return to step 4 until the credibility of all root nodes is higher than the threshold;

[0047] Step 6: Randomly sample the data of the leaf nodes of the root node according to the proportion of credibility, and use the sampling result as the state information; wherein the proportion of credibility refers to the ratio of the credibility of the leaf node to the credibility of the root node to which the leaf node belongs, and the credibility of the root node is equal to the sum of the credibility of all leaf nodes under the root node;

[0048] Step 7: Input the state information into the graph neural network to update and aggregate the state, so as to output the final node representation;

[0049] Step 8: Concatenate the root node and leaf node representations generated by the graph neural network G, use the attention mechanism to realize score prediction, and calculate the MSE loss based on the actual score.

[0050] Among them, there are no edges between nodes of the same type in the graph neural network G, and there may be weights between nodes of different types (user nodes and project nodes), which are user ratings.

[0051] In step 1, the data structure includes time, type (user or project), connection relationship, value relationship, etc.

[0052] In one embodiment, the similarity analysis is calculated using the cosine similarity formula:

[0053]

[0054] Among them, I i ,I j They are the historical record vectors of the interactions between the root node i and the leaf node j of the same type.

[0055] In one embodiment, the normalized timestamp information of the time series data is: the normalized timestamp information t of the user node to the project node ij , that is, normalize the time when leaf node j occurs on the time scale of root node i;

[0056] In one embodiment, the credibility is calculated as follows: for a root node i, the credibility of the score connected to its leaf node j is, that is, the credibility of the score connected to the root node i and the leaf node j of the node i is c i,j for

[0057]

[0058] Among them, d i is the degree of the root node i; λ is the adjustment factor, which ranges from [0,1) and is obtained by training the graph neural network.

[0059] In one embodiment, the threshold is adjusted according to the MSE loss calculated in step 8, and the initial time can be randomly given; the score of the newly incorporated leaf node is consistent with the original score of the similar node and the leaf node.

[0060] In step 6, the sampling probability formula of the root node i is:

[0061] Where N i is the set of all leaf nodes j of the root node i.

[0062] In step 7, the status update and aggregation are to update and aggregate the status of nodes of different types respectively.

[0063] The aggregation formula for the state representation of all leaf nodes j for node i at the lth layer is:

[0064]

[0065] For the l-th layer node i, the aggregated state representation is used to update the final representation of the node:

[0066]

[0067] Among them, || is the splicing operation, W (l) and W' (l) are the parameter matrices to be learned, σ(·) is the sigmoid activation function, is the state information input, l∈[0,L] is the number of layers, and L is a parameter to be determined.

[0068] In step 8, the score prediction between node i and its leaf node j using the attention mechanism is:

[0069] in SOFTMAX is a normalized exponential function, W1, W2, W r is the parameter matrix to be learned.

[0070] The MSE loss is:

[0071] Among them, ||E train || is the training set E train The size of r i,j is the score of node i and its leaf node j.

[0072] In a specific embodiment, the following six public data sets provided by Amazon are used:

[0073] 1. BOOK: The interaction network between users and online books. The selected subgraph contains 6,788,854 user nodes, 33,734 item nodes, and 1,000,000 ratings.

[0074] 2.CD: The interaction network between users and online music albums. The selected subgraph contains 77,172 user nodes, 11,402 item nodes, and 500,000 ratings.

[0075] 3. FOOD: The interaction network between users and food, including 768,438 user nodes, 166,049 item nodes and 1,297,156 ratings.

[0076] 4.MOVIE: The interaction network between users and movies, including 2,088,619 user nodes, 201,298 item nodes and 4,607,047 ratings.

[0077] 5. MUSIC: The interaction network between users and music tracks, including 478,235 user nodes, 266,414 item nodes, and 836,006 ratings.

[0078] 6.TOY: The interaction network between users and toys, including 1,342,911 user nodes, 327,705 item nodes and 2,252,771 ratings.

[0079] Each data set is divided into 80% training set and 20% test set, and the results are as follows:

[0080] Sampling strategy BOOK CD FOOD MOVIE MUSIC TOY Uniform Sampling 1.2553 1.0921 1.5654 0.8922 0.9145 1.3857 Time-based sampling 1.2258 1.0790 1.5274 0.8602 0.9241 1.3915 Degree-based sampling 1.2373 1.0919 1.5141 0.8736 0.9317 1.3062 Sampling based on rating credibility 1.1824 1.0250 1.4874 0.8452 0.9048 1.3274

[0081] It can be seen that sampling based on rating credibility is better.

[0082] Furthermore, an adaptive approach can be adopted on this basis to improve the effect.

[0083] In one embodiment, the present application further provides a time series data adaptive trusted sampling device based on a graph neural network, comprising:

[0084] A graph construction module is used to construct a graph neural network G based on time series data; wherein, in the graph neural network G, there are no edges between nodes of the same type, and there are weights between nodes of different types;

[0085] The extraction module is used to analyze the topological structure of the graph neural network G and extract the two-layer tree topological connection structure of each node;

[0086] The similarity calculation module is used to calculate the similarity between all nodes of the same type through similarity analysis;

[0087] A credibility calculation module, used to calculate the credibility of the connected leaf nodes in the two-layer tree topological connection structure of all root nodes by using the normalized timestamp information of the time series data;

[0088] A node incorporation module, for selecting leaf nodes of nodes similar to a certain root node and incorporating them into the leaf nodes of the certain root node according to the degree of similarity when the credibility of all leaf nodes of a certain root node is less than or equal to a threshold value, until the credibility of all root nodes is higher than the threshold value;

[0089] A sampling module, used to randomly sample from the data of the leaf nodes of the root node according to the proportion of credibility, and use the sampling result as the state information; wherein the proportion of credibility refers to the proportion of the credibility of the leaf node to the credibility of the root node to which the leaf node belongs, and the credibility of the root node is equal to the sum of the credibility of all leaf nodes under the root node;

[0090] An update aggregation module, used to input the state information into the graph neural network to implement state update and aggregation, so as to output a final node representation;

[0091] The loss calculation module is used to splice the node representations generated by the graph neural network G, use the attention mechanism to realize score prediction, and calculate the MSE loss based on the actual score.

[0092] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0093] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0094] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0095] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0096] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0097] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0098] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory ((RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0099] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A project rating prediction method for adaptive credible sampling of time series data based on graph neural network, It is characterized in that include: Step 1: Construct a graph neural network G based on time series data; in the graph neural network G, there are no edges between nodes of the same type, and there are weights between nodes of different types; The weight is the user rating; The time series data structure contains time, user type, item type, connection relationship and value relationship; The project is an online book, online music album, food, movie, music single or toy; Step 2: Extract the two-layer tree topological connection structure of each node; Step 3: Calculate the similarity between all nodes of the same type; Step 4: Using the normalized timestamp information of the time series data, calculate the credibility of the connected leaf nodes in the two-layer tree topological connection structure of all root nodes; The credibility is calculated as follows: The credibility c of the score connected to the root node i and the leaf node j of node i i,j for: Among them, d i is the degree of the root node i; λ is the adjustment factor, and its value range is [0,1); The normalized timestamp information t of the time series data ij As follows: Normalize the time when leaf node j occurs on the time scale of root node i; Step 5: If the credibility of all leaf nodes of a certain root node is less than or equal to the threshold, select the leaf nodes of nodes similar to the certain root node according to the similarity and merge them into the leaf nodes of the certain root node, and return to step 4 until the credibility of all root nodes is higher than the threshold; Step 6: Randomly sample the data of the leaf nodes of the root node according to the proportion of credibility, and use the sampling result as the state information; wherein the proportion of credibility refers to the ratio of the credibility of the leaf node to the credibility of the root node to which the leaf node belongs, and the credibility of the root node is equal to the sum of the credibility of all leaf nodes under the root node; Step 7: Input the state information into the graph neural network to update and aggregate the state, so as to output the final node representation; Step 8: Concatenate the root node and leaf node representations generated by the graph neural network G, use the attention mechanism to predict the rating, and calculate the MSE loss based on the actual rating. The threshold is adjusted according to the MSE loss calculated in step 8, and the initial moment can be randomly given; the score of the newly incorporated leaf node is consistent with the original score of the similar node and the leaf node.

2. According to claim 1, the project rating prediction method based on time series data adaptive credible sampling of graph neural network, Features: Calculating the similarity between all nodes of the same type includes: Among them, I m ,I n They are the historical record vectors of the interactions between nodes m and n of the same type.

3. According to claim 1, the project rating prediction method based on time series data adaptive credible sampling of graph neural network, Features: The sampling probability p(i|j) of the data of leaf node j of root node i is: Where N i is the set of all leaf nodes j of the root node i, c i,j For credibility.

4. According to claim 1, the project rating prediction method based on time series data adaptive credible sampling of graph neural network, Features: The state updating and aggregation are to update and aggregate the states of nodes of different types respectively; The aggregation formula for the state representation of all leaf nodes j for node i at the lth layer is: l-1 represents the l-1th layer node, k∈N i , is the number corresponding to the set of all leaf nodes j of the root node i; N i is the set of all leaf nodes j of root node i For the l-th layer node i, the aggregated state representation is used to update the final node representation: Among them, || is the splicing operation, W (l) and W' (l) are the parameter matrices to be learned, σ(·) is the sigmoid activation function, is the state information input, l∈[0,L] is the number of layers, and L is a parameter to be determined.

5. According to claim 4, the project rating prediction method based on time series data adaptive credible sampling of graph neural network, Features: The score between node i and its leaf node j is achieved by using the attention mechanism: in SOFTMAX is the normalized exponential function, W 1 , W 2 , W r is the parameter matrix to be learned.

6. According to claim 5, the project rating prediction method based on time series data adaptive credible sampling of graph neural network, Features: The MSE loss is: Among them, ||Etrain|| is the size of the training set Etrain, r i,j is the score of the root node i and the leaf node j of the root node i.