Network alignment method based on counterfactual inference

CN116506302BActive Publication Date: 2026-08-11HENAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

然而,现有方法主要从观察到的特征或网络拓扑中提取语义特征并用于计算跨网络用户的相似度,而忽视了用户行为产生的原因,这会影响用户对齐模型的泛化能力

Benefits of technology

[0062]1)本发明通过在网络对齐中应用双曲空间嵌入以增强用户的表征能力,有助于区分网络中对齐用户和干扰用户,深入挖掘用户间的层次性和关联关系;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_35
    Figure SMS_35
  • Figure SMS_36
    Figure SMS_36
  • Figure SMS_51
    Figure SMS_51
Patent Text Reader

Abstract

This invention discloses a network alignment method based on counterfactual inference. First, user features are extracted and embedded into a hyperbolic space. Then, user features are aggregated using a hyperbolic graph attention network to obtain an aggregated feature embedding vector for each user in the hyperbolic space. Community detection is used to obtain the community set for each network. Counterfactual inference is then performed based on the feature embedding vectors and the communities to optimize the user feature embedding vectors. Finally, user alignment is performed based on the communities and the optimized user feature embedding vectors. This invention uses the community as a processing variable to analyze network causal relationships, and optimizes the user feature embedding vectors through counterfactual and factual networks, reducing the interference of data distribution differences on network alignment and improving the accuracy of network alignment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network technology, and more specifically, relates to a network alignment method based on counterfactual inference. Background Technology

[0002] With the booming development of the internet and the expansion of the internet user base, users typically share and communicate across multiple networks. Due to the openness, interactivity, and timeliness of the internet, it is difficult to accurately mine user characteristics based on a single network. However, network alignment (linking multiple accounts of real users across networks) can interconnect data from multiple networks, promoting relevant research and possessing practical value. For example, network alignment can help analyze differences in user behavior and interests across different networks, improve the efficiency of user recommendations and information dissemination, and enhance network security and stability. Therefore, how to effectively perform user alignment is a challenging problem.

[0003] Network alignment, also known as anchor link prediction, user identity association, and network alignment, can be categorized into three main research directions: user feature-based, network topology-based, and a combination of user features and network topology. Graph representation learning often enables adaptive fusion of topology and features, embedding users from multiple networks into the same vector space and identifying aligned users based on distances between them. However, existing methods primarily extract semantic features from observed features or network topology to calculate cross-network user similarity, neglecting the underlying causes of user behavior. This affects the generalization ability of user alignment models. If the training and test sets differ significantly, user alignment models built on the training set may struggle to achieve good user alignment on the test set. Data bias and poor generalization in network user alignment require further investigation. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a network alignment method based on counterfactual inference. This method uses communities as processing variables to analyze network causal relationships, optimizes user feature embedding vectors through counterfactual networks and fact networks, reduces the interference of data distribution differences on network alignment, and improves the accuracy of network alignment.

[0005] To achieve the above-mentioned objectives, the network alignment method based on counterfactual inference of the present invention includes the following steps:

[0006] S1: Let the source network to be aligned be... The target network is ,in Represents a set of users. , Represents network The first in One user, , Represents network The number of users in Represents the set of links between users. Represents network The corresponding adjacency matrix, when the user With users If there are friend relationships, then the adjacency matrix elements in =1, otherwise =0, ; Obtain known aligned user pairs, and then construct a system of size . Interlayer link relationship matrix This is used to represent the interlayer link relationship between the source network and the target network. users in and target network Chinese users When the alignment is for the same user, the corresponding inter-layer link relationship is 1; otherwise, it is 0.

[0007] For each user Perform user semantic feature extraction to obtain 3D user feature embedding vector ;

[0008] S2: Embed each user's features into a vector The transformation from Euclidean space to hyperbolic space yields the feature embedding vector for each user in hyperbolic space. ;

[0009] S3: User feature aggregation is performed based on a hyperbolic graph attention network to obtain the aggregated feature embedding vector of each user in the hyperbolic space. The specific methods for user feature aggregation are as follows:

[0010] The network is first calculated using the following formula. Chinese users Weights of each friend user when aggregating neighborhood features :

[0011]

[0012]

[0013] in, Represents the curvature of hyperbolic space. Represents the parameter vector to be trained. Indicates the weights of the parameters to be trained. This indicates a splicing operation. Indicates user A gathering of friends , Represents a nonlinear activation function in Euclidean space. Represents an exponential function in Euclidean space;

[0014] The following formula is used based on the user Feature embedding vector Feature embedding vector in corresponding Euclidean space Update to get users Aggregated feature embedding vector :

[0015]

[0016] in, Indicates along the vector The direction of embedding features into the vector Mapping from Euclidean tangent plane space to hyperbolic space , Indicates the weights of the parameters to be trained;

[0017] Based on known aligned user pairs, training samples are obtained, and the parameter vector to be trained is... Weights of parameters to be trained , Train the system, and then use the trained parameters to obtain the parameters for each user. Aggregated feature embedding vector ;

[0018] S4: For the two networks respectively Conduct community discovery to obtain each network community collection ;

[0019] S5: Feature optimization based on counterfactual inference, specifically the following method:

[0020] S5.1: Based on the inter-layer link relationship matrix Source Network and target network Aligning users in the middle creates a global fact network, with connections between users serving as fact links. If a user... If the two entities are located in the same community within the same network, then the corresponding fact-based processing applies. Otherwise, the facts should be handled accordingly. ;

[0021] S5.2: Based on the diffusion model, feature fusion of the fact network and the counterfactual network is performed to obtain the fusion embedding matrix of the fact network and the counterfactual network. The specific method is as follows:

[0022] S5.2.1: Extract from the global fact network of step S5.1 only the set of aligned user pairs The user subnetwork is aligned with the center and serves as the first fact network. ;

[0023] S5.2.2: Initialize the fact network sequence number ;

[0024] S5.2.3: For fact networks Generate the corresponding counterfactual network The specific method is as follows:

[0025] For the set of aligned user pairs Users in Based on the current user feature embedding vectors, respectively from the source network and target network The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them; if the interlayer link matrix Chinese users Interlayer link relationships If the value is 1, then the user will... Counterfactual treatment Counterfactual interlayer links Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links ;

[0026] For the source network If the user If links exist between them, then based on the current user feature embedding vector, the link is retrieved from the source network. The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them; if the source network adjacency matrix Chinese users Adjacency relationship between If the value is 1, then the user will... Counterfactual treatment Counterfactual adjacency Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links ;

[0027] For the target network If the user If a link exists between them, then based on the current user feature embedding vector, the link is transferred from the target network. The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them, if the target network adjacency matrix Chinese users Adjacency relationship between If the value is 1, then the user will... Counterfactual treatment Counterfactual adjacency Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links ;

[0028] S5.2.4: Build size is The feature embedding matrix, where the first The user's feature embedding vector in the behavior source network, then User feature embedding vectors in the behavioral target network; based on the fact network For the included users, the feature embedding vector of that user obtained in step S3 is filled into the corresponding row of the feature embedding matrix, and the feature embedding matrix is ​​the fact network. The feature embedding vector corresponding to the user is not included, and the resulting fact network is thus obtained. Feature Embedding Matrix Then, the same method is used to obtain the counterfactual network. Feature Embedding Matrix ;

[0029] S5.2.5: Determine if it is a factual network If it is not a fully factual network, proceed to step S5.2.6; otherwise, proceed to step S5.2.8.

[0030] S5.2.6: Add fact network Each user has not yet joined the fact network. First-order neighbor users, get the A fact network ;

[0031] S5.2.7: Order Return to step S5.2.3;

[0032] S5.2.8: Let the logarithm of the final fact network and counterfactual network be . The fusion embedding matrix of the sub-fact network is calculated using the following formula. Fusion embedding matrix with counterfactual networks :

[0033]

[0034] S5.3: Embedding the fusion of fact networks into the matrix Fusion embedding matrix with counterfactual networks The input is a multilayer perceptron, which acts as an encoder to fuse the embedding matrix. , The encoded features are obtained by encoding, and then the encoded features are input into the decoder. The decoder is used to decode based on the encoded features to generate the fact network and antifact network after feature update and topology update.

[0035] S5.4: The loss function is calculated using the following method:

[0036] Extract the updated source network from the updated fact network. adjacency matrix Update the target network adjacency matrix and updating the source network and update the target network Interlayer link relationship matrix Extract the corresponding empirical fact distribution of user pairs in fact processing from them. Experience with counterfactual processing and counterfactual distribution between users , Then, based on the distribution of corresponding empirical facts... Sampling is performed to obtain the empirical fact adjacency matrix. Empirical adjacency matrix Inter-layer link matrix of empirical facts Based on the corresponding empirical counterfactual distribution Sampling is performed to obtain the empirical counterfactual adjacency matrix. Empirical counterfactual adjacency matrix Inter-layer link matrix of empirical counterfactual relationships Then, the fact-learning loss functions of the source network and the target network are calculated using the following formula. and counterfactual learning loss function :

[0037]

[0038]

[0039] in, , Indicates that according to the updated network adjacency matrix Determined users Factual and counterfactual links between them Represents the adjacency matrix based on empirical facts. Determined users The empirical facts link between them Represents the adjacency matrix based on empirical counterfactual facts. Determined users The experience of counterfactual links between them;

[0040] The fact learning loss function of the inter-layer network is calculated using the following formula. and counterfactual learning loss function :

[0041]

[0042]

[0043] in, , This indicates that the inter-layer link relationship matrix is ​​used to represent the relationship between the layers. Determined users Factual and counterfactual links between them Represents the adjacency matrix based on empirical facts. Determined users The empirical facts link between them Represents the adjacency matrix based on empirical counterfactual facts. Determined users The experience of counterfactual links between them;

[0044] The user alignment loss is calculated using the following formula. :

[0045]

[0046] in, , Denotes the Frobenius norm;

[0047] The alignment similarity loss function is calculated using the following formula. :

[0048]

[0049] The user distance loss is calculated using the following formula. :

[0050]

[0051] The total loss function for optimizing user-embedded feature vectors is calculated using the following formula. :

[0052]

[0053] in, , , Indicates the preset weight;

[0054] S5.5: Determine whether the preset termination condition has been met. If not, proceed to step S5.6. If it has been met, the user feature embedding vector optimization ends.

[0055] S5.6: Based on the calculated total loss function Update the parameters of the multilayer perceptron and return to step S5.2;

[0056] S6: For the source network Users to be aligned Record the community where it is located as Calculate its relationship with the target network Similarity of each community ,

[0057]

[0058] in, Represents the target network The A community , This indicates how to find the number of elements in a set. and This represents the set of aligned users within the corresponding community; This represents the aligned set of users shared by both communities.

[0059] From the target network Select from all communities in China and related communities The community with the highest similarity is selected as the target community. The similarity between each user in the target community and the user to be aligned is calculated. The hyperbolic distance of the embedded feature vectors is used to filter out the minimum hyperbolic distance. If the minimum hyperbolic distance is less than a preset threshold, the corresponding user is selected as the user to be aligned. Align with the user; otherwise, do nothing.

[0060] This invention presents a network alignment method based on counterfactual inference. First, user features are extracted and embedded into hyperbolic space. Then, user features are aggregated based on a hyperbolic graph attention network to obtain the aggregated feature embedding vector of each user in hyperbolic space. Community discovery is used to obtain the community set of each network. Counterfactual inference is performed based on the feature embedding vector and the community to optimize the user feature embedding vector. Finally, user alignment is performed based on the community and the optimized user feature embedding vector.

[0061] The present invention has the following beneficial effects:

[0062] 1) This invention enhances the representation ability of users by applying hyperbolic space embedding in network alignment, which helps to distinguish between aligned users and interfering users in the network and to deeply explore the hierarchical and relational relationships between users;

[0063] 2) This invention analyzes the causal relationships within and between multiple network layers, performs data augmentation based on counterfactual inference, and uncovers the deep causal reasons for the formation of network friend relationships, thereby improving the accuracy of user alignment;

[0064] 3) This invention combines network alignment with community discovery to perform user alignment in highly similar communities, thereby improving computational efficiency and reducing interference from other similar users in the network. Attached Figure Description

[0065] Figure 1 This is a flowchart illustrating a specific implementation of the network alignment method based on counterfactual inference of the present invention;

[0066] Figure 2 This is a schematic diagram illustrating the mapping relationship between Euclidean space and hyperbolic space;

[0067] Figure 3 This is a cause-and-effect diagram;

[0068] Figure 4 This is a user alignment cause-and-effect diagram;

[0069] Figure 5 This is a flowchart of feature optimization based on counterfactual inference in this invention;

[0070] Figure 6 This is a flowchart of the process of fusing fact network features and counterfact network features using the diffusion model concept in this invention;

[0071] Figure 7 This is an example diagram of the construction of the counterfactual network in this invention;

[0072] Figure 8 This is an example diagram illustrating the fusion of fact networks and counterfactual networks in this invention;

[0073] Figure 9 This is a comparison chart of user similarity before and after training in this embodiment of the invention;

[0074] Figure 10 This is a comparison chart of the accuracy of the present invention and five comparative methods in this embodiment. Detailed Implementation

[0075] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.

[0076] Example

[0077] Figure 1 This is a flowchart illustrating a specific implementation of the network alignment method based on counterfactual inference of the present invention. Figure 1 As shown, the specific steps of the network alignment method based on counterfactual inference of the present invention include:

[0078] S101: Obtain network information:

[0079] Let the source network to be aligned be... The target network is ,in Represents a set of users. , Represents network The first in One user, , Represents network The number of users in Represents the set of links between users. Represents network The corresponding adjacency matrix, when the user With users If there are friend relationships, then the adjacency matrix elements in =1, otherwise =0, Obtain known aligned user pairs, then construct a system of size [size missing]. Interlayer link relationship matrix This is used to represent the interlayer link relationship between the source network and the target network. users in and target network Chinese users When the match is the same user, the corresponding inter-layer link relationship is 1; otherwise, it is 0.

[0080] For each user Perform user semantic feature extraction to obtain 3D user feature embedding vector In this embodiment, the user semantic feature extraction adopts the method in the literature "Huang Y, Zhao P, Zhang Q, et al. ASemantic-Enhancement-Based Social Network User-Alignment Algorithm[J].Entropy, 2023, 25(1): 172.", which extracts multi-level user semantic features including user-generated content, user attributes, and check-in.

[0081] S102: Hyperbolic Embedding:

[0082] Embed the feature vector for each user The transformation from Euclidean space to hyperbolic space yields the feature embedding vector for each user in hyperbolic space. .

[0083] In this invention, each user on the Poincaré sphere has one The Euclidean tangent plane space of dimension 1, and the transformation between Euclidean space and the Poincaré sphere can be achieved through exponential and logarithmic mappings. Figure 2 This is a schematic diagram illustrating the mapping relationship between Euclidean space and hyperbolic space. For example... Figure 2 As shown. Suppose there are two user feature embedding vectors on the Poincaré sphere. , The vector in a certain direction in the Euclidean tangent plane space corresponding to the given location is: , along the vector via exponential mapping The direction will be the data The mapping from Euclidean tangent plane space to hyperbolic space is shown in the following equation:

[0084]

[0085] in, Represents the curvature of hyperbolic space. Indicates Möbius strip, The conformal factor representing the Riemannian and Euclidean metrics refers to the proportion by which lengths and angles in one metric space are mapped to another metric space.

[0086] The data is mapped from hyperbolic space to the Euclidean tangent plane space via a logarithmic mapping, as shown in the following equation:

[0087]

[0088] To enhance the expressive power of graph data and improve user alignment, this invention incorporates user features of Euclidean space. Mapped to hyperbolic space Given the feature embedding vectors of users in Euclidean space. ,by Let be the origin in hyperbolic space, and have the Euclidean inner product. Then the feature embedding vector will be used. Feature embedding vectors transformed into hyperbolic space The process is as follows:

[0089]

[0090] S103: Feature aggregation based on hyperbolic graph attention network:

[0091] Hyperbolic space not only encodes hierarchical features well, but its capacity is also much larger than that of Euclidean space. A hyperbolic graph attention network is used as a graph generator to aggregate features from surrounding neighbors with different weights and optimize the user embedding vector in hyperbolic space. The same graph generation process is performed on both the source and target networks. Since linear transformations cannot be directly performed in hyperbolic space, a logarithmic mapping is needed to map it to the tangent plane at its location. Then, calculations are performed based on vector and matrix multiplication in Euclidean space, and finally, an exponential mapping is used to remap it back to hyperbolic space.

[0092] In this invention, user features are aggregated based on a hyperbolic graph attention network to obtain the feature embedding vector of each user in the hyperbolic space after feature aggregation. The specific methods for user feature aggregation are as follows:

[0093] First, the weights of neighboring users are calculated when a user performs feature aggregation. This is to effectively represent users in the network. Feature embedding vectors in hyperbolic space, and users Users with friend relationships need to learn about relationship-level attention and the weighting when aggregating neighborhood features. The calculation formula is:

[0094]

[0095]

[0096] in, Represents the parameter vector to be trained. Indicates the weights of the parameters to be trained. This indicates a splicing operation. Indicates user A gathering of friends , Represents a nonlinear activation function in Euclidean space. This represents an exponential function in Euclidean space. Using the above formula, the attention weights at the relational level can be calculated. , representing a collection of friends Chinese users For learning users The importance of the features.

[0097] The attention mechanism of graph attention networks allows the neural network to focus more on the information needed for user alignment, based on the features of neighboring users, using the following formula based on user... Feature embedding vector The corresponding feature embedding vector in Euclidean space Update to get users Aggregated feature embedding vector :

[0098]

[0099] in, Indicates along the vector The direction of embedding features into the vector Mapping from Euclidean tangent plane space to hyperbolic space , This represents the weights of the parameters to be trained.

[0100] Based on known aligned user pairs, training samples are obtained, and the parameter vector to be trained is... Weights of parameters to be trained , Train the parameters, and then use the trained parameters to obtain the parameters for each user. Aggregated feature embedding vector .

[0101] Network user alignment requires matching the same user account based on the similarity between users in two different networks. High similarity between two users within the same network can interfere with user alignment. Therefore, in feature aggregation training, the training objective is to make the aggregated feature embedding vectors of the two users in the aligned user pair as close as possible, while making the aggregated feature embedding vectors of the two users within the same network as far apart as possible. Therefore, the loss function used in user feature aggregation training in this embodiment... The calculation method is as follows:

[0102]

[0103] in, The alignment similarity loss is represented by the following formula:

[0104]

[0105] in, Indicates the alignment of user pairs into a set. This represents calculating the hyperbolic distance between two users in hyperbolic space. Dimensions representing user characteristics The curvature of the hyperbolic space is represented by the following formula for calculating the hyperbolic distance:

[0106]

[0107] The user distance loss in the network is represented by the following formula:

[0108]

[0109] S104: Community Discovery

[0110] For the two networks respectively Conduct community discovery to obtain each network community collection .

[0111] Community detection categorizes users with similar interests, specifically into non-overlapping community detection and overlapping community detection. Overlapping community detection refers to the fact that each user in the network can appear in multiple communities simultaneously, with overlap between communities. Aligning network users based on community detection not only improves computational efficiency through local similarity calculation but also enhances alignment effectiveness by aligning users within similar communities. Community detection is closely related to network user alignment; performing community detection based on already aligned users can effectively improve the effectiveness and efficiency of network user alignment. In this embodiment, the method disclosed in the literature "Zhu Z, Zhou T, Jia C, et al. Community detection across multiple social networks based on overlapping users[J]. Transactions on Emerging Telecommunications Technologies, 2022, 33(6)" is used for community detection. This method can be briefly summarized as follows:

[0112] The communities formed by aligned users are defined as core communities. First, nonnegative matrix factorization (NMF) is used for community discovery, with the relationships between aligned users in multiple networks as constraints. Core communities are extracted from the network adjacency matrix. Then, the similarity of users is calculated, and each core community in different networks is expanded by adding users with strong similarity, ultimately mining communities in multi-layer networks.

[0113] S105: Feature optimization based on counterfactual inference:

[0114] This invention, referencing "Zhao, Tong, et al. "Learning from counterfactual links forlink prediction." International Conference on Machine Learning. PMLR, 2022.", extends counterfactual inference from a single network to multiple networks and combines it with aligned user feature diffusion to optimize user feature embedding vectors, thereby improving the network user alignment effect.

[0115] In counterfactual inference, the analysis of causal relationships between variables is often done by calculating the individual treatment effect (ITE) and the average treatment effect (ATE). Causal diagrams are commonly used to describe causal inference problems. Figure 3 This is a schematic diagram of a cause-and-effect graph. For example... Figure 3 As shown, Indicates a confounding variable. Indicates the variable being processed. Representing outcome variables, analyzed using ITE and ATE. right The impact. For a binary variable, the value can be either 0 or 1. Indicates processing, This indicates no intervention. The difference between the outcome produced with and without intervention is the individual causal effect, assuming... Indicates a given hour As a result, the individual causal effect can be expressed as This can indicate that in a specific Value below, Regarding the results The corresponding average causal effect is .

[0116] In network user alignment, the feature embedding vectors of users are learned to predict the users to be aligned in multiple networks. Figure 4 This is a user-aligned cause-and-effect diagram. For example... Figure 4 As shown, the user The feature embedding vector in hyperbolic space is ,correspond Figure 3 Confounding factors ,and correspond Figure 4 The results The objective of this invention is to assess community response. Influence to enhance user characteristics To improve the alignment of users in a multi-layer network, both intra-layer links (topology within the same network) and inter-layer links (aligned user topology between different networks) are considered. The individual causal effects between users in the network can be expressed as:

[0117]

[0118] For binary fact processing matrix, Indicates user's opinion and The handling, Let represent the counterfactual processing matrix, and Within the same network, whether a user belongs to the same community is used as a processing variable; belonging to the same community represents... If not, it means Similar user pairs are found in different communities and used as counterfactual links. Need to find the most similar As a counterfactual link. For factual results, and This represents the counterfactual link matrix that was not observed when processing results differed from counterfactual results, serving as augmented data to improve user alignment.

[0119] Based on the above analysis, this invention proposes a method for feature optimization based on inverse inference. Figure 5 This is a flowchart of feature optimization based on counterfactual inference in this invention. For example... Figure 5 As shown, the specific steps for feature optimization based on counterfactual inference in this invention include:

[0120] S501: Constructing a Global Fact Network

[0121] Based on the inter-layer link relationship matrix Source Network and target network Aligning users in the middle creates a global fact network, with connections between users serving as fact links. If a user... If the two entities are located in the same community within the same network, then the corresponding fact-based processing applies. Otherwise, the facts should be handled accordingly. .

[0122] S502: Fusion of Fact Network and Counterfact Network Features:

[0123] Research has shown that the proportion of counterfactual links in the entire network has different effects on the optimization of user feature embedding vectors. Therefore, in order to improve the optimization effect of user feature embedding vectors, this invention performs feature fusion of fact network and feature fusion of counterfactual network based on the diffusion model idea, and obtains the fused embedding matrix of fact network and counterfactual network. Figure 6 This is a flowchart illustrating the fusing of fact network features and the fusing of counterfact network features using the diffusion model concept in this invention. For example... Figure 6 As shown, the specific steps for fusing fact network features and counterfactual network features based on the diffusion model in this invention include:

[0124] S601: Obtain the first fact network:

[0125] Extract only the set of aligned user pairs from the global fact network in step S501. The user subnetwork is aligned with the center and serves as the first fact network. .

[0126] S602: Initialize the fact network sequence number .

[0127] S603: Generate a counterfactual network:

[0128] Targeting the fact network Generate the corresponding counterfactual network The specific method is as follows:

[0129] For the set of aligned user pairs Users in Based on the current user feature embedding vectors, respectively from the source network and target network The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them. If the inter-layer link matrix... Chinese users Interlayer link relationships If the value is 1, then the user will... Counterfactual treatment Counterfactual interlayer links Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links It can be expressed by the formula:

[0130]

[0131] For the source network If the user If links exist between them, then based on the current user feature embedding vector, the link is retrieved from the source network. The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user The counterfactual link between them. If the source network adjacency matrix Chinese users Adjacency relationship between If the value is 1, then the user will... Counterfactual treatment Counterfactual adjacency Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links It can be expressed by the formula:

[0132]

[0133] For the target network If the user If a link exists between them, then based on the current user feature embedding vector, the link is transferred from the target network. The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them, if the target network adjacency matrix Chinese users Adjacency relationship between If the value is 1, then the user will... Counterfactual treatment Counterfactual adjacency Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links It can be expressed by the formula:

[0134]

[0135] Figure 7 This is an example diagram of the counterfactual network construction in this invention. For example... Figure 7 As shown, this invention constructs a counterfactual network using the community as the processing variable, thereby enhancing the network and causal relationships, and thus improving user alignment.

[0136] S604: Generate the feature embedding matrix:

[0137] Build size is The feature embedding matrix, where the first The user's feature embedding vector in the behavior source network, then Feature embedding vectors of users in the behavioral target network. Based on the fact network. For the included users, the feature embedding vector of the user obtained in step S103 is filled into the corresponding row of the feature embedding matrix, and the feature embedding matrix is ​​a fact network. The feature embedding vector corresponding to the user is not included, and the resulting fact network is thus obtained. Feature Embedding Matrix Then, the same method is used to obtain the counterfactual network. Feature Embedding Matrix .

[0138] S605: Determining if a network is real If it is not a full-fact network, proceed to step S606; otherwise, proceed to step S608.

[0139] S606: Generate the first A network of facts:

[0140] Increase fact network Each user has not yet joined the fact network. First-order neighbor users, get the A fact network .

[0141] S607: Order Return to step S603.

[0142] S608: Obtain the fused feature embedding matrix:

[0143] Let the logarithm of the final fact network and counterfactual network be . The fusion embedding matrix of the sub-fact network is calculated using the following formula. Fusion embedding matrix with counterfactual networks :

[0144]

[0145] Figure 8 This is an example diagram illustrating the fusion of fact networks and counterfactual networks in this invention. Figure 8 As shown, several fact networks and counterfactual networks are generated by diffusion from the fact network, and then the features are fused and used as input for the subsequent multilayer perceptron.

[0146] S503: Generate and reconstruct the network:

[0147] Embedding the fusion of fact networks into the matrix Fusion embedding matrix with counterfactual networks The input is a multilayer perceptron (MLP), which acts as an encoder to fuse the embedding matrix. , The encoded features are obtained through encoding and then input into the decoder. The decoder is used to decode based on the encoded features to generate the fact network and counterfactual network after feature update and topology update.

[0148] The multilayer perceptron is a commonly used type of neural network, and its specific structure will not be elaborated here. The encoder-decoder architecture is also a commonly used architecture in deep learning, and its specific principles and working process will not be elaborated here.

[0149] S504: Calculate the loss function:

[0150] In existing technologies, user alignment models are typically constructed based on the data features and distribution patterns of the training set. These models can fit existing or similar user features well, but networks are dynamically evolving, and the differences between different networks are significant. To enhance data diversity and improve the model's generalization ability, this invention uses a constructed counterfactual network as augmenting data. Based on deep learning, it analyzes the changes in data distribution after topological changes among users, thereby improving the feature mining capability for unknown data. This invention uses... This represents the observed factual distribution of user interactions with features and processing variables. This represents the counterfactual distribution of opposite processing variables and similar user pairs. While actual observed data distributions can be used for modeling and analysis, due to network dynamics and differences between network platforms, limited existing sample data, sampling errors, and noise, directly using observed data distributions may lead to model instability and inaccuracy. Empirical distributions, derived from the statistical properties of data samples, provide more stable and accurate distribution models. Therefore, this invention calculates the loss function based on empirical factual and empirical counterfactual distributions to optimize the user feature embedding vector.

[0151] The updated source network is extracted from the updated fact network. adjacency matrix Update the target network adjacency matrix and updating the source network and update the target network Interlayer link relationship matrix Extract the corresponding empirical fact distribution of user pairs in fact processing from them. Experience with counterfactual processing and counterfactual distribution between users , Then, based on the corresponding empirical facts distribution... Sampling is performed to obtain the empirical fact adjacency matrix. Empirical adjacency matrix Inter-layer link matrix of empirical facts Based on the corresponding empirical counterfactual distribution Sampling is performed to obtain the empirical counterfactual adjacency matrix. Empirical counterfactual adjacency matrix Inter-layer link matrix of empirical counterfactual relationships Then, the fact-learning loss functions of the source network and the target network are calculated using the following formula. and counterfactual learning loss function :

[0152]

[0153]

[0154] in, , Indicates that according to the updated network adjacency matrix Determined users Factual and counterfactual links between them Represents the adjacency matrix based on empirical facts. Determined users The empirical facts link between them Represents the adjacency matrix based on empirical counterfactual facts. Determined users The experiential counterfactual links between them.

[0155] The fact learning loss function of the inter-layer network is calculated using the following formula. and counterfactual learning loss function :

[0156]

[0157]

[0158] in, , This indicates that the inter-layer link relationship matrix is ​​used to represent the relationship between the layers. Determined users Factual and counterfactual links between them Represents the adjacency matrix based on empirical facts. Determined users The empirical facts link between them Represents the adjacency matrix based on empirical counterfactual facts. Determined users The experiential counterfactual links between them.

[0159] Optimizing the fact and counterfact distributions can uncover users' hidden features, but the test set only contains the fact distribution, which can lead to bias in the trained model. Therefore, this invention minimizes the distance between the fact and counterfact distributions to ensure effective user alignment. This user alignment loss... The following formula can be used for calculation:

[0160]

[0161] in, , This represents the Frobenius norm.

[0162] By optimizing the differences between fact distribution and empirical fact distribution, counterfactual distribution and empirical counterfactual distribution, as well as the difference between fact distribution and counterfactual distribution, causal relationships between network users can be learned. Network user alignment requires matching the same user account based on the similarity between users in two different networks. Based on the embedding distance between two users in hyperbolic space, the alignment similarity loss function in this invention... The following formula is used for calculation:

[0163]

[0164] High similarity between two users within the same network can interfere with user alignment. To reduce this noise, the embedding distance between users in the same network is increased. This invention introduces a user distance loss mechanism. The following formula is used for calculation:

[0165]

[0166] This invention considers the causal relationships between users in a network, with the primary goal of increasing the similarity between aligned users and decreasing the similarity between misaligned users. Secondly, it optimizes the user embedding feature vectors by optimizing the fact distribution and counterfactual distribution. Therefore, the total loss function for optimizing the user embedding feature vectors is... for:

[0167]

[0168] in, , , This indicates the preset weight.

[0169] By reducing the total loss function, the causal links between network users can be enhanced, the similarity of the same user across multiple networks can be optimized, and the interference from other users in the same network can be reduced, thereby optimizing the hyperbolic space features of users and improving the alignment effect of network users.

[0170] S505: Determine whether the preset termination condition has been met. If not, proceed to step S506. If it has been met, the user feature embedding vector optimization ends.

[0171] The termination condition can be set according to actual needs. In this embodiment, the termination condition is whether the distance before and after the user feature embedding vector update is less than a threshold.

[0172] S506: Parameter Update:

[0173] Based on the calculated total loss function Update the parameters of the multilayer perceptron and return to step S502.

[0174] S106: User Alignment:

[0175] The behavior of the same real user differs across multiple networks, but their behavioral characteristics remain unchanged; they share similar friend relationships and belong to similar communities. Therefore, this invention performs user alignment based on communities, specifically through the following method:

[0176] For the source network Users to be aligned Record the community where it is located as Calculate its relationship with the target network Similarity of each community ,

[0177]

[0178] in, Represents the target network The A community , This indicates how to find the number of elements in a set. and This represents the set of aligned users in the corresponding community. This represents the aligned set of users shared by both communities.

[0179] From the target network Select from all communities in China and related communities The community with the highest similarity is selected as the target community. The similarity between each user in the target community and the user to be aligned is calculated. The hyperbolic distance of the embedded feature vectors is used to filter out the minimum hyperbolic distance. If the minimum hyperbolic distance is less than a preset threshold, the corresponding user is selected as the user to be aligned. Align with the user; otherwise, do nothing.

[0180] In practical applications, in order to further improve the effect of user alignment, after the user alignment is completed in step S106, the aligned user pairs obtained in this round can be added to the aligned user pair set, the inter-layer link relationship matrix can be updated, and the network alignment can be performed again in step S103 until no new aligned user pairs appear, at which point the network alignment ends.

[0181] To better illustrate the technical effects of this invention, a specific example is used for experimental verification. In this experiment, a social network is used. User data is crawled from two pairs of existing social networks to form the source network and the target network, resulting in two different datasets. User alignment is mainly based on the similarity between the users to be aligned; the higher the similarity, the better the alignment effect. Figure 9 This is a comparison image of user similarity before and after training in this embodiment of the invention. For example... Figure 9 As shown in the figure, the horizontal axis represents 100 randomly selected users to be aligned, and the vertical axis represents the similarity between the users to be aligned. It can be seen from the figure that after processing by this invention, the similarity between the users to be aligned is significantly improved. This demonstrates that using the goal of maximizing the similarity between the users to be aligned and minimizing the similarity between users within the same social network as the loss objective can improve the accuracy of user alignment, proving the effectiveness and feasibility of this algorithm.

[0182] This embodiment uses four existing user alignment methods as comparison methods, including the GraphUIL algorithm, INFUNE algorithm, MAUIL algorithm, and SNAME algorithm, wherein:

[0183] The GraphUIL algorithm is based on a graph neural network framework and learns hidden user features by utilizing both local and global information in social networks.

[0184] The INFUNE algorithm utilizes the encoder and decoder to fuse heterogeneous features and uses a graph convolutional network to fuse neighborhood features, thereby improving matching accuracy.

[0185] The MAUIL algorithm embeds text attributes into character sets, word levels, and topic levels, improving user accuracy in the absence of labeled data.

[0186] The SNAME algorithm aligns users based on multiple embedding techniques, including multi-level text feature embedding, graph attention networks, and fuzzy c-means clustering.

[0187] Figure 10 This is a comparison chart of the accuracy of the present invention and five comparative methods in this embodiment. Figure 10 The horizontal axis represents the proportion of the training set, and the vertical axis represents the probability of a hit among the first k results (hit-precision@k), where k is set to 30. For example... Figure 9 As shown, the user alignment performance of this invention is superior to other baseline methods, with an average improvement of 3.2%. The results show that this invention achieves an average improvement of 3.2% over other baseline methods in both datasets. Figure 10 As shown in (a), this invention achieves good results even with a training set ratio of 10. Comparing the evaluation results at training sets of 10, 30, and 50, compared to other baseline algorithms, this invention shows a faster improvement in Hit-precision@30 when the training set ratio is small. This is because this invention focuses on causal relationships rather than correlational relationships within social networks. Other baseline algorithms primarily mine multi-dimensional user features and optimize feature fusion using graph neural networks or other methods, embedding two different social networks into the same vector space for comparison. When the training set is small, it is difficult to fully explore the correlations between user features, making it difficult for baseline methods to achieve optimal results when the training ratio is low and the testing ratio is high. Our proposed algorithm, however, studies the causal relationships between users and user links using the community as the processing variable, enabling a deeper analysis of user feature correlations. This helps improve user alignment performance when the training set is small. Figure 10As can be seen in (b), adjusting the training ratio of each algorithm has little impact on the accuracy of user alignment. This is because the training set is extracted from the same network at different times. Compared with the two different intersecting networks in the Douban-Weibo dataset, the feature differences of users in the DBLP dataset are smaller.

[0188] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.

Claims

1. A method for network alignment based on counterfactual inference, the method comprising: Includes the following steps: S1: the source network to be aligned is , and the target network is , wherein denotes a user set, , denotes the i-th user in the network , , , denotes the number of users in the network , denotes a link relationship set between users, denotes the corresponding adjacency matrix of the network , when a user has a friend relationship with a user , the element in the adjacency matrix is 1, otherwise is 0, ; known aligned user pairs are obtained, and then an inter-layer link relationship matrix with a size of is constructed to represent the inter-layer link relationship of the source network and the target network, when a user in the source network and a user in the target network are aligned as the same user, the corresponding inter-layer link relationship is 1, otherwise 0; For each user Perform user semantic feature extraction to obtain dimensional user Euclidean space feature embedding vector ; S2: Embed each user's Euclidean space features into a vector. The transformation from Euclidean space to hyperbolic space yields the hyperbolic space feature embedding vector for each user. ; S3: User feature aggregation is performed based on a hyperbolic graph attention network to obtain the aggregated feature embedding vector of each user in the hyperbolic space. ; S4: For the two networks respectively Conduct community discovery to obtain each network community collection ; S5: Feature optimization based on counterfactual inference, specifically the following method: S5.1: Based on the inter-layer link relationship matrix Source Network and target network Aligning users in the middle creates a global fact network, with connections between users serving as fact links. If a user... If the two entities are located in the same community within the same network, then the corresponding fact-based processing applies. Otherwise, the facts should be handled accordingly. ; S5.2: Based on the diffusion model idea, the feature fusion of fact network and antifactual network is performed to obtain the fusion embedding matrix of fact network and antifactual network; S5.3: Embedding the fusion of fact networks into the matrix Fusion embedding matrix with counterfactual networks The input is a multilayer perceptron, which acts as an encoder to fuse the embedding matrix. , The encoded features are obtained by encoding, and then the encoded features are input into the decoder. The decoder is used to decode based on the encoded features to generate the fact network and antifact network after feature update and topology update. S5.4: Extract the updated source network from the updated fact network adjacency matrix Update the target network adjacency matrix and updating the source network and update the target network Interlayer link relationship matrix Extract the corresponding empirical fact distribution of user pairs in fact processing from them. Experience with counterfactual processing and counterfactual distribution between users , Then, based on the distribution of corresponding empirical facts... Sampling is performed to obtain the empirical fact adjacency matrix. Empirical adjacency matrix Inter-layer link matrix of empirical facts Based on the corresponding empirical counterfactual distribution Sampling is performed to obtain the empirical counterfactual adjacency matrix. Empirical counterfactual adjacency matrix Inter-layer link matrix of empirical counterfactual relationships Then, the total loss function for optimizing the user-embedded feature vectors is calculated. ; S5.5: Determine whether the preset termination condition has been met. If not, proceed to step S5.

6. If it has been met, the user feature embedding vector optimization ends. S5.6: Based on the calculated total loss function Update the parameters of the multilayer perceptron and return to step S5.2; S6: For the source network Users to be aligned Record the community where it is located as Calculate its relationship with the target network Similarity of each community , , in, Represents the target network The A community , This indicates how to find the number of elements in a set. and This represents the set of aligned users within the corresponding community; This represents the aligned set of users shared by both communities. From the target network Select from all communities in China and related communities The community with the highest similarity is selected as the target community. The similarity between each user in the target community and the user to be aligned is calculated. The hyperbolic distance of the embedded feature vectors is used to filter out the minimum hyperbolic distance. If the minimum hyperbolic distance is less than a preset threshold, the corresponding user is selected as the user to be aligned. Align with the user; otherwise, do nothing.

2. The network alignment method according to claim 1, characterized in that, The specific method for user feature aggregation in step S3 is as follows: The network is first calculated using the following formula. Chinese users Weights of each friend user when aggregating neighborhood features : , , in, Represents the curvature of hyperbolic space. Represents the parameter vector to be trained. Indicates the weights of the parameters to be trained. This indicates a splicing operation. Indicates user A gathering of friends , Represents a nonlinear activation function in Euclidean space. Represents an exponential function in Euclidean space; The following formula is used based on the user Feature embedding vector Feature embedding vector in corresponding Euclidean space Update to get users Aggregated feature embedding vector : , in, Indicates along the vector The direction of embedding features into the vector Mapping from Euclidean tangent plane space to hyperbolic space , Indicates the weights of the parameters to be trained; Based on known aligned user pairs, training samples are obtained, and the parameter vector to be trained is... Weights of parameters to be trained , Train the system, and then use the trained parameters to obtain the parameters for each user. Aggregated feature embedding vector .

3. The network alignment method according to claim 2, characterized in that, The loss function used in the user feature aggregation training The calculation method is as follows: , in, The alignment similarity loss is represented by the following formula: , in, Indicates the alignment of user pairs into a set. This represents calculating the hyperbolic distance between two users in hyperbolic space. Dimensions representing user characteristics This represents the curvature of the hyperbolic space; The user distance loss in the network is represented by the following formula: 。 4. The network alignment method according to claim 1, characterized in that, The specific methods for fact network feature fusion and counterfactual network feature fusion in step S5.2 are as follows: S5.2.1: Extract from the global fact network of step S5.1 only the set of aligned user pairs The user subnetwork is aligned with the center and serves as the first fact network. ; S5.2.2: Initialize the fact network sequence number ; S5.2.3: For fact networks Generate the corresponding counterfactual network The specific method is as follows: For the set of aligned user pairs Users in Based on the current user feature embedding vectors, respectively from the source network and target network The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them; If the interlayer link relationship matrix Chinese users Interlayer link relationships If the value is 1, then the user will... Counterfactual treatment Counterfactual interlayer links Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links ; For the source network If the user If links exist between them, then based on the current user feature embedding vector, the link is retrieved from the source network. The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them; if the source network adjacency matrix Chinese users Adjacency relationship between If the value is 1, then the user will... Counterfactual treatment Counterfactual adjacency Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links ; For the target network If the user If a link exists between them, then based on the current user feature embedding vector, the link is transferred from the target network. The search simultaneously satisfies and ,and The two smallest users As the most similar user pair This indicates a preset threshold, and then the user... The connection between them serves as a user Counterfactual links between them, if the target network adjacency matrix Chinese users Adjacency relationship between If the value is 1, then the user will... Counterfactual treatment Counterfactual adjacency Otherwise, it will make users feel... Counterfactual processing Counterfactual interlayer links ; S5.2.4: Build size is The feature embedding matrix, where the first The user's feature embedding vector in the behavior source network, then User feature embedding vectors in the behavioral target network; based on the fact network For the included users, the feature embedding vector of that user obtained in step S3 is filled into the corresponding row of the feature embedding matrix, and the feature embedding matrix is ​​the fact network. The feature embedding vector corresponding to the user is not included, and the resulting fact network is thus obtained. Feature Embedding Matrix Then, the same method is used to obtain the counterfactual network. Feature Embedding Matrix ; S5.2.5: Determine if it is a factual network If it is not a fully factual network, proceed to step S5.2.6; otherwise, proceed to step S5.2.

8. S5.2.6: Add fact network Each user has not yet joined the fact network. First-order neighbor users, get the A fact network ; S5.2.7: Order Return to step S5.2.3; S5.2.8: Let the logarithm of the final fact network and counterfactual network be . The fusion embedding matrix of the sub-fact network is calculated using the following formula. Fusion embedding matrix with counterfactual networks : 。 5. The network alignment method according to claim 1, characterized in that, The total loss function in step S5.4 The calculation method is as follows: The fact learning loss function is calculated using the following formula. and counterfactual learning loss function : , , in, , Indicates that according to the updated network adjacency matrix Determined users Factual and counterfactual links between them Represents the adjacency matrix based on empirical facts. Determined users The empirical facts link between them Represents the adjacency matrix based on empirical counterfactual facts. Determined users The experience of counterfactual links between them; The fact learning loss function of the inter-layer network is calculated using the following formula. and counterfactual learning loss function : , , in, , This indicates that the inter-layer link relationship matrix is ​​used to represent the relationship between the layers. Determined users Factual and counterfactual links between them Represents the adjacency matrix based on empirical facts. Determined users The empirical facts link between them Represents the adjacency matrix based on empirical counterfactual facts. Determined users The experience of counterfactual links between them; The user alignment loss is calculated using the following formula. : , in, , Denotes the Frobenius norm; The alignment similarity loss function is calculated using the following formula. : , The user distance loss is calculated using the following formula. : , The total loss function for optimizing user-embedded feature vectors is calculated using the following formula. : , in, , , This indicates the preset weight.

6. The network alignment method according to claim 1, characterized in that, It also includes the following steps: After user alignment is completed in step S6, the aligned user pairs obtained in this round are added to the aligned user pair set, the inter-layer link relationship matrix is ​​updated, and the process returns to step S3 to perform network alignment again until no new aligned user pairs appear, at which point the network alignment ends.

Citation Information

Patent Citations

  • A social network alignment method based on graph convolution

    CN109636658A

  • Method and device for user alignment between social networks based on neural network, and medium

    CN111476673A