Heterogeneous collaborative recommendation method and system for multi-geometry interactive embedding and graph convolution contrast learning
The heterogeneous collaborative recommendation method, which combines multi-geometric interaction embedding with graph convolutional contrastive learning, addresses the problem of insufficient representation in a single geometric space. It achieves efficient capture of complex structural relationships and enhances the diversity of recommendation results, thereby improving the robustness and accuracy of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU NORMAL UNIVERSITY
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-01
AI Technical Summary
Existing recommendation technologies suffer from low accuracy, poor robustness, and insufficient diversity due to insufficient representation capabilities in a single geometric space, lack of cross-space interaction mechanisms, and inadequate fusion of knowledge signals and collaborative signals.
A heterogeneous collaborative recommendation method is adopted, which combines multi-geometric interaction embedding and graph convolutional contrastive learning. By mapping entities to three complementary geometric spaces—Euclidean, hyperbolic, and spherical—a cross-space attention mechanism is designed, and a heterogeneous collaborative recommendation model is constructed, including a multi-geometric interaction attention network, a graph convolutional attention network, and a score prediction module. The model is trained using a multi-task loss function.
It significantly improves the model's ability to capture complex structural relationships in knowledge graphs, enhances the accuracy and interpretability of recommendation decisions, and improves the model's robustness in data-sparse scenarios and the diversity of recommendation results.
Smart Images

Figure CN121958633A_ABST
Abstract
Description
A heterogeneous collaborative recommendation method and system based on multi-geometric interaction embedding and graph convolutional contrastive learning Technical Field
[0001] This invention belongs to the field of knowledge graph representation learning technology, specifically involving a heterogeneous collaborative recommendation method and system based on multi-geometric interaction embedding and graph convolutional contrastive learning. Background Technology
[0002] With the deep integration of knowledge graphs and recommender systems, knowledge graph-based recommendation methods have become an important way to alleviate data sparsity, improve recommendation quality, and enhance interpretability. However, existing technologies still have significant shortcomings in knowledge representation capabilities and collaborative optimization of recommender models: traditional embeddings are mostly based on a single Euclidean space, which is difficult to express the complex geometric features widely present in knowledge graphs, such as hierarchical structures, symmetric relationships, and circular dependencies; although existing research has introduced hyperbolic and spherical spaces, they are mostly limited to single-space modeling, lacking information interaction and fusion mechanisms across geometric spaces, and failing to leverage the complementary advantages of multi-space structures. At the recommender model level, knowledge representation and recommendation prediction are usually loosely coupled, resulting in the inability to fully transmit the semantics of knowledge structure in the user-item interaction graph. At the same time, attention mechanisms are still coarse in capturing complex semantic relationships and are difficult to cope with sparse data and noise interference. On this basis, although contrastive learning has been introduced to improve the robustness and generalization ability of models, existing methods mostly rely on simple graph augmentation operations, ignoring the structural semantic features of nodes and relationships, and failing to fully utilize the multi-dimensional structural information in knowledge graphs, resulting in unstable construction of positive and negative samples and insufficient semantic consistency. In addition, mainstream recommendation systems still generally face the limitations of severe homogenization of recommendation results and lack of diversity control, which further affects user experience and the long-term benefits of the system. Summary of the Invention
[0003] The purpose of this invention is to provide a heterogeneous collaborative recommendation method and system based on multi-geometric interaction embedding and graph convolutional contrastive learning, in order to solve the problems of low recommendation accuracy, poor robustness and insufficient diversity caused by insufficient representation ability of a single geometric space, lack of cross-space interaction mechanism and insufficient fusion of knowledge signal and collaborative signal in existing recommendation technologies.
[0004] In a first aspect, the present invention provides a heterogeneous collaborative recommendation method based on contrastive learning of multi-geometric interaction embedding and graph convolution, characterized in that: the method includes:
[0005] Acquire collaborative knowledge graph data; the collaborative knowledge graph data includes a user-item interaction bipartite graph and an entity knowledge graph; the user-item interaction bipartite graph includes user sets, item sets, and interaction behaviors; the entity knowledge graph includes head entities, tail entities, and relationships;
[0006] Embedding vectors for head entities, tail entities, and relations in the entity knowledge graph are constructed respectively, and the entity representation of the head entity is obtained based on the embedding vectors of the tail entity and relation. The entity representation is mapped to the geometric space to generate the corresponding geometric space embedding. The geometric space embedding is mapped to the tangent space to obtain the tangent space representation. The corresponding geometric space distance is obtained based on the geometric space embedding of the entity pair.
[0007] A heterogeneous collaborative recommendation model is constructed. The heterogeneous collaborative recommendation model includes a multi-geometric space interactive attention network, a graph convolutional attention network, and a score prediction module connected in sequence. The multi-geometric space interactive attention network is used to interact and fuse the tangent space representations to obtain a unified representation vector of entities. The graph convolutional attention network is used to extract the final representation of entities. The score prediction module is used to obtain the user's predicted score for an item based on the final representation of the entity.
[0008] The heterogeneous collaborative recommendation model is trained using joint collaborative knowledge graph data, and the trained heterogeneous collaborative recommendation model is used to obtain the target user's predicted scores for all items. Candidate items are selected from all items based on the magnitude of the predicted scores, and a recommendation list is generated based on the candidate items.
[0009] Preferably, in each layer of the graph convolutional attention network, a graph convolution operation is performed on the graph convolution output of the previous layer to obtain the graph convolution output of the current layer; the graph convolution output is projected into a query vector, a key vector, and a value vector; geometric spatial distance is introduced to interact with the query vector, key vector, and value vector to obtain the attention output; the attention output and the graph convolution output are fused to obtain the final output of the current layer; and a linear transformation is performed on the sum of the final outputs of all layers in the graph convolutional attention network to obtain the final representation of the entity.
[0010] Preferably, the interaction process of the query vector, key vector, and value vector is as follows: the element-wise interaction results of the query vector of the target entity and the key vectors of neighboring entities are concatenated with the encoded geometric spatial distance, and the concatenation result is normalized to obtain the attention weight; the attention weight is used to perform a weighted summation of the value vectors of neighboring nodes to obtain the attention output of the target node.
[0011] Preferably, the geometric space includes Euclidean space, hyperbolic space, and spherical space.
[0012] Preferably, in the cross-attention module, the query matrix, key matrix, and value matrix corresponding to the scissor space representation are obtained; the value matrix corresponding to the target scissor space representation is interacted with the query matrix and key matrix corresponding to the other two scissor space representations to obtain the attention feature vector of the target scissor space; after performing a linear transformation on the attention feature vector of the scissor space, it is fused with the corresponding scissor space representation to obtain the enhanced representation of the scissor space; the enhanced representations of different scissor spaces are concatenated to obtain the unified representation vector output by the cross-attention module.
[0013] As a preferred method, the following approach is used to map entity representations to different geometric spaces:
[0014] A linear transformation is performed on the entity representation to obtain rotation and translation components; the Euclidean space embedding is generated by multiplying the rotation and translation components element by element; the hyperbolic space embedding is generated by using hyperbolic space multiplication and exponential mapping for the rotation and translation components; the spherical space embedding is generated by using spherical space multiplication and exponential mapping for the rotation and translation components.
[0015] Preferably, the Euclidean tangent space representation is obtained by performing an identity transformation on the Euclidean space embedding; the hyperbolic tangent space representation is obtained by performing a logarithmic mapping on the hyperbolic space embedding with the origin of the hyperbolic space as the base point; and the spherical tangent space representation is obtained by performing a logarithmic mapping based on the angle between the spherical space embedding and the north pole of the sphere.
[0016] Preferably, the entity representation is obtained by concatenating the embedding vectors of the tail entity and the relation, and extracting the mean of the concatenation results corresponding to all outgoing edges of the head entity as the entity representation.
[0017] Preferably, during training, a multi-task loss function is constructed to guide the parameter updates of the heterogeneous collaborative recommendation model; the multi-task loss function includes a contrast loss function, a recommendation loss function, and an embedding loss function.
[0018] The method for constructing the contrast loss function is as follows: two contrast views are generated using different data augmentation strategies; positive and negative sample pairs are constructed using the results of the input graph convolutional attention network of the two contrast views; and a contrast loss function is constructed based on the positive and negative sample pairs corresponding to users and items.
[0019] The method for constructing the recommendation loss function is as follows: construct the main recommendation loss by maximizing the prediction scores of positive and negative samples; construct the auxiliary click-through rate prediction loss by maximizing the prediction scores of positive samples and minimizing the prediction scores of negative samples; and obtain the recommendation loss function by combining the main recommendation loss and the auxiliary click-through rate prediction loss.
[0020] The method for constructing the embedding loss function is as follows: construct the knowledge graph triplet loss based on the deviation between the scores of positive sample triplets and their corresponding negative sample triplets in the geometric space; construct the geometric space alignment loss by minimizing the maximum mean difference between different tangent space representations; combine the knowledge graph triplet loss and the geometric space alignment loss, and introduce an embedding smoothing regularization term to obtain the embedding loss function.
[0021] As a preferred approach, a three-stage training strategy is adopted to train the model during the training process: the first stage uses the embedding loss function as the optimization objective; the second stage uses the multi-task loss function as the optimization objective; and the third stage uses the contrast loss function, the recommendation loss function, and the embedding smoothing regularization term as optimization objectives.
[0022] Preferably, the method for fusing the attention output and the graph convolution output is as follows: using a gate vector generated by the Sigmoid function, the attention output and the graph convolution output are weighted and fused.
[0023] Preferably, after obtaining the predicted scores, the predicted scores for each item are adjusted, and the recommended list is regenerated using the adjusted predicted scores. The method for adjusting the predicted scores is as follows: the diversity of the recommended list is obtained based on the average dissimilarity between different items in the recommended list; the predicted score of the new item is adjusted based on the diversity after adding the new item to the recommended list.
[0024] Secondly, this invention provides a heterogeneous collaborative recommendation system based on multi-geometric interaction embedding and graph convolutional contrastive learning, which is used to execute the aforementioned heterogeneous collaborative recommendation method. This heterogeneous collaborative recommendation system includes a data acquisition module, a data processing module, a fusion module, a graph attention network module, a score prediction module, and a recommendation generation module. The data acquisition module is used to construct knowledge graph triples and user-item interaction graphs from raw data. The data processing module is used to achieve tangent space representation of head entities through multi-space mapping and tangent space projection. The fusion module is used to achieve the fusion of input features through cross-attention. The graph attention network module is used to perform message propagation, geometric relationship encoding, and structure-aware attention aggregation on the interaction graph. The score prediction module is used to obtain the user's predicted score for an item based on the result of the graph attention network module. The recommendation generation module is used to generate a final recommendation list based on the target user's predicted score for the item.
[0025] The beneficial effects of this invention are:
[0026] 1. This invention uses a multi-geometric space interactive embedding mechanism to simultaneously map entities into three complementary geometric spaces: Euclidean, hyperbolic, and spherical. It also designs cross-space attention to achieve deep interaction between different geometric features, effectively overcoming the limitations of single geometric space representation. This significantly improves the model's ability to capture complex structural relationships (such as hierarchical structures and circular dependencies) in knowledge graphs, making knowledge representation richer and more accurate, and laying a solid semantic foundation for subsequent recommendation tasks.
[0027] 2. This invention integrates the geometric relationships between edges and nodes in a graph neural network. By constructing a geometric relationship vector and incorporating it into a graph attention mechanism, it achieves structure-aware message propagation. This enables the model to simultaneously consider the feature interaction similarity between nodes and the structural affinity based on multiple geometric spaces when aggregating neighbor node information. This effectively enhances the graph neural network's ability to model knowledge logic and improves the accuracy and interpretability of recommendation decisions.
[0028] 3. This invention effectively balances the synergy and conflict between different optimization objectives by jointly optimizing the recommendation ranking loss, contrastive learning loss, and knowledge embedding loss, and combining them with a three-stage progressive training method. This not only significantly improves the stability and convergence efficiency of model training, but also enhances the robustness of the model in data-sparse scenarios through the contrastive learning mechanism, while ensuring the integrity and consistency of the knowledge structure. Attached Figure Description
[0029] Figure 1 is an overall flowchart of the present invention.
[0030] Figure 2 is a schematic diagram of the collaborative knowledge graph in this invention.
[0031] Figure 3 is a structural diagram of the multi-geometric space interactive attention network in this invention.
[0032] Figure 4 is a diagram of the graph convolutional attention network structure in this invention.
[0033] Figure 5 is a diagram of the knowledge enhancement graph comparison learning structure in this invention. Detailed Implementation
[0034] The present invention will be further described below with reference to the accompanying drawings.
[0035] A heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning is proposed. The heterogeneous collaborative recommendation system includes a data acquisition and processing module, a multi-geometric representation and fusion module, a graph neural network and attention calculation module, a contrastive learning and loss calculation module, and a recommendation generation module. The data acquisition and processing module constructs knowledge graph triples and user-item interaction graphs from raw data. The multi-geometric representation and fusion module achieves geometric representation and fusion of knowledge through multi-space mapping, tangent space projection, and cross-attention. The graph neural network and attention calculation module performs message propagation, geometric relationship encoding, and structure-aware attention aggregation on the interaction graph. The contrastive learning and loss calculation module enhances representation robustness through data augmentation and contrastive learning optimization. The recommendation generation module generates the final recommendation list based on a diversity-enhanced prediction mechanism. These modules are sequentially connected to form a complete knowledge recommendation system, and end-to-end optimization is achieved through a multi-stage training strategy.
[0036] This heterogeneous collaborative recommendation method includes the following steps:
[0037] Step 1: Obtain collaborative knowledge graph data and construct a user-item interaction bipartite graph. And item knowledge graph (entity knowledge graph) .in, For user collection; A collection of items; Represents the interaction edges between the user and the item; For head entities; It is a tail entity; For relationship; For a collection of entities; For a set of relations. Tail entity. and relationships initialization 3D embedding vector: ;in, The embedding vector of the tail entity; For relation embedding vectors; It is a uniform distribution; As a preset constant, .
[0038] Step 2: Construct the entity representation of the head entity
[0039] To fully utilize the structural information of the knowledge graph, this invention aggregates the adjacency context information of the head entity to represent the head entity. Specifically, for the head entity... Calculate the entity representation of its adjacency context features. The entity is represented by aggregating the vectors of relation-tail entities corresponding to all outgoing edges of the entity, and its expression is:
[0040]
[0041] in, For head entity The set of all outgoing edges; This is a learnable weight matrix.
[0042] The physical significance of this design lies in the fact that, in a knowledge graph, the semantics of an entity is largely defined by its connections and neighboring entities. By explicitly aggregating this local structural information, a more expressive, context-aware initial representation can be generated for each entity, laying the foundation for subsequent mappings in different geometric spaces. Based on this step, entity and relation embedding vectors are initialized, and their global embedding matrices in each geometric space are defined as learnable parameters of the model, used for subsequent regularization calculations.
[0043] Step 3: Multi-geometric space mapping
[0044] To overcome the limitations of representing entities in a single geometric space, entities are simultaneously mapped to three geometric spaces with complementary structural properties. By designing unique geometric transformation functions for each space, the underlying structural features of the knowledge graph—translation invariance (Euclidean space), hierarchy (hyperbolic space), and cyclic symmetry (spherical space)—are captured. The specific process is as follows:
[0045] 2-1. Generating Fundamental Components of Geometric Transformations
[0046] Representing entities through shared linear transformations Mapped to an intermediate vector containing rotation and translation components, it is represented as:
[0047]
[0048] in, These are the rotation component and the translation component, respectively; A learnable weight matrix shared by three geometric spaces; For shared, learnable bias vectors.
[0049] The design aims to extract a unified geometric transformation basis component from the entity representation, significantly reducing model parameters and promoting knowledge sharing and feature alignment across different geometric spaces.
[0050] 2-2. Generating Euclidean Space Embedding
[0051] In Euclidean space, the rotational component With translation components Euclidean space embedding is generated through element-wise multiplication. It is represented as:
[0052]
[0053] in, This represents element-wise multiplication (Hadamard product).
[0054] The physical significance of this design lies in enhancing the flexibility of representation through the interaction between components, while using simple linear operations to embody the flatness and translation invariance of Euclidean space.
[0055] 2-3. Generate hyperbolic space embedding
[0056] Hyperbolic space adopts the Poincaré sphere model, with curvature parameters... (Learnable). Utilizing rotational components. Translation components Möbius multiplication in hyperbolic space With exponential mapping Generate hyperbolic space embedding It is represented as:
[0057]
[0058] in, For the exponential mapping of hyperbolic space, it is defined as follows:
[0059]
[0060] in, is the independent variable.
[0061] Generated hyperbolic space embedding Located inside the Poincaré sphere, satisfying To capture the potential hierarchical structural features in knowledge graphs.
[0062] 2-4. Generating spherical space embedding
[0063] Using rotational components Translation components Through Möbius multiplication in spherical space With exponential mapping Generate a spherical space embedding and normalize it to obtain the spherical space embedding. Its expression is:
[0064]
[0065] in, For the curvature parameters of the spherical space, (Learnable); For the exponential mapping of spherical space, it is defined as follows:
[0066]
[0067] in, It serves as a fixed base point.
[0068] Normalized spherical space embedding mode This ensures that the embedding is located on a unit sphere to capture potential cyclic symmetry structural features in the knowledge graph.
[0069] In this embodiment, the Möbius multiplication operation between hyperbolic space and spherical space adopts a unified definition. For arbitrary curvature parameters... ( At that time, it was hyperbolic space. (when in spherical space), Möbius multiplication Defined as:
[0070]
[0071] in, The input vector; Indicates the inner product; This represents the Euclidean norm.
[0072] Step 4: Obtain the tangent space representation and geometric space distance.
[0073] 4-1. Unified Mapping of Tangent Space
[0074] This invention unifies the embedding of different geometric spaces into a local tangent space through tangent space mapping. To achieve effective interaction between features of different geometric spaces, a unified representation space must be found. This invention utilizes concepts from differential geometry to map embedding points in hyperbolic and spherical spaces to their respective tangent spaces at a reference point (such as the origin or the north pole). The tangent space is a linear approximation of a manifold at a point and is a Euclidean vector space, thus allowing the use of standard vector operations. The mapping methods for embedding different spaces are as follows:
[0075] (1) For Euclidean space, its tangent space is itself, so the mapping is an identity transformation to obtain the Euclidean tangent space representation. for:
[0076]
[0077] (2) The logarithmic mapping of hyperbolic space with the origin of hyperbolic space Using the base point, obtain the hyperbolic tangent space representation. for:
[0078]
[0079] in, For a logarithmic mapping of hyperbolic space; It is the inverse hyperbolic tangent function.
[0080] (3) Logarithmic mapping of spherical space with the spherical north pole Using the base point as the starting point, first calculate the angle between the embedding and the base point. Its expression is:
[0081]
[0082] According to the included angle Perform a logarithmic mapping to obtain the spherical tangent space representation. for:
[0083]
[0084] in, It is a logarithmic mapping for spherical space.
[0085] The physical significance of this step is to act as a "geometric translator." It transforms points on a curved manifold that are originally incomparable or inoperable directly ( ), projected onto a uniform, flat vector space ( This allows features from three completely different geometric worlds—Euclidean, hyperbolic, and spherical—to interact and merge within the same mathematical framework.
[0086] 4-2. Obtaining Geometric Spatial Distance
[0087] Based on the node pairs in the interaction bipartite graph Spatial embedding to obtain the corresponding geometric spatial distance The method to obtain it is as follows:
[0088]
[0089]
[0090]
[0091] in, These are Euclidean distance, hyperbolic distance, and spherical distance, respectively. Euclidean space embedding for nodes; Hyperbolic space embedding for nodes; Embedded in the spherical space of the node.
[0092] To handle scale differences in different geometric spatial distances, the geometric spatial distances are standardized as follows:
[0093]
[0094] in, and These represent the geometric spatial distances before and after standardization. This represents the average distance between all pairs of interacting nodes in different spaces. Let be the standard deviation of the distances between all interactive node pairs in different spaces.
[0095] Step 5: Construct a heterogeneous collaborative recommendation model
[0096] The heterogeneous collaborative recommendation model comprises a multi-geometric space interaction attention network, a graph convolutional attention network, and a score prediction module. The multi-geometric space interaction attention network enables the interaction and fusion of features between Euclidean space, hyperbolic space, and spherical space. The graph convolutional attention network extracts the final representations of users and items. The score prediction module obtains the predicted score for the user on each item based on the final representation extracted by the graph convolutional attention network.
[0097] 5-1. Multi-geometric spatial interactive attention network
[0098] As shown in Figure 3, a unified tangent space representation has been obtained. Subsequently, a cross-attention module is used to facilitate deep interaction between features in different geometric spaces. Within the cross-attention module, the query matrix, key matrix, and value matrix corresponding to different tangent space representations are obtained, and the methods for obtaining them are as follows:
[0099]
[0100]
[0101]
[0102] in, Let the Euclidean space represent the corresponding query matrix, key matrix, and value matrix; Let the hyperbolic tangent space represent the corresponding query matrix, key matrix, and value matrix; Let the spherical tangent space represent the corresponding query matrix, key matrix, and value matrix; It is a learnable linear matrix.
[0103] Obtain attention feature vectors corresponding to different tangent space representations based on the query matrix, key matrix, and value matrix. This allows queries in any geometric space to dynamically retrieve relevant information from key-value pairs in the other two spaces. This cross-space interaction not only fully preserves the unique structural modeling advantages of each geometric space (translation invariance of Euclidean space, hierarchy of hyperbolic space, and cyclicity of spherical space), but more importantly, it generates a synergistic effect of "geometric thinking collision," enabling entity representations to be enhanced and corrected simultaneously from multiple geometric perspectives. Attention Feature Vector The methods for obtaining it are as follows:
[0104]
[0105]
[0106]
[0107] in, These are the attention feature vectors for spherical space, Euclidean space, and hyperbolic space, respectively. It is a normalized exponential function; This is used to scale the dot product and prevent gradient vanishing. In single-head attention mechanisms, the dimension of the key vector is equal to the total embedding dimension. .
[0108] The physical significance of this design lies in simulating a "collision of geometric thinking." It does not force all information to be compressed into a single space, but rather allows the model to dynamically and selectively allow features from different geometric perspectives to engage in dialogue. This cross-space interaction greatly enhances the model's ability to understand and reason about complex knowledge relationships.
[0109] After performing a linear transformation on the attention feature vectors corresponding to different spaces, the transformation result is fused with the corresponding tangent space representation to obtain the enhanced representations of different spaces; the fused results of different spaces are then concatenated to obtain the unified representation vector output by the cross-attention module. This results in a unified representation that is rich in information and structurally complete, providing a strong semantic foundation for downstream recommendation tasks and significantly improving the model's ability to understand and reason about complex knowledge relationships. The above process can be expressed by the following formula:
[0110]
[0111]
[0112]
[0113]
[0114] in, These are the enhanced representations of Euclidean space, hyperbolic space, and spherical space after residual fusion, with dimensions of [missing information]. ; The weight matrix is a learnable matrix with dimension . ; This represents a vector concatenation operation, which combines three vectors... Concatenate dimensional vectors into one Dimensional vector.
[0115] The physical meaning of this step is to achieve "information integration and retention". Residual addition ensures two things: 1) new information brought about by cross-spatial attention ( ) can be integrated; 2) the most original and essential characteristics of each geometric space itself ( The data will not be overwritten or lost, thus serving a similar function to short-circuit protection. The final concatenation operation completely preserves all geometric perspective information, forming a rich and unified representation that provides powerful input features for downstream graph neural network processing.
[0116] 5-2. Graph Convolutional Attention Network
[0117] Graph convolutional attention networks fuse geometric relation vectors encoded in multiple geometric spaces with node feature interaction signals. By simultaneously considering feature similarity and structural affinity in attention weight calculation, they achieve structure-aware message propagation, significantly improving the accuracy and interpretability of information aggregation in the graph. Furthermore, through different projection matrices, the model can learn how to extract the most effective feature representations for different stages of the attention mechanism, achieving "role assignment" and "information purification" of node features.
[0118] 5-2-1. Constructing Network Input
[0119] By mapping the unified representation vectors of users and items using projection matrices respectively, the input representation of the graph convolutional attention network is obtained as follows:
[0120]
[0121]
[0122] in, and These are the input representations for user nodes and item nodes, respectively; These are the learnable projection matrices for users and items, respectively.
[0123] The input representations of all nodes are combined to form the input matrix of the graph convolutional attention network. The physical significance of this design lies in the fact that it respects the heterogeneity of users and items in recommendation scenarios, allowing the model to adaptively adjust the features transferred from the knowledge graph according to the characteristics of different node types, thus providing a high-quality starting point for subsequent graph-based message propagation.
[0124] 5-2-2. Graph Convolution Propagation
[0125] In each layer of the graph convolutional attention network, perform a graph convolution propagation operation to obtain the graph convolution output of the k-th layer. Its expression is:
[0126]
[0127] in, The normalized adjacency matrix represents the user. With items Interaction between them; This represents the graph convolution output of the (k-1)th layer graph convolution propagation; ; Let be the number of layers in the graph convolutional attention network.
[0128] In a user-item interaction graph scenario, this propagation operation allows user and item nodes to exchange information through interaction edges. The physical significance of this step lies in capturing collaborative filtering signals. Based on the assumption that "neighboring nodes behave similarly," it allows user nodes to absorb features of items they have interacted with, and vice versa. Through this explicit message passing, the model can smooth the representation of neighboring nodes in the graph, thereby encoding local interaction patterns into node embeddings and mitigating data sparsity issues.
[0129] 5-2-3. Extracting Geometric Relation Vectors
[0130] The distance between two nodes in multiple geometric spaces of the knowledge graph reflects various potential structural relationships between them (such as hierarchical, circular, and translational). This is achieved through a multilayer perceptron encoder. A nonlinear transformation is applied to the geometric spatial distance to elevate it into a high-dimensional, learnable geometric relation representation, resulting in a geometric relation vector. This is equivalent to injecting rich, structured prior knowledge from the knowledge graph, including geometric relation vectors, into the node pairs in the graph. Represented as:
[0131]
[0132] in, It is a multilayer perceptron; This represents the dimension of each spatially encoded geometric relation vector.
[0133] In this embodiment, the multilayer perceptron includes an input layer, a hidden layer, and an output layer connected in sequence. The input layer receives geometric spatial distances; the hidden layer processes the geometric spatial distances; and the output layer linearly projects the hidden state output by the hidden layer to obtain the output of the multilayer perceptron; this can be expressed by the formula:
[0134]
[0135]
[0136] in, For the hidden layer The hidden state of the layer output; and For the first Learnable weights and biases of layers; For activation functions; This is the output of the multilayer perceptron; and These are the weights and biases of the output layer, respectively.
[0137] 5-2-4. Extracting Geometric Self-Attention
[0138] As shown in Figure 4, the graph convolution output based on all nodes in the current layer... By using a learnable linear transformation matrix, the graph convolution output of the nodes is projected onto the query, key, and value space to obtain the query vector of the nodes. Key vector Sum value vector It can be expressed by the formula:
[0139]
[0140] in, They represent the first Layer query, key-value projection matrix; For node a in the th The graph convolution output of the layer.
[0141] To simultaneously consider the interactions of node features and their inherent geometric relationships when calculating attention, the query vector of the target node is... Key vectors of neighboring nodes Element-wise interaction results and geometric relationship vectors The vectors are concatenated to obtain the comprehensive input vector. This allows the calculation of attention weights to not only rely on the similarity of features between nodes, but also be strongly guided by the inherent structural relationships under various geometric spaces in the underlying knowledge graph, thus achieving the fusion of "feature interaction signals" and "geometric structure priors." (Comprehensive input vector) Represented as:
[0142]
[0143] in, This represents the element-wise multiplication operation; This indicates a vector concatenation operation.
[0144] The comprehensive input vector is then normalized sequentially using a feedforward network and a Softmax layer to obtain the attention weights. Using attention weights value vector of neighboring nodes Perform a weighted summation to obtain the target node. Attention output This allows the target node to prioritize neighbors that are not only matched at the feature level but also closely related at the knowledge graph structure level when aggregating neighbor information, thus making inferences that are more consistent with knowledge logic. Attention Output Represented as:
[0145]
[0146]
[0147]
[0148] in, The set of neighboring nodes of the target node; The original attention score for the target node; This represents the activation function of a linear rectifier unit with leakage. Indicates the first Attention parameter vector of the layer.
[0149] 5-2-5. Fusion of graph convolution output and attention output
[0150] To flexibly combine the local smoothing effect of graph convolution with the global structured focusing capability of geometric self-attention, a gated fusion mechanism is introduced. This mechanism uses a gate vector generated by the sigmoid function. Dynamically adjust the graph convolution output. With attention output The contribution ratio in the final output is used to weight and fuse the two outputs to obtain the final output. This achieves adaptive mode selection. The gating mechanism allows the model to autonomously decide, for each node at different network layers, whether to rely more on collaborative filtering signals from the local neighborhood or on global attention signals guided by knowledge relationships. This flexibility enables the model to handle different modes that may exist in different regions of the network, relying more on GCN in densely connected regions and more on attention in sparsely connected but knowledge-related regions. Final output... Represented as:
[0151]
[0152]
[0153] in, This represents the Sigmoid activation function; Indicates the first The layer's gate weight matrix; Indicates the first The gating bias vector of the layer.
[0154] 5-2-6. Extracting the final representation of entities
[0155] The final output will be determined based on the heterogeneity of node types (users and items). Divided into user representation and item representation The user representations and item representations of all layers are summed and aggregated separately to obtain the aggregated user representation vector. Item aggregation representation vector Multilayer perceptrons were used to aggregate the user representation vectors. Item aggregation representation vector Processing is performed to obtain the user's final response. and the final representation of the item A multilayer perceptron (MLP) consists of cascaded hidden layers and an output layer; the hidden layers consist of cascaded fully connected layers and a ReLU activation function; the output layer consists of cascaded fully connected layers and a Tanh activation function. Since different types of nodes (users / items) may play different roles in recommendation decisions, nonlinear transformations using independent MLPs can learn highly abstract user and item representations that better fit the final prediction target (e.g., click-through rate), achieving task-specific feature refinement. The final user representation... and the final representation of the item This can be expressed by the formula:
[0156]
[0157]
[0158] in, Multilayer perceptrons, one for users and one for items, are used to project aggregated representations onto the final representation space; The hidden layer weight matrix is... This is the hidden layer bias vector. This is the output layer weight matrix. This is the output layer bias vector.
[0159] 5-3. Score Prediction Module
[0160] In the score prediction module, the user's predicted score for the item is obtained based on the user's final representation and the item's final representation. Its expression is:
[0161]
[0162] The physical meaning of this formula lies in fusing two complementary matching signals: the first term is the vector inner product, used to measure the linear matching degree between users and items in the latent space, reflecting the element-wise synergistic effect between features; the second term is cosine similarity, used to capture the consistency between the two in direction, reflecting the degree of fit of the overall interest profile. Hyperparameters This is used to balance the contributions of these two signals, so that the prediction focuses on both the intensity matching of features and the similarity of pattern structure.
[0163] Step Six: Model Training
[0164] A heterogeneous collaborative recommendation model was trained using joint collaborative knowledge graph data. During training, a multi-task loss function was constructed to guide the parameter updates of the model. This multi-task loss function weightedly integrates supervision signals from three core aspects: recommendation tasks, contrastive learning, and knowledge embedding, ensuring the model simultaneously possesses high accuracy, strong robustness, and sound knowledge logic. The loss functions include contrastive loss, recommendation loss, and embedding loss, which are represented as follows:
[0165]
[0166] in, These are the contrast loss function, the recommendation loss function, and the embedding loss function, respectively. and These are the weighting coefficients for the contrastive loss and the embedding loss, respectively.
[0167] The construction process of the comparison loss function, recommendation loss function, and embedding loss function is as follows:
[0168] (1) Comparison of loss functions
[0169] As shown in Figure 5, a graph contrastive learning mechanism is introduced to achieve robustness in representation learning and alleviate the data sparsity problem commonly found in recommendation models. This mechanism creates different augmented views of the same graph data and trains the model to recognize the representation of the same node in different views, thereby learning essential features that are less sensitive to noise and have better generalization ability. Two contrastive views are generated from the original graph data using two different and complementary data augmentation strategies to simulate noise and missing data that may exist in the real world.
[0170] View 1: Edge Drop Enhancement
[0171] This strategy works by analyzing the edge set of the original graph. Perform random sampling to generate a subgraph ,in Edge drop probability That is, on average, 80% of the original edges are retained.
[0172] The physical significance of this enhancement lies in simulating the uncertainty or partial absence of interaction relationships. In real-world systems, observed user-item interaction records may only represent a portion of all potential interactions and may contain random noise. By randomly discarding edges, the model is forced not to overly rely on any single edge or small local structure in the graph, but must learn node representations that remain stable under perturbations of the overall connectivity pattern. This helps improve the model's robustness to sparse interactions and noisy data.
[0173] View 2: Feature Mask Enhancement
[0174] This strategy uses a randomly generated binary mask matrix consisting of 0s and 1s. The input feature matrix of the graph neural network Element-wise multiplication is performed, randomly setting some node feature dimensions to zero. Mask matrix. Each element in the matrix is independently set with a mask rate. Sampling from a Bernoulli distribution (i.e., set to 0), it is represented as:
[0175]
[0176] The physical significance of this enhancement lies in simulating partial loss or incomplete observation of node feature information. It forces the model to infer and complete the effective representation of nodes through graph structure (neighbor information) even when some feature information is obscured. This encourages the model to make greater use of the topological signals propagating in the graph, rather than relying solely on initial features, thereby enhancing the robustness of the representation to feature noise and promoting a balanced use of feature and structural information.
[0177] The physical significance of this step lies in generating a "multi-angle snapshot" for each node. For the same node (such as a user...) The final representation obtained through a graph attention network under two different augmented views. and This is considered a positive sample pair. Although the input data undergoes different perturbations, they originate from the same essential entity, therefore their deep representations should be close to each other in the feature space. For users... Its final statement With other users in the batch Final representation in View 2 These form negative sample pairs. The core objective of contrastive learning is to narrow the distance between positive sample pairs while widening the distance between negative sample pairs. The two enhanced views are then input into the heterogeneous collaborative recommendation model, and a contrastive loss function is constructed based on the final representation of the model. for:
[0178]
[0179]
[0180]
[0181] in, and These are the contrastive loss functions for users and items, respectively; These are the final representations of the user and items obtained from View 1, respectively. This represents the cosine similarity function, used to measure the degree of similarity between two vectors in a direction; For temperature parameters, This is used to adjust the sensitivity of the loss function to difficult negative samples. A smaller temperature parameter will make the model focus more on distinguishing positive samples from those very similar negative samples. and The final representations of users and items obtained from the view, respectively; This is a negative sample batch.
[0182] The physical meaning of this loss is "contrast discrimination". The model is trained to maximize the similarity score (numerator) of positive sample pairs (different views of the same user) while minimizing the similarity score (denominator) of negative sample pairs (views of different users). By optimizing this loss, the graph attention network learns to ignore the "surface" differences introduced by data augmentation and capture the most core and stable feature representations of node identity.
[0183] (2) Recommendation of loss function
[0184] Recommended loss function This includes the main recommendation loss and the auxiliary click-through rate (CTR) prediction loss. The main recommendation loss, based on Bayesian personalized ranking theory, optimizes the ranking quality of the recommendation list by maximizing the prediction scores of positive and negative samples. The auxiliary CTR prediction loss enhances the model's ability to model known preferences by directly fitting observed user interactions. Essentially, the auxiliary CTR prediction loss is a cross-entropy loss, whose optimization objective is to maximize the prediction probability of observed interactions (positive samples) while minimizing the prediction probability of unobserved interactions (negative samples). Recommendation Loss Function Represented as:
[0185]
[0186]
[0187]
[0188] in, The weight is 0.5; This represents the training sample set, where each sample... Includes users Positive sample items and negative sample items ; and These represent the user's prediction scores for positive and negative samples, respectively. It is the sigmoid function; The L2 regularization coefficient; Represents model parameters. This represents the set of edges in the user-item interaction graph; It is a binary tag that indicates to the user With items Whether there is actually any interaction between them (such as clicking or purchasing).
[0189] (3) Embedding loss function
[0190] Embedding loss function Including knowledge graph triple loss Geometric alignment loss and embedded smoothing regularization terms The knowledge graph triplet loss uses marginal ranking loss, which physically ensures that the scores of positive sample triples are consistent across the three geometric spaces: Euclidean, hyperbolic, and spherical. All are higher than their corresponding negative sample triple scores. At least above the margin This maintains the structural integrity of the knowledge graph. Geometric alignment loss aligns pairs of the same entity in different geometric spaces by minimizing the maximum mean difference (MMD). Tangent space representation , and Embedding loss function Represented as:
[0191]
[0192]
[0193]
[0194]
[0195] in, For embedding regularization coefficients; For negative sampling triples; These are marginal parameters; The set of node pairs participating in attention calculation (i.e., all node pairs corresponding to user-item interaction edges); They are nodes With nodes Distance in three geometric spaces: Euclidean, hyperbolic, and spherical.
[0196] To ensure the model can learn stably and efficiently and achieve optimal performance during training, a three-stage training strategy is adopted. The first stage uses the embedding loss function... As an optimization objective, in embedding loss The decline was less than 5 times in five consecutive rounds. Alternatively, the second phase can begin after 50 training rounds. The second phase uses a multi-task loss function. As an optimization objective, the third stage begins after the recommendation accuracy metric Recall@20 shows an improvement of less than 0.001 for 10 consecutive rounds or after 100 training rounds. The third stage focuses on the comparison loss function, recommendation loss function, and embedding smoothing regularization term. As the optimization objective, in the optimization objective The decline has been less than 55 consecutive rounds. Alternatively, the training process can be terminated after 50 rounds of training.
[0197] In the first stage, the model temporarily removes the objectives related to the recommendation task. and This focuses on optimizing the multi-geometric representation of the knowledge graph itself. Its physical significance lies in "laying a solid foundation of knowledge first": by minimizing the embedding loss function. This allows the model to learn accurate, consistent, and smooth entity and relation representations in Euclidean, hyperbolic, and spherical spaces without being influenced by recommendation signals. This enables the subsequent recommendation module to learn based on high-quality knowledge features, avoiding the difficulty of learning knowledge representations and recommendation strategies from scratch.
[0198] In the second stage, while maintaining its existing knowledge structure, the model learns how to use this knowledge to optimize the recommendation task. ), and utilize comparative learning ( This enhances the robustness of the representation. This is a delicate balancing process where the model learns to deeply integrate knowledge semantics, user behavior, and graph structure information.
[0199] In the third stage, assuming the basic knowledge structure has been fully preserved in the model parameters, this constraint is relaxed, allowing the model more freedom to adjust its parameters. All capacity is then focused on maximizing the final recommendation performance metric and combating potential overfitting. At this point, contrastive loss is used. As an effective regularization method, it is retained to ensure the robustness of the representation. The three-stage training strategy effectively solves the training instability problem caused by target conflict in multi-task learning by introducing different loss targets in stages and with emphasis.
[0200] Step 7: Generate Recommendations
[0201] Use the trained heterogeneous collaborative recommendation model to obtain the predicted scores of a specified user for all items. Based on predicted scores Select the item with the highest predicted score from all items. Each item generates its personalized Top-K recommendation list, represented as follows:
[0202]
[0203] To overcome the inherent flaw of collaborative filtering algorithms that easily lead to "information cocoons" and to avoid overly homogeneous items in the recommendation list, a diversity enhancement mechanism is introduced. This mechanism first quantifies the recommendation list. diversity :
[0204]
[0205] Its physical meaning is to calculate the average dissimilarity between all pairs of items in the recommendation list. The higher the value, the more dispersed the content or characteristics of the items in the list are, and the better the diversity.
[0206] During the generation of the recommendation list, for all items Predicted score Make real-time adjustments to obtain the adjusted predicted score. for:
[0207]
[0208] in, This is a hyperparameter.
[0209] The core physical significance of this design lies in introducing exploratory incentives: when a new object... After adding it, if it can improve the overall diversity of the current recommendation list (i.e.) If the value is large, then its final score will receive a positive reward. Hyperparameters By controlling the weight of diversity in the final decision, the system can proactively and controllably break the "information cocoon" while ensuring the accuracy of recommendations, thereby enhancing the breadth and novelty of the user experience.
[0210] Based on adjusted predicted scores Regenerate the recommendation list This completes the generation of recommendations for the target users.
Claims
1. A heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning, characterized in that: The method includes: acquiring joint collaboration knowledge graph data; the joint collaboration knowledge graph data includes a user-item interaction bipartite graph and an entity knowledge graph; the user-item interaction bipartite graph includes a user set, an item set, and interaction behaviors; the entity knowledge graph includes head entities, tail entities, and relations; constructing embedding vectors for head entities, tail entities, and relations in the entity knowledge graph respectively, and obtaining the entity representation of the head entity based on the embedding vectors of the tail entity and relations; mapping the entity representation to a geometric space to generate the corresponding geometric space embedding; mapping the geometric space embedding to a tangent space to obtain the tangent space representation; obtaining the corresponding geometric space distance based on the geometric space embedding of the entity pair; and constructing a heterogeneous collaborative recommendation model; The heterogeneous collaborative recommendation model comprises a multi-geometric space interactive attention network, a graph convolutional attention network, and a score prediction module connected in sequence. The multi-geometric space interactive attention network is used to interact and fuse the tangent space representations to obtain a unified representation vector of entities. The graph convolutional attention network is used to extract the final representation of entities. The score prediction module is used to obtain the user's predicted score for items based on the final representation of entities. The heterogeneous collaborative recommendation model is trained using joint collaborative knowledge graph data, and the trained heterogeneous collaborative recommendation model is used to obtain the target user's predicted scores for all items. Candidate items are selected from all items based on the magnitude of the predicted scores, and a recommendation list is generated based on the candidate items.
2. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 1, characterized in that: In each layer of the graph convolutional attention network, a graph convolution operation is performed on the graph convolution output of the previous layer to obtain the graph convolution output of the current layer; the graph convolution output is projected into a query vector, a key vector, and a value vector; geometric spatial distance is introduced to interact with the query vector, key vector, and value vector to obtain the attention output; the attention output and the graph convolution output are fused to obtain the final output of the current layer; a linear transformation is performed on the sum of the final outputs of all layers in the graph convolutional attention network to obtain the final representation of the entity.
3. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 2, characterized in that: The interaction process of the query vector, key vector and value vector is as follows: the element-wise interaction result of the query vector of the target entity and the key vector of the neighboring entities is concatenated with the encoded geometric space distance, and the concatenation result is normalized to obtain the attention weight. The target node is obtained by weighting and summing the value vectors of its neighbors using attention weights. Attention output.
4. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 1, characterized in that: The geometric spaces include Euclidean space, hyperbolic space, and spherical space.
5. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 4, characterized in that: In the cross-attention module, the query matrix, key matrix, and value matrix corresponding to the slicing space representation are obtained. The value matrix corresponding to the target slicing space representation is interacted with the query matrix and key matrix corresponding to the other two slicing space representations to obtain the attention feature vector of the target slicing space. After performing a linear transformation on the attention feature vector of the slicing space, it is fused with the corresponding slicing space representation to obtain the enhanced representation of the slicing space. The enhanced representations of different slicing spaces are concatenated to obtain the unified representation vector output by the cross-attention module.
6. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 1, characterized in that: The method for obtaining the entity representation is as follows: concatenate the embedding vectors of the tail entity and the relation, and extract the mean of the concatenation results corresponding to all outgoing edges of the head entity as the entity representation.
7. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 1, characterized in that: During training, a multi-task loss function is constructed to guide the parameter updates of the heterogeneous collaborative recommendation model; the multi-task loss function includes a contrast loss function, a recommendation loss function, and an embedding loss function; the contrast loss function is constructed by generating two contrast views using different data augmentation strategies; Positive and negative sample pairs are constructed using the results of a convolutional attention network input graph from two contrasting views. A contrastive loss function is constructed based on the positive and negative sample pairs corresponding to users and items. The recommendation loss function is constructed as follows: a main recommendation loss is constructed by maximizing the predicted scores of positive and negative samples; an auxiliary click-through rate (CTR) prediction loss is constructed by maximizing the predicted scores of positive samples and minimizing the predicted scores of negative samples; the main recommendation loss and the auxiliary CTR prediction loss are combined to obtain the recommendation loss function. The embedding loss function is constructed as follows: a knowledge graph triplet loss is constructed based on the deviation between the scores of positive sample triplets and their corresponding negative sample triplets in the geometric space; a geometric space alignment loss is constructed by minimizing the maximum mean difference between different tangent space representations; the knowledge graph triplet loss and the geometric space alignment loss are combined, and an embedding smoothing regularization term is introduced to obtain the embedding loss function.
8. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 7, characterized in that: During training, a three-stage training strategy is adopted to train the model; the first stage uses the embedding loss function as the optimization objective; the second stage uses the multi-task loss function as the optimization objective. The third stage uses the contrastive loss function, the recommendation loss function, and the embedding smoothing regularization term as optimization objectives.
9. The heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning according to claim 1, characterized in that: After obtaining the predicted scores, the predicted scores for each item are adjusted, and the recommended list is regenerated using the adjusted predicted scores. The method for adjusting the predicted scores is as follows: the diversity of the recommended list is obtained based on the average dissimilarity between different items in the recommended list; the predicted score of the new item is adjusted based on the diversity after adding the new item to the recommended list.
10. A heterogeneous collaborative recommendation system based on multi-geometric interaction embedding and graph convolutional contrastive learning, characterized in that: This system is used to execute a heterogeneous collaborative recommendation method based on multi-geometric interaction embedding and graph convolutional contrastive learning as described in claim 1. The heterogeneous collaborative recommendation system includes a data acquisition module, a data processing module, a fusion module, a graph attention network module, a score prediction module, and a recommendation generation module. The data acquisition module constructs knowledge graph triples and user-item interaction graphs from raw data. The data processing module performs tangent space representation of head entities through multi-space mapping and tangent space projection. The fusion module performs input feature fusion through cross-attention. The graph attention network module performs message propagation, geometric relationship encoding, and structure-aware attention aggregation on the interaction graph. The score prediction module obtains the user's predicted score for an item based on the results of the graph attention network module. The recommendation generation module generates a final recommendation list based on the target user's predicted score for the item.