Social network link prediction method and system based on time-frequency perception graph convolution network, terminal and storage medium
By using a time-frequency-aware graph convolutional network framework, which integrates information from the frequency domain, time domain, and spatial domain, this method solves the problem that existing social network link prediction methods struggle to balance short-term and long-term time trends with complex spatial structures, achieving higher link prediction accuracy and better user recommendation performance.
Patent Information
- Application Number
- CN202511442926.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-10-10
AI Technical Summary
Existing methods for predicting links in social networks only consider single features or local spatial relationships in time series, making it difficult to simultaneously take into account the long-term and short-term time trends and complex spatial structures of social networks, resulting in low accuracy in link prediction.
We adopt a method based on time-frequency perceptual graph convolutional network (TFAGCN). Through the TFAGCN framework, we combine frequency domain module, spatiotemporal domain module and time-frequency attention module to fuse information in the frequency domain, time domain and spatial domain. We use DFT and IDFT for signal transformation, combine GCN and GRU for feature extraction, design a time-frequency bidirectional cross-attention network for feature fusion, and use a sparse penalty loss function for training.
It significantly improves the accuracy of social network link prediction, enhances the personalization of user recommendations, and better captures the complex spatiotemporal relationships of social networks.
Smart Images

Figure CN120915702B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network link prediction, in particular to a social network link prediction method, system, terminal and computer readable storage medium based on a time-frequency perception graph convolution network. BACKGROUND
[0002] In the application scenario of a social network, how to accurately predict the potential connection between users and the information propagation path is a key technical problem for detecting false information propagation and optimizing resource allocation of a social platform. The social network link prediction problem is essentially a graph completion task, that is, predicting potential but not yet formed edges in the current known graph structure. Existing social network link prediction methods mainly include traditional methods based on structural similarity, link prediction methods based on matrix decomposition and deep learning methods based on graph neural networks.
[0003] Traditional methods based on structural similarity evaluate the possibility of forming a link between a pair of nodes by designing a heuristic similarity index. Although this method is computationally efficient, simple to implement and suitable for small-scale static networks, it cannot establish nonlinear associations in network structure and has insufficient prediction ability when facing dynamic evolving networks. Link prediction methods based on matrix decomposition aim to learn the latent node representation from the connection matrix through dimensionality reduction techniques. This method can theoretically learn both structural and temporal features, but its main limitations are: 1. It relies on dense matrix computation and is difficult to extend to large-scale graphs; 2. The feature expression capability is limited and cannot fully capture complex node dependency relationships. Deep learning methods based on graph neural networks automatically extract network structure features and evolution patterns through an end-to-end learning framework. Although this method improves the accuracy of link prediction, most of them only focus on time domain modeling and ignore the potential of frequency domain information. Therefore, existing methods often only consider single features of time series or local spatial relationships, making it difficult to simultaneously consider long-term and short-term time trends and complex spatial structures of social networks, resulting in low accuracy of social network link prediction.
[0004] Therefore, the prior art still needs to be improved and developed. SUMMARY
[0005] The main purpose of the present application is to provide a social network link prediction method, system, terminal and storage medium based on a time-frequency perception graph convolution network, which aims to solve the problem of low accuracy of social network link prediction caused by only considering single features of time series or local spatial relationships, which makes it difficult to simultaneously consider long-term and short-term time trends and complex spatial structures of social networks.
[0006] To achieve the above object, the application provides a social network link prediction method based on a time-frequency perception graph convolution network, which comprises the following steps:
[0007] Obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information;
[0008] Training and processing a time-frequency perception graph convolution network according to the social network link training set to obtain a social network link prediction model;
[0009] Obtaining to-be-predicted social network information of the user, inputting the to-be-predicted social network information into the social network link prediction model, and obtaining a user social link prediction result.
[0010] Optionally, the social network link prediction method based on the time-frequency perception graph convolution network, wherein the obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information specifically comprises:
[0011] Obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, wherein the preprocessing comprises data cleaning, data conversion and data integration;
[0012] Obtaining a social network graph snapshot sequence of the target historical social network information, and obtaining a real social network graph snapshot sequence corresponding to the social network graph snapshot sequence;
[0013] Obtaining a plurality of groups of training samples according to the social network graph snapshot sequence and the real social network graph snapshot sequence, and creating a social network link training set according to all the training samples.
[0014] Optionally, the social network link prediction method based on the time-frequency perception graph convolution network, wherein the training and processing a time-frequency perception graph convolution network according to the social network link training set to obtain a social network link prediction model specifically comprises:
[0015] Inputting a group of training samples in the social network link training set into the time-frequency perception graph convolution network, performing matrix matching on a social network graph snapshot of the training sample, obtaining an adjacency matrix sequence, and performing dimension reduction conversion processing on the adjacency matrix sequence to obtain a social network time domain signal;
[0016] The time-domain signal of the social network is subjected to domain transformation processing to obtain the frequency-domain signal of the social network. The frequency-domain signal of the social network is subjected to complex number processing to obtain the frequency-domain signal of the target social network. The frequency-domain signal of the target social network is then transformed to obtain the frequency-domain features.
[0017] Define the node feature matrix of the historical social network information, perform graph convolution on each adjacency matrix in the adjacency matrix sequence based on the node feature matrix to obtain multiple graph snapshot space feature structures, and perform time evolution on all graph snapshot space feature structures to obtain time domain features;
[0018] The frequency domain features and the time domain features are linearly processed using a time domain attention neural network to obtain time domain attention information, and the frequency domain features and the time domain features are linearly processed using a frequency domain attention neural network to obtain frequency domain attention information.
[0019] The time-domain attention information and the frequency-domain attention information are weighted and predicted to obtain the social network link prediction result. The loss value of the social network link prediction result is calculated based on the real social network graph snapshot sequence of the training samples to obtain the target loss value. The parameters of the time-frequency awareness graph convolutional network are corrected based on the target loss value.
[0020] The next set of training samples is input into the time-frequency sensing graph convolutional network until the training status of the time-frequency sensing graph convolutional network meets the preset conditions, thus obtaining the trained social network link prediction model.
[0021] Optionally, in the aforementioned social network link prediction method based on time-frequency sensing graph convolutional networks, the complex number processing of the frequency domain signal of the social network specifically includes:
[0022] ;
[0023] The step of performing graph convolution processing on each adjacency matrix in the adjacency matrix sequence based on the node feature matrix is specifically as follows:
[0024] ;
[0025] in, For the target social network frequency domain signal, For activation function, For social network frequency domain signals, The weight matrix is a complex number. For complex bias, For the spatial feature structure of the graph snapshot, Social network graph snapshot The Laplace transform result, is a degree matrix, is a degree matrix, is a node feature matrix, is a learnable weight parameter.
[0026] Optionally, the social network link prediction method based on the time-frequency perception graph convolutional network, wherein the time evolution includes update gate processing, reset gate processing, candidate hidden state processing, and determined hidden state processing.
[0027] The time evolution of all graph snapshot spatial feature structures is specifically:
[0028] ;
[0029] ;
[0030] ;
[0031] ;
[0032] wherein, is an update gate, is a sigmoid activation function, is a hidden state of the i-th time step, is a graph snapshot spatial feature structure, is a reset gate, is a candidate hidden state of the i-th time step, is a hidden state of the i-th time step, is an element-wise multiplication, , , , , , , , and are all learnable parameters.
[0033] Optionally, the social network link prediction method based on the time-frequency perception graph convolutional network, wherein the weighting prediction of the time domain attention information and the frequency domain attention information obtains a social network link prediction result, specifically including:
[0034] The time domain attention information is normalized to obtain a first calculation result, and the frequency domain attention information is normalized to obtain a second calculation result.
[0035] The first calculation result and the second calculation result are added together to obtain the time-frequency feature result. Link prediction is then performed based on the last hidden state in the time-frequency feature result to obtain the social network link prediction result.
[0036] The normalization calculation of the temporal attention information specifically involves:
[0037] ;
[0038] The normalization calculation of the frequency domain attention information specifically involves:
[0039] ;
[0040] in, The first calculation result, For queries in the temporal attention neural network within temporal attention information, For the key of the temporal attention neural network in temporal attention information, The value of the temporal attention neural network in the temporal attention information. For normalization function, For transpose, For dimensional information, This is the second calculation result. For querying frequency domain attention neural networks within frequency domain attention information, For frequency domain attention information, it is the key of the frequency domain attention neural network. represents the value of the frequency domain attention neural network in the frequency domain attention information.
[0041] Optionally, in the aforementioned social network link prediction method based on time-frequency aware graph convolutional networks, the step of calculating the loss value of the social network link prediction result based on the real social network graph snapshot sequence of the training samples specifically involves:
[0042] ;
[0043] in, For the target loss value, For the penalty matrix, For the first Social network link prediction results at each time step For the first The adjacency matrix corresponding to the sequence of real social network graph snapshots at each time step.
[0044] Optionally, the social network link prediction method based on time-frequency aware graph convolutional networks, wherein the social network link prediction system based on time-frequency aware graph convolutional networks includes:
[0045] a data processing module, configured to acquire historical social network information of a user, preprocess the historical social network information to obtain target historical social network information, and create a social network link training set according to the target historical social network information;
[0046] a model training module, configured to train and process a time-frequency-aware graph convolution network according to the social network link training set to obtain a social network link prediction model;
[0047] a link prediction module, configured to acquire to-be-predicted social network information of the user, input the to-be-predicted social network information into the social network link prediction model, and obtain a user social link prediction result.
[0048] In addition, to achieve the above object, the application further provides a terminal, wherein the terminal comprises a memory, a processor, and a social network link prediction program based on a time-frequency-aware graph convolution network stored in the memory and executable on the processor, and the social network link prediction program based on the time-frequency-aware graph convolution network implements the steps of the social network link prediction method based on the time-frequency-aware graph convolution network when executed by the processor.
[0049] In addition, to achieve the above object, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a social network link prediction program based on a time-frequency-aware graph convolution network, and the social network link prediction program based on the time-frequency-aware graph convolution network implements the steps of the social network link prediction method based on the time-frequency-aware graph convolution network when executed by a processor.
[0050] In the application, historical social network information of a user is acquired, the historical social network information is preprocessed to obtain target historical social network information, and a social network link training set is created according to the target historical social network information; a time-frequency-aware graph convolution network is trained and processed according to the social network link training set to obtain a social network link prediction model; to-be-predicted social network information of the user is acquired, the to-be-predicted social network information is input into the social network link prediction model, and a user social link prediction result is obtained. The application can not only consider single features or local spatial relationships of time series, but also take into account long-term and short-term time trends and complex spatial structures of a social network, thereby significantly improving the link prediction accuracy of the social network and improving the personalization effect of user recommendation. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 is a flowchart of a preferred embodiment of the social network link prediction method based on a time-frequency-aware graph convolution network of the application;
[0052] Figure 2 is the overall architecture schematic diagram of the social network link prediction method based on the time-frequency perception graph convolution network of the present application;
[0053] Figure 3 is the structure schematic diagram of the time-frequency bidirectional cross attention network in the preferred embodiment of the present application;
[0054] Figure 4 is the structure diagram of the preferred embodiment of the social network link prediction system based on the time-frequency perception graph convolution network of the present application;
[0055] Figure 5 is the structure diagram of the preferred embodiment of the terminal of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical scheme and advantages of the present application more clear and explicit, the present application is further described in detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0057] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, motion condition, etc. between the components in a certain posture (as shown in the drawings), and if the certain posture changes, the directional indications will also change accordingly.
[0058] In addition, if the embodiments of the present application involve descriptions of "first", "second", etc., the descriptions of "first", "second", etc. are only for description purposes and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features with "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the realization of a person skilled in the art, and when the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist and is not within the protection scope required by the present application.
[0059] The social network link prediction method based on the time-frequency perception graph convolution network described in the preferred embodiment of the present application, as shown in Figure 1 The social network link prediction method based on the time-frequency perception graph convolution network includes the following steps:
[0060] Step S10, obtaining the historical social network information of the user, pre-processing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information.
[0061] Specifically, in the social network application scenario, how to accurately predict the potential connection between users and the information propagation path is a key technical problem to improve the performance of the recommendation system, detect false information propagation and optimize the resource allocation of the social platform; However, the traditional method often only considers a single feature or local spatial relationship of the time series, and it is difficult to simultaneously consider the long and short term time trends and complex spatial structures of the social network, resulting in low prediction accuracy of the links of the social network. In order to solve the above problems, the present application proposes a social network link prediction method based on time-frequency perception graph convolutional network, which can fully integrate frequency domain, time domain and spatial domain information in the node prediction and link prediction tasks of the social network through TFAGCN (Time-Frequency Aware Graphical Convolutional Networks, Time-Frequency Aware Graphical Convolutional Networks). The framework corresponding to this method includes a frequency domain module, a time-space domain module and a time-frequency attention module, wherein the frequency module maps the user interaction time series to the frequency domain through DFT (Discrete Fourier Transform), learns the global time dependence relationship in the frequency domain using MLP (Multilayer Perceptron), and then restores it to the time domain through IDFT (Inverse Discrete Fourier Transform), thereby capturing the periodicity and global trend in the social network; The time-space module combines GCN (Graph Neural Network) and GRU (Gated Recurrent Unit) to model the structural relationship between user nodes and short-term dynamic interaction, thereby extracting local space-time dependent features; The time-frequency attention module designs a TF-att (Time-Frequency Bidirectional Cross-Attention Network), which weights and fuses the frequency domain features and the time domain features, highlights the time-frequency information that contributes most to the node representation and prediction, and the corresponding overall framework diagram is as shown in Figure 2 First, the DFT is used to convert the social network time domain signal into a social network frequency domain signal, and the DFT is used to convert the social network frequency domain signal back to the time domain signal; Then, GCN is used to capture the local topological features of each social network graph snapshot sequence, and the comprehensive representation learned by the GCN is input into the GRU to capture the local time dependence of the dynamic graph. In addition, the designed time-frequency bidirectional cross-attention network adaptively fuses features from different domains at each time step; Finally, a sparse penalty loss is used to achieve more accurate and reliable link prediction.
[0062] The specific processing involves acquiring data for training the time-frequency awareness graph convolutional network, namely, a social network link training set. This training set is created by obtaining the user's historical social network information. A social network is a network structure composed of nodes and relationships between them (usually represented as edges or links), and it is dynamically changing. Formally, it is represented as a sequence of social network graph snapshots. ,in, This is a snapshot of the social network graph at the first time step. This is a snapshot of the social network graph at the second time step. For the first The first time step is a snapshot of the social network graph, all social network graph snapshots share the same set of nodes, and each social network graph snapshot is an undirected and unweighted network, while the second time step is a snapshot of the social network graph. Social network graph snapshot at a time step Contains a set of nodes and a set of edges ,use express, Using an adjacency matrix (also known as a symmetric matrix). describe The corresponding static topology, where, Let be the set of real numbers. Let be the number of nodes in the set. Specifically, when the _th ... The first time step The node and the first There is an edge between each node, that is ,but ;otherwise ,in, For the first The first time step The node and the first The relationship between edges between nodes For the first The first time step The node and the first The relationship between edges between nodes. The prediction of social network links is defined as follows: given a previously observed sequence of social network graph snapshots... Predicting the first Social network graph snapshot at a time step The corresponding expression is:
[0063] ;
[0064] in, for The predicted value, For the first a snapshot of a social network graph at a time step, A prediction method for social network links. After obtaining historical social network information, the historical social network information is preprocessed to obtain target historical social network information, wherein the preprocessing includes data cleaning, data conversion and data integration; the purpose of preprocessing is to remove noise and outliers to improve data quality; then, a sequence of social network graph snapshots of the target historical social network information is obtained, for example, a sequence of social network graph snapshots with a length of , and a real sequence of social network graph snapshots corresponding to the sequence of social network graph snapshots is obtained; a plurality of training samples are obtained according to the sequence of social network graph snapshots and the real sequence of social network graph snapshots, and a social network link training set is created according to all the training samples.
[0065] Step S20, training a time-frequency-aware graph convolutional network according to the social network link training set to obtain a social network link prediction model.
[0066] Specifically, after creating the social network link training set, the time-frequency-aware graph convolutional network needs to be trained according to the social network link training set. Specifically, a group of training samples in the social network link training set is input into the time-frequency-aware graph convolutional network, and matrix matching is performed on the social network graph snapshot of the training sample to obtain a sequence of adjacency matrices Since directly using the sequence of adjacency matrices as feature input will result in high dimension, which will make the sample sparse in space and not conducive to the model learning effective rules. Therefore, before domain transformation, the sequence of adjacency matrices is processed by using nonlinear transformation for dimension reduction to compress the feature space, so as to improve the data density and represent each node in the social network with a lower dimension; that is, the sequence of adjacency matrices is processed by dimension reduction conversion to obtain a social network time domain signal, and the corresponding dimension reduction conversion formula is:
[0067] ;
[0068] wherein, is a social network time domain signal, and are learnable parameters, is a reduced dimension, and specifically, dimension rearrangement is performed on so that .
[0069] In the past link prediction research, many works learn the time sequence characteristics of dynamic networks in the time domain, and model the time dependence through recurrent neural networks or attention networks. However, these methods learn the time characteristics at each time step in the time domain, can only see a limited window, are limited by the local receptive field, and are difficult to model long-term time dependence. After the social network time domain signal is converted into the social network frequency domain signal by the spectrum, the social network frequency domain signal reflects the comprehensive information of all time steps of any user in the social network, so that the global time variation pattern of the social network is learned more easily. In the embodiment of the application, by learning the structure of the frequency domain multilayer perception model, the social network time domain signal is converted into the real part and the imaginary part of the spectrum to learn the specific patterns of the real part and the imaginary part of the spectrum respectively, so as to capture the long-term time dependence of the social network. Specifically, the process includes two stages, namely domain transformation and frequency learning.
[0070] For domain transformation, the social network time domain signal is processed by domain transformation through discrete Fourier transform to obtain a social network frequency domain signal, wherein the discrete Fourier transform is to convert a discrete time domain signal into a discrete frequency domain signal, is commonly used in the field of signal processing and spectrum analysis, and can convert a time domain signal into a frequency domain signal for spectrum analysis, filtering and the like. The corresponding conversion formula is:
[0071] ;
[0072] Wherein, is the social network frequency domain signal, is a complex domain.
[0073] For frequency learning, a frequency domain multilayer perception is constructed to process the social network frequency domain signal in a complex number, and a target social network frequency domain signal is obtained. The corresponding expression is:
[0074] ;
[0075] Wherein, is the target social network frequency domain signal, is an activation function, is the social network frequency domain signal, is a complex weight matrix, is a complex bias, wherein:
[0076] ;
[0077] ;
[0078] Wherein, is the jth complex weight matrix, is the (j-1)th complex weight matrix, is the (j+1)th complex weight matrix. a complex weight matrix, is the first complex bias, is the first complex bias, is the imaginary unit; and according to the rules of complex multiplication, the expression of the target social network frequency domain signal is further represented as:
[0079] ;
[0080] wherein, is the real part of the complex number, is the imaginary part of the complex number, according to the formula, the frequency domain multilayer perception can be realized by calculating the real part and the imaginary part of the frequency component respectively.
[0081] After completing the frequency learning, the target social network frequency domain signal is converted into a time domain representation by inverse discrete Fourier transform, wherein the inverse discrete Fourier transform is the inverse operation of the discrete Fourier transform, used to return from the frequency domain to the time domain, and the frequency domain representation signal is converted back to the original time domain representation, and the conversion expression is:
[0082] ;
[0083] wherein, is the time domain feature representation. In order to improve the training speed and generalization ability of the model, a residual connection is added, and the corresponding frequency domain feature is obtained, and the corresponding expression is:
[0084] .
[0085] After that, in the embodiment of the application, in order to capture the local network structure information and local time information of the social network, the spatial attributes and temporal attributes of different time steps are simulated by combining GCN and GRU, so as to better learn the embedding vector representation of the nodes in the dynamic social network; specifically, GCN is used to learn the spatial structure of the social network for each time step of the social network graph snapshot, and GRU is used to learn the short-term social network evolution pattern for the adjacent time steps of the social network graph snapshot. Considering that the attributes of users in the social network are usually difficult to obtain, the application uses location encoding as the feature to distinguish different nodes in the social network; the node feature matrix of the historical social network information is defined, and the node feature of the first node is expressed as:
[0086] ;
[0087] wherein, is the encoding of the location of the first The node characteristics of each node. The encoding of the position is as follows The first time The node characteristics of each node. Let be the dimension of the location embedding, where , Then the node feature matrix of all nodes can be represented as .
[0088] Based on the node feature matrix, graph convolution is performed on each adjacency matrix in the adjacency matrix sequence to obtain multiple graph snapshot space feature structures, the corresponding expressions of which are:
[0089] ;
[0090] in, For the spatial feature structure of the graph snapshot, Adjacency matrix The Laplace transform result, for The degree matrix, The node feature matrix, where are learnable weight parameters; , The identity matrix is used. Furthermore, this invention uses the spatial feature structure of each graph snapshot as input information for the GRU to simulate the evolution of real-world social network structures over time, including update gate processing, reset gate processing, candidate hidden state processing, and hidden state determination processing, with corresponding expressions as follows:
[0091] ;
[0092] ;
[0093] ;
[0094] ;
[0095] in, To update the gate, which is used to determine the information that needs to be transmitted in the previous moment. It is the sigmoid activation function. For the first The hidden state at each time step. For the spatial feature structure of the graph snapshot, To reset the gate, which determines how much historical information to discard. For the first The system identifies candidate hidden states at each time step and uses reset gates to control the forgetting of historical information. For the first The hidden state at each time step, i.e., the time-domain feature, is determined by the update gate as the "interpolation" between the candidate hidden state and the old hidden state. For element-wise multiplication, , , , , and All parameters are learnable. Notably, all social network graph snapshots share the same GCN and GRU units to reduce the number of parameters in the model.
[0096] Subsequently, to effectively integrate frequency domain features and time domain features, i.e., long-term evolution trends and short-term evolution trends, this invention proposes a time-frequency bidirectional cross-attention network for learning the dynamic representation of nodes in a social network. The structure of the time-frequency bidirectional cross-attention network is as follows: Figure 3 As shown, by Figure 3 It can be seen that TF-att first uses frequency domain features as queries in the temporal attention neural network, extracting useful temporal information from the temporal features through a cross-attention mechanism. Similarly, TF-att uses temporal features as queries in the frequency domain attention neural network, extracting useful frequency domain information from the frequency domain features. Finally, the extracted information is summed and passed to the next GRU unit as the final hidden state of the current time step, until the last hidden state is obtained. Specifically, the frequency domain features and the temporal features are linearly processed according to the temporal attention neural network to obtain temporal attention information, wherein the temporal attention information includes the query of the temporal attention neural network, the key of the temporal attention neural network, and the value of the temporal attention neural network. The query of the temporal attention neural network is obtained by linearly processing the frequency domain features according to the temporal attention neural network. The corresponding expression is:
[0097] ;
[0098] in, For the first Social frequency domain characteristics at each time step These are learnable weight parameters. The dimensional information is used; the temporal features are linearly processed according to the temporal attention neural network to obtain the key of the temporal attention neural network. And the values of the temporal attention neural network The corresponding expression is:
[0099] ;
[0100] in, For the first The hidden state at each time step, i.e., the time-domain features. and All are learnable weight parameters; similarly, frequency domain features and time domain features are linearly processed using a frequency domain attention neural network to obtain frequency domain attention information, wherein the frequency domain attention information includes the query of the frequency domain attention neural network, the key of the frequency domain attention neural network, and the value of the frequency domain attention neural network, wherein the query of the time domain attention neural network is obtained by linearly processing the time domain features using the frequency domain attention neural network. The corresponding expression is:
[0101] ;
[0102] in, The weight parameters are learnable; the frequency domain features are linearly processed according to the frequency domain attention neural network to obtain the key of the frequency domain attention neural network. The values of the frequency domain attention neural network The corresponding expression is:
[0103] ;
[0104] in, and All of these are learnable weight parameters.
[0105] Subsequently, the context representations of the temporal attention information and the frequency domain attention information are calculated separately using a cross-attention mechanism. Specifically, the temporal attention information is normalized to obtain a first calculation result, and the frequency domain attention information is normalized to obtain a second calculation result. The expression for normalizing the temporal attention information is as follows:
[0106] ;
[0107] The expression for normalizing the frequency domain attention information is as follows:
[0108] ;
[0109] in, The first calculation result, For normalization function, For transpose, For dimensional information, The first calculation result is then added to the second calculation result to obtain the time-frequency feature result, which is then used as the final hidden state at the current time step. The corresponding expression is:
[0110] ;
[0111] wherein, is an element-wise addition; finally, the last hidden state in the time-frequency feature result is input into a fully connected layer to generate a social network link prediction result , the corresponding expression is:
[0112] ;
[0113] wherein, is the social network link prediction result of the th time step, i.e. is the adjacency matrix corresponding to the social network graph snapshot of the th time step, and the MLP is a multi-layer perceptron. In particular, in the , except for the last layer using a sigmoid activation function, the remaining layers all use a ReLU activation function.
[0114] Finally, since the social network is sparse, the connections between nodes in the social network are relatively small compared to the total possible connections, resulting in a low connection density of the network; and the sparsity of the social network will lead the model to be dominated by a large number of negative samples, resulting in insufficient learning of positive samples (real links), so that the model tends to judge all prediction results as no links; therefore, when designing the loss function, the sparsity of the social network needs to be considered. In order to solve the problem of sparsity of the social network, more attention is given to the existing links in the back propagation, and a loss function with sparse penalty is used in the present application, the loss value between the real social network graph snapshot sequence of the training sample and the social network link prediction result is calculated according to the loss function with sparse penalty, to obtain a target loss value, and the corresponding expression is:
[0115] ;
[0116] wherein, is the target loss value, is a penalty matrix, is the social network link prediction result of the th time step, is the adjacency matrix corresponding to the real social network graph snapshot sequence of the th time step; the expression of the penalty matrix is:
[0117] ;
[0118] wherein, is a penalty coefficient, is the the first and the second elements of the adjacency matrix corresponding to the real social network graph snapshot sequence of the time step; the social network sparsity problem is solved by imposing more penalties on the non-zero elements.
[0119] According to the target loss value, the parameters of the time-frequency perception graph convolution network are corrected, the next group of training samples is input into the time-frequency perception graph convolution network, and the above process is repeated, which will not be described here. Until the training condition of the time-frequency perception graph convolution network meets the preset condition, the preset condition includes that the number of training times reaches a preset number, and the preset requirement can be determined according to the time-frequency perception graph convolution network, which will not be described in detail. Finally, a trained social network link prediction model is obtained.
[0120] Further, after obtaining the trained social network link prediction model, in the embodiment of the present application, the model is verified on four public data sets, including Haggle, LH10, InVS13 and Email. Haggle records the contact between people through a wireless device, the node represents a person, and the link between the nodes represents the contact between people. LH10 uses RFID (Radio Frequency Identification) technology to identify the contact between people, and the data is collected in a hospital. InVS13 mainly involves the coexistence behavior and interaction between people in the real world. Email is an email data. These data sets are divided into training set, validation set and test set according to the ratio of 7:1:2, and the statistical information of the data set is shown in Table 1.
[0121] Table 1: Statistical information of the data set
[0122]
[0123] The present application uses three common performance indicators to compare the link prediction model, which are AUC (Area Under the Curve), MR (Mean Rank) and Recall (recall rate or recall rate), wherein AUC reflects the prediction accuracy of the model; Recall reflects the identification ability of the model to positive samples, both of which are better the larger the index value is; and MR reflects the proportion of prediction errors of the model, the smaller the index value is, the better the effect is.
[0124] To make a systematic comparison, three types of prediction methods are selected, namely similarity index-based methods, matrix decomposition-based methods and deep learning-based methods, and several representative methods are selected from the three types of prediction methods; for similarity index-based methods: PR-CzN (hybrid similarity index) and NC-LGBM (Node Centrality-Light Gradient Boosting Machine, light gradient boosting machine based on node centrality); for matrix decomposition-based methods: LPANMF (Link Prediction by Adversarial Non-negative Matrix Factorization, link prediction based on adversarial non-negative matrix factorization) and MljFE (Joint Multi-label learning and feature extraction, joint multi-label learning and feature extraction model); for deep learning-based methods: GC-LSTM (Graph Convolution embedded LSTM, graph convolution embedded LSTM), and GCN_MA (GCN with Memory Attention, graph convolution network with memory attention mechanism) and SRG (Spatial Recursive Group, deep learning model for image super-resolution).
[0125] Then, 10 historical time step windows are used as the length of the social network graph snapshot sequence, and the average value of 5 random experiments is taken as the experimental result; for the static graph link prediction model, the last social network graph snapshot is used as the input of the model; for the TFAGCN of the application, the dimension of the reduction is set to 32, the dimension of the position embedding is set to 16, the dimension of the GCN output feature and the dimension of the GRU output hidden state are both set to 32, and the output dimension of the time-frequency bidirectional cross attention network is set to 32; during prediction, a two-layer structure is used, the last layer is set to the number of nodes, the remaining hidden layer dimensions are all set to 64, the loss function penalty coefficient is set to 2, the learning rate of the Adam optimizer is 0.0005, and the corresponding comparison experimental results are shown in Table 2.
[0126] Table 2: Comparison experimental results
[0127]
[0128] As can be seen from Table 2, the TFAGCN of the application obtains the optimal performance on all data sets, in particular, although the MR performance of the TFAGCN is slightly weaker than the baseline GC-LSTM on the LH10 data set, the TFAGCN is superior to the GC-LSTM in terms of average performance. For example, compared with the matrix decomposition-based method, the TFAGCN achieves an average performance improvement of 12.7%, 7.1% and 18.6% in AUC, MR and Recall. The LPANMF only considers the sparsity and spatial structure of the social network, however, the social network has obvious time dependence, resulting in relatively poor prediction performance. In addition, although the MljFE considers the dynamics and topology of the network and updates the feature matrix and parameter matrix by gradient descent to complete link prediction, this simple matrix decomposition is difficult to learn complex nonlinear relationships, resulting in general prediction performance. The TFAGCN learns the node representation of the social network in a data-driven manner, so it can capture the complex spatio-temporal relationship of the social network. On the four data sets, the prediction effect of the TFAGCN is superior to that of this kind of method, especially in the performance of AUC.
[0129] In step S30, the to-be-predicted social network information of the user is obtained, and the to-be-predicted social network information is input into the social network link prediction model to obtain a user social link prediction result.
[0130] Specifically, after obtaining the social network link prediction model, the to-be-predicted social network information of the user is obtained, and the to-be-predicted social network information is input into the social network link prediction model to obtain a user social link prediction result. The TFAGCN framework proposed by the application unifies the frequency domain, time domain and spatial domain information of the social network, fully excavates the complex structure information contained in the social network, and improves the link prediction accuracy of the social network. The time-frequency bidirectional cross-attention network is designed, so as to adaptively fuse the frequency domain features and the time domain features, fully utilize the advantages of frequency domain analysis and time domain analysis, and achieve the purpose of effectively expressing the node information in the social network.
[0131] Further, as shown in Figure 4 Based on the above social network link prediction method based on the time-frequency perception graph convolution network, the application also correspondingly provides a social network link prediction system based on the time-frequency perception graph convolution network, wherein the social network link prediction system based on the time-frequency perception graph convolution network comprises:
[0132] The data processing module 51 is configured to obtain the historical social network information of the user, pre-process the historical social network information to obtain target historical social network information, and create a social network link training set according to the target historical social network information.
[0133] Model training module 52 is used to train the time-frequency awareness graph convolutional network based on the social network link training set to obtain a social network link prediction model.
[0134] Link prediction module 53 is used to obtain the user's social network information to be predicted, input the social network information to be predicted into the social network link prediction model, and obtain the user's social link prediction result.
[0135] Furthermore, such as Figure 5 As shown, based on the above-mentioned social network link prediction method based on time-frequency sensing graph convolutional network, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 5 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0136] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as program code installed on the terminal. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a social network link prediction program 40 based on a time-frequency aware graph convolutional network, which can be executed by the processor 10 to implement the social network link prediction method based on a time-frequency aware graph convolutional network in this application.
[0137] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the social network link prediction method based on time-frequency sensing graph convolutional networks.
[0138] The display 30 can be, in some embodiments, an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) toucher, etc. The display 30 is used to display information at the terminal and to display a visualized user interface.
[0139] In an embodiment, the following steps are implemented when the processor 10 executes the social network link prediction program 40 based on the time-frequency-aware graph convolution network in the memory 20:
[0140] Obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information;
[0141] Training and processing a time-frequency-aware graph convolution network according to the social network link training set to obtain a social network link prediction model;
[0142] Obtaining to-be-predicted social network information of the user, inputting the to-be-predicted social network information into the social network link prediction model, and obtaining a user social link prediction result.
[0143] The obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information specifically includes:
[0144] Obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information specifically includes:
[0145] Obtaining a social network graph snapshot sequence of the target historical social network information, and obtaining a real social network graph snapshot sequence corresponding to the social network graph snapshot sequence;
[0146] Obtaining a plurality of training samples according to the social network graph snapshot sequence and the real social network graph snapshot sequence, and creating a social network link training set according to all the training samples.
[0147] The training and processing a time-frequency-aware graph convolution network according to the social network link training set to obtain a social network link prediction model specifically includes:
[0148] inputting a set of training samples in the social network link training set into the time-frequency perception graph convolution network, performing matrix matching on a social network graph snapshot of the training sample, obtaining an adjacency matrix sequence, and performing dimension reduction conversion processing on the adjacency matrix sequence to obtain a social network time domain signal;
[0149] performing domain transformation processing on the social network time domain signal to obtain a social network frequency domain signal, performing complex number processing on the social network frequency domain signal to obtain a target social network frequency domain signal, and performing transformation processing on the target social network frequency domain signal to obtain a frequency domain feature;
[0150] defining a node feature matrix of the historical social network information, performing graph convolution processing on each adjacency matrix in the adjacency matrix sequence according to the node feature matrix to obtain a plurality of graph snapshot space feature structures, and performing time evolution on all graph snapshot space feature structures to obtain a time domain feature;
[0151] performing linear processing on the frequency domain feature and the time domain feature according to a time domain attention neural network to obtain time domain attention information, and performing linear processing on the frequency domain feature and the time domain feature according to a frequency domain attention neural network to obtain frequency domain attention information;
[0152] performing weighted prediction on the time domain attention information and the frequency domain attention information to obtain a social network link prediction result, performing loss value calculation on the social network link prediction result according to a real social network graph snapshot sequence of the training sample to obtain a target loss value, and correcting parameters of the time-frequency perception graph convolution network according to the target loss value;
[0153] inputting a next set of training samples into the time-frequency perception graph convolution network until the training condition of the time-frequency perception graph convolution network meets a preset condition to obtain a trained social network link prediction model.
[0154] The complex number processing on the social network frequency domain signal is specifically:
[0155] ;
[0156] The graph convolution processing on each adjacency matrix in the adjacency matrix sequence according to the node feature matrix is specifically:
[0157] ;
[0158] wherein, is a target social network frequency domain signal, is an activation function, is a social network frequency domain signal, is a complex weight matrix, is a plurality of bias, is a graph snapshot space feature structure, is a social network graph snapshot of Laplace transform results, is a degree matrix, of is a node feature matrix, is a learnable weight parameter.
[0159] Wherein, the time evolution includes update gate processing, reset gate processing, candidate hidden state processing and determined hidden state processing;
[0160] The time evolution of all graph snapshot space feature structures is specifically:
[0161] ;
[0162] ;
[0163] ;
[0164] ;
[0165] Wherein, is an update gate, is a sigmoid activation function, is a hidden state of the th time step, is a graph snapshot space feature structure, is a reset gate, is a candidate hidden state of the th time step, is a hidden state of the th time step, is an element-wise multiplication, , , , , and are all learnable parameters.
[0166] Wherein, the weighting prediction of the time domain attention information and the frequency domain attention information obtains a social network link prediction result, specifically including:
[0167] The time domain attention information is normalized to obtain a first calculation result, and the frequency domain attention information is normalized to obtain a second calculation result;
[0168] The first calculation result and the second calculation result are added to obtain a time-frequency feature result, and link prediction is performed according to a last hidden state in the time-frequency feature result to obtain a social network link prediction result.
[0169] The time-domain attention information is normalized, and the normalization calculation of the time-domain attention information is specifically as follows:
[0170] ;
[0171] The frequency-domain attention information is normalized, and the normalization calculation of the frequency-domain attention information is specifically as follows:
[0172] ;
[0173] Wherein, is a first calculation result, is a query of a time-domain attention neural network in the time-domain attention information, is a key of the time-domain attention neural network in the time-domain attention information, is a value of the time-domain attention neural network in the time-domain attention information, is a normalization function, is a transpose, is dimension information, is a second calculation result, is a query of a frequency-domain attention neural network in the frequency-domain attention information, is a key of the frequency-domain attention neural network in the frequency-domain attention information, is a value of the frequency-domain attention neural network in the frequency-domain attention information.
[0174] The loss value calculation of the social network link prediction result according to the real social network snapshot sequence of the training sample is specifically as follows:
[0175] ;
[0176] Wherein, is a target loss value, is a penalty matrix, is a social network link prediction result at a time step, is a real social network snapshot sequence corresponding to the time step.
[0177] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a social network link prediction program based on a time-frequency perception graph convolution network, and the social network link prediction program based on the time-frequency perception graph convolution network, when executed by a processor, implements steps of the social network link prediction method based on the time-frequency perception graph convolution network.
[0178] In summary, the application provides a social network link prediction method, system, terminal and storage medium based on a time-frequency perception graph convolution network, the method comprising: obtaining historical social network information of a user, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set according to the target historical social network information; training and processing a time-frequency perception graph convolution network according to the social network link training set to obtain a social network link prediction model; obtaining to-be-predicted social network information of the user, inputting the to-be-predicted social network information into the social network link prediction model, and obtaining a user social link prediction result. The application not only considers single features or local spatial relationships of time series, but also takes into account long-term and short-term time trends and complex spatial structures of social networks, thereby significantly improving the link prediction accuracy of social networks and improving the personalization effect of user recommendations.
[0179] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusions, so that processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed, or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of another identical element in the process, method, article or device that includes the element.
[0180] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware (such as a processor, a controller, etc.) to complete, and the program can be stored in a computer readable computer readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The computer readable storage medium can be a memory, a disk, an optical disk, etc.
[0181] It should be understood that the application is not limited to the above examples, and those skilled in the art can make improvements or changes according to the above description, and all these improvements and changes should be within the protection scope of the appended claims of the application.
Claims
1. A social network link prediction method based on time-frequency sensing graph convolutional networks, characterized in that, The social network link prediction method based on time-frequency sensing graph convolutional networks includes: Obtain the user's historical social network information, preprocess the historical social network information to obtain target historical social network information, and create a social network link training set based on the target historical social network information; The time-frequency sensing graph convolutional network is trained based on the social network link training set to obtain the social network link prediction model. The step of training the time-frequency awareness graph convolutional network based on the social network link training set to obtain the social network link prediction model specifically includes: A set of training samples from the social network link training set is input into the time-frequency sensing graph convolutional network. Matrix matching is performed on the social network graph snapshots of the training samples to obtain an adjacency matrix sequence. The adjacency matrix sequence is then subjected to dimensionality reduction transformation to obtain the social network time domain signal. The time-domain signal of the social network is subjected to domain transformation processing to obtain the frequency-domain signal of the social network. The frequency-domain signal of the social network is subjected to complex number processing to obtain the frequency-domain signal of the target social network. The frequency-domain signal of the target social network is then transformed to obtain the frequency-domain features. Define the node feature matrix of the historical social network information, perform graph convolution on each adjacency matrix in the adjacency matrix sequence based on the node feature matrix to obtain multiple graph snapshot space feature structures, and perform time evolution on all graph snapshot space feature structures to obtain time domain features; The frequency domain features and the time domain features are linearly processed using a time domain attention neural network to obtain time domain attention information, and the frequency domain features and the time domain features are linearly processed using a frequency domain attention neural network to obtain frequency domain attention information. The time-domain attention information and the frequency-domain attention information are weighted and predicted to obtain the social network link prediction result. The loss value of the social network link prediction result is calculated based on the real social network graph snapshot sequence of the training samples to obtain the target loss value. The parameters of the time-frequency awareness graph convolutional network are corrected based on the target loss value. The next set of training samples is input into the time-frequency sensing graph convolutional network until the training status of the time-frequency sensing graph convolutional network meets the preset conditions, and the trained social network link prediction model is obtained. Obtain the user's social network information to be predicted, input the social network information to be predicted into the social network link prediction model, and obtain the user's social link prediction result.
2. The social network link prediction method based on time-frequency sensing graph convolutional networks according to claim 1, characterized in that, The process of acquiring a user's historical social network information, preprocessing the historical social network information to obtain target historical social network information, and creating a social network link training set based on the target historical social network information specifically includes: The user's historical social network information is obtained, and the historical social network information is preprocessed to obtain the target historical social network information. The preprocessing includes data cleaning, data transformation and data integration. Obtain the social network graph snapshot sequence of the target historical social network information, and obtain the real social network graph snapshot sequence corresponding to the social network graph snapshot sequence; Multiple sets of training samples are obtained based on the social network graph snapshot sequence and the real social network graph snapshot sequence, and a social network link training set is created based on all the training samples.
3. The social network link prediction method based on time-frequency sensing graph convolutional networks according to claim 1, characterized in that, The complex number processing of the frequency domain signal of the social network specifically includes: ; The step of performing graph convolution processing on each adjacency matrix in the adjacency matrix sequence based on the node feature matrix is specifically as follows: ; in, For the target social network frequency domain signal, For activation function, For social network frequency domain signals, The weight matrix is a complex number. For complex bias, For the spatial feature structure of the graph snapshot, Social network graph snapshot The Laplace transform result, for The degree matrix, The node feature matrix, These are learnable weight parameters.
4. The social network link prediction method based on time-frequency sensing graph convolutional networks according to claim 1, characterized in that, The time evolution includes update gate processing, reset gate processing, candidate hidden state processing, and hidden state determination processing; The step of temporally evolving the spatial feature structure of all graph snapshots specifically involves: ; ; ; ; in, To update the door, It is the sigmoid activation function. For the first The hidden state at each time step For the spatial feature structure of the graph snapshot, To reset the door, For the first Candidate hidden states at each time step For the first The hidden state at each time step For element-wise multiplication, , , , , and All of these are learnable parameters.
5. The social network link prediction method based on time-frequency sensing graph convolutional networks according to claim 1, characterized in that, The step of weighting and predicting the temporal attention information and the frequency domain attention information to obtain the social network link prediction result specifically includes: The time-domain attention information is normalized to obtain a first calculation result, and the frequency-domain attention information is normalized to obtain a second calculation result. The first calculation result and the second calculation result are added together to obtain the time-frequency feature result. Link prediction is then performed based on the last hidden state in the time-frequency feature result to obtain the social network link prediction result. The normalization calculation of the temporal attention information specifically involves: ; The normalization calculation of the frequency domain attention information specifically involves: ; in, The first calculation result, For queries in the temporal attention neural network within temporal attention information, For the key of the temporal attention neural network in temporal attention information, The value of the temporal attention neural network in the temporal attention information. For normalization function, For transpose, For dimensional information, This is the second calculation result. For querying frequency domain attention neural networks within frequency domain attention information, For frequency domain attention information, it is the key of the frequency domain attention neural network. This represents the value of the frequency domain attention neural network in the frequency domain attention information.
6. The social network link prediction method based on time-frequency sensing graph convolutional networks according to claim 1, characterized in that, The step of calculating the loss value for the social network link prediction results based on the real social network graph snapshot sequence of the training samples is specifically as follows: ; in, For the target loss value, For the penalty matrix, For the first Social network link prediction results at each time step For the first The adjacency matrix corresponding to the sequence of real social network graph snapshots at each time step.
7. A social network link prediction system based on time-frequency sensing graph convolutional networks, characterized in that, The social network link prediction system based on time-frequency aware graph convolutional networks is used to implement the social network link prediction method based on time-frequency aware graph convolutional networks as described in any one of claims 1-6. The social network link prediction system based on time-frequency aware graph convolutional networks includes: The data processing module is used to acquire the user's historical social network information, preprocess the historical social network information to obtain target historical social network information, and create a social network link training set based on the target historical social network information. The model training module is used to train the time-frequency awareness graph convolutional network based on the social network link training set to obtain the social network link prediction model. The link prediction module is used to obtain the user's social network information to be predicted, input the social network information to be predicted into the social network link prediction model, and obtain the user's social link prediction result.
8. A terminal, characterized in that, The terminal includes a memory, a processor, and a program stored in the memory and executable on the processor. When executed by the processor, the program implements the steps of the social network link prediction method based on a time-frequency aware graph convolutional network as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program thereon, wherein the computer-readable storage medium stores a social network link prediction program based on a time-frequency aware graph convolutional network, and the social network link prediction program based on a time-frequency aware graph convolutional network, when executed by a processor, implements the steps of the social network link prediction method based on a time-frequency aware graph convolutional network as described in any one of claims 1-6.
Citation Information
Patent Citations
Social network link prediction method adopting knowledge graph embedding and time convolution network
CN111784081A
Social network link prediction method based on perceptual neural network
CN112508085A