Online social platform friend recommendation method based on enhanced contrast representation

By using enhanced contrast representation and graph neural network to extract user representation on online social platforms, the problem of low accuracy of friend recommendations in the existing methods is solved, and a more accurate and reliable friend recommendation effect is achieved.

CN120011655AActive Publication Date: 2025-05-16ZHEJIANG UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510077131.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-16
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

It is difficult to efficiently obtain comprehensive social network users' statements on existing online social platforms, resulting in low recommendation accuracy.

Method used

Using a method based on enhanced contrast representation, by constructing social networks and negative social networks, using graph neural networks to extract user representations, and computing hierarchical comparison learning loss, topological loss and structural loss, combining each loss to obtain the final total loss function, and finally achieving personalized friend recommendations through social user representation.

Benefits of technology

It improves the accuracy and reliability of the friend recommendation algorithm, and optimizes social network representation through multi-angle information, enhancing the accuracy and user stickiness of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011655A_ABST
    Figure CN120011655A_ABST
Patent Text Reader

Abstract

An online social platform friend recommendation method based on enhanced contrast characterization comprises the following steps: firstly, constructing a social network and a negative network subjected to noise disturbance for an online social platform; then, using a graph neural network to extract social user representations of the social network and the negative network; then, hierarchical comparison learning loss, topology loss and structure loss are calculated on social user characterization; and finally, obtaining a final total loss function in combination with each loss, and realizing personalized friend recommendation through the finally obtained social user representation. According to the method, information enhancement is carried out on the original social network, the robustness of the network is improved through multi-loss constraint, deep potential information is captured, and a high-accuracy and high-generalization friend recommendation result can be provided for an online social platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of recommendation, and in particular relates to an online social platform friend recommendation method based on enhanced contrast representation. Background Art

[0002] Online social platforms, such as Weibo and WeChat, can provide users with online social services and play an important role in the current development of the Internet. Social interaction is an inherent need of human spiritual life, which is conducive to individual growth, group harmony, and cultural dissemination. Online social interaction can break through the constraints of geographical location and provide real-time social interaction, so that people's social needs are further met. The relationships between online users can form a huge social network. Data analysis of social networks can understand users' interpersonal relationships and potential relationships, accurately place advertisements to users, and more effectively disseminate knowledge and information, thereby profoundly affecting people's thinking and communication methods. Therefore, it has a very broad market prospect.

[0003] Online social friend recommendation aims to predict possible friend relationships based on known online social friend relationships. This method is widely used in major social platforms. On the one hand, users can find suitable friends through social friend recommendations and expand their circle of friends. On the other hand, social platforms can use this to improve user stickiness and activity, thereby enhancing the commercial value of the platform. However, the number of friends of a user is far less than the huge number of social network users. Therefore, social network relationship information is sparse, which greatly increases the destructiveness of noise connections to social network relationships, thereby affecting the accuracy of online social friend recommendation systems. Therefore, how to capture robust social network information representation with rich information has become a research hotspot in the current online social friend recommendation system based on artificial intelligence. Summary of the invention

[0004] In order to overcome the problems that existing methods are difficult to efficiently obtain comprehensive social network user representations and the accuracy of recommended friends is not high, the present invention proposes an online social platform friend recommendation method based on enhanced contrast representation with strong representation ability and excellent recommendation effect.

[0005] The specific technical steps adopted by the present invention to solve the technical problem are:

[0006] A friend recommendation method for online social platforms based on enhanced contrastive representation. First, a social network and a negative social network perturbed by noise are constructed for the online social platform. Then, a graph neural network is used to extract social user representations of the social network and the negative network. Then, hierarchical contrastive learning loss, topological loss, and structural loss are calculated on the social user representation. Finally, the final total loss function is obtained by combining the losses, and personalized friend recommendation is achieved through the final social user representation.

[0007] Further, the method comprises the following steps:

[0008] Step 1: Build a social network G between users of the online social platform. In the network G, the nodes in the network are defined as users. If two users follow each other in the online social platform, there is an edge between the users, and each user has attribute information; build a negative network The network is constructed by randomly modifying the order of some edges and some attributes of the social network G;

[0009] Step 2: Build a graph neural network, which consists of a l-layer graph convolutional network. The graph neural network is used to mine the social network G and the negative network respectively. The information in the corresponding k≤l layer representation h is obtained k and

[0010] Step 3: Calculate the hierarchical contrastive learning loss of social user representation in the graph neural network. For the kth layer, calculate the global network representation g of this layer k , construct a discriminator β for similarity calculation, by maximizing β(g k ,h k ), minimize To achieve the contrastive learning loss construction of the k-th layer;

[0011] Step 4: Calculate the topological loss of social user representation in the graph neural network. For the kth layer, construct the topological representation c k and topological negative representation Construct a discriminator γ for similarity calculation, by maximizing γ(g k , c k ), minimize To achieve the topological loss construction of the kth layer;

[0012] Step 5: Calculate the structural loss of social user representation in the graph neural network. For the kth layer, use matrix multiplication r k =h k (h k ) T Get the predicted k-th layer network structure by maximizing the distance between user i and user j in the real social network value to achieve the social network structure loss of the kth layer, and do similar operations on the negative network to achieve the negative network structure loss of the kth layer;

[0013] Step 6: Calculate the total loss function;

[0014] Step 7: Repeat steps 2 to 6 to obtain the final social user representation matrix;

[0015] Step 8: Personalized friend recommendations are made to users by calculating the representation similarity scores.

[0016] Preferably, in step 1, users and user relationship information is obtained through an online social platform, and then a social network G = (V, E, X) is constructed based on this information, where V = {v1, v2, ..., v N} represents all users, E represents the relationship between users, N represents the number of users, X∈R N×dim Represents the attribute information of the user, with a total of dim attributes. The adjacency matrix of the social network is represented by A=[a ii ]∈R N×N Indicates that when users are friends with each other, ij =1, otherwise a ij = 0, the degree matrix of the social network is represented by D = diag (d1, d2, ... d N ) indicates that d i =∑ j a ij , the negative network use of social networks Indicates that To randomly modify some edges of G, To randomly disrupt the attributes of some users;

[0017] In step 2, a graph neural network is used to extract user representations of the social network G. The network consists of a graph convolutional network GCN with l layers. The social user representation of the kth layer GCN is

[0018]

[0019] where k∈{1,..,l}, W k is the weight matrix of the kth layer, I is the identity matrix, h 0 =X, is the PRELU activation function; is the negative network Perform the same graph neural network operation to obtain the corresponding negative representations of social users at each layer

[0020] In step 3, the hierarchical contrast loss of social user representation in the graph neural network is calculated.

[0021]

[0022] The contrast loss of the kth layer is,

[0023]

[0024] where k∈{1,..,l}, Q is the learnable weight matrix, is the matrix h k The i-th row vector of represents the characterization of the i-th user. For the matrix The i-th row vector of represents the negative representation of the i-th user; is the global network representation, σ is the sigmoid activation function;

[0025] In step 4, the topological loss of social user representation in the graph neural network is calculated.

[0026]

[0027] The topological loss of the kth layer is,

[0028]

[0029] where k∈{1,..,l}, is the topological representation of the kth layer, is the topological negative representation of the kth layer, c k The i-th row vector of represents the topological representation of the i-th user. for The i-th row vector of represents the topological representation of the i-th user;

[0030] In step 5, the structural loss of social user representation in the graph neural network is calculated.

[0031]

[0032] The structural loss of the kth layer is,

[0033]

[0034] where k∈{1,..,l},r k =h k (h k )T is the predicted k-th layer network structure, is the predicted k-th layer negative network structure, It is an indicator function, and its value is 1 when the subscript condition is met, otherwise it is 0;

[0035] In step six, the total loss function is calculated.

[0036] L = L1 + L2 + L3;

[0037] In step 7, steps 2 to 6 are repeated. When L decreases to a specified threshold, the calculation is terminated. The final social user representation matrix is ​​h=h 1+h 2 +…+h l ;

[0038] In step 8, for any social user i, its user representation h i is the vector represented by the i-th row of the social user representation matrix h, calculates the representation similarity scores of the social user and all other social users, and selects the K non-friends with the highest similarity scores as the recommended friends of the user.

[0039] The technical concept of the present invention is: the present invention enhances the representation of social network users through a comparative learning method, thereby improving the accuracy and reliability of a friend recommendation algorithm.

[0040] The beneficial effects of the present invention are as follows: overall user information, user topological relationships and network structural relationships are considered respectively, social network representation is optimized through multi-angle information, and the accuracy and reliability of recommendations are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 Schematic diagram of the process of friend recommendation method for online social platforms based on enhanced contrast representation. DETAILED DESCRIPTION

[0042] The present invention will be further described below in conjunction with the accompanying drawings.

[0043] Reference Figure 1 , a friend recommendation method for an online social platform based on enhanced contrast representation, comprising the following steps:

[0044] Step 1: Obtain user and user relationship information through online social platforms, and then use this information to build a social network G = (V, E, X), where V = {v1, v2, ..., v N} represents all users, E represents the relationship between users, N represents the number of users, X∈R N×dim Represents the user's attribute information, including age, education, gender and other attributes. The adjacency matrix of the social network is represented by A = [a ij ]∈R N×N Indicates that when users are friends with each other, ij =1, otherwise a ij = 0, the degree matrix of the social network is represented by D = diag (d1, d2, ... d N ) indicates that d i =∑ j a ij , the negative network use of social networks Indicates that To randomly modify some edges of G, To randomly disrupt the attributes of some users;

[0045] Step 2: Use a graph neural network to extract user representations of the social network G. The network consists of a graph convolutional network GCN with l layers. The social user representation of the k-th layer GCN is:

[0046]

[0047] where k∈{1,..,l}, W k is the weight matrix of the kth layer, I is the identity matrix, h 0 =X, is the PRELU activation function; is the negative network Perform the same graph neural network operation to obtain the corresponding negative representations of social users at each layer

[0048] Step 3: Calculate the hierarchical contrast loss of social user representation in graph neural network.

[0049]

[0050] The contrast loss of the kth layer is,

[0051]

[0052] where k∈{1,..,l}, W is the learnable weight matrix, is the matrix h k The i-th row vector of represents the characterization of the i-th user. For the matrix The i-th row vector of represents the negative representation of the i-th user; is the global network representation, σ is the sigmoid activation function;

[0053] Step 4: Calculate the topological loss of social user representation in the graph neural network.

[0054]

[0055] The topological loss of the kth layer is,

[0056]

[0057] where k∈{1,..,l}, is the topological representation of the kth layer, is the topological negative representation of the kth layer, c k The i-th row vector of represents the topological representation of the i-th user. for The i-th row vector of represents the topological representation of the i-th user;

[0058] Step 5: Calculate the structural loss of social user representation in the graph neural network.

[0059]

[0060] The structural loss of the kth layer is,

[0061]

[0062] where k∈{1,..,l},r k =h k (h k ) T is the predicted k-th layer network structure, is the predicted k-th layer negative network structure, It is an indicator function, and its value is 1 when the subscript condition is met, otherwise it is 0;

[0063] Step 6: Calculate the total loss function.

[0064] L = L1 + L2 + L3;

[0065] Step 7: Repeat steps 2 to 6. When L decreases to the specified threshold, the calculation ends. The final social user representation matrix is ​​h = h 1 +h 2 +…+h l ;

[0066] Step 8: For any social user i, its user representation h i is the vector represented by the i-th row of the social user representation matrix h, calculates the representation similarity scores of the social user and all other social users, and selects the K non-friends with the highest similarity scores as the recommended friends of the user.

[0067] In this embodiment, for a certain social user, a representation of the social user is obtained, which comprehensively considers attribute information such as the user's age and gender, as well as multi-hop neighbor user information. By calculating the similarity between the representation and the representations of all other social users, the non-friend with the highest overall similarity is obtained as the final recommended friend.

[0068] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. A friend recommendation method for an online social platform based on enhanced contrast representation, characterized in that: Firstly, a social network and a negative social network with noise disturbance are constructed for the online social platform. Secondly, a graph neural network is used to extract the social user representations of the social network and the negative network. Then, the hierarchical contrastive learning loss, topological loss and structural loss are calculated on the social user representations. Finally, the total loss function is obtained by combining the losses. Meanwhile, personalized friend recommendation is realized through the final social user representations.

2. The online social platform friend recommendation method based on enhanced contrast representation as claimed in claim 1, characterized in that: The method comprises the following steps: Step 1: Build a social network G between users of the online social platform. In the network G, the nodes in the network are defined as users. If two users follow each other in the online social platform, there is an edge between the users, and each user has attribute information; build a negative network The network is constructed by randomly modifying the order of some edges and some attributes of the social network G; Step 2: Build a graph neural network, which consists of a l-layer graph convolutional network. The graph neural network is used to mine the social network G and the negative network respectively. The information in the corresponding k≤l layer representation h is obtained k and Step 3: Calculate the hierarchical contrastive learning loss of social user representation in the graph neural network. For the kth layer, calculate the global network representation g of this layer k , construct a discriminator β for similarity calculation, by maximizing β(g k ,h k ), minimize To achieve the contrastive learning loss construction of the k-th layer; Step 4: Calculate the topological loss of social user representation in the graph neural network. For the kth layer, construct the topological representation c k and topological negative representation Construct a discriminator γ for similarity calculation, by maximizing γ(g k ,c k ), minimize To achieve the topological loss construction of the kth layer; Step 5: Calculate the structural loss of social user representation in the graph neural network. For the kth layer, use matrix multiplication r k =h k (h k ) T Get the predicted k-th layer network structure by maximizing the distance between user i and user j in the real social network value to achieve the social network structure loss of the kth layer, and do similar operations on the negative network to achieve the negative network structure loss of the kth layer; Step 6: Calculate the total loss function; Step 7: Repeat steps 2 to 6 to obtain the final social user representation matrix; Step 8: Personalized friend recommendations are made to users by calculating the representation similarity scores.

3. The online social platform friend recommendation method based on enhanced contrast representation as claimed in claim 2, characterized in that: In step 1, the user and user relationship information is obtained through the online social platform, and then a social network G = (V, E, X) is constructed based on this information, where V = {v1, v2, ..., v N } represents all users, E represents the relationship between users, N represents the number of users, X∈R N×dim Represents the attribute information of the user, with a total of dim attributes. The adjacency matrix of the social network is represented by A=[a ij ]∈R N ×N Indicates that when users are friends with each other, ij =1, otherwise a ij =0, the degree matrix of the social network is represented by D=diag(d1,d2,…d N ) indicates that d i =∑ j a ij , the negative network use of social networks Indicates that To randomly modify some edges of G, To randomly disrupt the attributes of some users; In the step 2, a graph neural network is used to extract user representations of the social network G. The network consists of a graph convolutional network GCN of l layers. The social user representation of the k-th layer GCN is: where k∈{1,..,l}, W k is the weight matrix of the kth layer, I is the identity matrix, h 0 =X, is the PRELU activation function; is the negative network Perform the same graph neural network operation to obtain the corresponding negative representations of social users at each layer In step 3, the hierarchical contrast loss of social user representation in the graph neural network is calculated. The contrast loss of the kth layer is, where k∈{1,..,l}, W is the learnable weight matrix, is the matrix h k The i-th row vector of represents the characterization of the i-th user. For the matrix The i-th row vector of represents the negative representation of the i-th user; is the global network representation, σ is the sigmoid activation function; In step 4, the topological loss of social user representation in the graph neural network is calculated. The topological loss of the kth layer is, where k∈{1,..,l}, is the topological representation of the kth layer, is the topological negative representation of the kth layer, c k The i-th row vector of represents the topological representation of the i-th user. for The i-th row vector of represents the topological representation of the i-th user; In step 5, the structural loss of social user representation in the graph neural network is calculated. The structural loss of the kth layer is, where k∈{1,..,l}, r k =h k (h k ) T is the predicted k-th layer network structure, is the predicted k-th layer negative network structure, It is an indicator function, and its value is 1 when the subscript condition is met, otherwise it is 0; In step six, the total loss function is calculated. L = L1 + L2 + L3; In step 7, steps 2 to 6 are repeated. When L decreases to a specified threshold, the calculation is terminated. The final social user representation matrix is ​​h=h 1 +h 2 +…+h l ; In step 8, for any social user i, its user representation h i is the vector represented by the i-th row of the social user representation matrix h, calculates the representation similarity scores of the social user and all other social users, and selects the K non-friends with the highest similarity scores as the recommended friends of the user.

Citation Information

Patent Citations

  • Social network service platform friend recommendation method based on global attention mechanism representation learning

    CN112100514A

  • Network audio and video intelligent recommendation method and system based on social constraint

    CN117407593A

  • Recommendation method based on community perception and multi-scale graph comparative learning

    CN119046541A

  • Citation network graph representation learning system and method based on multi-view contrastive learning

    WO2022267953A1