A social recommendation method and device based on hyperbolic space contrast learning
By learning multi-source higher-order relations in hyperbolic space and designing a personalized social information transformation module, the problems of instability in sparse user modeling and social signal bias are solved, thereby improving the stability and accuracy of social recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAZHONG UNIV OF SCI & TECH
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-09
Smart Images

Figure CN122173714A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of user item recommendation technology, and in particular to a social recommendation method and apparatus based on hyperbolic space contrastive learning. Background Technology
[0002] In the era of information overload, recommender systems can effectively infer user preferences and are therefore widely used in various consumer platforms. They help users discover relevant content from massive amounts of items and provide personalized services by accurately identifying users' personalized interests. Collaborative filtering is a classic and mainstream recommendation method, the core idea of which is to infer user preferences by utilizing the historical interaction behavior between similar users and items. Despite the significant success of collaborative filtering, it still faces a key challenge: data sparsity. In real-world scenarios, most users interact with only a very small number of items, which greatly limits the expressive power of representation learning and significantly reduces recommendation performance.
[0003] To alleviate data sparsity, an intuitive approach is to leverage the homogeneity of social relationships to uncover richer shared interaction patterns among users. Based on this idea, social recommendation has received increasing attention in recent years, aiming to improve recommendation performance by incorporating social network information. Early methods typically employed matrix factorization, encoding user-item interactions and user social relationships into the same latent space. With the development of graph neural networks (GNNs), recent research has further enhanced social recommendation performance by modeling higher-order connection structures in the graph through iterative message passing in Euclidean space.
[0004] However, real-world social networks typically exhibit a highly skewed power-law degree distribution, meaning that only a small number of users possess a large number of social connections, while the vast majority of users, especially those at the bottom of the hierarchy, have only extremely sparse social relationships. User-item interaction graphs exhibit similar characteristics. These tree-like hierarchical structures grow exponentially with the network radius, while the volume of Euclidean space grows only polynomially. Therefore, embedding such power-law distribution graphs into Euclidean space inevitably introduces severe geometric distortion, leading to structural reconstruction errors and limiting model performance.
[0005] In contrast, hyperbolic space, due to its exponentially expanding geometry, is naturally well-suited for characterizing tree-like and hierarchical structures. This property allows hyperbolic embeddings to better preserve distance relationships and structural information that are severely distorted in Euclidean space, making them particularly suitable for modeling social networks and interaction patterns. Inspired by this, recent studies have incorporated hyperbolic geometry into collaborative filtering tasks, demonstrating its advantages in characterizing hierarchical relationships.
[0006] Despite the progress made by the aforementioned methods, applying hyperbolic geometry to social recommendation still faces two key challenges. First, existing research indicates that users at the tail end of the hierarchy, with limited connections, are often unconstrainedly pushed towards the boundaries of the hyperbolic space during training. This phenomenon means that hyperbolic space may actually amplify data sparsity when dealing with sparse users, leading to unstable hierarchical positions and consequently affecting the discriminativeness of user preference modeling. Second, different users exhibit significantly different sensitivities to social influences, while existing methods typically employ simple weighted aggregation to fuse social signals. This naive fusion approach already introduces bias in Euclidean space, but the problem is even more severe in hyperbolic space: due to the geometric properties of hyperbolic space, small changes in embedding can lead to drastic changes in distance, thus amplifying geometric bias and reducing model stability. These issues collectively limit the effectiveness of hyperbolic geometry in social recommendation tasks. Summary of the Invention
[0007] In view of this, it is necessary to provide a social recommendation method and device based on hyperbolic space contrastive learning to effectively solve the technical problems of unstable sparse user modeling and bias introduced when hyperbolic geometry is applied to social recommendation.
[0008] This invention provides a social recommendation method based on hyperbolic space contrastive learning, comprising the following steps: Step S1: Map the nodes of the user item interaction graph and the social network graph into hyperbolic space, and reconstruct the user item interaction graph to obtain a reconstructed graph from a global perspective; Step S2: Combining the user item interaction graph, the social network graph, and the reconstructed graph, a graph neural network is used to learn the multi-source high-order relationships of the hyperbolic graph, and preliminary fusion and embedding information of each node from multiple perspectives and sources is obtained. Step S3: Based on the preliminary fusion and embedding information, perform social information transformation and fusion for each user based on their social information sensitivity to obtain personalized fusion and embedding information; Step S4: Construct a hyperbolic space model using the hyperbolic distance between users and items as the predicted score. Set up a contrastive learning strategy with two levels of perception: positive sample weighting and negative sample filtering. Set up contrastive learning loss with two levels of perception: social perception and interaction perception. Use the trained hyperbolic space model to predict the correlation between users and items.
[0009] Preferably, in step S1, mapping the nodes of the user-item interaction graph and the social network graph to hyperbolic space specifically involves: Initialize the user interaction embedding and the item embedding in Euclidean space; map the initial user embedding and the initial item embedding in Euclidean space to hyperbolic space to obtain the initial user embedding and the initial item embedding in hyperbolic space.
[0010] Preferably, in step S1, reconstructing the user-item interaction graph to obtain a reconstructed graph from a global perspective specifically involves: A random matrix is generated to obtain the subspace of the user item interaction graph; Perform QR decomposition on the subspace to obtain the column subspace orthogonal deviation of the subspace; Based on the orthogonal deviation of the column subspace, a structure matrix containing the structural information of the user item interaction graph is obtained; singular value decomposition is performed on the structure matrix to obtain orthogonal vectors, and only the orthogonal vectors corresponding to the largest set number of singular values are retained; The user-item interaction graph is reconstructed based on the retained orthogonal vectors and the orthogonal deviation to obtain a reconstructed graph from a global perspective.
[0011] Preferably, step S2 specifically comprises: Step S21: Map the nodes of the user-item interaction graph, the social network graph, and the reconstructed graph into a tangent space to obtain the interaction embedding and item embedding under the tangent space; use a fully connected layer unit to obtain the user's social embedding; Step S22: Information is transmitted on the user item interaction graph, the user social network graph, and the reconstructed graph respectively; Step S23: Set up a controllable aggregation mechanism in each graph convolution process to update the user embedding; Step S24: Perform multi-layer embedding stacking on the user item interaction graph, the social network graph, and the reconstructed graph respectively. Stack multiple layers of user embedding for each node to obtain the preliminary fusion embedding information and realize the fusion of multi-source and multi-domain features of each node.
[0012] Preferably, step S24 specifically comprises: On the user item interaction graph, multiple layers of item embedding and interaction embedding are stacked for each node to obtain preliminary item fusion embedding and preliminary interaction fusion embedding. By stacking multiple layers of social embedding for each node on the user social network graph, a preliminary social fusion embedding is obtained. On the reconstruction graph, multiple layers of item embedding and interaction embedding are stacked for each node to obtain preliminary item reconstruction fusion embedding and preliminary interaction reconstruction fusion embedding.
[0013] Preferably, step S3 specifically comprises: In the tangent space, the meta-knowledge of each user is extracted from the user item interaction graph and the reconstructed graph, and a user meta-network is used to obtain the parameterized transformation matrix of each user. Based on the parameterized transformation matrix and the preliminary fusion embedding information, the social signals obtained by different users from social networks are calculated to obtain personalized fusion embedding information based on user sensitivity.
[0014] Preferably, in step S4, the hyperbolic space model is constructed using the hyperbolic distance between user items as the predicted score, specifically as follows: After learning the hyperbolic graph and fusing personalized embeddings, the user embeddings in the tangent space are mapped back to the hyperbolic space to obtain the fused embedding information in the hyperbolic space. In hyperbolic space, the hyperbolic distance between the user fusion embedding and the item fusion embedding is calculated as the predicted score. At the same time, a basic loss function is set based on the user fusion embedding and the item fusion embedding to construct a hyperbolic space model.
[0015] Preferably, in step S4, the hyperbolic space model employs a contrastive learning strategy with two levels of perception: positive sample weighting and negative sample filtering. Specifically: A positive sample weighting strategy is set: the hierarchical depth of a node in hyperbolic space is calculated based on the user embedding of the node in the interaction graph view and the global view. A positive sample weighting factor is set based on the difference in hierarchical depth of the same node in the two different views. The positive sample weighting factor is used to reduce the difference in hierarchical depth of the same node in different views. Set a negative sample filtering strategy: Filter all negative samples for each node, and select a set number of negative samples with the smallest difference in hierarchical depth from all negative samples as the final negative samples.
[0016] Preferably, in step S4, the hyperbolic space model is configured with contrastive learning loss at two levels: social perception and interaction perception. Specifically: Social fusion embedding based on social network graph and interaction fusion embedding based on user item interaction graph are set with social perception hierarchical contrastive learning loss to promote the sharing of semantic information between user item interaction graph and social network graph while retaining their respective features. The interaction fusion embedding based on the user-item interaction graph and the reconstructed graph sets the first contrastive learning loss for the interaction perception level; the item fusion embedding based on the user-item interaction graph and the reconstructed graph sets the second contrastive learning loss for the interaction perception level; the contrastive learning loss for the interaction perception level is obtained by combining the first contrastive learning loss and the second contrastive learning loss. The total loss function is obtained by combining the basic loss function, the social perception hierarchical contrastive learning loss, and the interaction perception hierarchical contrastive learning loss. The hyperbolic space model parameters are updated by using the backpropagation loss of the hyperbolic space-specific optimizer to obtain the trained hyperbolic space model.
[0017] The present invention also provides a social recommendation device based on hyperbolic space contrastive learning, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the social recommendation method based on hyperbolic space contrastive learning.
[0018] Compared with existing technologies, the present invention has the following advantages: First, based on the hierarchical characteristics and tree structure of social and interactive networks, the present invention maps nodes to hyperbolic space for learning, and the learned node information can better represent the topological features of the network. Then, a hyperbolic high-order relational graph convolutional network is designed to learn the higher-order knowledge of nodes in hyperbolic space. Considering that some nodes are far apart in the actual network but actually influence each other, a stacked convolutional layer method is adopted to allow nodes to learn more beneficial knowledge in hyperbolic space beyond the hop count. Since different users have different sensitivities to social networks, some previous methods simply use weighted summation to integrate user interaction features and social features, introducing considerable bias. The present invention, through a personalized conversion module for social information, can flexibly adjust the influence of social information on users to reduce bias. Finally, two general strategies for hyperbolic space contrastive learning are designed. By weighting positive samples and implementing negative sample screening, higher weights are set for nodes with large hierarchical differences, and useless negative samples with large hierarchical differences are discarded. Compared with previous hyperbolic space contrastive learning methods, the training time is greatly reduced while the scoring is effectively improved. This invention achieves more stable and geometrically consistent user embeddings even under extremely sparse conditions by jointly modeling user-item interactions and user-user social relationships in hyperbolic space. It also proposes two novel contrastive learning paradigms that can simultaneously improve the representation quality and recommendation performance of top and bottom users. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 is a flowchart of an embodiment of a social recommendation method based on hyperbolic space contrastive learning provided by the present invention; Figure 2 yes Figure 1 The schematic diagram of the embodiment shown; Figure 3a yes Figure 1 The recommended performance in the illustrated embodiment is affected by the number of convolutional layers. and fusion factor A schematic diagram illustrating the impact on the Ciao dataset; Figure 3b yes Figure 1 The recommended performance in the illustrated embodiment is affected by the number of convolutional layers. and fusion factor A diagram illustrating the impact on the Epinions dataset; Figure 3c yes Figure 1 The recommended performance in the illustrated embodiment is affected by the number of convolutional layers. and fusion factor A diagram illustrating the impact on the Yelp dataset; Figure 4a yes Figure 1 The illustrated embodiment shows the recommendation effect on the Ciao dataset under different sparse scenarios. Figure 4b yes Figure 1 The illustrated embodiment shows the recommendation performance of the Epinions dataset under different sparse scenarios. Figure 4c yes Figure 1 The illustration shows the recommendation performance of Yelp datasets in different sparse scenarios in the examples shown. Figure 5a yes Figure 1 The diagram shown illustrates the distribution of the head and tail nodes of the Ciao dataset in the embodiment shown. Figure 5b yes Figure 1 The diagram shows the distribution of the head and tail nodes of the Yelp dataset in the illustrated embodiment. Detailed Implementation
[0020] The technical terminology of this invention will be explained and described below: Graph representation learning: Using graph convolution to extract information from graph structures and learn node representations.
[0021] Recall@K metric: Recall@K measures the proportion of relevant items that the model successfully hits out of all truly relevant items in the Top-K recommendation results. It is used to evaluate the recommendation system's ability to cover the user's true preferences.
[0022] NDCG@K Metric: NDCG@K considers whether a relevant item is hit while introducing a positional penalty factor, giving higher weight to hits that rank higher, thereby evaluating the sorting quality of the recommendation list.
[0023] Euclidean distance: measures the absolute distance between two points or vectors in a multidimensional space, that is, the square root of the difference between the vectors.
[0024] Hyperbolic distance: measures the absolute distance between two points or vectors in hyperbolic space.
[0025] Contrastive learning: A self-supervised learning paradigm that learns discriminative representations by bringing positive sample pairs closer together and pushing negative sample pairs further apart, thereby maximizing mutual information between different views.
[0026] The solutions to the difficulties existing in the current technology are as follows: To address the first challenge, we propose two mechanisms in hyperbolic space: social-aware contrastive learning and interaction-aware contrastive learning. Social-aware contrastive learning maximizes the mutual information between user item interaction patterns and social networks; interaction-aware contrastive learning generates enhanced views by reconstructing the interaction graph through random low-rank approximations to improve representation learning performance. To address the second challenge, we design a user meta-network to model users' personalized sensitivity to social influences, thus avoiding the bias introduced by simple weighted aggregation in hyperbolic space.
[0027] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0028] Example 1 Please see Figure 1 The social recommendation method based on hyperbolic space contrastive learning in this embodiment specifically includes the following steps: Step S1: Map the nodes of the user item interaction graph and the social network graph into hyperbolic space, and reconstruct the user item interaction graph to obtain a reconstructed graph from a global perspective; Step S2: Combining the user item interaction graph, the social network graph, and the reconstructed graph, a graph neural network is used to learn the hyperbolic graph multi-source high-order relations to obtain the preliminary fusion and embedding information of each node from multiple perspectives and sources. Step S3: Based on the preliminary fusion and embedding information, perform social information transformation and fusion for each user based on their social information sensitivity to obtain personalized fusion and embedding information; Step S4: Construct a hyperbolic space model using the hyperbolic distance between users and items as the predicted score. Set up a contrastive learning strategy with two levels of perception: positive sample weighting and negative sample filtering. Set up contrastive learning loss with two levels of perception: social perception and interaction perception. Use the trained hyperbolic space model to predict the correlation between users and items.
[0029] This embodiment maps the user-item bipartite graph index to a hyperbolic space to better model the tree-like hierarchical structure; it utilizes graph neural networks to learn multi-view, multi-source high-order information from nodes; based on each user's sensitivity to social information, it achieves personalized social information knowledge transformation and fusion; it designs a positive sample weighting and negative sample filtering strategy, and on this basis, it designs social perception contrastive learning and interaction perception contrastive learning optimization, finally performing rating prediction. This embodiment considers the connection between recommendation tasks and social networks, and through hyperbolic space contrastive learning based on hierarchical perception, the social recommendation model can more accurately predict user preferences, significantly improving recommendation performance.
[0030] The following combination Figure 2 Each step will be explained in further detail.
[0031] Furthermore, in step S1, the user-item interaction graph is first used as a basis. and user social network graph Mapping the nodes on the graph to hyperbolic space is done as follows: Initialize user embeddings and item embeddings in Euclidean space. `embedding` represents embedding. in, and These represent user and item embeddings, respectively. This indicates that the embedding is located in a European-style space. and These represent the number of users and the number of items, respectively. Indicates the embedding dimension; Map the initial embedding in Euclidean space to hyperbolic space. middle: in, This indicates that the embedding is located in hyperbolic space. Let o be an exponential mapping function. , is the origin of hyperbolic space.
[0032] Furthermore, in step S1, the user-item interaction graph is reconstructed based on the random low-rank approximation method. Obtain the reconstructed graph from a global perspective Specifically: Generate a random matrix To obtain subspace ,in It is a low-ranking, and , It is an oversample screening parameter used to enhance the robustness of subspace approximation; In acquiring Then, perform QR decomposition on it to obtain... orthogonal deviation of column subspace ,pass You can get a reservation Small matrix of key structural information : ; right Perform singular value decomposition to obtain orthogonal vectors: in , , ; Keep only the largest The vectors corresponding to the singular values are obtained as follows: , , ; Reconstruction graph It can be represented as: .
[0033] Furthermore, step S2 incorporates the user-item interaction graph. User social network graph and reconstructed graph To learn hyperbolic graph relationships, specifically: Step S21: Before learning the multi-source higher-order relationships of nodes in the graph convolutional network, since there is no average pooling operation in hyperbolic space, the nodes are first mapped to a tangent space that approximates hyperbolic space. In the middle, we get , ; where the superscript 0 indicates the 0th layer embedding of the 1st convolution; To differentiate between users in the social domain and the interaction domain, a fully connected layer unit is used to obtain the user's unique social embedding. : in Represents the element-wise product. This represents the sigmoid activation function; Step S22: First, information is transmitted on the graph, for example, in the user's social network graph. Information transmission on the network can be represented as: in, yes The regularization matrix, It is a diagonal matrix; Similarly, in the user-item interaction graph Information transmission on the network can be represented as: in, yes The regularization matrix, and They are The row diagonal matrix and column diagonal matrix. Represented as graph convolution Layer embedding; In the reconstruction diagram The calculation process and the interaction graph of user items The information transmission process is similar, so it will not be elaborated further. Step S23: Initially fuse multi-source and multi-domain features of nodes, and design a controllable aggregation mechanism to update the user embedding during each graph convolution process: in, The weighting factors of social information can be controlled; Step S24: By stacking multiple layers of embedding, the embedding representation of the graph convolution output can be obtained as follows: Similarly, the reconstructed graph can be completed based on the above formula. Preliminary fusion of multi-source and multi-domain features of the upper node.
[0034] Furthermore, in step S3, for different users, based on their sensitivity to social information, the user information is personalized, specifically as follows: First, in cutting space Extracting meta-knowledge from each user : in, Indicates horizontal splicing. Indicates user A collection of neighboring items. Indicates user The interactive embedding indicates personal preferences. Indicates user Social embedding; A user meta-network is used to obtain the parameterized transformation matrix for each user: in, and This represents two multilayer perceptrons, which are fully connected layers. , These are two low-rank transformation matrices. It indicates a lower rank; Through calculation It can obtain social signals obtained by different users from social networks based on user sensitivity. Ultimately, the personalized fusion of user embeddings can be represented as: in, This module controls the weighting of the fusion of user interaction embedding and social embedding, which can alleviate the fusion bias caused by hyperbolic space. Similarly, it can be obtained through the methods described above. .
[0035] Further, step S4 specifically includes: Step S41: After hyperbolic graph learning and personalized conversion of user social information, map the embedding in the tangent space back to the hyperbolic space: To optimize hyperbolic space In and First, in the scissor space Social embedding of users on Interactive embedding and Reconstructing the global perspective embedding of the graph and The exponent is mapped onto hyperbolic space: and It can be obtained in a similar way; Step S42: Construct a hyperbolic space model for rating prediction, sort the ratings, and calculate the loss for the main recommendation task. In hyperbolic space, ratings are predicted based on the hyperbolic distance between the user and the item: in, Indicates user Interactive embedding, Represents items The interaction embedding, as shown in the above formula, indicates that the greater the distance between two nodes, the lower their correlation score will be; For each pair of positive samples, the following loss function aims to promote a higher predicted relevance score and a lower score for negative samples: in, This indicates the format of each sample in the batch, as defined by the user. Positive sample items and negative sample items .
[0036] Step S43: Design two hierarchical perceptual hyperbolic contrast learning strategies: a positive sample weighting strategy and a negative sample filtering strategy, which are used to quickly bring in positive samples and discard useless negative samples, respectively. Hierarchical perception of positive sample weighting: In hyperbolic space The size of can represent the hierarchical depth of a node in hyperbolic space. The distribution of a node in different viewpoints should be regarded as a pair of positive samples. If their hierarchical differences are too large, then a larger weight should be added to pull them closer. Therefore, a positive sample weight factor is designed: in, and This represents the embedding of the same node from two different perspectives. It allows control over the weighting of hierarchical differences; Hierarchical-aware negative sample selection: If the hierarchical differences of negative samples in hyperbolic space are too large, then the differences in their hyperbolic distances are attributed to hierarchical influences rather than semantic differences. Therefore, these negative samples are unlikely to provide meaningful contrast signals and will introduce additional computational overhead. Therefore, to select more meaningful negative samples, a selection process is performed for each node across all negative samples. The negative sample with the smallest hierarchical difference: While contrastive learning has proven effective in mitigating data sparsity in Euclidean space-based social recommendation, its potential in hyperbolic space-based social recommendation remains largely unexplored. Unlike existing hyperbolic contrastive learning paradigms, we design a hierarchy-aware scaling factor to emphasize the alignment process between positive sample pairs with significant hierarchy inconsistencies. Furthermore, considering that existing hyperbolic contrastive learning methods typically treat all samples as negative samples, leading to inefficient training, we propose a hierarchy-aware hard negative sample sampling strategy.
[0037] Step S44: Design two levels of perceptual contrastive learning loss: social perceptual contrastive learning and interaction perceptual contrastive learning. Social perceptual contrastive learning is used to align user information on the social graph and interaction graph, while interaction perceptual contrastive learning is used to align node information on the interaction graph and reconstruction graph. Socially-aware contrastive learning can facilitate the sharing of semantic information related to interaction graphs and social networks while preserving their individual characteristics: in, Indicates the temperature coefficient. This represents the batch corresponding to the training process. Indicates the positive sample weight factor. Indicates user negative samples, Used to calculate the hyperbolic distance between two nodes.
[0038] The reconstructed graph can extract key collaborative signals from the global perspective of the interaction graph, and use interaction-aware contrastive learning to align the node representations on the interaction graph and the reconstructed graph: in, Indicates the temperature coefficient. This represents the batch corresponding to the training process. Indicates the positive sample weight factor. Indicates user negative samples, Used to calculate the hyperbolic distance between two nodes.
[0039] The result can be obtained in a similar way to the above formula, and the final interactive perception contrastive learning loss is defined as: Finally, the total loss of the hyperbolic space model can be defined as: Step S45: Use the hyperbolic space-specific optimizer to backpropagate the loss and update the hyperbolic space model parameters to obtain the trained hyperbolic space model. A trained hyperbolic space model is used to predict and score the relevance between users and items, and items are recommended to users based on the scores.
[0040] To verify the effectiveness of this embodiment, a comparative experiment was conducted between the existing method and this embodiment, and the results are shown in Table 1. Table 1: Comparison of Recall and NDCG indices between existing methods and this embodiment From the experimental results in Table 1, we can see that: First, introducing social networks can significantly improve recommendation performance. Both Euclidean and hyperbolic space-based methods achieve better performance when combined with social networks. For example, DiffNet++ enhances representation learning by recursively modeling the diffusion process on user-item interaction graphs and user-user social graphs, while RecDiff uses a diffusion model to denoise social relationships; therefore, both achieve superior performance. In contrast, HGCF, which only utilizes user-item interaction relationships, has the weakest performance among all hyperbolic models. This phenomenon indicates that social homogeneity can effectively capture shared user behavioral preferences and mine potential interaction patterns, thereby enhancing representation learning and significantly alleviating the data sparsity problem in recommendation scenarios. Second, overall, hyperbolic space-based methods outperform Euclidean space-based methods, especially models such as HICF, HDRM, HyperCL, HyperSoRec, and HGSR, which achieve better results on multiple datasets and evaluation metrics. This result validates the advantages of hyperbolic geometry in preserving high-order connections and tree-like hierarchical influence patterns, making it more expressive in social recommendation tasks. Furthermore, HyperCL demonstrates strong competitiveness in hyperbolic models without incorporating social networks, primarily due to its combination of contrastive learning mechanisms and hyperbolic distance, thereby improving representation learning performance. However, compared to our proposed H2CLSR, HyperCL's performance still lags significantly. This is because H2CLSR not only introduces social relationships to alleviate data sparsity but also designs a hierarchy-aware scaling factor, which adaptively adjusts the weights of positive sample pairs based on their proximity in the hierarchical structure, achieving more stable and effective alignment. Finally, it significantly outperforms existing methods on all datasets and most evaluation metrics. Compared to the best baseline model HGSR, this invention achieves stable improvements on Recall@K and NDCG@K, with an average improvement of approximately 5%, and all improvements pass statistical significance tests. This result fully validates the effectiveness of the proposed method.
[0041] To further verify the effectiveness of each module in this embodiment, several ablation experiments were designed, and the results are shown in Table 2. Table 2. Ablation Experiment Results As shown in Table 2: First, removing social perception contrastive learning and interaction perception contrastive learning resulted in a decrease in performance, which fully verifies the effectiveness of the hyperbolic space contrastive learning combined with positive sample weighting factors in this invention. Second, removing user-personalized knowledge conversion resulted in a certain degree of performance decrease, indicating that different users have different sensitivities to social information. Especially in hyperbolic space, the reasonable integration of social information is particularly important. Without personalized information integration, social influence will lead to significant deviations. Finally, replacing hyperbolic space modeling with Euclidean space modeling resulted in a significant performance decrease. This indicates that social networks and interaction graph structures have hierarchical characteristics and tree-like structures. If Euclidean modeling is used to represent the tree structure, it will produce serious distortion, leading to a significant performance decrease.
[0042] This embodiment also summarizes the efficiency and performance comparison of contrastive learning, as shown in the table below: Table 3. Efficiency and Performance Comparison of Contrastive Learning Figure 3a , Figure 3b , Figure 3c The recommended performance in this embodiment of the invention is affected by the number of convolutional layers. and fusion factor The diagram illustrates the impact of experiments conducted on three different datasets, demonstrating the relationship between the recommendation performance of this embodiment and the number of convolutional layers and the fusion factor.
[0043] Figure 4a , Figure 4b , Figure 4c This is a schematic diagram of the recommendation effect in different sparse scenarios in the embodiments of the present invention. Experiments were also conducted on three different datasets, which show the relationship between the recommendation effect of this embodiment and sparse scenarios.
[0044] Figure 5a , Figure 5b This is a schematic diagram showing the distribution of the head node and tail node in hyperbolic space in an embodiment of the present invention. Figure 5a This is a schematic diagram of the distribution on the Ciao dataset. Figure 5b This is a schematic diagram illustrating the distribution on the Yelp dataset. From... Figure 5a , Figure 5b It can be observed that head nodes and tail nodes with different sparsity are evenly distributed on rings of different radii in hyperbolic space, while exhibiting a clear hierarchical structure. This suggests that by simultaneously aligning social information and reconstructing interaction signals, contrastive learning can provide additional supervisory signals to sparse users, preventing sparse nodes from being pushed infinitely towards the edge of hyperbolic space.
[0045] Example 2 This embodiment provides a social recommendation device based on hyperbolic space contrastive learning, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, it implements the social recommendation method based on hyperbolic space contrastive learning described in Embodiment 1.
[0046] The social recommendation device based on hyperbolic space contrastive learning provided in this embodiment is used to implement the social recommendation method based on hyperbolic space contrastive learning. Therefore, the social recommendation device based on hyperbolic space contrastive learning also has the same technical effects as the social recommendation method based on hyperbolic space contrastive learning, and will not be described again here.
[0047] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of the present invention.
Claims
1. A social recommendation method based on hyperbolic space contrastive learning, characterized in that, Includes the following steps: Step S1: Map the nodes of the user item interaction graph and the social network graph into hyperbolic space, and reconstruct the user item interaction graph to obtain a reconstructed graph from a global perspective; Step S2: Combining the user item interaction graph, the social network graph, and the reconstructed graph, a graph neural network is used to learn the multi-source high-order relationships of the hyperbolic graph, and preliminary fusion and embedding information of each node from multiple perspectives and sources is obtained. Step S3: Based on the preliminary fusion and embedding information, perform social information transformation and fusion for each user based on their social information sensitivity to obtain personalized fusion and embedding information; Step S4: Construct a hyperbolic space model using the hyperbolic distance between users and items as the predicted score. Set up a contrastive learning strategy with two levels of perception: positive sample weighting and negative sample filtering. Set up contrastive learning loss with two levels of perception: social perception and interaction perception. Use the trained hyperbolic space model to predict the correlation between users and items.
2. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, In step S1, the nodes of the user item interaction graph and the social network graph are mapped to hyperbolic space, specifically as follows: Initialize the user interaction embedding and the item embedding in Euclidean space; map the initial user embedding and the initial item embedding in Euclidean space to hyperbolic space to obtain the initial user embedding and the initial item embedding in hyperbolic space.
3. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, In step S1, the user item interaction graph is reconstructed to obtain a reconstructed graph from a global perspective, specifically as follows: A random matrix is generated to obtain the subspace of the user item interaction graph; Perform QR decomposition on the subspace to obtain the column subspace orthogonal deviation of the subspace; Based on the orthogonal deviation of the column subspace, a structure matrix containing the structural information of the user item interaction graph is obtained; Singular value decomposition is performed on the structure matrix to obtain orthogonal vectors, and only the orthogonal vectors corresponding to the largest set number of singular values are retained; The user-item interaction graph is reconstructed based on the retained orthogonal vectors and the orthogonal deviation to obtain a reconstructed graph from a global perspective.
4. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, Step S2 specifically involves: Step S21: Map the nodes of the user-item interaction graph, the social network graph, and the reconstructed graph into a tangent space to obtain the interaction embedding and item embedding under the tangent space; use a fully connected layer unit to obtain the user's social embedding; Step S22: Information is transmitted on the user item interaction graph, the user social network graph, and the reconstructed graph respectively; Step S23: Set up a controllable aggregation mechanism in each graph convolution process to update the user embedding; Step S24: Perform multi-layer embedding stacking on the user item interaction graph, the social network graph, and the reconstructed graph respectively. Stack multiple layers of user embedding for each node to obtain the preliminary fusion embedding information and realize the fusion of multi-source and multi-domain features of each node.
5. The social recommendation method based on hyperbolic space contrastive learning according to claim 4, characterized in that, Step S24 specifically involves: On the user item interaction graph, multiple layers of item embedding and interaction embedding are stacked for each node to obtain preliminary item fusion embedding and preliminary interaction fusion embedding. By stacking multiple layers of social embedding for each node on the user social network graph, a preliminary social fusion embedding is obtained. On the reconstruction graph, multiple layers of item embedding and interaction embedding are stacked for each node to obtain preliminary item reconstruction fusion embedding and preliminary interaction reconstruction fusion embedding.
6. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, Step S3 specifically involves: In the tangent space, the meta-knowledge of each user is extracted from the user item interaction graph and the reconstructed graph, and a user meta-network is used to obtain the parameterized transformation matrix of each user. Based on the parameterized transformation matrix and the preliminary fusion embedding information, the social signals obtained by different users from social networks are calculated to obtain personalized fusion embedding information based on user sensitivity.
7. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, In step S4, a hyperbolic space model is constructed using the hyperbolic distance between user items as the predicted score. Specifically: After learning the hyperbolic graph and fusing personalized embeddings, the user embeddings in the tangent space are mapped back to the hyperbolic space to obtain the fused embedding information in the hyperbolic space. In hyperbolic space, the hyperbolic distance between the user fusion embedding and the item fusion embedding is calculated as the predicted score. At the same time, a basic loss function is set based on the user fusion embedding and the item fusion embedding to construct a hyperbolic space model.
8. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, In step S4, the hyperbolic space model employs a contrastive learning strategy with two levels of perception: positive sample weighting and negative sample filtering. Specifically: A positive sample weighting strategy is set: the hierarchical depth of a node in hyperbolic space is calculated based on the user embedding of the node in the interaction graph view and the global view. A positive sample weighting factor is set based on the difference in hierarchical depth of the same node in the two different views. The positive sample weighting factor is used to reduce the difference in hierarchical depth of the same node in different views. Set a negative sample filtering strategy: Filter all negative samples for each node, and select a set number of negative samples with the smallest difference in hierarchical depth from all negative samples as the final negative samples.
9. The social recommendation method based on hyperbolic space contrastive learning according to claim 1, characterized in that, In step S4, the hyperbolic space model is configured with contrastive learning losses at two levels: social perception and interaction perception. Specifically: Social fusion embedding based on social network graph and interaction fusion embedding based on user item interaction graph are set with social perception hierarchical contrastive learning loss to promote the sharing of semantic information between user item interaction graph and social network graph while retaining their respective features. Based on the user item interaction graph and the reconstructed graph, the interaction perception level is set by the first contrastive learning loss; The second contrastive learning loss for interaction perception is set based on the item fusion embedding of the user item interaction graph and the reconstructed graph; the contrastive learning loss for interaction perception is obtained by combining the first contrastive learning loss and the second contrastive learning loss. The total loss function is obtained by combining the basic loss function, the social perception hierarchical contrastive learning loss, and the interaction perception hierarchical contrastive learning loss. The hyperbolic space model parameters are updated by using the backpropagation loss of the hyperbolic space-specific optimizer to obtain the trained hyperbolic space model.
10. A social recommendation device based on hyperbolic space contrastive learning, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the social recommendation method based on hyperbolic space contrastive learning as described in any one of claims 1-9.