A social network denoising method based on a graph neural network
By designing a dual trainable denoising module, structural noise and feature noise in social networks are purified, improving the accuracy of node classification tasks and solving the problem of low classification accuracy of social networks under the influence of noise in existing technologies.
Patent Information
- Application Number
- CN202511677186.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-11-17
AI Technical Summary
Existing social networks contain structural noise and feature noise, which leads to inconsistencies between node features and topological structure. Existing methods are unable to effectively clean up these noises and improve classification accuracy.
A dual trainable denoising module is designed, including a structural noise corrector and a feature noise filter. The noise is purified through a GCN network and trained by combining InfoNCE loss and reconstruction loss to generate a purified user node feature matrix.
It significantly improves the accuracy of node classification tasks, enhances the model's generalization ability and robustness, and can effectively handle complex and noisy social networks.
Smart Images

Figure CN121118975B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of social networks, and in particular to a social network denoising method based on a graph neural network. BACKGROUND
[0002] A social network is a carrier for expressing complex relationships between people, where nodes represent users and edges represent relationships such as following and friendship. Using a graph neural network for node classification (such as user interest classification and abnormal account detection) is one of the core tasks of a social network. However, there are a large number of noises in real social networks, which result in low classification accuracy and poor results, and seriously damage the performance of GNNs. The noises include structural noise and feature noise.
[0003] Structural noise: includes false relationships (such as random following by bot accounts), missing relationships (real social relationships are not fully captured by the platform), and malicious attacks (a large number of connections are fabricated to increase influence).
[0004] Feature noise: includes missing and incorrect user profile information (such as false birthdates and regions), as well as ambiguous and misleading information filled by users to protect their privacy.
[0005] These noises result in a serious uniformity deviation between the node features and the topology of a social network. For example, a spam account (suspicious feature) may have a high node degree (topological centrality) by following a large number of people; a normal user (normal feature) may be at the edge of the network due to social inactivity.
[0006] However, existing social network denoising methods have obvious limitations:
[0007] (1) Unreasonable connection structure is not explicitly separated: before GNN training, heuristic methods such as Jaccard coefficients are used to delete "untrusted" edges. This method is separated from the downstream task, may mistakenly delete important edges, and cannot handle feature noise.
[0008] (2) Weak robustness to feature noise: some GNNs try to improve robustness by using attention mechanisms (such as GAT) or constraints on the aggregation process. However, they passively defend against feature noise and lack an effective mechanism for purifying data, and have limited effectiveness in strong feature noise scenarios.
[0009] Therefore, the existing technology lacks an end-to-end solution that can cooperatively purify structural and feature noise and effectively reconcile feature-topology inconsistency.
[0010] Name explanation:
[0011] GNN: Graph Neural Network, graph neural network.
[0012] GCN: Graph Convolutional Network, graph convolutional network.
[0013] Spam account: refers to an account registered and maintained by a malicious user.
[0014] GAT: Graph Attention Network, graph attention network. SUMMARY
[0015] The purpose of the present application is to provide a social network denoising method based on a graph neural network, which can simultaneously purify structural noise and feature noise, align the representations of the original view and the purified view using consistent training, and thus learn a pure, reliable and highly effective social network representation for node classification tasks.
[0016] In order to achieve the above purpose, the technical scheme adopted by the present application is as follows: a social network denoising method based on a graph neural network, comprising the following steps:
[0017] S1, obtaining social network data G=(V,E,X);
[0018] Wherein V is a set of user nodes, E is a set of user relationship edges, X is a user node feature matrix, each user node includes at most k-order neighbors, Wherein M is the total number of user nodes in V, N is the total number of feature dimensions of user nodes, x m is the N-dimensional feature of user node m, 1≤m≤M;
[0019] S2, constructing a double trainable denoising module, including a structural noise corrector, a feature noise filter and a fusion layer;
[0020] The structural noise corrector includes a correction feature layer and a first GCN network.
[0021] The correction feature layer is used to generate the corrected feature X of X according to s Wherein σ(∙) is an activation function, W s is the first weight matrix.
[0022] The first GCN network includes k layers of graph convolution layers, which are used to aggregate 1~k-order neighbor information Z (1) ~Z (k) , concatenate along the dimension to obtain a concatenation matrix , and generate a mixed feature according to the following formula;
[0023] ,
[0024] wherein, is the weight matrix of the k-th layer graph convolution layer of the first GCN network, and is a concatenation operator;
[0025] The feature noise filter comprises a preprocessing unit and a second GCN network;
[0026] The preprocessing unit sequentially processes each row vector in X to obtain a corresponding preprocessed feature, and then concatenates the preprocessed features into a preprocessed matrix X ω , wherein the preprocessed feature of the m-th row vector x m is obtained according to the following formula:
[0027] ,
[0028] ,
[0029] wherein u is the index of the neighbor node of the user node m, γ is the number of steps of the random walk of the user node m to the neighbor node u, A, D and are respectively the adjacency matrix, the weighted diagonal matrix and the normalized adjacency matrix of G, and is the u-th row vector of A , is the u-th row vector of D , is the u-th row vector of A , is a module parameter,
[0030] The second GCN network comprises K layers of graph convolution layers, and is configured to input X ω , and obtain a graph convolution output through k layers of graph convolution operations;
[0031] The fusion layer is configured to fuse and to obtain a purified user node feature matrix ;
[0032] S3, constructing a loss function L, training the dual trainable denoising module to obtain a dual denoising model by minimizing L using the social network data G;
[0033] L = L mi + αL f ,
[0034] wherein L mi is an InfoNCE loss function, L f is a reconstruction loss, and α is the weight of L f ;
[0035] S4: Obtain the social network data to be denoised, and obtain the corresponding purified user node feature matrix through a dual denoising model.
[0036] As a preferred option, W s , They all learn during training. Construct the assembly according to the following formula:
[0037] .
[0038] Preferably, the preprocessing unit processes the m-th row vector x in X. m Generate preprocessed features x ωm The method is as follows;
[0039] Sa1, x m The corresponding user node m is taken as the target node, its neighboring nodes and their indices u are obtained, and the feature function of user node m is preset. ;
[0040] ,
[0041] In the formula, i is the imaginary unit. Let m be the probability of a random walk between user node m and neighbor node u.
[0042] Sa2, generated using Euler's identity. real part and the virtual part ;
[0043] ,
[0044] Sa3, let , We obtain the following formula;
[0045] ,
[0046] Sa4 is formed by concatenating the real and imaginary parts of Sa3 into x. ωm ;
[0047] .
[0048] As a preferred option, purify the user node feature matrix. ,in This is the fusion coefficient.
[0049] As a preferred option, the InfoNCE loss function L mi Calculate according to the following formula;
[0050] ,
[0051] wherein, for user node m and user node j in V, when m=j, it is a positive sample, and when m≠j, it is a negative sample, ζ is a hyperparameter, , are the m-th row vector and the j-th row vector in V respectively, , are the m-th row vector and the j-th row vector in V respectively, e is a natural constant, and sim(·,·) is a cosine similarity calculation.
[0052] As preferred, the reconstruction loss L f is calculated according to the following formula:
[0053] ,
[0054] wherein, MLP(·) is a multi-layer perceptron, is a reconstruction signal generated based on the multi-layer perceptron MLP, and MSE(·,·) is a mean square error or L2 loss.
[0055] Regarding the idea of the application:
[0056] The application designs a double-trainable denoising module, including a structural noise corrector and a feature noise filter, both of which are optimized synchronously in the GCN training process, and the outputs of the two are fused to obtain a purified user node feature matrix X' to replace the original user node feature matrix X.
[0057] Regarding the structural noise corrector:
[0058] (1) In order to clarify the unreasonable connections such as false relationships, missing relationships and malicious attacks, a modified feature layer is designed, which assembles the features of the target node and the features calculated by the neighborhood to obtain modified features X s , X s =σ(XW s ), W s is continuously learned in training;
[0059] (2) The first GCN network is used to aggregate 1~k order neighbor information Z (1) ~Z (k) , which is spliced along the dimension to obtain a spliced matrix . Taking k=2 as an example:
[0060] ,
[0061] wherein, ((A-I E )X) is the first-order neighbor information Z (1) , and ((AA T -A-I E )X) is the second-order neighbor information Z(2) , I E is a unit matrix, || is a splicing operator, and T is a transpose operation;
[0062] Then, the modified feature X s obtained in (1) is spliced with the splicing matrix obtained in (2) to generate a mixed feature according to the formula , which is output of the structure noise corrector. The meaning of the formula is that in the feature updating of the target node, the proportion of the neighbor feature is weakened and the proportion of the node itself is increased by splicing the feature of the node itself twice, so that the feature of the target node itself and the neighbor feature in the social network data are distinguished, which helps to eliminate more unreasonable connections.
[0063] Regarding the feature noise filter:
[0064] (1) Design a preprocessing unit: unlike the spectral graph convolution in the traditional spectral graph theory, which is only performed in the real number domain, the model of the application introduces the Euler formula to map the real number feature of the node to the complex number domain to obtain a complex number feature with amplitude and phase information. In this way, not only can specific frequency components be amplified or reduced (controlled by the modulus), but also phase shifts can be performed on different frequency components. Through the phase information, the model can learn that even if two node features are similar (close in amplitude), if their structural roles in the network are different (different in phase φ), the information they pass to each other should also be different. This directly reconciles the contradiction between feature information and structure information. In the application, the preprocessing unit processes each row vector in X m in turn to obtain a preprocessed feature x ωm , and finally obtains a corresponding preprocessed matrix X ω .
[0065] (2) The second GCN network is used to perform k times of graph convolution operations on the preprocessed matrix X ω , and obtains a graph convolution output in the last layer (the kth layer).
[0066] Regarding the fusion layer: used to fuse and to obtain a purified user node feature matrix . Then, the dual denoising model is obtained by combining the loss function and training, which is used for denoising of the social network data to be denoised. After the data is denoised, it can be used in subsequent classification tasks.
[0067] Compared with the prior art, the application has the following advantages:
[0068] (1) Effective reconciliation of feature-topology inconsistency: A structure noise corrector is designed to identify and suppress noise connections in the network structure, enhancing the semantic consistency of the topology. At the same time, a feature noise filter is designed to filter out irrelevant and interfering information in the user node features, retaining task-related semantics. Further combining a consistency training strategy, the outputs of the structure noise corrector and the feature noise filter are fused to generate a purified user node feature matrix X' to replace the original matrix X, so that the model can ignore inconsistent noise in the features and structure, and mine the unified semantic information behind them, significantly improving the representation quality in complex noisy social networks. Through consistency training to align the representation distribution of the original view and the purified view, the model learns more pure, reliable and highly effective social network representation for node classification tasks, enhancing the generalization ability and robustness of the model.
[0069] (2) Task-oriented adaptive purification: The denoising strategy is driven by the final classification task loss, which can adaptively retain useful information for the task and filter out harmful noise, avoiding the subjectivity of heuristic methods.
[0070] (3) High practical value: Directly targeting the pain points of node classification tasks in social networks, effectively improving performance. According to tests, the accuracy of node classification tasks on social networks based on traditional graph neural network models is 92.17%, while the method proposed by the present application is 93.52%, an increase of 1.46%, significantly improving the accuracy of node classification. BRIEF DESCRIPTION OF DRAWINGS
[0071] Figure 1 is a structure diagram of a double trainable denoising module;
[0072] Figure 2 is a flowchart of the present application. DETAILED DESCRIPTION
[0073] The present application will be further described below in conjunction with embodiments and drawings.
[0074] Example 1: Referring to Figure 1 , Figure 2 A social network denoising method based on a graph neural network includes the following steps:
[0075] S1, obtaining social network data G=(V,E,X);
[0076] where V is a set of user nodes, E is a set of user relationship edges, X is a user node feature matrix, each user node includes at most k-order neighbors, where M is the total number of user nodes in V, N is the total number of feature dimensions of user nodes, x m is the N-dimensional feature of user node m, 1≤m≤M.
[0077] S2, constructing a dual trainable denoising module, including a structural noise corrector, a feature noise filter, and a fusion layer;
[0078] The structural noise corrector includes a modified feature layer and a first GCN network.
[0079] The modified feature layer is configured to generate a modified feature X of X according to s where σ(·) is an activation function, W is a first weight matrix. s
[0080] The first GCN network includes k layers of graph convolution layers configured to aggregate 1-k order neighbor information Z (1) ~Z (k) , concatenate along the dimension to obtain a concatenation matrix , and generate a hybrid feature according to the following formula
[0081]
[0082] wherein, is a weight matrix of the kth layer of graph convolution layers of the first GCN network, and || is a concatenation operator.
[0083] The feature noise filter includes a preprocessing unit and a second GCN network.
[0084] The preprocessing unit sequentially processes each row vector in X to obtain a corresponding preprocessed feature, and concatenates the preprocessed features to obtain a preprocessed matrix X ω wherein the preprocessed feature of the mth row vector x m is obtained according to the following formula
[0085]
[0086]
[0087] wherein, u is an index of a neighbor node of user node m, γ is a number of steps of random walk of user node m to neighbor node u, A, D, are an adjacency matrix, a weighted diagonal matrix, and a normalized adjacency matrix of G, respectively, and is a u-th row vector in is a power of is a module parameter, is a u-th row vector in X.
[0088] The second GCN network comprises K layers of graph convolution layers for inputting X ω , and obtaining a graph convolution output through k layers of graph convolution operations ;
[0089] The fusion layer is configured to fuse and to obtain a purified user node feature matrix ;
[0090] S3, constructing a loss function L, training the dual trainable denoising module with the social network data G to minimize L, and obtaining a dual denoising model;
[0091] L=L mi +αL f ,
[0092] In the formula, L mi is an InfoNCE loss function, L f is a reconstruction loss, and α is the weight of L f ;
[0093] S4, obtaining social network data to be denoised, and obtaining a corresponding purified user node feature matrix through the dual denoising model.
[0094] Wherein, W s , are learned in training, are spliced according to the following formula:
[0095] .
[0096] The preprocessing unit processes the mth row vector x m in X to generate a preprocessed feature x ωm .
[0097] Sa1, taking the user node m corresponding to x m as a target node, obtaining its neighbor nodes and their indexes u, and presetting a feature function of the user node m ;
[0098] ,
[0099] In the formula, i is an imaginary unit, is the random walk probability between the user node m and the neighbor node u;
[0100] Sa2, generating the real part and the imaginary part of x using Euler's identity;
[0101] ,
[0102] P(u|m) in the above equation is calculated using random walk algorithm, assuming that user node m walks from its initial position j to neighbor node u in γ steps, P(u|m) can be expressed as P(u=m j+γ| m);
[0103] Sa3, in order to quantify P(u=m j+γ| m), the present application constructs a normalized adjacency matrix , and replaces P(u=m j+γ| m) with the power of the γ-th row vector of in the u-th row of , that is, replaces P(u|m) with P(u=m , , obtaining the following equation;
[0104] ,
[0105] Sa4, splices the real part and the imaginary part in Sa3 as x ωm ;
[0106] ,
[0107] After sequentially processing M rows of x m in X, M rows of x ωm are obtained, and the M×N matrix structure is spliced back to obtain the pre-processing matrix X ω .
[0108] The purified user node feature matrix , wherein is a fusion coefficient.
[0109] The InfoNCE loss function L mi is calculated according to the following equation;
[0110] ,
[0111] In the equation, for user node m and user node j in V, when m=j, it is a positive sample, and when m≠j, it is a negative sample, ζ is a hyperparameter, , are the m-th row vector and the j-th row vector in , , are the m-th row vector and the j-th row vector in , e is a natural constant, and sim(∙,∙) is a cosine similarity calculation.
[0112] The reconstruction loss L f is calculated according to the following equation;
[0113] ,
[0114] where MLP(·) is a multi-layer perceptron, is a reconstruction signal generated based on the multi-layer perceptron MLP, and MSE(·,·) is a mean square error or L2 loss.
[0115] Embodiment 2: Refer to Figure 1 and Figure 2 In order to more intuitively express the denoising effect of the application, a node classification task is used for comparative experiments.
[0116] Dataset: MS dataset, which is a co-author of Microsoft Academic Network. Nodes represent authors, edges represent co-authorship, and features are keywords in the author's papers. The dataset has 18333 nodes, 81894 edges, and each node has 6805-dimensional features.
[0117] Experimental environment: hardware environment is 2.39 GHz E5-2680 CPU, 8 cores, 64 GB RAM, 11G GTX1080ti GPU, and software environment is PyTorch Geometric.
[0118] Experimental method: including method one and method two:
[0119] Method one: the application designs a double trainable denoising module for the node classification task. The double trainable denoising module includes a structural noise corrector, a feature noise filter, and a fusion layer, wherein the structural noise corrector and the feature noise filter respectively include a first GCN network and a second GCN network. Both GCN networks are k-layer graph convolution layers, and each graph convolution layer uses a ReLU activation function.
[0120] In the training process, the embedding dimension is 16, the number of layers k=2, the number of iterations is 300, the optimal L2 regularization with weight decay is 5e-4, the learning rate ranges from 0.01, the dropout value ranges from 0.6, and the InfoNCE loss function L mi and the reconstruction loss L f are used for multi-objective optimization, and each parameter is dynamically adjusted during the training process.
[0121] After training the double trainable denoising module of the application with the MS dataset, a double denoising model is obtained, which is used to output a purified user node feature matrix corresponding to the user node feature matrix X. is used for classification tasks.
[0122] Method two: a classic GCN model is used, the dataset is subjected to feature extraction by the GCN model, and then a classification task is performed.
[0123] The accuracy and Macro-F1 score of the first method and the second method are compared, and the following Table 1 is obtained:
[0124] Table 1. Performance index comparison table of different methods
[0125] Method Accuracy (%) Macro-F1 score (%) Method 1 93.52 92.96 Method 2 92.17 90.40
[0126] In Table 1, Macro-F1 score is macro-averaged F1 score in English.
[0127] Data analysis: The first method is better than the second method in accuracy and Macro-F1 score, showing higher classification accuracy. By improving the network architecture, the model of the application can generate higher quality node representation and can better handle complex node classification tasks.
[0128] The above only describes the preferred embodiments of the application and is not intended to limit the application. Any modification, equivalent replacement and improvement made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A social network denoising method based on a graph neural network, characterized in that, The method comprises the following steps: S1, obtaining social network data G=(V, E, X); where V is a set of user nodes, E is a set of user relationship edges, X is a user node feature matrix, each user node includes at most k-order neighbors, where M is the total number of user nodes in V, N is the total number of feature dimensions of user nodes, x m corresponding to the N-dimensional feature of the user node m, 1≤m≤M; S2, constructing a dual trainable denoising module, comprising a structure noise corrector, a feature noise filter, and a fusion layer; The structure noise corrector comprises a correction feature layer and a first GCN network; The correction feature layer is used to generate a correction feature X of X according to generating a correction feature X of X s where σ(·) is an activation function, W s is a first weight matrix; The first GCN network comprises k layers of graph convolution layers, used to aggregate 1-k order neighbor information Z (1) (k) , and the dimension is spliced into a splicing matrix , and a hybrid feature is generated according to the following formula ; , In the formula, is the weight matrix of the kth layer of the first GCN network, and is a splicing operator. The feature noise filter comprises a preprocessing unit and a second GCN network; The preprocessing unit processes each row vector in X sequentially to obtain the corresponding preprocessed features, which are then concatenated into a preprocessing matrix X. ω , , where the m-th row vector x m Preprocessing features It is obtained from the following formula; , , In the formula, u is the index of the neighbor node of the user node m, γ is the step number of the random walk of the user node m to the neighbor node u, A, D, respectively, are the adjacency matrix, the weighted diagonal matrix, and the normalized adjacency matrix of G, and is the u-th row vector in X, is the u-th row vector in X, is the u-th row vector in X, is the module parameter, is the u-th row vector in X; The second GCN network comprises K layers of graph convolution layers for inputting X ω , and obtaining graph convolution output through k layers of graph convolution operations ; The fusion layer is used for fusing and obtaining a purified user node feature matrix ; S3, constructing a loss function L, and training the dual trainable denoising module with the social network data G to minimize L, to obtain a dual denoising model; L = L mi + aL f , In the formula, L mi is the InfoNCE loss function, L f is the reconstruction loss, and a is the weight of L f . S4, obtaining social network data to be denoised, and obtaining a corresponding purified user node feature matrix through the dual denoising model.
2. The social network denoising method based on a graph neural network according to claim 1, characterized in that, W s 、 both learn in training, are stitched according to the following formula: 。 3. The social network denoising method based on a graph neural network according to claim 1, characterized in that, The pre-processing unit processes the m-th row vector x in X m The method for generating the pre-processed feature x ωm is; Sa1, will x m The corresponding user node m is taken as a target node, and its neighbor nodes and their indexes u are obtained. The characteristic function of the preset user node m is obtained ; , where i is the imaginary unit, is the random walk probability from user node m to neighbor node u. Sa2, generated using Euler's identity the real part and the imaginary part ; , Sa3, let , , to give the following formula; , Sa4, concatenate the real and imaginary parts in Sa3 as x ωm ; 。 4. The social network denoising method based on a graph neural network according to claim 1, characterized in that, purification user node feature matrix wherein is a fusion coefficient.
5. The social network denoising method based on a graph neural network according to claim 1, characterized in that, InfoNCE loss function L mi is calculated according to the following formula; , where, for user node m and user node j in V, m = j is a positive sample and m ≠ j is a negative sample, ζ is a hyper parameter, , are the m-th row vector and the j-th row vector in V respectively, are the m-th row vector and the j-th row vector in V respectively, , are the m-th row vector and the j-th row vector in V respectively, are the m-th row vector and the j-th row vector in V respectively, e is a natural constant, and sim(∙,∙) is a cosine similarity calculation.
6. The social network denoising method based on a graph neural network according to claim 1, characterized in that, reconstruction loss L f is calculated according to the following formula; , where MLP(·) is a multi-layer perceptron, is a reconstruction signal generated based on a multi-layer perceptron MLP, and MSE(·, ·) is a mean squared error or L2 loss.
Citation Information
Patent Citations
Associated user recognition method and device based on multilayer graph attention network
CN113628059A
Remote sensing image target detection method based on cross correction network
CN118052979A