Personalized recommendation method and system based on semantic dynamic aggregation and meta-contrast learning

By combining semantic dynamic aggregation with meta-contrastive learning, the problem of heterogeneity in knowledge graphs and the fixed temperature parameter in traditional contrastive learning is solved, thereby improving the feature representation ability and generalization performance of the recommendation system and achieving more accurate personalized recommendations.

CN121526727APending Publication Date: 2026-02-13ANHUI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511509963.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing recommendation systems suffer from insufficient generalization ability and inaccurate recommendation results due to the heterogeneity of knowledge graphs, fine-grained semantic confusion, and the fixed temperature parameter problem of traditional contrastive learning.

Method used

We employ a semantic dynamic aggregation and meta-contrastive learning approach. By using split attention feature enhancement, adaptive sparse gating, and meta-contrastive learning, we dynamically adjust weights and temperature parameters to improve the model's ability to perceive heterogeneous relationships and its feature representation.

Benefits of technology

It effectively alleviates the problems of data sparsity and noise interference, and enhances the generalization performance of the model and the accuracy and diversity of recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0576EBD0-043F-4633-839B-53D2F9AFE30F
    Figure 0576EBD0-043F-4633-839B-53D2F9AFE30F
  • Figure 0859C4F9-C345-48FA-8345-3734777A833C
    Figure 0859C4F9-C345-48FA-8345-3734777A833C
  • Figure 0ABFB4AC-E985-45F7-B79F-30ECCB5C3EA6
    Figure 0ABFB4AC-E985-45F7-B79F-30ECCB5C3EA6
Patent Text Reader

Abstract

The invention relates to the technical field of personalized recommendation, in particular to a personalized recommendation method and system based on semantic dynamic aggregation and meta-contrast learning, and the method comprises the steps: S1, data preprocessing; s2, semantic perception dynamic weight generation; s3, enhancing split attention features; s4, self-adaptive sparse gating is carried out; s5, dynamically aggregating heterogeneous knowledge; s6, performing meta-contrast learning; and S7, recommendation generation. According to the method, interpretable heterogeneous convolution dynamic aggregation of the knowledge graph is realized, an attention mechanism is adopted to further reinforce feature representation, a meta-contrast learning mechanism is introduced, double contrast signals of an interaction view and a semantic view are constructed, and adaptive temperature adjustment and semantic perception negative sampling strategies are combined to obtain a high-resolution image. Therefore, the aspects of fine-grained semantic perception and dynamic environment adaptation are obviously improved; the IDAMCR decomposes the multi-source features into independent subspaces and performs targeted optimization, so that the feature expression ability is effectively improved, the problems of data sparsity and noise interference are relieved, and the generalization performance of the model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of personalized recommendation technology, specifically to a personalized recommendation method and system based on semantic dynamic aggregation and meta-comparative learning. Background Technology

[0002] Recommender systems construct intelligent filtering mechanisms for predicting user preferences and matching content from massive amounts of information through algorithmic models. Their core task is to learn users' historical interaction behavior and infer interest scores for uninterrupted items, thereby generating personalized recommendations. Collaborative filtering, as a classic recommendation paradigm, has significantly improved its representation capabilities in recent years by incorporating techniques such as variational autoencoders and attention mechanisms; however, its performance is still generally limited by the sparsity of user-item interaction data. Therefore, knowledge graphs have been introduced into recommender systems as auxiliary information sources. Their semantic networks, through rich entity relationships and multi-hop paths, help to refine the modeling of deep semantic associations. Knowledge-aware recommendation methods based on graph neural networks (such as graph propagation and multi-hop semantic aggregation) have become a cutting-edge research direction.

[0003] However, existing knowledge perception methods mainly rely on supervised learning, and the sparsity of interaction data often leads to insufficient supervision signals, limiting the model's generalization ability. Contrastive learning, through self-supervision, mines implicit user-item relationships, significantly improving recommendation performance in long-tail scenarios while enhancing representation decoupling capabilities, and has become an important approach to alleviate the data sparsity problem.

[0004] Nevertheless, existing recommendation algorithms still have the following key limitations: (1) Insufficient utilization of the heterogeneity of knowledge graphs: The heterogeneity of knowledge graphs places higher demands on the aggregation mechanisms of graph neural networks. However, most graph neural networks are only applicable to homogeneous graphs (where all nodes and edges are of the same type), making it difficult to effectively capture semantic differences in heterogeneous relationships. Existing GNN-based recommendation models typically use fixed aggregation patterns (such as average pooling) to process the neighborhood information of item nodes, failing to dynamically perceive differences in neighborhood importance under different semantic environments. This leads to problems such as the accumulation of noise in high-order neighborhood information and exacerbated semantic sparsity.

[0005] (2) Fine-grained semantic confusion and limitations in feature representation: Traditional neighborhood aggregation operations forcibly compress features of heterogeneous relationships into a single representation space, resulting in the loss of fine-grained semantic information. This leads to recommendations biased towards less relevant categories and a lack of dynamic semantic awareness of different relationship types. This not only ignores the potential value of long-tail items but also limits the efficient use of the rich information in knowledge graphs, ultimately affecting the accuracy and diversity of recommendation results.

[0006] (3) Traditional contrastive learning struggles to generate high-quality supervision signals: Temperature parameters control the smoothness of similarity in contrastive learning, directly affecting the discriminative power and gradient magnitude of positive and negative sample pairs. Traditional methods typically use fixed temperature parameters, which are difficult to adapt to the heterogeneous distribution of user behavior in recommendation systems: popular items require lower temperatures to enhance discriminative power, while long-tail items require higher temperatures for smooth optimization. Furthermore, traditional strategies either use all negative samples, leading to memory overflow, or employ random negative sampling to introduce a large number of low-information negative examples, both of which blur the contrastive signal and reduce learning efficiency.

[0007] To address the aforementioned issues, we propose a personalized recommendation method and system based on semantic dynamic aggregation and meta-contrast learning. Summary of the Invention

[0008] The purpose of this invention is to provide a personalized recommendation method and system based on semantic dynamic aggregation and meta-contrast learning, so as to solve the problems mentioned in the background art.

[0009] To achieve the above objectives, the present invention provides the following technical solution: a personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning, characterized in that it includes: S1. Data preprocessing: Obtain user-item interaction data and knowledge graph triple data, filter sparse data, and divide them into training set, validation set and test set according to 7:2:1; S2. Semantic-aware dynamic weight generation: Entity and relation embeddings are initialized using TransE, triple similarity and importance scores are calculated, and attention weights are generated using softmax. S3, Split Attention Feature Enhancement: Group neighbor triples by relationship and split within each group. Generate enhanced entity representations through global average pooling and attention weighting. S4. Adaptive Sparse Gating: Construct a gated network to calculate the gating value of the edges, introduce dynamic sparsity rate constraints and sparse loss, and filter out noisy edges; S5. Heterogeneous knowledge dynamic aggregation: Based on attention weights and gating values, aggregate item embeddings in a hierarchical manner, and then aggregate user embeddings through user-item interaction graphs; S6, Meta-contrastive learning: The inner loop generates task-specific parameters and adaptive temperature, while the outer loop optimizes global parameters to enhance the generalization of the representation; S7. Recommendation Generation: Calculate the similarity between user and item embeddings to generate a Top-K recommendation list.

[0010] Preferably, step S2 includes the following specific steps: The translation-based embedding method TransE is used to initialize entities and relations. For any valid triple... The embedding vector of the tail entity should be close to the embedding vector of the head entity plus the displacement vector corresponding to the relation, that is: Embedding vectors of head entity, tail entity, and relation can be obtained. and ; make express The norm is used as a function to measure the similarity of embedded vectors. For a given triple, it can be represented as: knowledge graph Randomly replace the tail of the triplet to obtain the negative sample. ,use Let denot sigmoid function, then the optimization loss function for the initial embedding of the knowledge graph can be defined as shown in equation (3): To capture the impact of different relations on node semantics, a relation-specific linear transformation matrix is ​​introduced; For each type of relation Define a transformation matrix This is used to transform the features of neighboring nodes: This yields the initial node representation for relationship awareness, providing a foundation for subsequent aggregation.

[0011] Preferably, in step S2, interpretability scores are assigned to the global triples, as shown in equation (5): in , It is a trainable attention weight matrix. This represents element-wise multiplication. Through the above calculation, each triple will obtain a "score" that reflects its importance in helping to predict user preferences; By reducing the number of neighbors of the head entity The effect of weighted scores is normalized using the softmax function to make the explanatory scores of different neighbors of the same head entity comparable: The resulting relation-aware weights can effectively distinguish the importance of different neighbor nodes, making the model more focused on high-value neighbors carrying strong signals, while enhancing the interpretability of the recommendation results.

[0012] Preferably, step S3 includes the following specific steps: First, the head entity set of all neighbor triples Classified by relation type A set of disjoint base arrays: in, , Representing the A base array containing all relation types. Base array The larger the value, the finer the feature clustering. For each basis array... We generate a group representation vector for each relation group. : in This represents the introduced relation-specific transformation matrix used to transform the tail entity. Embedded projection onto relation A more relevant semantic space, For relationship Embedded vector, Represents "relationship type" The overall semantic information contained in the group.

[0013] To generate attention weights, we need to capture the global contextual information for each semantic unit. For each group representation vector... Perform global average pooling (GAP) to compress it into a scalar representing the set of global contexts: .

[0014] Preferably, in step S3, the further steps are as follows: Further splitting sub-features within each basis array This represents the number of splits within the base array. The larger the value, the more branches there are within each basis array, allowing for the capture of more complex feature interactions. To ensure the weights are comparable across different perspectives, we normalize the statistics along the split Radix dimension and compute the values ​​for each semantic unit. Normalized attention weights :

[0015] Preferably, in step S3, the further steps are as follows: Based on attention weights, for each semantic unit after splitting The features from all perspectives are weighted and summed to generate the first... Layered entity Final reinforcement representation: This module constructs a complete feature enhancement chain: first, multi-view semantic modeling is achieved through channel splitting; then, dynamic feature selection is achieved through an attention mechanism; and finally, dimensionality consistency is restored through linear reconstruction.

[0016] Preferably, it includes: Data preprocessing module: used to perform step S1 as described in claim 1, to collect, filter and classify user-item interaction data and knowledge graph data; Semantic-aware dynamic weight module: used to execute step S2 as described in claim 1, to realize the embedding initialization of entities and relations and the calculation of triplet attention weights; Split attention feature enhancement module: used to perform step S3 as described in claim 1, to realize the grouping, splitting and enhancement of entity representation of neighbor triples; Adaptive sparse gating module: used to execute step S4 as described in claim 1, to calculate the gating value and filter noise edges; Heterogeneous knowledge dynamic aggregation module: used to execute step S5 as described in claim 1, to realize hierarchical aggregation and cross-layer fusion of user embedding and item embedding; Meta-comparison learning module: used to execute step S6 as described in claim 1, to realize the processing of support set and query set, generation of adaptive temperature and optimization of global parameters; Recommendation generation module: used to perform step S7 as described in claim 1, to realize similarity calculation and generation of Top-K recommendation list.

[0017] Compared with the prior art, the beneficial effects of the present invention are: This invention achieves interpretable heterogeneous convolutional dynamic aggregation of knowledge graphs and further enhances feature representation using an attention mechanism. Simultaneously, a meta-contrast learning mechanism is introduced to construct dual contrast signals for the interactive view and the semantic view. Combined with adaptive temperature adjustment and semantic-aware negative sampling strategies, significant improvements are achieved in fine-grained semantic perception and dynamic environment adaptation. IDAMCR decomposes multi-source features into independent subspaces and performs targeted optimization, effectively improving feature representation capabilities, alleviating data sparsity and noise interference problems, and enhancing the model's generalization performance.

[0018] This chapter provides a detailed introduction and theoretical analysis of the IDAMCR model, explaining the design philosophy of its core modules. Through systematic experiments on real-world datasets, the model is compared with various baseline methods to verify its effectiveness and the contributions of each component. Attached Figure Description

[0019] Figure 1This is a schematic diagram of the structure of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] The IDAMCR model employs a propagation-based knowledge perception model, leveraging knowledge graphs to capture deep interaction information between users and items. This model effectively captures high-order semantic relationships by dynamically aggregating multi-hop neighborhood information from the knowledge graph and then enhancing the aggregated representations to enrich entity representations. Furthermore, the model introduces meta-learning and contrastive learning mechanisms, improving the accuracy of similarity judgments between sample pairs through a multi-view comparison strategy. The overall structure of IDAMCR is as follows: Figure 1 As shown, it mainly consists of five core modules: semantic awareness dynamic weight generation, split attention feature enhancement, adaptive sparse gating, heterogeneous knowledge dynamic aggregation, and meta-contrastive learning.

[0022] (1) Semantic perception dynamic weight generation Traditional graph neural networks (GNNs) struggle to effectively distinguish the importance of different neighboring nodes when processing heterogeneous knowledge graphs. To address this issue, this module proposes a semantically aware dynamic weight generation mechanism that assigns corresponding attention weights to each triple in the knowledge graph. Based on different relation types and node features, this mechanism distinguishes the semantic importance of each element in heterogeneous relations, thereby extracting crucial semantic information for recommendation tasks from complex knowledge structures. It also assigns dynamic and interpretable weights to neighborhood information, ultimately enabling global knowledge triples to obtain interpretable importance scores.

[0023] The dataset used in this invention is in the format of knowledge graph triples as input. After reading the data, the model traverses each triple, extracting the head entity, tail entity, and relation to complete the construction of the knowledge graph. Subsequently, the entities and relations in the graph are mapped to a low-dimensional dense vector space for representation learning.

[0024] The translation-based embedding method TransE is used to initialize entities and relations. For any valid triple... The embedding vector of the tail entity should be close to the embedding vector of the head entity plus the displacement vector corresponding to the relation, that is: Embedding vectors of head entity, tail entity, and relation can be obtained. and ( (For the dimension of embedding). Let express The norm is used as a function to measure the similarity of embedded vectors. For a given triple, it can be represented as: knowledge graph Randomly replace the tail of the triplet to obtain the negative sample. ,use Let denot sigmoid function, then the optimization loss function for the initial embedding of the knowledge graph can be defined as shown in equation (3): To capture the impact of different relations on node semantics, this module introduces a relation-specific linear transformation matrix. For each relation type... Define a transformation matrix This is used to transform the features of neighboring nodes: This yields the initial node representation for relationship awareness, providing a foundation for subsequent aggregation.

[0025] In the propagation of knowledge graphs, neighboring entities have varying importance in different contexts. To filter information crucial for recommendations and enhance interpretability, this module borrows from graph attention mechanisms, assigning an interpretable attention weight to each triple. This weight identifies the triple's contribution to collaborative interactions, overcoming the problem of traditional GNNs ignoring heterogeneous semantic differences during homogeneous aggregation. (Refer to Yang...) REF _Ref188473734 \r \h \* MERGEFORMAT [4] Based on the knowledge rationalization mechanism proposed by others, this module assigns interpretability scores to its global triples, as shown in equation (3-1): in , It is a trainable attention weight matrix. This represents element-wise multiplication. Through the above calculation, each triple receives a "score" that reflects its importance in helping predict user preferences. This is achieved by reducing the number of neighbors of the head entity. To normalize the weighted scores, we use the softmax function to ensure comparability of explanatory scores among different neighbors of the same head entity. The resulting relation-aware weights can effectively distinguish the importance of different neighbor nodes, making the model more focused on high-value neighbors carrying strong signals, while enhancing the interpretability of the recommendation results.

[0026] (2) Enhanced split attention features Traditional knowledge perception models usually treat all feature channels equally and place all types of neighbor relationships on the same dimension for competition, lacking explicit modeling of macro-semantic differences between different relationship groups. For example, in movie recommendation, the semantic importance conveyed by the "director" relationship group as a whole may be significantly higher than that of the "color" relationship group, indicating that there are still multi-perspective and fine-grained semantic information within the features that have not been fully explored. This uniform processing method limits the model's ability to distinguish heterogeneous semantic relationships, resulting in limited feature expression ability and recommendation performance. Influenced by existing research [1], we introduce the SplitAttention mechanism to achieve adaptive enhancement of multi-source heterogeneous features, further improving the model's discriminative ability and interpretability.

[0027] The Split Attention Feature Enhancement module aims to strengthen the feature representations of users, items, and knowledge graph entities. By capturing fine-grained feature interactions from multi-source information, it achieves selective feature enhancement. This mechanism splits feature channels and applies attention weights, enabling the model to dynamically focus on key semantic channels, suppressing noise or redundant information, thereby improving recommendation accuracy and enhancing interpretability.

[0028] This module employs a dual grouping strategy combining cardinality and radix to achieve structured decomposition of input features and capture of semantic patterns.

[0029] Grouping by relation type: First, the head entity set of all neighbor triples Classified by relation type A set of disjoint base arrays: in, , Representing the A base array containing all relation types. Base array The larger the value, the finer the feature clustering. For each basis array... We generate a group representation vector for each relation group. : in This represents the introduced relation-specific transformation matrix used to transform the tail entity. Embedded projection onto relation A more relevant semantic space, For relationship Embedded vector, Represents "relationship type" The overall semantic information contained in the group.

[0030] To generate attention weights, we need to capture the global contextual information for each semantic unit. For each group representation vector... Perform global average pooling (GAP) to compress it into a scalar representing the set of global contexts: Splitting within the radix array: Further splitting sub-features within each basis array This represents the number of splits within the base array. The larger the value, the more branches there are within each basis array, allowing for the capture of more complex feature interactions. To ensure the weights are comparable across different perspectives, we normalize the statistics along the split Radix dimension and compute the values ​​for each semantic unit. Normalized attention weights : Feature-weighted fusion: Based on attention weights, for each semantic unit after splitting The features from all perspectives are weighted and summed to generate the first... Layered entity Final reinforcement representation: This module constructs a complete feature enhancement chain: first, multi-view semantic modeling is achieved through channel splitting; then, dynamic feature selection is achieved through an attention mechanism; and finally, dimensionality consistency is restored through linear reconstruction. The entire process significantly improves the model's ability to perceive fine-grained semantics and the discriminative power of feature representation.

[0031] (3) Adaptive sparse gating mechanism Traditional knowledge graph aggregation methods often overlook the differences in information importance and redundancy between different relations, leading to the introduction of invalid information by some low-frequency relations or noisy edges, thus affecting recommendation performance. To address this issue and overcome the limitations of existing filtering methods (such as fixed thresholds or random deactivation) in adapting to the complex structure and dynamic characteristics of knowledge graphs, AdaSparse... REF _Ref188473734 \r \h \* MERGEFORMAT [4]Inspired by [previous theories], we propose an adaptive sparse gating mechanism. This mechanism applies sparsity constraints through a learnable gating network, assigning higher gating values ​​to strong relationships (such as purchases and favorites) and lower gating values ​​to weak relationships (such as browsing and accidental clicks), thereby achieving binarized filtering of edge features. Only edges with high information content are retained for aggregation, effectively filtering noisy edges and thus improving aggregation quality and model efficiency.

[0032] Gated networks are constructed by splicing together the features of nodes connected by edges in a knowledge graph. As input, a lightweight gating network is used to independently compute the gating value for each edge, as shown in the formula: Gating value This reflects the informational importance of the edge (h, t): the closer the value is to 1, the more likely the edge should be activated; conversely, it should be suppressed. To reduce parameter complexity, we employ a globally shared threshold mechanism and use a two-layer perceptron (MLP) to better model complex semantic relationships in knowledge graphs.

[0033] In binary gating methods (i.e., gating values) ), traditional Norm regularization struggles to precisely control sparsity, easily leading to issues like unsuppressed redundant edges or incorrectly pruned important edges. To address this, we introduce a "dynamic sparsity constraint" mechanism, which presets a sparsity boundary... (For example, [0.15, 0.25] represents retaining 15% to 25% of the active edges) to guide the distribution of the gating values ​​to meet the expected sparsity. The gating values ​​are determined by... The gated vector obtained after embedding The sparsity ratio is defined as: in Representing the gate vector Norm, For the first The number of neurons in a layer. For example, when the sparsity... A gating value of 0.2 indicates that 20% of the gating values ​​in this layer are active (gating value 1), while the remaining 80% are suppressed (gating value 0). To encourage redundant edges to gradually converge to zero during training, we introduce a flexible sparsity regularization method to control the gating value. The learning, in order to force the actual sparsity Approaching the preset target We introduce a mean squared error loss term: in, Represents the number of network layers. The dynamic balancing weights are determined according to the following rules: 1) If Within the preset boundaries, No regularization pressure is applied; 2) If Deviating from the boundary, It increases linearly with the degree of deviation, in order to drive Converges to the target value.

[0034] Initial settings The gating value is gradually increased during training to ensure the model focuses on learning gating patterns early on, while sparsity constraints are strengthened later. This is to enforce the gating value. To threshold Since the direction of convergence is convergent, we introduce a sparsity loss function: in It is the regularization coefficient. This represents the total number of edges. Adaptive sparsity is achieved by minimizing the absolute error between the gate value and the threshold. This mechanism can automatically adjust the gate state, effectively suppressing noisy edges and retaining edges with high information content, thereby achieving an adaptive balance between noise filtering and information preservation.

[0035] (4) Dynamic aggregation of heterogeneous knowledge After completing the semantic-aware dynamic weight generation and adaptive sparse gating, the above information needs to be integrated through an efficient dynamic aggregation process. This process is responsible for aggregating the propagated information from neighboring nodes and is a key step in the entire recommendation model. Dynamic information aggregation aims to achieve refined fusion of multi-relationship information in the knowledge graph, in order to solve the problem that the fixed weight mechanism in traditional aggregation methods is difficult to capture the dynamic characteristics of relationships and information redundancy, thereby improving the recommendation system's ability to model complex semantic relationships.

[0036] Based on the knowledge triple importance score (formula) and sparse gating value (formula) generated by the dynamic weighting proposed above, dynamic weighting can be performed according to the semantic importance of adjacent entities, and the gating mechanism can be used to strengthen important edges and suppress redundant or noisy edges. To construct a heterogeneous knowledge aggregator, we embed relational context information into the representation of adjacent entities, and regulate the propagation process of information from neighbors to the central node according to the dynamic weights and gating values. The specific aggregation formula is as follows: in, Represents the number of aggregation layers. For element-wise multiplication, This represents a first-order neighbor subgraph centered on nodes. The formula first injects relational context into the entity representation by element-wise multiplication of embedding vectors, bridging the semantic gap between interpretive weights and the aggregation process. Then, it considers the contextual relationships between knowledge entities and weights the head entity with neighbor information based on normalized interpretive scores. Furthermore, it combines gating values ​​to filter redundant edges and enhance strong relational edges, thereby achieving dynamic and refined aggregation of nodes in the knowledge graph.

[0037] Through the hierarchical propagation mechanism described above, we can obtain the structured representation of items in each layer after dynamic aggregation. Finally, through cross-layer summation and fusion, we obtain the final embedded representation of the items: Since the set of items is a subset of the entities in the knowledge graph, i.e., items In a knowledge graph, it is equivalent to an entity. and To model the collaborative signals between users and items, we further adopt a bottom-up propagation approach, using a user-item interaction graph. knowledge graph Item information is propagated to user nodes, and user embedding is obtained through the following formula: in This represents the first step in the information dissemination process of a knowledge graph. Layer Item Entity Embedded, This represents a first-order neighbor subgraph centered on the user. Similarly, different layers of the entire knowledge graph are represented. The dynamic aggregation results of the nodes are summed to obtain the final representation of the user: The heterogeneous knowledge dynamic aggregation module effectively captures the complex semantic relationships between user-item interactions and knowledge graphs through hierarchical propagation and cross-layer fusion, realizing refined modeling of heterogeneous neighborhood structures and significantly improving the system's robustness in noisy environments and the interpretability of recommendation results.

[0038] (5) Meta-contrastive learning In contrastive learning-based knowledge graph recommendation systems, learning high-quality user and item representations is a core challenge. Traditional contrastive learning methods typically employ fixed temperature hyperparameters, making it difficult to handle the dynamic changes in the semantic association strength between different entities in the knowledge graph, as well as the differentiated requirements for contrastive learning strength across different tasks.

[0039] To address this issue, we propose a contrastive learning module called MetaContrast, which integrates the rapid adaptation approach of meta-learning with dynamic temperature scaling techniques. This module endows the model with the ability to "learn" through a meta-learning mechanism, enabling it to rapidly generate model parameter increments based on feedback from the support set (in the form of rationalized features and loss gradients). This allows the encoder to agilely adjust according to the characteristics of the current data, achieving efficient "contextual learning" and thus enhancing the model's generalization ability. Simultaneously, the module dynamically calculates temperature parameters based on the semantic similarity of positive sample pairs, automatically adjusting the sensitivity of the contrastive loss to difficult samples, achieving more robust and intelligent representation learning.

[0040] The core of the meta-contrastive learning module is a two-layer optimization mechanism based on an inner loop and an outer loop, as shown in the figure (figure numbers should be inserted according to the actual situation). The inner loop generates task-specific parameters on the support set using a meta-learner, quickly adapting to the local knowledge graph structure. This process simulates the human ability to rapidly generalize knowledge from new domains, such as quickly identifying the association between "diving equipment" and "outdoor sports" in an e-commerce scenario. The outer loop encodes features on the query set using the adapted parameters and optimizes the global model parameters through contrastive loss, ensuring the generalization of knowledge representation.

[0041] We have used and We will use a portion of the item representations from the user-item interaction graph and the knowledge view, respectively. As the support set and query set, and as the input to this module, we assume the number of samples in the support set is [number missing]. The number of samples in the query set is .

[0042] Rapid adaptation of internal circulation: Within the inner loop, the module utilizes the support set for rapid adaptation, first defining meta-initialized hyperparameters that the encoder can use for training. neural networks Feature extraction is performed on the support set: We calculate the mean of the features from the two views, concatenate them, and then input them into a small network to generate sample-level temperatures: in This represents a concatenation operation. After concatenation, the data passes through a small MLP and outputs a scaling factor. Represents the base temperature value. Ensure the temperature is within By varying the temperature within a certain range, adaptive temperature parameters can be obtained. .

[0043] To ensure alignment of item representations across views and avoid overfitting and spurious negatives, we employ a contrastive learning objective. A random sample is assigned as a negative sample for each view, and a similarity matrix is ​​calculated: ,but express The Middle One sample and The Middle Cosine similarity of samples.

[0044] For each sample Treating these as anchor points, the loss of the entire support set is the average of the losses of all anchor points: Subsequently, a meta-learner Generate parameter increments based on the gradient information of the inner loop loss: Outer loop optimization: Increment of parameters generated by the inner loop Apply to encoders: The adapted query representation is obtained: Recalculate the temperature parameters to adapt to the new characteristics: Calculate query loss: Experiment and Results Analysis: (1) Dataset To comprehensively evaluate the model's performance, this chapter conducts experiments on three publicly available large-scale datasets: Alibaba-iFashion, Last-FM, and MIND. These datasets differ significantly in terms of domain background, scale, and sparsity, effectively validating the model's generalization and robustness in different real-world scenarios.

[0045] Alibaba-iFashion originates from Alibaba's online shopping platform and includes user interactions with fashion products, making it suitable for e-commerce recommendation scenarios. Last-FM is extracted from the Last.fm music website and records users' listening behavior towards artists, making it suitable for music recommendation tasks; MIND contains user interaction logs and news articles on the Microsoft News platform, making it suitable for news recommendation research.

[0046] To ensure data quality, we filtered out users and items that appeared less than 10 times and removed the corresponding sparse interaction records. The remaining interaction data was randomly divided into training, validation, and test sets in a 7:2:1 ratio. Basic information about these datasets is shown in Table 3-1. Table STYLEREF 1 \s 3 SEQ Table * ARABIC \s 1 1 Dataset Information Experimental environment and parameter settings: The hardware environment for this experiment consisted of an NVIDIA GeForce RTX 4060 Laptop GPU (8GB VRAM) and a 64-bit Windows 11 operating system, using Python 3.9 as the programming language. The experiment primarily relied on the PyTorch 1.13.0 framework, and depended on basic libraries such as NumPy 1.24.0 and Scikit-learn 1.2.2, with CUDA version 11.6. Model parameters were initialized using the Xavier method, and training was performed using the Adam optimizer.

[0047] To ensure consistency and comparability of the experiments, this invention uses the parameter settings listed in Table STYLEREF 1\s 3 2 of REF _Ref11605. This invention applies a grid search to the hyperparameters, exploring the range of mask size values ​​in {128, 256, 512, 1024}, and adjusting the dropout rate in {0.4, 0.5, 0.6, 0.7, 0.8}, with temperature values ​​ranging from {0.1, ..., 1.0}. For each benchmark method, all hyperparameters are configured according to the original settings in their respective papers. All methods employ an early stopping strategy; if the recall@20 metric on the test set no longer improves for several consecutive epochs, training is terminated early.

[0048] Table STYLEREF 1 \s 3 SEQ Table * ARABIC \s 1 2 Experimental Parameter Settings (2) Evaluation indicators To fairly evaluate model performance, this invention employs a full-ranking evaluation strategy. Specifically, for each user in the test set, all items they have not interacted with are considered as candidate negative samples and mixed with the positive sample items they have interacted with, participating in the ranking together. The model generates a global ranking list of all items for that user and calculates the ranking metric based on this list.

[0049] To comprehensively evaluate the effectiveness of Top-K recommendations, this invention selects two widely used core evaluation metrics in recommendation systems: recall (Recall@K) and normalized depreciation cumulative gain (NDCG@K), where K is set to 20.

[0050] Recall@K: The main goal of a recommender system is to ensure that a user's recommendation list contains as many relevant items as possible, and recall is one of the most widely used evaluation metrics in recommender systems. Recall refers to the proportion of clicks made by the user on the K recommended items out of the user's total clicks, directly reflecting the breadth of coverage of user interests by the recommender system. The specific calculation formula is as follows: in For users, This indicates that the model recommends the top [top] users. A collection of items, It is a collection of items that users have interacted with in the test set. The value is between 0 and 1, and the higher the value, the better the recommendation model performs.

[0051] NDCG@K: NDCG (Normalized Discounted Cumulative Gain) is an improved version of DCG (Discounted Cumulative Gain). Through normalization, it ensures the comparability of performance evaluations across different users. This metric is often used to measure and evaluate the accuracy of rankings, for example, in a recommendation list of size k. This indicates the interaction between the item and the user. If the first... If an item has been interacted with by the user, it is assigned a score of 1; if it has not been interacted with, it is assigned a score of 0. The score of the entire recommendation list is the sum of the interaction scores of each recommendation result, i.e., the cumulative gain. : To account for the impact of items in different positions on the recommendation results, we want the gain to be greater as items are ranked earlier and less as items are ranked later, thus obtaining the cumulative gain of the loss. : Next, regarding Further normalization was performed to make them comparable, thus obtaining... The key metrics for evaluating the performance of recommendation algorithms are: Indicates user The largest Value. Calculated by the recommendation results. Score and actual situation The ratio of scores can more accurately measure the quality of the recommended list and how well it matches the user's actual needs.

[0052] (3) Baseline Model To demonstrate the effectiveness of the model proposed in this invention, we compare it with the following most representative models: GC-MC: This model treats recommendations as a link prediction problem on a user-item graph and proposes a graph autoencoder framework to complete the matrix.

[0053] LightGCN: A state-of-the-art recommendation model based on graph neural networks. This model simplifies traditional graph convolutional networks, retaining only the neighborhood aggregation operation and removing weights and feature transformations to improve performance.

[0054] SGL: Building upon LightGCN, it introduces a self-supervised learning paradigm, enhancing the model's robustness and accuracy through contrastive learning. The model utilizes random augmentation to generate contrastive views and optimizes the user-item graph based on the InfoNCE objective function.

[0055] CKE: This model is an embedded knowledge graph-based recommender that uses the TransR model to learn vector representations of entities and relations from the knowledge graph. It is trained on structured knowledge to enrich item representations, thereby enhancing collaborative filtering.

[0056] KGCN is a recommender system model that combines knowledge graphs with graph convolutional networks. It uses GNNs to aggregate knowledge by considering higher-order information and to provide user-embedded preferences for item representations.

[0057] KGAT: The model introduces the concept of collaborative knowledge graphs, applying attention aggregation to the joint user-item-entity graph. The attention score reflects the importance of knowledge triples.

[0058] KGIN: The model views user-item interactions as behaviors driven by multiple potential intentions, and models each intention as a combination of relationships in the knowledge graph, using relationship path-aware aggregation to effectively capture rich information on the knowledge graph.

[0059] MCCLK: The model mines structured information in knowledge graphs through hierarchical contrastive learning to solve the problem of sparse supervision signals in traditional knowledge perception recommendation models based on graph neural networks.

[0060] KGCL: This model introduces contrastive learning into knowledge graphs to reduce potential knowledge noise and sparsity issues. The contrastive signals from the knowledge graph are further used to guide user preference learning.

[0061] KGRec: This model enhances recommendation performance and interpretability by mining important knowledge structures in the knowledge graph through rationalization mechanisms and contrastive learning, while suppressing noise.

[0062] (4) Model comparison The proposed IDAMCR model and the benchmark model were trained and tested on the Alibaba-iFashion, Last-FM, and MIND datasets. The specific results are shown in Table STYLEREF 1 s 3 3 of REF _Ref11742. K in the evaluation metrics was set to 20, and the underlined data is the best value obtained among all the comparison models.

[0063] Table STYLEREF 1 \s 3 SEQ Table * ARABIC \s 1 3 Model Comparison Experiment Results As shown in Table 3-3, IDAMCR outperforms the benchmark models in terms of Recall@20 and NDCG@20 metrics across the three datasets.

[0064] Specifically, on the Alibaba-iFashion dataset, the model of this invention outperformed the best benchmark model by 1.43% and 1.76% in Recall@20 and NDCG@20, respectively.

[0065] On the Last-FM dataset, the model of this invention outperforms the best baseline model by 0.86% and 0.74% on Recall@20 and NDCG@20, respectively.

[0066] On the MIND dataset, we achieved significant improvements of 2.77% in Recall@20 and 10.97% in NDCG@20, respectively.

[0067] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning, characterized in that, include: S1. Data preprocessing: Obtain user-item interaction data and knowledge graph triple data, filter sparse data, and divide them into training set, validation set and test set according to 7:2:1; S2. Semantic-aware dynamic weight generation: Entity and relation embeddings are initialized using TransE, triple similarity and importance scores are calculated, and attention weights are generated using softmax. S3, Split Attention Feature Enhancement: Group neighbor triples by relationship and split within each group. Generate enhanced entity representations through global average pooling and attention weighting. S4. Adaptive Sparse Gating: Construct a gated network to calculate the gating value of the edges, introduce dynamic sparsity rate constraints and sparse loss, and filter out noisy edges; S5. Heterogeneous knowledge dynamic aggregation: Based on attention weights and gating values, aggregate item embeddings in a hierarchical manner, and then aggregate user embeddings through user-item interaction graphs; S6, Meta-contrastive learning: The inner loop generates task-specific parameters and adaptive temperature, while the outer loop optimizes global parameters to enhance the generalization of the representation; S7. Recommendation Generation: Calculate the similarity between user and item embeddings to generate a Top-K recommendation list.

2. The personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning according to claim 1, characterized in that, In step S2, the specific steps are as follows: The translation-based embedding method TransE is used to initialize entities and relations. For any valid triple... The embedding vector of the tail entity should be close to the embedding vector of the head entity plus the displacement vector corresponding to the relation, that is: Embedding vectors of head entity, tail entity, and relation can be obtained. and ; make express The norm is used as a function to measure the similarity of embedded vectors. For a given triple, it can be represented as: knowledge graph Randomly replace the tail of the triplet to obtain the negative sample. ,use Let denot sigmoid function, then the optimization loss function for the initial embedding of the knowledge graph can be defined as shown in equation (3): To capture the impact of different relations on node semantics, a relation-specific linear transformation matrix is ​​introduced; For each type of relation Define a transformation matrix This is used to transform the features of neighboring nodes: This yields the initial node representation for relationship awareness, providing a foundation for subsequent aggregation.

3. The personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning according to claim 2, characterized in that, In step S2, interpretability scores are assigned to the global triples, as shown in equation (5): in , It is a trainable attention weight matrix. This indicates element-wise multiplication; through the above calculation, each triple will obtain a "score" that reflects its importance in helping to predict user preferences; By reducing the number of neighbors of the head entity The effect of weighted scores is normalized using the softmax function to make the explanatory scores of different neighbors of the same head entity comparable: The resulting relation-aware weights can effectively distinguish the importance of different neighbor nodes, making the model more focused on high-value neighbors carrying strong signals, while enhancing the interpretability of the recommendation results.

4. The personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning according to claim 3, characterized in that, In step S3, the specific steps are as follows: First, the head entity Set of all neighbor triples Classified by relation type A set of mutually disjoint base arrays: in, , Representing the A base array containing all relation types. Base array The larger the value, the finer the feature clustering. For each basis array... We generate a group representation vector for each relation group. : in This represents the introduced relation-specific transformation matrix used to transform the tail entity. Embedded projection onto relation A more relevant semantic space, For relationship Embedded vector, Represents "relationship type" The overall semantic information contained in the group.

5. To generate attention weights, we need to capture the global contextual information for each semantic unit. For each group representation vector... Perform global average pooling (GAP) to compress it into a scalar representing the set of global contexts: 。 6. The personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning according to claim 4, characterized in that, In step S3, the further steps are as follows: Further splitting sub-features within each basis array This represents the number of splits within the base array. The larger the value, the more branches there are within each basis array, allowing for the capture of more complex feature interactions. To ensure the weights are comparable across different perspectives, we normalize the statistics along the split Radix dimension and compute the values ​​for each semantic unit. Normalized attention weights : 。 7. The personalized recommendation method based on semantic dynamic aggregation and meta-comparative learning according to claim 5, characterized in that, In step S3, the further steps are as follows: Based on attention weights, for each semantic unit after splitting The features from all perspectives are weighted and summed to generate the first... Layered entity Final reinforcement representation: This module constructs a complete feature enhancement chain: first, multi-view semantic modeling is achieved through channel splitting; then, dynamic feature selection is achieved through an attention mechanism; and finally, dimensionality consistency is restored through linear reconstruction.

8. A personalized recommendation system based on semantic dynamic aggregation and meta-comparative learning, characterized in that, include: Data preprocessing module: used to perform step S1 as described in claim 1, to collect, filter and classify user-item interaction data and knowledge graph data; Semantic-aware dynamic weight module: used to execute step S2 as described in claim 1, to realize the embedding initialization of entities and relations and the calculation of triplet attention weights; Split attention feature enhancement module: used to perform step S3 as described in claim 1, to realize the grouping, splitting and enhancement of entity representation of neighbor triples; Adaptive sparse gating module: used to execute step S4 as described in claim 1, to calculate the gating value and filter noise edges; Heterogeneous knowledge dynamic aggregation module: used to execute step S5 as described in claim 1, to realize hierarchical aggregation and cross-layer fusion of user embedding and item embedding; Meta-comparison learning module: used to execute step S6 as described in claim 1, to realize the processing of support set and query set, generation of adaptive temperature and optimization of global parameters; Recommendation generation module: used to perform step S7 as described in claim 1, to realize similarity calculation and generation of Top-K recommendation list.