Dynamic social network user behavior prediction method based on core edge model and graph neural network
By introducing the method of core-edge structure and time memory fusion module in dynamic social networks, combining node attributes and network structure information, the problem of insufficient core-edge structure and time dynamic modeling in the existing technology is solved, and more accurate user behavior prediction is achieved.
Patent Information
- Application Number
- CN202510189626.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-06-10
AI Technical Summary
The existing technology ignores the core-edge structure in dynamic social networks and fails to effectively combine the dynamic changes of node attributes and network structure, resulting in insufficient time dynamic modeling and the inability to accurately capture the hierarchical characteristics and long-term evolution trends in the network.
A dynamic social network user behavior prediction method based on core edge model and graph neural network is adopted. By introducing the core-edge structure and time memory fusion module, core nodes and edge nodes are identified, combined with node attributes and network structure information, the node representation of historical time steps is integrated, and the model parameters are optimized to predict user behavior.
Effectively capture the different roles and evolutionary laws of core nodes and edge nodes in the network, improve the accuracy of user behavior prediction, and can simultaneously capture the local interaction mode and global structural characteristics in dynamic social networks.
Smart Images

Figure CN120124672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence and social network analysis, and in particular, to a method for predicting user behavior in a dynamic social network based on a core-periphery model and a graph neural network. Background Art
[0002] A dynamic social network refers to a network structure in which the interaction relationships between users change over time. In a social network, users interact through messages, comments, likes, etc., and these interaction behaviors will continue to evolve over time. For example, users may interact frequently within a certain period of time and reduce interaction in other periods. The research on dynamic social networks aims to capture these laws of temporal evolution, so as to predict the future behavior of users, identify key users, or analyze the evolution trend of the network structure.
[0003] A graph neural network is a deep learning model specifically used to process graph-structured data. Different from traditional neural networks, a graph neural network can directly process the relationships between nodes and edges, and capture local and global information in the graph structure. In recent years, graph neural networks have been widely applied in the fields of social network analysis, recommendation systems, knowledge graphs, etc. For a dynamic social network, a graph neural network can capture the dynamic evolution law of the network by combining time information.
[0004] Existing methods mainly focus on community structure or global network characteristics, while ignoring the important mesoscale network characteristic of the core-periphery structure. The core-periphery theory is mainly used to explain the unequal relationships between different regions or groups in social, economic, or geographical systems. It divides the system into two parts: "core" and "periphery". The core region usually has more resources, power, and economic advantages, while the periphery region is relatively dependent on the core region. In a social network, the core-periphery theory can be used to describe the hierarchical structure within the network. Some nodes (such as opinion leaders, individuals with rich resources) may be in the core position, while other nodes are in the periphery position, relying on core nodes to obtain resources and information. The dynamic changes in the social network (such as the formation and breakage of relationships) will affect the formation and evolution of the core-periphery structure, and thus affect the overall structure of society.
[0005] The core-periphery structure widely exists in real networks (such as core users and periphery users in a social network). If this structure is ignored, it will be difficult or even impossible for the analysis model to accurately capture the hierarchical features and asymmetric interaction patterns in the network.
[0006] Dynamic network embedding is a technique that maps network nodes to a low-dimensional vector space while capturing time-evolution characteristics. Most existing dynamic network embedding methods mainly focus on changes in network structure, while ignoring the dynamic changes in node attributes. Node attributes (such as users' interests, ages, occupations, etc.) play an important role in social networks and can provide rich context information. However, existing methods often treat node attributes as static features and fail to effectively combine the dynamic changes in node attributes and network structure. Existing dynamic network embedding methods are insufficient in time dynamics modeling, especially in capturing long-term evolution trends. Most methods only rely on network snapshots at the current time step to process historical information. These methods often cannot effectively capture the long-term evolution laws of nodes and edges in the network. Summary of the Invention
[0007] Aiming at the problems existing in the prior art, the present invention provides a method for predicting user behavior in a dynamic social network based on a core-periphery model and a graph neural network. By introducing a core-periphery structure and a time memory fusion module, the problems of ignoring the core-periphery structure, failing to effectively combine node attributes and network structure, and insufficient time dynamics modeling in the prior art are solved.
[0008] The technical solution of the present invention is implemented as follows:
[0009] A method for predicting user behavior in a dynamic social network based on a core-periphery model and a graph neural network, comprising the following steps:
[0010] S1. Construct a model; the model includes a graph convolutional network and a time memory fusion module;
[0011] S2. Core-periphery structure detection: Load historical data of the dynamic social network; perform core-periphery structure detection on each time step of the historical data to identify nodes in the dynamic social network; the nodes include core nodes and peripheral nodes; generate a core-periphery structure matrix using the nodes;
[0012] S3. Node embedding coding: Use a graph convolutional network to encode the node embedding to generate a first node representation; the first node representation includes structural information and attribute information; the goal of this step is to combine node attributes and network structure information to generate a low-dimensional node representation, thereby capturing the local structural features and attribute information of the nodes.
[0013] S4. Time memory fusion: Use the time memory fusion module to fuse the first node representations of the same node at different time steps to obtain a second node representation; used to capture the long-term evolution trend of the dynamic social network;
[0014] S5. Model Training and Optimization: Construct an objective function, which includes a random walk loss and a core-edge structure loss; use the objective function to optimize the parameters of the model; the random walk loss is used to capture local structure information, and the core-edge structure loss is used to enhance the discrimination ability between core nodes and edge nodes.
[0015] S6. User Behavior Prediction: Use the model to predict the future interaction behaviors of users. For example, whether a user will establish contact with a new user, or whether they will participate in the discussion of a certain topic.
[0016] The user behavior prediction task can be formulated as a link prediction problem. Specifically, given the node embeddings at time step t; for the node embeddings, the goal is to predict which pairs of nodes will form new edges at time step t + 1; divide the edge set at time step t + 1 into a training set, a validation set, and a test set. The training set is used to train a logistic regression classifier, the validation set is used to adjust the hyperparameters of the classifier, and the test set is used to evaluate the prediction performance of the model. On the test set, the area under the ROC curve (AUC) and the F1 score are used as evaluation metrics. AUC measures the classification performance of the model at different thresholds, while the F1 score comprehensively considers the precision and recall of the prediction results. Through these two metrics, the performance of the model in the user behavior prediction task can be comprehensively evaluated.
[0017] The present invention first introduces the core-edge structure into dynamic network embedding, which can better capture the different roles of core nodes and edge nodes in the network and their evolution laws. The core-edge structure not only reflects the hierarchical characteristics of the network but also can effectively promote the modeling of information dissemination and influence diffusion.
[0018] On the other hand, the time memory fusion module proposed by the present invention captures the long-term evolution trend of the network by fusing the node representations of historical time steps. This module adaptively adjusts the weights of historical information using the similarity of the core-edge structure, ensuring that the model can effectively utilize historical information to predict future user behaviors.
[0019] Finally, the present invention designs a dual loss function, combining the random walk loss and the core-edge structure loss, to optimize the model parameters. The random walk loss is used to capture local structure information, and the core-edge structure loss is used to enhance the discrimination ability between core nodes and edge nodes, ensuring that the model can simultaneously capture the local interaction patterns and global structure features in the dynamic social network.
[0020] As a further optimization of the above solution, in step S2, the historical data is represented as: G = {g 1 , g 2 , … g t … g T}; g t=(V t ,E t ,X t ), where t represents the time step and T is the total number of the time steps; V t represents the set of nodes at time step t; E t represents the set of edges between nodes at time step t; X t Represents the node attribute matrix at time step t; also includes the adjacency matrix A between the nodes t ;
[0021] It also includes constructing an idealized core-edge structure (A t ) * ;
[0022] (A t ) * The construction or update is:
[0023]
[0024] in, c represents the coreness value of a node; when c=0, it represents an edge node, and when c=1, it represents a core node; q represents the number of the core-edge pair to which a node belongs; K is a preset value, indicating that the dynamic social network consists of K non-overlapping core-edge pairs; represents the connection relationship between node i and node j in the core-edge structure;
[0025] Calculate A using the evaluation function t and (A t ) * The similarity value between Right now:
[0026]
[0027] Where d represents the degree of a node; through several optimization iterations, adjust (A t ) * The parameters make the similarity value Maximize to generate the core-edge structure matrix B t ,Right now:
[0028]
[0029] Indicates whether the i-th node and the j-th node belong to the same core-edge pair at time step t;
[0030] denotes belonging to the same core-edge pair, Indicates not belonging to the same core - periphery pair.
[0031] In graph theory, degree is a fundamental concept that describes the connectivity of vertices in a graph. The degree refers to the number of edges connected to a vertex. and represent the core values of the \(i\) - th node and the \(j\) - th node at the \(i\) - th time step respectively; similarly, and represent the numbers of the \(i\) - th node and the \(j\) - th node at the \(i\) - th time step respectively. Other symbols follow the same pattern.
[0032] is the expected value based on the configuration model, used to preserve the degree distribution of the original network, representing the expected number of connections between nodes \(i\) and \(j\) under the configuration and model.
[0033] By iteratively optimizing the node labels to maximize, the core - periphery structure at each time step can be detected, and the corresponding core - periphery structure matrix can be generated.
[0034] Through step S2, the core nodes and peripheral nodes in the dynamic social network can be identified, and structural information can be provided for subsequent node embedding coding and temporal memory fusion.
[0035] As a further optimization of the above - mentioned scheme, in step S2, for each of the said nodes Initialize to generate a label Initialize (A t ) * ;
[0036] Initialize the adjacency matrix A t , that is: A t =(A t ) * ;
[0037] The optimization iteration is as follows:
[0038] Modify the core value for each of the said nodes respectively, and calculate and compare the similarity values before and after the modification;
[0039] Only when the similarity value after the modification is greater than the similarity value before the modification, retain the modification of the core value of the node.
[0040] The core value \(c\) can only be changed from 0 to 1, or from 1 to 0, that is, try to assign the node as a core node or a peripheral node, and confirm whether to accept the assignment through the change of the similarity value.
[0041] By maximizing the similarity value, node groupings that conform to the ideal core-edge structure can be found, making the connections between core nodes closer and the connections between edge nodes sparser.
[0042] As a further optimization of the above solution, in step S3, the graph convolutional network uses SGC as the encoder; encoding the node embeddings using the encoder is specifically:
[0043]
[0044] where X t represents the node attribute matrix at time step t; W t is a preset weight matrix; α is a preset decay rate parameter; M t represents the first node representation.
[0045] SGC stands for Simplified Graph Convolutional Network, which is a simplified graph convolutional network; the static data of dynamic network social data at a certain time step can be recorded as a graph snapshot, and the graph snapshot records the node network graph structure and node information at that time. Encoding the node embeddings of the graph snapshot using the encoder can obtain the first node representation.
[0046] where W t is a trainable weight matrix; α is a trainable decay rate parameter; H t is the initial first node representation; Y t represents the first node representation based on the adjacency matrix, capturing the global structure information of the network; Z t represents the first node representation based on the core-edge structure matrix, capturing the local features of the core-edge structure. exp() is the exponential function.
[0047] As the time step increases, the historical information of the network gradually becomes richer. By introducing the decay rate parameter α, the weight of the core-edge structure information can be controlled to gradually reduce the dependence on the core-edge structure information and rely more on the global structure information provided by the adjacency matrix.
[0048] Through this adaptive aggregation method, it is possible to make full use of the core-edge structure information in the early stage of network evolution, while relying more on the global structure information in the later stage, thereby generating more robust and representative node embeddings.
[0049] M t is the finally fused first node representation, which not only contains the attribute information of the nodes, but also fuses the global structure and core-edge structure information of the network, providing high-quality input for subsequent time memory fusion and user behavior prediction.
[0050] As a further optimization of the above solution, in step S4, construct a historical information matrix be [M 1 , M 2 , …, M t-1 any of the sub-matrices represented by the first node;
[0051] The second node is represented as N t , and the calculation is as follows:
[0052]
[0053] where λ is a preset attenuation parameter; represents the structural similarity of the core-edge structure between the t-th time step and the i-th time step; represents the zero-padding operation on the historical information matrix to make and M t have the same dimension, and |v t | represents the number of nodes in the set at the t-th time step.
[0054] The core idea of the time memory fusion module is to enhance the model's ability to model network dynamic changes by fusing node representations at historical time steps. The time memory fusion module not only considers the node representation at the current time step but also ensures that the model can effectively utilize historical information to predict future user behavior by adaptively adjusting the weights of historical information.
[0055] λ is a learnable attenuation parameter used to control the attenuation speed of historical information; max() is the maximum value function. The finally generated second node representation N t not only contains the structural and attribute information at the current time step but also fuses the evolutionary information at historical time steps, providing strong support for subsequent model training and user behavior prediction.
[0056] As a further optimization of the above solution, in step S5, the objective function is represented as L, and the calculation process is represented as: L = (1 - μ)·L rw + μ·L cp ;
[0057] where L rw is the random walk loss; L cp is the core-edge structure loss; μ is a preset hyperparameter used to balance the contributions of the random walk loss and the core-edge structure loss.
[0058] The optimization of the model can be achieved by minimizing L. After the objective function is defined, the Adam optimizer is used to optimize the model parameters. Specifically, the learning rate is set to 0.001, and an early stopping strategy is adopted to prevent overfitting. The model is trained on the graph snapshots at each time step, and the parameters are updated through the backpropagation algorithm to minimize the objective function L. Combining the random walk loss and the core-edge structure loss can effectively integrate local structure information and global core-edge structure information.
[0059] As a further optimization of the above scheme, the random walk loss L rw is specifically calculated as follows:
[0060]
[0061] where V t represents the set of the nodes at time step t; represents the set of nodes that co-occur with node v in the random walk at time step t; σ(·) is the sigmoid function; <,> represents the inner product operation; is the negative sampling node set based on the degree distribution, and w n is a preset hyperparameter used to control the proportion of negative sampling.
[0062] Random Walk is a mathematical statistical model used to describe a path composed of a series of random steps. Its core feature is that the future direction cannot be predicted based on historical performance, and all conserved quantities of random walkers correspond to the diffusion transport law, approaching the ideal mathematical state of Brownian motion.
[0063] The random walk loss L rw preserves the local structure information of the network by encouraging nodes that co-occur in the random walk to have similar embedding representations.
[0064] The Sigmoid function (also known as the Logistic function) is an S-shaped curve function.
[0065] The degree of a node represents the number of its connections in the graph, and the degree distribution reflects the statistical characteristics of node connections in the network. High-degree nodes usually have stronger network influence (such as central users in a social network).
[0066] The negative sampling node set based on the degree distribution is an efficient sampling strategy in graph representation learning. Its core idea is to dynamically adjust the selection probability of negative samples according to the degree distribution of nodes in the graph to improve the training effect and efficiency of the model.
[0067] As a further optimization of the above scheme, the core-edge structure loss L cpThe specific calculation is as follows:
[0068]
[0069] Among them, B t represents the core-edge structure matrix at time step t; represents whether the u-th node and the v-th node belong to the same core-edge pair at time step t; represents belonging to the same core-edge pair, represents not belonging to the same core-edge pair; c represents the centrality value of the node.
[0070] The first term L of the core-edge structure loss function 3 encourages nodes within the same core-edge pair to have similar embedding representations, and has a stronger constraint on core nodes; the second term L 4 then promotes nodes between different core-edge pairs to have different embedding representations to preserve the global structural features of the network. (‖·‖) represents the norm of a vector or matrix, which is used to measure its length or size.
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] (1) The present invention first introduces the core-edge structure into dynamic network embedding, which can better capture the different roles of core nodes and edge nodes in the network and their evolution laws. The core-edge structure not only reflects the hierarchical characteristics of the network but also can effectively promote the modeling of information dissemination and influence diffusion.
[0073] (2) The time memory fusion module proposed by the present invention captures the long-term evolution trend of the network by fusing node representations of historical time steps. This module adaptively adjusts the weights of historical information using the similarity of the core-edge structure to ensure that the model can effectively use historical information to predict future user behaviors.
[0074] (3) The present invention designs a dual loss function, combining the random walk loss and the core-edge structure loss, to optimize the model parameters. The random walk loss is used to capture local structural information, and the core-edge structure loss is used to enhance the discrimination ability between core nodes and edge nodes to ensure that the model can simultaneously capture local interaction patterns and global structural features in the dynamic social network. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 is a schematic flowchart of a method for predicting user behaviors in a dynamic social network based on a core-edge model and a graph neural network provided by an embodiment of the present invention;
[0076] Figure 2 is a statistical information table of the data set provided by an embodiment of the present invention;
[0077] Figure 3 It is an experimental result table of using different repetitions of the user behavior prediction task for the data set provided by the embodiments of the present invention. Detailed implementation manners
[0078] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, 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 only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0079] As Figure 1 shown, this embodiment provides a method for predicting user behavior in a dynamic social network based on a core-edge model and a graph neural network, including the following steps:
[0080] S1. Construct a model; the model includes a graph convolutional network and a temporal memory fusion module.
[0081] S2. Core-edge structure detection: Load the historical data of the dynamic social network; the historical data is represented as: G = {g 1 , g 2 , … g t … g T}; g t = (V t , E t , X t ); where t represents the time step, and T is the total number of time steps; V t represents the set of nodes at the t time step; E t represents the set of edges between nodes at the t time step; X t represents the node attribute matrix at the t time step; for each node initialize to generate a label
[0082] It further includes constructing an idealized core-edge structure (A t ); initialize (A * ) using the label; the construction or update of (A t ) is represented as: * (A t ) * The construction or update of (A
[0083]
[0084] Where c represents the core value of a node; when c = 0, it represents an edge node, and when c = 1, it represents a core node; q represents the number of a node in the core-edge pair it belongs to; K is a preset value, indicating that the dynamic social network consists of K non-overlapping core-edge pairs; Indicates the connection relationship between node i and node j in the core-edge structure.
[0085] It also includes the adjacency matrix A between nodes t ; Initialize the adjacency matrix A t , that is: A t =(A t ) * .
[0086] Use the evaluation function to calculate the similarity value between A t and (A t ) * ; That is:
[0087]
[0088] where d represents the degree of a node.
[0089] Perform core-edge structure detection for each time step of historical data to identify nodes in the dynamic social network; the nodes include core nodes and edge nodes.
[0090] Use the nodes to generate a core-edge structure matrix; specifically, through several optimization iterations, adjust the parameters of (A t ) * to maximize the similarity value and generate the core-edge structure matrix B t , that is:
[0091]
[0092] Indicates whether the i-th node and the j-th node belong to the same core-edge pair at the t time step;
[0093] Indicates belonging to the same core-edge pair, Indicates not belonging to the same core-edge pair.
[0094] The optimization iteration is:
[0095] Modify the core value of each node separately, and calculate and compare the similarity values before and after the modification;
[0096] Only when the similarity value after the modification is greater than the similarity value before the modification, retain the modification of the core value of the node.
[0097] The core value c can only be changed from 0 to 1 or from 1 to 0, that is, try to assign the node as a core node or a peripheral node, and confirm whether to accept the assignment by the change of the similarity value.
[0098] By maximizing the similarity value, those node groupings that conform to the ideal core - periphery structure can be found, making the connections between core nodes closer and the connections between peripheral nodes sparser.
[0099] In graph theory, degree is a basic concept that describes the connection situation of vertices in a graph. Degree refers to the number of edges connected to a vertex. and respectively represent the core values of the i - th node and the j - th node at the i - th time step; similarly, and respectively represent the numbers of the i - th node and the j - th node at the i - th time step. Other symbol representations follow the same pattern.
[0100] is the expected value based on the configuration model, used to retain the degree distribution of the original network, representing the expected number of connections between nodes i and j under the configuration and model.
[0101] By iteratively optimizing the node labels to maximize, the core - periphery structure at each time step can be detected, and the corresponding core - periphery structure matrix can be generated.
[0102] Through step S2, the core nodes and peripheral nodes in the dynamic social network can be identified, and structural information can be provided for subsequent node embedding coding and temporal memory fusion.
[0103] S3, Node Embedding Code: Use SGC as the encoder; use the encoder to encode the node embedding, specifically:
[0104]
[0105] where, W t is the preset weight matrix; α is the preset decay rate parameter; M t represents the first - node representation.
[0106] SGC is short for Simplified Graph Convolutional Network, that is, a simplified graph convolutional network; the static data of dynamic network social data at a certain time step can be recorded as a graph snapshot, and the graph snapshot records the node network graph structure and node information at that time. Using the encoder to encode the graph snapshot for node embedding, the first - node representation can be obtained.
[0107] where, W tis a trainable weight matrix; α is a trainable decay rate parameter; H t is the initial first node representation; Y t represents the first node representation based on the adjacency matrix, capturing the global structure information of the network; Z t represents the first node representation based on the core-edge structure matrix, capturing the local features of the core-edge structure. exp() is the exponential function.
[0108] As the time steps increase, the historical information of the network gradually becomes richer. By introducing the decay rate parameter α, the weight of the core-edge structure information can be controlled to gradually reduce the dependence on the core-edge structure information and rely more on the global structure information provided by the adjacency matrix.
[0109] Through this adaptive aggregation method, the core-edge structure information can be fully utilized in the early stage of network evolution, while more reliance on the global structure information in the later stage, thus generating more robust and representative node embeddings.
[0110] M t is the finally fused first node representation, which not only contains the attribute information of the node, but also fuses the global structure and core-edge structure information of the network, providing high-quality input for subsequent time memory fusion and user behavior prediction. The goal of this step is to combine the node attributes and network structure information to generate low-dimensional node representations, thereby capturing the local structure features and attribute information of the nodes.
[0111] S4. Time memory fusion: Using the time memory fusion module, fuse the first node representations of the same node at different time steps to obtain the second node representation; used to capture the long-term evolution trend of the dynamic social network.
[0112] In this embodiment, construct the historical information matrix as a submatrix of any one of the first node representations in [M 1 , M 2 , …, M t-1 ;
[0113] The second node representation is N t , and the calculation is as follows:
[0114]
[0115] where λ is a preset decay parameter; represents the structural similarity between the core-edge structure at time step t and time step i; represents zero-padding operation on the historical information matrix to make and Mt has the same dimension as |v t | represents the number of nodes in the set at time step t.
[0116] The core idea of the temporal memory fusion module is to enhance the model's ability to model the dynamic changes of the network by fusing the node representations of historical time steps. The temporal memory fusion module not only considers the node representation of the current time step but also adaptively adjusts the weights of historical information to ensure that the model can effectively utilize historical information to predict future user behavior.
[0117] λ is a learnable decay parameter used to control the decay rate of historical information; max() is the maximum function. The finally generated second node representation N t not only contains the structural and attribute information of the current time step but also fuses the evolution information of historical time steps, providing strong support for subsequent model training and user behavior prediction.
[0118] S5. Model Training and Optimization: Construct an objective function, which includes a random walk loss and a core-edge structure loss.
[0119] In this embodiment, the random walk loss L rw is specifically calculated as follows:
[0120]
[0121] where represents the set of nodes that co-occur with node v in the random walk at time step t; σ(·) is the sigmoid function; <,> represents the inner product operation; is the negative sampling node set based on the degree distribution, and w n is a preset hyperparameter used to control the proportion of negative sampling.
[0122] Random Walk is a mathematical statistical model used to describe a path composed of a series of random steps. Its core feature is that the future direction cannot be predicted based on historical performance, and all conserved quantities of random walkers correspond to the diffusion transport law, approaching the ideal mathematical state of Brownian motion.
[0123] The random walk loss L rw preserves the local structure information of the network by encouraging nodes that co-occur in the random walk to have similar embedding representations.
[0124] The Sigmoid function (also known as the Logistic function) is an S-shaped curve function.
[0125] The degree of a node represents the number of its connections in the graph, and the degree distribution reflects the statistical characteristics of node connections in the network. High-degree nodes usually have stronger network influence (such as central users in a social network).
[0126] The negative sampling node set based on degree distribution is an efficient sampling strategy in graph representation learning. Its core idea is to dynamically adjust the selection probability of negative samples according to the degree distribution of nodes in the graph to improve the training effect and efficiency of the model.
[0127] In this embodiment, the core-edge structure loss L cp is specifically calculated as follows:
[0128]
[0129] where indicates whether the u-th node and the v-th node belong to the same core-edge pair at the t-th time step; indicates belonging to the same core-edge pair, indicates not belonging to the same core-edge pair; c represents the core value of the node.
[0130] The first term L 3 of the core-edge structure loss function encourages nodes within the same core-edge pair to have similar embedding representations, and has a stronger constraint on core nodes; the second term L 4 then promotes nodes between different core-edge pairs to have different embedding representations to preserve the global structural features of the network. (‖·‖) represents the norm of a vector or matrix, which is used to measure its length or size.
[0131] The random walk loss is used to capture local structural information, and the core-edge structure loss is used to enhance the discrimination ability between core nodes and edge nodes.
[0132] The parameters of the model are optimized using the objective function; in this embodiment, the objective function is denoted as L, and the calculation process is expressed as: L = (1 - μ)·L rw + μ·L cp ;
[0133] where μ is a preset hyperparameter used to balance the contributions of the random walk loss and the core-edge structure loss.
[0134] The optimization of the model can be achieved by minimizing L. After the definition of the objective function is completed, the Adam optimizer is used to optimize the model parameters. Specifically, the learning rate is set to 0.001, and an early stopping strategy is adopted to prevent overfitting. The model is trained on the graph snapshots at each time step, and the parameters are updated through the backpropagation algorithm to minimize the objective function L. Combining the random walk loss and the core-edge structure loss can effectively combine local structure information and global core-edge structure information.
[0135] S6. User behavior prediction: Use the model to predict the future interaction behaviors of users. For example, whether a user will establish contact with a new user, or whether a user will participate in the discussion of a certain topic.
[0136] The user behavior prediction task can be formalized as a link prediction problem. Specifically, given the node embeddings at time step t; for the node embeddings, the goal is to predict which pairs of nodes will form new edges at time step t + 1; the edge set at time step t + 1 is divided into a training set, a validation set, and a test set. The training set is used to train a logistic regression classifier, the validation set is used to adjust the hyperparameters of the classifier, and the test set is used to evaluate the prediction performance of the model. On the test set, the area under the ROC curve (AUC) and the F1 score are used as evaluation metrics. AUC measures the classification performance of the model at different thresholds, while the F1 score comprehensively considers the precision and recall of the prediction results. Through these two metrics, the performance of the model in the user behavior prediction task can be comprehensively evaluated.
[0137] The user behavior prediction method can be widely applied to a variety of dynamic social network scenarios. As Figure 2 shown, experimental evaluations were conducted on the following three datasets:
[0138] Enron dataset: This dataset was extracted from the internal email communication network of Enron and records the email interaction behaviors among employees. The nodes in the dataset represent employees, and the edges represent email communications among employees.
[0139] University of California, Irvine dataset: This dataset was extracted from an online social network at the University of California, Irvine and records the message communication behaviors among users. The nodes in the dataset represent users, and the edges represent the messages sent among users.
[0140] Reddit dataset: This dataset was extracted from the "Formula1" sub-forum on the Reddit forum social platform. This dataset records the reply behaviors of users to posts at different time periods, reflecting the interaction patterns among users. The nodes in the dataset represent users, and the edges represent the reply relationships among users.
[0141] As Figure 3As shown, the experimental results demonstrate the excellent performance of the proposed solution of the present invention on this dynamic social network dataset, achieving the best results on all three datasets. This indicates that the method can not only capture the local interaction patterns and global structural features in the dynamic social network, but also adaptively adjust the weights of historical information, thereby significantly improving the accuracy of user behavior prediction. Through its application in practical scenarios, the method can provide strong support for tasks such as social network analysis, content recommendation, and social relationship prediction.
[0142] The present invention first introduces the core-periphery structure into dynamic network embedding, which can better capture the different roles of core nodes and peripheral nodes in the network and their evolution laws. The core-periphery structure not only reflects the hierarchical characteristics of the network, but also can effectively promote the modeling of information dissemination and influence diffusion.
[0143] On the other hand, the time memory fusion module proposed by the present invention captures the long-term evolution trend of the network by fusing the node representations of historical time steps. The module uses the similarity of the core-periphery structure to adaptively adjust the weights of historical information, ensuring that the model can effectively utilize historical information to predict future user behaviors.
[0144] Finally, the present invention designs a dual loss function, combining the random walk loss and the core-periphery structure loss, to optimize the model parameters. The random walk loss is used to capture local structural information, and the core-periphery structure loss is used to enhance the discrimination ability between core nodes and peripheral nodes, ensuring that the model can simultaneously capture the local interaction patterns and global structural features in the dynamic social network.
[0145] Based on the disclosure and teachings of the above specification, those skilled in the art to which the present invention pertains can also make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the protection scope of the claims of the present invention. In addition, although some specific terms are used in this specification, these terms are only for convenience of description and do not constitute any limitation to the present invention.
Claims
1. A dynamic social network user behavior prediction method based on core edge model and graph neural network, characterized in that: The following steps are involved: S1. Construct a model; the model includes a graph convolutional network and a time memory fusion module; S2, core-edge structure detection: loading historical data of a dynamic social network; performing core-edge structure detection on each time step of the historical data to identify nodes in the dynamic social network; the nodes include core nodes and edge nodes; using the nodes to generate a core-edge structure matrix; S3, node embedding code: using a graph convolutional network to embed the node and generate a first node representation; the first node representation includes structure information and attribute information; S4, time memory fusion: using the time memory fusion module, fusing the first node representations of the same node at different time steps to obtain a second node representation; S5, model training and optimization: constructing an objective function, the objective function including random walk loss and core-edge structure loss; optimizing the parameters of the model using the objective function; S6. User behavior prediction: using the model to predict the user's future interactive behavior.
2. According to claim 1, a dynamic social network user behavior prediction method based on core edge model and graph neural network is characterized in that: In step S2, the historical data is represented as: G = {g 1 ,g 2 ,…g t …g T }; g t =(V t ,E t ,X t ), where t represents the time step and T is the total number of the time steps; V t represents the set of nodes at time step t; E t represents the set of edges between nodes at time step t; X t Represents the node attribute matrix at time step t; also includes the adjacency matrix A between the nodes t ; It also includes constructing an idealized core-edge structure (A t ) * ; (A t ) * The construction or update is: in, c represents the coreness value of a node; when c=0, it represents an edge node, and when c=1, it represents a core node; q represents the number of the core-edge pair to which a node belongs; K is a preset value, indicating that the dynamic social network consists of K non-overlapping core-edge pairs; represents the connection relationship between node i and node j in the core-edge structure; Calculate A using the evaluation function t and (A t ) * The similarity value between Right now: Where d represents the degree of a node; through several optimization iterations, adjust (A t ) * The parameters make the similarity value Maximize to generate the core-edge structure matrix B t ,Right now: Indicates whether the i-th node and the j-th node belong to the same core-edge pair at time step t; denotes belonging to the same core-edge pair, Indicates that they do not belong to the same core-edge pair.
3. According to claim 2, a dynamic social network user behavior prediction method based on core edge model and graph neural network is characterized in that: In step S2, for each of the nodes Initialize generated tags Initialize using the tag (A t ) * ; Initialize the adjacency matrix A t , that is: A t =(A t ) * ; The optimization iteration is: Modifying the coreness value of each of the nodes respectively, and calculating and comparing the similarity values before and after the modification; The modification of the coreness value of the node is retained only when the similarity value after the modification is greater than the similarity value before the modification.
4. According to claim 1, a dynamic social network user behavior prediction method based on core edge model and graph neural network is characterized in that: In step S3, the graph convolutional network uses SGC as an encoder; the encoder is used to embed the node, specifically: Among them, X t represents the node attribute matrix at time step t; W t is the preset weight matrix; α is the preset decay rate parameter; M t Represents the first node representation.
5. According to claim 2, a dynamic social network user behavior prediction method based on core edge model and graph neural network is characterized in that: In step S4, construct the historical information matrix For [M 1 ,M 2 ,…,M t-1 ] any one of the submatrices represented by the first node; The second node is denoted as N t , calculated as follows: Among them, λ is the preset attenuation parameter; represents the structural similarity of the core-edge structure between time step t and time step i; Represents the historical information matrix Perform zero padding to make and M t The dimensions are the same, |v t | represents the number of nodes in the set at time step t.
6. According to claim 1, a dynamic social network user behavior prediction method based on core edge model and graph neural network is characterized in that: In step S5, the objective function is represented by L, and the calculation process is represented by: L = (1-μ)·L rw +μ·L cp ; Among them, L rw is the random walk loss; L cp is the core-edge structure loss; μ is a preset hyperparameter used to balance the contribution of the random walk loss and the core-edge structure loss.
7. A method for predicting user behavior in a dynamic social network based on a core edge model and a graph neural network according to claim 6, characterized in that: The random walk loss L rw The specific calculation is: Among them, V t represents the set of nodes at time step t; represents the set of nodes that co-appear with node v in the random walk at time step t; σ(·) is the sigmoid function; <,> represents the inner product operation; is a set of negatively sampled nodes based on degree distribution, w n It is a preset hyperparameter used to control the proportion of negative sampling.
8. The method for predicting user behavior in a dynamic social network based on a core edge model and a graph neural network according to claim 6, characterized in that: The core-edge structure loss L cp The specific calculation is: Among them, B t represents the core-edge structure matrix at time step t; Indicates whether the u-th node and the v-th node belong to the same core-edge pair at time step t; denotes belonging to the same core-edge pair, indicates that they do not belong to the same core-edge pair; c indicates the coreness value of the node.
Citation Information
Cited By
Social user behavior prediction method based on graph structure and related equipment
CN122388771A