Recommendation method integrating angular distance and robust scale metric learning
By integrating angular distance and robust scale metric learning, combined with weighted user popularity sampling and graph comparison learning, the shortcomings of traditional recommendation algorithms in the diversity of user interest expressions and data complexity are solved, and more accurate and personalized recommendations are achieved. Recommended results.
Patent Information
- Application Number
- CN202410451851.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-04-16
AI Technical Summary
Traditional recommendation algorithms have shortcomings in handling the diversity and variability of user interest expressions, complex data modeling, and large-scale high-dimensional sparse data. In particular, they do not fully consider ternary relationships, insufficient similarity measures, and adaptive boundary selection problems. At the same time, the imbalance of positive and negative samples and the variance problem within item categories make it difficult to capture the differences in user preferences.
Adopt a recommendation method that integrates angular distance and robust scale metric learning, balance positive and negative samples through weighted user popularity sampling method, use angular distance and ternary hinge loss function to optimize metric learning, and combine graph comparison learning to better understand users and the interactive relationship between items to improve the accuracy and personalization of the recommendation system.
This method significantly improves the accuracy and robustness of the recommendation system, can better capture the complex relationships between items, solves the problem of item category balance, reduces uninteresting items in negative samples, and improves the model's generalization ability and personalized recommendations. performance.
Smart Images

Figure CN118364910B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a recommendation method integrating angular distance and robust scale metric learning. Background Art
[0002] In today's information age, personalized recommendation systems play an important role as a key bridge between users and massive information. With the vigorous development of the Internet, users are faced with a huge and complex information selection space. Therefore, designing a powerful and intelligent recommendation system has become an urgent need to meet personalized needs and improve user experience.
[0003] Traditional recommendation algorithms are usually based on information such as user historical behavior and interest tags to predict items that users may like. However, these methods have certain shortcomings in dealing with the diversity and variability of user interest expressions and in modeling high-dimensional complex data. Metric learning, as an important branch of machine learning, aims to improve the accuracy and flexibility of similarity measurement by learning metrics between data.
[0004] In the field of recommendation, metric learning methods provide new ideas for solving the various limitations of traditional recommendation algorithms. Traditional metric learning methods, such as Euclidean distance learning, Mahalanobis distance learning, and local metric learning, aim to better capture the diversity and variability of user interests by learning the metric relationship between data. However, these methods still face some challenges in practical applications. First, although Euclidean distance learning is simple and intuitive, its ability to model nonlinear relationships is limited and it is difficult to handle complex user interest expressions. Second, Mahalanobis distance learning considers the correlation between data features, but it still has some shortcomings in terms of computational complexity and handling nonlinear relationships. Local metric learning methods have certain advantages in improving the flexibility of recommendation systems. However, they still face some problems in modeling large-scale, high-dimensional sparse data. (1) The ternary relationship is not fully considered; (2) The similarity metric needs to be improved; (3) It is difficult to select an adaptive boundary. In addition, in the current research on recommendation systems, the problems of imbalanced positive and negative samples and intra-category variance of items make it difficult for traditional metric learning methods to accurately capture the differences in user preferences on imbalanced item sets. Summary of the invention
[0005] The present invention aims to at least solve the technical problems existing in the prior art, and in particular innovatively proposes a recommendation method that integrates angular distance and robust scale metric learning.
[0006] In order to achieve the above-mentioned object of the present invention, the present invention provides a recommendation method integrating angular distance and robust scale metric learning, comprising the following steps:
[0007] The data is converted into sample points, and the sample points are represented by triples (u, i, j); the data includes user ID, item ID and preference information, and the preference information includes one or any combination of click information, purchase information and rating information; u is an anchor sample, representing user u; i is a positive sample, representing an item that user u likes; j is a negative sample, representing an item that user u does not like or has not been exposed to;
[0008] Then, the proposed weighted user popularity sampling method is used to preprocess the triples to obtain a triple with balanced positive and negative samples. The processed triple data is used to construct a user-item interaction graph, in which users and items are nodes in the graph, and positive samples and negative samples are connected by interaction behaviors as edges.
[0009] Then, the angular distances between the preprocessed triplets are calculated to perform metric learning to learn the similarities between nodes in the graph; and the ternary hinge loss function is used to optimize the metric learning.
[0010] The traditional similarity calculation method is replaced by a metric method based on angle distance. This improvement fully considers the characteristics of triple data, which not only enhances the recommendation system's ability to capture complex relationships between items, but also significantly improves the accuracy and robustness of the system. In addition, the optimization of metric learning using the ternary hinge loss function can solve the problem of item category balance. It makes the recommendation process more accurate and fair by shortening the distance between users and positive samples and increasing the distance between users and negative samples.
[0011] In the optimization process of metric learning using the ternary hinge loss function, we perform gradient descent on the loss function to balance computational efficiency and convergence speed:
[0012] (1) Calculation Represents the loss function About parameter w in w (t) Gradient of a point, gradient is a vector, each component of which is the partial derivative of the loss function corresponding to each element of the parameter w;
[0013] (2) Calculation Δw (t) represents the change of parameter w in the tth time step;
[0014] (3) Randomly select the learning rate γ
[0015] (4)w (t+1) =w (t) +γΔw (t) , update the parameter w;
[0016] (5) t = t + 1;
[0017] (6) If t>=tmax, the training ends and the loss function converges to w.
[0018] Furthermore, the weighted user popularity sampling method includes the following steps:
[0019] (1) In order to ensure that users with rich preferences are fully explored, calculate the user u i The probability of being sampled is:
[0020]
[0021] Among them, p(u i ) represents user u i The weight of the current space;
[0022] p(u k ) represents user u k The weight of the current space;
[0023] Interaction(u i ,v j ) represents user u i With items v j Frequency of interaction;
[0024] Interaction(u k ,v j ) represents user u k With items v j Frequency of interaction;
[0025] K means there are K users in total;
[0026] u k represents the kth user;
[0027] v j represents the jth item;
[0028] By adjusting the probability of users being sampled, we can explore different goals of user-item relationships, more accurately reflect the diverse preferences of users, and select samples in a targeted manner, thereby improving the recommendation model's ability to understand and predict user behavior.
[0029] (2) Based on the sampled users, continue to sample the popularity of positive samples and negative samples separately:
[0030]
[0031] Among them, p(v i ) indicates item v i The weight of the current space;
[0032] p(v k ) indicates item v k The weight of the current space;
[0033] Interaction(u i ,v i ) represents user u i With items v i Frequency of interaction;
[0034] Interaction(u i ,v k ) represents user u i With items v k Frequency of interaction;
[0035] K means there are K users in total;
[0036] v k represents the kth item;
[0037] u i represents the i-th user.
[0038] Different from sampling based only on item popularity, our method calculates the i The probability of being sampled is taken into account while considering the popularity of users, paying more attention to those users with rich preferences to ensure that the model can better understand and predict user behavior in all aspects. Then continue to sample the popularity of positive and negative samples separately to ensure that the training model has better generalization ability when facing diverse user behaviors. It can greatly reduce the items of no interest in negative samples, so as to retain only the unexposed items as much as possible.
[0039] Furthermore, the loss function is
[0040]
[0041] in, Represents the loss function after cross entropy optimization;
[0042] Represents N pairs of loss functions;
[0043] η, λ are two hyperparameters that can weight the importance between pairwise loss and scale-invariant loss.
[0044] N pairs of loss functions are integrated into the scale-invariant loss function of the model. In the process of optimizing the loss function, negative sample items gradually move away from positive sample items and users, and positive samples gradually move closer to users, thereby learning users' discriminative preferences for positive and negative samples.
[0045] This method uses angular distance as a metric, which can more effectively capture the complex relative position relationship between items. Its advantage is that it can maintain stable performance in high-dimensional space, while avoiding the "dimensionality disaster" that traditional distance metrics (such as Euclidean distance) may encounter in high-dimensional data. In addition, angular distance pays more attention to direction rather than absolute distance when measuring similarity, which helps to distinguish vectors that are similar in direction but different in magnitude, further improving the accuracy of the recommendation system.
[0046] Robust scaling is also used to solve the adaptive boundary problem. Specifically, in the loss function, instead of assigning a learnable margin m to each user or item, the boundary is adaptively adjusted to balance the distance between positive and negative samples. This method not only reduces the number of model parameters, but also improves the generalization ability of the model. By avoiding setting separate parameters for each entity, this method simplifies the model structure and reduces the risk of overfitting, while ensuring the flexibility and adaptability of the model, enabling it to achieve good performance on different data sets.
[0047] Further, The calculation formula is as follows:
[0048]
[0049] θ represents a weight parameter used to balance the performance of the model under different types of interactions;
[0050] · T is the transpose symbol;
[0051] q u Represents the embedding vector corresponding to user u;
[0052] v i represents the i-th item;
[0053] v j represents the jth item;
[0054] (u,i,j) represents triple relationship information;
[0055] represents all triples.
[0056] Further, The calculation formula is as follows:
[0057]
[0058] Among them, (u,i,j) represents the triple relationship information;
[0059] · T is the transpose symbol;
[0060] q u Represents the embedding vector corresponding to user u;
[0061] v i represents the i-th user;
[0062] v j represents the jth user;
[0063] represents all triples;
[0064] N represents the total number of samples in the dataset.
[0065] Furthermore, the item may also be a project, a service, or content.
[0066] Furthermore, it also includes: combining the recommendation method that integrates angular distance and robust scale metric learning with graph contrast learning. Graph contrast learning learns the representation of nodes by comparing the similarity between nodes and their neighboring nodes, and uses the relationship and co-occurrence pattern between nodes to measure similarity, so as to better capture the potential association between users and items. Therefore, the recommendation method that integrates angular distance, robust scale metric learning and graph contrast learning can more comprehensively understand the interactive relationship between users and items, improve the accuracy and personalization of recommendations, and also enhance the system's ability to handle data anomalies.
[0067] This fusion method makes full use of the similarity information between nodes in the graph structure, and can more comprehensively understand the interactive relationship between users and items, thereby improving the accuracy and personalization of recommendations. Through graph comparative learning, the recommendation system can more effectively handle problems such as data sparsity and cold start, and provide users with more accurate and personalized recommendation services.
[0068] In summary, due to the adoption of the above technical solutions, the recommendation method proposed in the present invention integrates angular distance and robust scale metric learning; in addition, compared with the traditional recommendation method, the recommendation method of the present invention introduces a weighted user popularity sampling method to balance positive and negative samples, and at the same time more accurately evaluates the user's preference for an unbalanced item set through the loss function of angular distance. This makes up for the shortcomings of existing methods in dealing with differences in user preferences, and provides a more sophisticated and accurate method for the recommendation system.
[0069] The specific advantages are as follows:
[0070] (1) Recursive feature elimination is used to gradually remove features that contribute less to model performance to improve the generalization and robustness of the model. At the same time, a new weighted user popularity sampling method is proposed to better balance positive and negative samples and enhance measurement accuracy.
[0071] (2) We abandon the use of Euclidean distance and choose angular distance as the measurement, and propose a new loss function to better evaluate users' preferences on unbalanced item sets.
[0072] (3) A recommendation method that integrates angular distance and robust scale metric learning is proposed. It fully considers the ternary relationship and improves the similarity measurement method to better learn the preference differences of users.
[0073] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0075] Figure 1 is the angular distance diagram of the triplet, Figure 1 (a) is to directly minimize ∠n, Figure 1 (b) is the reconstructed triangle Δ mcn Define a more stable ∠n.
[0076] Figure 2 It is a system framework diagram of the robust scale metric learning recommendation method based on angular distance of the present invention.
[0077] Figure 3 It is a CML diagram of the present invention.
[0078] Figure 4 It is an SML diagram of the present invention.
[0079] Figure 5 It is an example diagram of the imbalance challenge of the present invention.
[0080] Figure 6 It is a schematic diagram of deriving ARSML in the present invention.
[0081] Figure 7 This is a performance comparison of different methods on different data sets in the present invention. Figure 7 (a) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Amazon-CDS dataset; Figure 7 (b) Comparison of the ARSML-GCL algorithm and other baseline models in terms of HR indicators on the Amazon-CDS dataset; Figure 7 (c) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the MovieLens dataset; Figure 7(d) is a comparison chart of the ARSML-GCL algorithm and other baseline models in terms of HR indicators on the MovieLens dataset; Figure 7 (e) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Amazon-books dataset; Figure 7 (f) is a comparison chart of the ARSML-GCL algorithm and other baseline models in terms of HR indicators on the Amazon-books dataset; Figure 7 (g) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Yelp2018 dataset; Figure 7 (h) is a comparison chart of the ARSML-GCL algorithm and other baseline models in terms of HR indicators on the Yelp2018 dataset.
[0082] Figure 8 This is a schematic diagram of the comparison of cold start performance of users of the present invention. Figure 8 (a) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Yelp2018 dataset under cold start; Figure 8 (b) is a comparison chart of the HR indicators of the ARSML-GCL algorithm and other baseline models on the Yelp2018 dataset under cold start; Figure 8 (c) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Amazon-books dataset under cold start; Figure 8 (d) is a comparison chart of the HR index of the ARSML-GCL algorithm and other baseline models on the Amazon-books dataset under cold start; Figure 8 (e) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Amazon-CDs dataset under cold start; Figure 8 (f) is a comparison chart of the HR index of the ARSML-GCL algorithm and other baseline models on the Amazon-CDs dataset under cold start; Figure 8 (g) is a comparison chart of the NDCG index of the ARSML-GCL algorithm and other baseline models on the Movie-Lens dataset under cold start; Figure 8 (h) is a comparison chart of the HR indicators of the ARSML-GCL algorithm and other baseline models on the Movie-Lens dataset under cold start. DETAILED DESCRIPTION
[0083] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0084] There is a close relationship between angular distance and recommendation algorithms and loss functions. As a method of measuring similarity, angular distance can convert their positional relationship in high-dimensional space into a relative angle measurement by calculating the angle between item vectors, thus providing an important similarity indicator for recommendation algorithms. At the same time, angular distance can also be integrated into the loss function of the recommendation model to help optimize the model training process. By making reasonable use of angular distance, the accuracy and personalization of the recommendation system can be improved. In order to understand the background knowledge required for the ARSML algorithm in detail, the specific details of angular distance are introduced in detail as follows:
[0085] 1. Angular distance
[0086] Metric learning aims to find a suitable similarity metric to maintain the desired distance structure between image pairs. Traditional methods usually focus on finding a better Mahalanobis distance in linear space, but the limitation of linear transformation is that it cannot fully capture the high-order correlations between the dimensions of the original data. The main work of deep metric learning can be classified as minimizing contrast loss (also known as twin networks) or ternary loss. By directly learning nonlinear feature representations, significant progress has been made and satisfactory results have been achieved in multiple tasks, including visual product search, face recognition, feature matching, image classification, and collaborative filtering. However, directly optimizing distance-based objectives in a deep learning framework remains challenging and requires the use of a variety of practical techniques, such as multi-task learning or difficult negative sample mining.
[0087] To address these challenges, recent studies have begun to explore new distance metrics. Among them, angular distance has attracted attention as a new method. Unlike traditional distance metrics, angular distance pays more attention to the direction between samples rather than the absolute distance. This method helps to overcome the limitations of traditional distance metrics, such as sensitivity to scale changes and only considering the second-order information between samples.
[0088] In short, the introduction of angular distance provides a new perspective for metric learning. By considering the directional information between samples, it overcomes some limitations of traditional distance metrics and thus improves the accuracy and reliability of data processing.
[0089] 1.1 Traditional ternary loss function
[0090] Triplet Loss is a loss function for training neural networks, especially for learning sample similarity relationships in embedding space. It performs well in solving contrastive learning (Siamese Networks) tasks, such as face verification and image retrieval. The core idea of this loss function is to adjust the network parameters by comparing triplet samples, that is, an anchor sample, a positive sample, and a negative sample, so that similar samples are closer in the embedding space, while dissimilar samples are more dispersed.
[0091] Specifically, for a triplet (a, p, n), the goal of Triplet Loss is to minimize the distance between the anchor sample and the positive sample, while maximizing the distance between the anchor sample and the negative sample, bounded by a predefined interval parameter α. This can be expressed by the following mathematical expression:
[0092]
[0093] Where f(·) is the embedding function of the neural network, a, p, n represent anchor samples, positive samples, and negative samples respectively; ||·|| represents the Euclidean distance. The form of this loss function ensures that the loss will be positive only when the distance between the positive sample and the negative sample is less than the distance between the anchor sample and the positive sample, otherwise it is zero. This forces the network to learn to produce more discriminative embedding representations that can better distinguish similar and dissimilar samples.
[0094] The effectiveness of Triplet Loss lies in its emphasis on sample relationships in contrastive learning, which provides an effective way to learn sample similarities in the embedding space, thereby achieving significant performance improvements when processing similarity tasks.
[0095] However, Triplet Loss, as a commonly used loss function in contrastive learning, has some obvious shortcomings. First, it is sensitive to sample imbalance and is easily affected by easily distinguishable samples, causing the model to tend to optimize simple samples and ignore complex sample relationships. Second, it is sensitive to hyperparameters, especially the choice of the interval parameter α, which needs to be carefully adjusted to balance the distance between positive and negative samples. Third, the computational efficiency is low. As the size of the dataset increases, it becomes expensive to calculate the loss of all possible triplets. In addition, Triplet Loss is sensitive to noise and is easily affected by samples containing label noise. Finally, the selection of difficult samples is a key issue, and clever strategies are needed to select challenging negative samples to ensure the robustness of training.
[0096] 1.2 Angle loss function
[0097] First, we consider Figure 1 (a) is an example of a triple, where T = (x a ,x p ,x n ) forms a triangle Δapn, whose sides are represented by e an =x a -x n 、e pn =x p -x n and e ap =x a -x p , T represents a triple, x n is a negative sample point, x a is the anchor point, x p is a positive sample point. Relative to an edge e at the bottom ap , the original triplet constraint has no effect on the longer edge e an Since the anchor and the positive sample share the same label, we can derive the symmetric triple constraint, which forces ||e ap ||+m≤||e pn ||. According to the cosine law, the longer side e an and e pn The included angle ∠n must be the smallest, that is, ∠n≤min(∠a,∠p). Since ∠n+∠a+∠p=180°, ∠n must be less than 60°. This prompts us to restrict the upper limit of the angle of each triple triangle:
[0098] ∠n≤α (2)
[0099] where α>0 is a predefined parameter. Intuitively, this constraint selects triplets that form thin triangles, whose shortest side e ap Connect nodes of the same type. Compared with traditional constraints defined on the absolute distance between points, the proposed angle constraint has three advantages:
[0100] (1) Angle is a measure that is invariant to similarity transformations and is proportional to the relative proportions of the triangle sides. With a fixed margin, ||x a -x p || 2 +m≤||x a -x n || 2 Always applies to any rescaling of local feature maps.
[0101] (2) The cosine rule determines that the calculation of ∠n involves all three sides of the triangle, while the original triplet only considers two sides. The additional constraints improve the robustness and effectiveness of the optimization.
[0102] (3) In the original triple constraint, it is difficult to choose a suitable distance margin without a meaningful reference. In contrast, setting α in the angle constraint is an easier task because it has a concrete and interpretable meaning in geometry.
[0103] However, formula (2) may become unstable in some special cases. Figure 1 (a) shows a triangle where ∠a>90°. Execute equation (2) to reduce ∠n, negative point x n May be pulled towards x n ', and x n Closer to anchor point x a This result contradicts our original goal (enlarging the distance between points of different categories). To solve this problem, the triple triangle is reconstructed to make formula (2) more stable.
[0104] Modeling negative sample points x n With the anchor point x a and positive sample point x p The relationship between the local sample distributions defined, such as Figure 1 (b) is shown. Make a a and x p Circle The center of the circle is at the midpoint x c =(x a +x p ) / 2. Then, we introduce a nc =x n -x c And in x c Hyperplanes that intersect at Hyperplane With surrounding circle intersects at two nodes, one of which is labeled x m Based on this, we define a new triangle Δ mcn , by changing the anchor point x a and positive sample point x p Move to x respectively c and x m Given a new triangle, we reformulate equation (2) to constrain nc and e nm The ∠n formed by the edges is less than a certain value.
[0105]
[0106] Among them, ||x m -x c || is the circumcircle The radius is equal to
[0107] Inspired by the triplet loss (Eq. 1), we pursue the best embedding to ensure that samples of different categories can be effectively separated according to the angle constraint (Eq. 3). In general, our angle loss minimizes the following hinge loss.
[0108]
[0109] in,[·] + = max(0,·) represents the hinge function. To better understand the effect of optimizing the angle loss, we study Relative to x a 、x p and x n The gradients of are:
[0110]
[0111] If ∠n is greater than α, the loss is zero. Figure 1 As shown in (b), the gradient will negative sample point x n Push away x c , that is, by x a and x p Defined circumcircle In addition, the anchor point x a and positive sample point x p Compared to the gradients of the original triplet loss that only depend on two points, the gradients in (3) are more robust because they consider all three points simultaneously.
[0112] 2. Proposed Method
[0113] A specific method called angular distance based robust scale metric learning recommendation (ARSML) is proposed. The framework diagram of the ARSML algorithm is shown in the figure. Figure 2As shown in the figure. Select the recommendation scenario under implicit feedback conditions. First, the data is processed according to the proposed weighted user popularity sampling method to form a triplet of balanced positive and negative samples. Then, the triplet is recommended according to the derived ternary hinge loss function that is independent of whether the item category is balanced. Finally, the fusion graph contrast learning fully considers the ternary relationship and improves the similarity measurement method. Specifically, first prepare the user-item interaction dataset. These data usually include user ratings, clicks, purchases, and other information on items. After a series of data processing operations such as data cleaning, deduplication, and filling missing values to ensure the quality and integrity of the data, a scoring table is obtained to show the number of interactions between users and items. The local features of the data are effectively captured through the CNN convolutional layer and pooling layer, and gradually abstracted into a higher-level feature representation, so that the positive and negative samples for the user, as well as the items that the user likes and dislikes, can be obtained. The user, positive sample item, and negative sample item are formed into a triplet. Then the angular distance is used to measure the similarity between data samples. Model the relationship between the negative sample point j' and the local sample distribution defined by the anchor point u and the positive sample point i. Make a circle passing through u and j' Define a new triangle Δiu'j' and constrain Thus, a loss function that integrates angular distance and robust scale metric learning is introduced. After learning, positive samples are brought closer to users and negative samples are pushed away from users, so that items that users may like can be recommended more accurately. Finally, the graph contrast learning method is further introduced to learn the representation of nodes by comparing the similarity between nodes and their neighboring nodes, and the relationship and co-occurrence pattern between nodes are used to measure similarity, so as to better capture the potential association between users and items.
[0114] 2.1 Weighted User Popularity Sampling Method
[0115] As mentioned in Question 1, in metric learning, random sampling is usually used to select samples due to the high cost of directly traversing all triplets. However, compared with other tasks such as classification, recommendation systems based on implicit feedback are more prone to the problems of unclear sample meaning and imbalanced positive and negative samples, which may lead to insufficient sample information and small loss gradients under random sampling. For example, in the classification task of computer vision, the labels of positive and negative samples are clear, and the formula can be used directly for model training. However, in the recommendation system based on implicit feedback, negative samples include items that users do not like and items that have not been exposed. Although both types of samples are marked as missing samples, the candidate set should consist of items that have not been exposed, rather than items that have been exposed but the user is not interested in.
[0116] In this case, if all negative samples have the same weight and are optimized by the formula, unexposed items may be "pushed" away by users along with items that they are not interested in, thus affecting the recommendation performance. In addition, since users and items with higher popularity usually have more interactions, considering the popularity of users and items is necessary for modeling. For example, a popular movie may have many viewers, which indicates that the movie has rich attributes / facets that can meet the different preferences of different users. In contrast, users and items with lower popularity have fewer corresponding interactions and may have less impact on the distribution within each space. Therefore, considering popularity helps to better model the relationship between users and items.
[0117] Given the importance of weighted sampling and considering popularity-based modeling, we choose to adopt weighted user popularity sampling. However, current popularity sampling for recommender systems is mainly based on item popularity, without fully considering the impact of user popularity on training. In order to effectively utilize the multi-preference nature of users, we design a calibrated sampling method that aims to capture user preferences more accurately. Compared with sampling that only focuses on popular items, our proposed calibrated sampling method also focuses on users with rich preferences to better reflect the diversity of user behaviors.
[0118] In order to ensure that users with rich preferences are fully explored, we denote user u i The probability of being sampled is as follows:
[0119]
[0120] Among them, p(u i ) represents user u i The weight of the current space;
[0121] p(u k ) represents user u k The weight of the current space;
[0122] Interaction(u i ,v j ) represents user u i With items v j Frequency of interaction;
[0123] Interaction(u k ,v j ) represents user u k With items v j Frequency of interaction;
[0124] K means there are K users in total;
[0125] u krepresents the kth user;
[0126] v j represents the jth item;
[0127] By adjusting the probability of users being sampled, we can explore different goals of user-item relationships, more accurately reflect the diverse preferences of users, and select samples in a targeted manner, thereby improving the recommendation model's ability to understand and predict user behavior.
[0128] Then, according to the sampled users, continue to sample the popularity of positive samples and negative samples respectively:
[0129]
[0130] Among them, p(v i ) indicates item v i The weight of the current space;
[0131] p(v k ) indicates item v k The weight of the current space;
[0132] Interaction(u i ,v i ) represents user u i With items v i Frequency of interaction;
[0133] Interaction(u i ,v k ) represents user u i With items v k Frequency of interaction;
[0134] K means there are K users in total;
[0135] v k represents the kth item;
[0136] u i represents the i-th user;
[0137] 2.2 ARSML method derivation
[0138] As described in Question 2, the model represented by the CML method limits the personalized expression of different users to a certain extent, because it does not fully consider the ternary relationship composed of users, items of interest to them (positive samples), and items of no interest to them (negative samples). In the metric space, CML only considers the binary relationship between users and items of interest to them, and the binary relationship between users and items of no interest to them, without further considering the relationship between items. In the metric space, if the distance between the user vector and the item vector is relatively close, it can be considered that the user likes the item, and if the distance between item i and item j is relatively close, it can be considered that the two items belong to the same category. Therefore, further considering the relationship between items is of auxiliary significance for capturing the personalized preferences of different users.
[0139] The core idea of the CML algorithm is to embed users and items into a low-dimensional space and measure their explicit proximity through the Euclidean distance to satisfy the inequality property. In CML, the distance function of each user-item interaction can be defined as:
[0140]
[0141] Among them, ||·||2 represents the L2-norm; α u and β v are the representations of user u and item v in the metric vector space respectively. Consider a triple (u, v, v - ),in represents a positive sample, and Represents negative samples. CML uses triple loss to ensure that user u is consistent with negative sample points v - The distance between them is greater than the distance between the current user u and the positive item v, and given the edge m>0, the final loss function can be expressed as follows:
[0142]
[0143] Where [x] + = max(x,0) represents the standard hinge loss, w u,v is the loss weight. For fair comparison, we use w for all samples of the present invention u,v Set to 1. To optimize equation (8), calculate its gradients respectively. If d(u,v)+m≤d(u,v - ), their gradients are zero; otherwise, the gradients are as follows:
[0144]
[0145] According to the stochastic gradient framework, for example Where η is the step size, CML can achieve like Figure 3 shown.
[0146] To address the shortcomings of CML, SML also increases the distance between the positive and negative samples of the target user. To design a more effective solution, the following two features need to be considered: First, it is worth noting that the label (positive / negative) of each item may vary for different users. This is significantly different from traditional classification tasks, where labels are not objective and fixed. For example, an item may be a positive sample for user u1 and a negative sample for user u2. In this case, when the interval m is uniformly expanded, the positive samples will be closely clustered around the user. As a result, the solution space becomes smaller and items and users become difficult to distinguish. Secondly, since m is large, the items recommended to the user are likely to fall on the boundary and may therefore be predicted as negative samples, reducing the recall of the recommendation system. In addition, if an additional conditional constraint maxd(v,v - ), the training cost is too high. And the goal is just to get a relatively large distance, not the maximum distance.
[0147] like Figure 4 As shown in Figure 2, SML assumes that the condition of user-centric measurement has been satisfied, that is, d(u,v)+m≤d(u,v - ). From a geometric point of view, we can find that the positive sample v is located at the center of u and r u is the radius of the ball. And the negative sample v - Then it is located at the center of u and r u +m is the radius of the larger ball. In the same vector space, users and items share the same metric. Therefore, we can analyze the relationship between them from the perspective of items: v and v - dissimilar, which means that their distance should be greater than d(v,u). Therefore, similar to the user-centered model, SML also adopts marginal loss, through the margin n, to keep the positive sample v closer to user u than the negative sample v - Closer Locations:
[0148]
[0149] In formula (10), due to the symmetry of the Euclidean distance, d(v,u) = d(u,v). Our goal is to ensure that uv becomes Δuvv - The shortest edge of . Based on the fact that different users have different standards, the edge m should be personalized for each user. Similarly, for symmetric constraints, the edge n should also vary from item to item. The SML method uses an adaptive edge m u and n vto replace the original edges m and n. Intuitively, SML prefers to use larger adaptive edges to reduce the variation. Therefore, the adaptive edge can be expressed as:
[0150]
[0151] In summary, the final loss function of SML is as follows:
[0152]
[0153] But obviously, as described in Question 3, for extremely sparse data recommendation system scenarios, it is very costly to assign a learnable margin m to each user and item. Because in actual application scenarios, the number of items and users can reach tens of millions, and it is unrealistic for each user and item to learn their own good adaptive boundaries. At the same time, the absolute distance metric cannot well reflect the user's preference for items with uneven distribution of categories, because different users' preferences for items are personalized, and a single distance metric may not be able to capture this personalized difference well. Some users may pay more attention to certain specific features and be less sensitive to other features.
[0154] Currently, recommendation algorithms based on metric learning still have many limitations, especially the difficulty in selecting adaptive boundaries and the need to improve similarity measurement methods. Figure 5 As shown in the figure, user u chooses items from two unbalanced classes, one of which is books and the other is clothes. Assume that user u likes items j' and j1', but dislikes items j and j1. However, when d(u,j) = d(u,j1'), it is difficult to measure the difference in user preferences for j and j1' using the absolute Euclidean distance boundary.
[0155] Set up the triplet: Where u represents the user, i represents the item the user likes, and j represents the item the user is not interested in or has not browsed. In the classical metric learning method (CML), the negative samples are kept away from the user distance, so that m>0, thereby minimizing the ternary hinge loss, and its formula is as follows:
[0156]
[0157] Where [.]+=max{0,·} represents the hinge function. u Refers to the embedding vector corresponding to user u. i v j Represent the vector corresponding to positive sample i and the vector corresponding to negative sample j respectively. However, this method only considers the relationship between users and items, but ignores the relationship between items, which may drag negative sample items towards positive sample items, which is contrary to the basic assumption of metric learning.
[0158] To solve this problem, it is first necessary to abandon the absolute Euclidean distance and use the angular distance. As Figure 6 shown, the triple forms a triangle Δuij, where i represents the item that u likes, i.e., the positive sample point; j represents the item that u does not like, i.e., the negative sample point; the purpose of metric learning is to pull the user closer to the positive sample point and push the negative sample point farther away, that is, to shorten ui and increase uj and ij. Therefore, in the triangle, ui must be the shortest side. According to the cosine theorem, the angle ∠n between uj and ij must be the smallest. Also, ∠n + ∠a + ∠p = 180°, so ∠n must be less than 60°. Limit the upper angle limit of each triple triangle: ∠n ≤ α. Where α > 0 is a predefined parameter.
[0159] However, ∠n ≤ α becomes unstable in some special cases. Set an auxiliary negative sample point j' such that uj' < uj and ∠n' < ∠n, and this case can be verified. For example, when ∠a > 90°. By executing ∠n ≤ α to reduce ∠n, the negative point j may be pulled towards j', and j' is closer to the anchor point u. This result contradicts our original goal (to increase the distance between different category points). To solve this problem, reconstruct the triple triangle.
[0160] Model the relationship between the negative sample point j' and the local sample distribution defined by the anchor point u and the positive sample point i. Make a circle passing through u and j' with the center located at the midpoint u' = (u + j) / 2. The hyperplane intersects the surrounding circle at two nodes, one of which is marked as j'. Based on this, we define a new triangle Δiu'j', which is achieved by moving the anchor point u and the positive sample point i to u' and j' respectively. Given the new triangle, we re-formulate ∠n ≤ α to constrain ∠n to be less than a certain value:
[0161]
[0162] where ||u'i'|| is the radius of the circumscribed circle and is equal to
[0163] To ensure that different category samples can be effectively separated according to the angle constraint. Generally speaking, our s-angular loss minimizes the following hinge loss:
[0164]
[0165] where ||ui|| represents the Euclidean norm of the vector ui;
[0166] α is a predefined parameter, and its value is always greater than 0;
[0167] ||u'j|| represents the Euclidean norm of vector u'j;
[0168] In the triple In the training, the goal is to update the vector q by minimizing the hinge loss described in Equation 16 u ,v i and v j . The distance in the metric space can be represented by the inner product of two embedded vectors:
[0169]
[0170] Among them, q u represents the embedding vector corresponding to user u, v i represents the i-th user, and d represents the embedding vector q u and v i The dimension of ||q u || 2 =||v i || 2 =||v j || 2 =d.θ ui Represents two vectors q u and v i So, Updated to:
[0171]
[0172] represents the metric learning loss function;
[0173] v j represents the jth user;
[0174] [x] + =max(x,0) represents the standard hinge loss;
[0175] We replace the original hinge loss with its smooth upper bound and derive the angle loss:
[0176]
[0177] N represents the total number of samples in the dataset, which is used to calculate the average loss.
[0178] The cross entropy function is a loss function used to measure the performance of a classification model and is widely used in deep learning. Its mathematical expression is:
[0179]
[0180] where t i is the i-th element of the true label, and y i is the corresponding probability distribution of the model output. Since the cross entropy function is a loss function widely used in classification tasks, it is also considered to have good adaptability in the recommendation system. This means that we can use the properties and optimization algorithms of the existing cross entropy function to train the recommendation system. The cross entropy function can intuitively measure the difference between the model output and the true label, making the model training process more interpretable. By minimizing the cross entropy loss, we can more clearly understand the model's learning and prediction process of user preferences, thereby improving the interpretability and accuracy of the recommendation system.
[0181] Therefore, when optimizing multiple negative samples at the same time, the cross entropy is used to measure the difference between the model output probability and the actual label distribution. The model is trained by minimizing this difference so that it can learn a more accurate classification probability distribution:
[0182]
[0183] Represents the loss function after cross entropy optimization;
[0184] θ represents a weight parameter used to balance the performance of the model under different types of interactions;
[0185] (u,i,j) represents triple relationship information;
[0186] represents all triples;
[0187] The N-pair loss function is a loss function used to train neural networks for supervised learning, mainly used in tasks such as face recognition. This loss function aims to improve the model's similarity between multiple samples of the same identity in order to improve recognition accuracy during the verification and testing phases. Its goal is to learn discriminative feature representations by minimizing the similarity loss between pairs of samples of the same identity while maximizing the intervals between pairs of samples of other identities. This form of loss usually involves a comparison of original sample pairs and negative sample pairs to encourage the network to better distinguish different samples of the same identity. Its loss function is:
[0188]
[0189] Our work on angle loss explores third-order relationships beyond the studied pairwise distance range. Due to its flexibility and generality, angle constraints can be easily combined with traditional distance metric losses to improve the overall performance. Fusion of the N-pair loss function and the ARSML loss function gives the final ARSML optimization loss function as shown in Equation 23:
[0190]
[0191] Among them, η and λ are two hyperparameters that can weight the importance between pairwise loss and scale-invariant loss.
[0192] 2.3 ARSML-GCL algorithm derivation
[0193] In recent years, GNNs combined with contrastive learning have shown excellent performance in recommendation data augmentation schemes, which aim to handle highly sparse data. Despite their success, most existing graph contrastive learning methods either perform random augmentation (e.g., node / edge perturbations) on user-item interaction graphs or rely on heuristic-based augmentation techniques (e.g., user clustering) to generate contrastive views. LightGCL (Simple Yet Effective Graph Contrtive Learning For Recommendation) argues that these methods cannot preserve inherent semantic structures well and are easily affected by noise interference, and proposes a simple yet effective graph contrastive learning paradigm, LightGCL, to alleviate these problems and compromise the generality and robustness of CL-based recommendations. Our model specifically exploits singular value decomposition for contrastive augmentation, which enables unconstrained structure refinement and global collaborative relationship modeling.
[0194] In this paper, we further extend the proposed method to LightGCL to form the ARSML-GCL network model given in Algorithm 1.
[0195]
[0196]
[0197] 3 Experiments
[0198] Experiments are conducted on different datasets to evaluate the performance of ARSML-GCL by comparing with various state-of-the-art recommendation methods, with the goal of answering the following research questions:
[0199] RQ1: How does ARSML-GCL perform when competing with different types of recommendation methods?
[0200] RQ2: How does ARSML-GCL perform in alleviating the data sparsity problem?
[0201] RQ3: What are the contributions of different key modules in ARSML-GCL to the overall performance?
[0202] ●RQ4: What is the impact of the hyperparameters set in ARSML-GCL on the changes in performance indicators HR and NDCG?
[0203] 3.1 Dataset
[0204] The basic information of the four real datasets is shown in Table 1: Amazon-CDS, MovieLens, Amazon-Book, and Yelp 2018 are four important datasets widely used in the fields of recommendation systems and data mining. The Amazon-CDS dataset contains user ratings and comments on music. It is a dataset about music recommendation, covering a variety of music styles and artists. The Movie-Lens dataset focuses on movie recommendations, contains user ratings and comments on movies, covers movies of various types and ages, and provides rich information for studying recommendation algorithms. The Amazon-Book dataset focuses on book recommendations, contains user ratings and comments on books, covers a wide range of topics and genres, and provides valuable data for building book recommendation systems. The Yelp 2018 dataset involves user evaluations and comments on businesses, contains data from multiple fields such as restaurants and stores, and provides rich user feedback and experience data for recommendation systems and business analysis. These datasets play an important role in the research and development of recommendation systems, personalized recommendation algorithms, etc., helping researchers and engineers better understand user behavior and improve the accuracy of recommendation systems and user satisfaction.
[0205] Table 1. Statistics of experimental datasets
[0206]
[0207] 3.2 Evaluation indicators
[0208] In order to evaluate the fairness, for each target user, all non-interaction items are used as negative samples to infer the preferences of the user. For performance evaluation, two representative indicators: Hr@N and NDCG@N are used to measure the performance of the proposed ARSML-GCL. By default, the value of N is set to 20 for the top N recommendations. The method ARSML-GCL is implemented using PyTorch, and its performance is compared with various baseline methods using official or third-party codes. The calculation formulas of Hr and NDCG are as follows:
[0209] 1) NDCG (Normalized Discounted Cumulative Gain): To evaluate the recommendation system, we need to evaluate the recommendation lists of all users in the entire test set as a whole and normalize the evaluation scores of recommendation lists of different users. IDCG refers to the list of the best recommendation results returned by the recommendation system for a certain user.
[0210]
[0211]
[0212] 2) HR (Hit_ratio), the denominator is all the test sets, and the numerator represents the sum of the number of test sets in each user's Top-K list.
[0213]
[0214] 3.3 Baseline Comparison
[0215] We compare the ARSML-GCL algorithm with various recommender systems for performance evaluation.
[0216] BPR: First, we select the Bayesian Personalized Ranking framework BPR (Bayesian Personalized Ranking), which is a scoring and ranking recommendation algorithm based on matrix decomposition. It directly uses Bayesian theory to optimize the ranking. At the same time, this model is the mainstream benchmark model.
[0217] CML: Collaborative metric learning learns a joint metric space that encodes user-user relationships and relationships between users and positive items, thereby making recommendations based on the distance between users and items in the metric space. This is the first work to incorporate metric learning into recommendation.
[0218] SML: Symmetric metric learning is an improvement based on CML, which aims to search for different optimal margins for each user and each item with symmetric hinge loss, thereby strengthening the personalized recommendation ability in recommendation.
[0219] LRML: Latent Relational Metric Learning via Memory-based Attention for Collaborative Ranking is an inspired latent relational metric learning method that employs an augmented memory module to induce the latent relations of each user-item interaction.
[0220] CPR: Cross Pairwise Ranking makes unbiased recommendations by changing the pairwise and point-wise rating losses, and proposes a dynamic sampling mechanism to make better use of each sample.
[0221] LightGCN: Light Graph Convolution Network builds a graph convolutional network (GCN) based on user-item interaction data, and exploits user-item interactions and user-user relationships through a second-order embedding smoothing step.
[0222] LightGCL: Simple Yet Effective Graph Contrastive Learning for Recommendation A simple yet effective graph contrastive learning paradigm, LightGCL, can alleviate these problems that impair the generality and robustness of CL-based recommenders.
[0223] Table 2 Comparison of distance and loss functions and baseline methods
[0224]
[0225] 3.4 Comparative Analysis Experiments with Recommender System Baseline Methods (RQ1)
[0226] Table 2 shows the overall performance evaluation of ARSML-GCL in HR and NDCG in Metric@10, Metric@30, Metric@50, and Metric@70 on four real datasets: Yelp2018, Amazon-Book, Amazon-CDS, and Movie-lens, compared with six baseline methods such as BPR and CML. Figure 5 The superiority of the ARSML-GCL method in Metric@20, Metric@40, Metric@60, Metric@80, and Metric@100 compared with the baseline model is intuitively demonstrated.
[0227] Table 3 Performance comparison of all methods on four datasets
[0228]
[0229]
[0230]
[0231] Table 3 and Figure 7The experimental results in show that ARSML-GCL outperforms other baselines in all cases, which verifies the effectiveness of using angular distance and weighted user popularity sampling. The diversity of the evaluation datasets varies depending on data sparsity, data characteristics, and recommendation scenarios. The results demonstrate the versatility and flexibility of ARSML-GCL. Overall, the progress of ARSML-GCL can be attributed to four aspects:
[0232] (1) Optimize triple relationships: Use weighted user popularity sampling. Popularity is a measure of the importance of an item or user. By using a weighted sampling method, the model is more likely to focus on samples that are more important or frequently appearing in the dataset. This ensures that the model better captures the global pattern of the data.
[0233] (2) Use of angular distance: Using angular distance may mean that the algorithm pays more attention to the directional relationship between users or items rather than just their distance. This helps to better capture the relative importance between items or the user's preference for different items, improving the similarity measurement method.
[0234] (3) Relieve the pressure of adaptive boundary selection: The robust processing method of the ARSML-GCL algorithm proposed in this patent enhances scale invariance, especially when processing multi-scale data. It helps to improve the generalization performance of the model on new samples. The model can better adapt to different data sets and reduce the risk of overfitting for specific data sets.
[0235] (4) Embed the proposed method into the graph network structure: further improve the model recommendation performance. The proposed method is extended into the graph network structure to form a network model.
[0236] 3.5 Analytical Experiments on Alleviating Data Sparsity by ARSML-GCL (RQ2)
[0237] By evaluating the performance of ARSML-GCL compared with other recommendation methods in the scenario of sparse data, in order to study the robustness of ARSML-GCL in dealing with users without sufficient interaction, the interaction information of knowledge graph users and items is sparse, a sparse user set is generated, the number of interactions is reduced, and the performance of handling users without sufficient interaction information is compared. The indicator is defined as hr - =hr·(-1) can more intuitively observe the performance comparison of ARSML-GCL compared with other methods on Recall@20, and is used together with NDCG to compare the performance of different recommendation methods in user cold start. The evaluation indicators here are HR@20 and NDCG@20. Figure 8 shown.
[0238] Depend on Figure 8It can be seen that in the scenario with sparse user-item interaction information graph, the ARSML-GCL model obtains the best evaluation results on HRl@20 and NDCG@20 compared with 9 methods such as BPR and CML. This result once again proves the superiority of the ARSML-GCL method in reducing user interest bias and popular recommendation bias. It shows the superiority and necessity of the high-quality interaction information selection strategy of ARSML-GCL, which can effectively alleviate the user interest bias problem in the sparse user set scenario.
[0239] 3.6 Ablation Experiments (RQ3)
[0240] ARSML-GCL outperforms other baseline methods in both HR and NDCG performance indicators. The improvement of ARSML-GCL can be attributed to the following factors:
[0241] ●Application of weighted user popularity sampling method
[0242] ●Use of angle distance
[0243] ●Combining metric learning-based methods with popular graph network frameworks in the field of recommender systems
[0244] To investigate the effectiveness of the proposed method, we conducted a series of ablation experiments to further explore the performance advantages of ARSML-GCL over other baseline methods. In these experiments, we gradually removed key components in ARSML-GCL and observed the changes in performance. The three ARSML-GCL method variants are as follows:
[0245] 1) ARSML-GCL / WP: First, we conducted an ablation experiment on the weighted user popularity sampling method, removing it from ARSML-GCL and only using ordinary triples for the experiment.
[0246] 2) ARSML-GCL / AG: Next, we conducted an ablation experiment on the use of angular distance. Instead of using the angular loss function proposed in the present invention, we used the traditional Euclidean distance for the experiment.
[0247] 3) ARSML: Finally, we study the impact of combining metric learning based methods with a popular graph network framework in the field of recommender systems. The GCN framework is removed for experiments.
[0248] The comparative analysis experiments of ARSML-GCL and three method variants on Recall, NDCG, and HR indicators on four real data such as Amazon-CDS are shown in Table 3.
[0249] Table 4 NDCG and HR evaluation results of ARSML-GCL and three variants on four real datasets
[0250]
[0251] From the results in Table 4, we can see that the performance superiority of ARSML-GCL can be achieved in all cases. This shows that the use of weighted user popularity sampling method, the use of angle distance, and the combination of metric learning-based methods with the popular graph network framework in the field of recommendation systems are reasonable and effective.
[0252] 3.7 Parameter Experiments (RQ4)
[0253] ARSML-GCL has two important hyperparameters, η and λ. We further show the evaluation results of the hyperparameters η and λ, respectively, from (10 -3 ,10 -2 ,10 -1 ) and (0.1, 0.2, 0.3, 0.4, 0.5) and analyze the impact of η and λ on the performance of ARSML-GCL on the dataset. Taking the Amazon-CDs dataset as an example, as shown in Table 5.
[0254] Table 5 analyzes the impact of η and λ on HR@20 and NDCG@20 of ARSML-GCL on the Amazon-CDs dataset
[0255]
[0256] In Table 4, it is found that when η is 10*10 -1 , when λ is set to 0.3, ARSML-GCL has the best performance. When the values of the two parameters are changed, the performance is significantly reduced. ARSML-GCL is more sensitive to λ. Setting λ to 0.3 is a better and safer choice. A smaller λ is conducive to faster convergence. At the same time, η shows a monotonic change in most cases. A smaller η can improve performance under certain circumstances, but a smaller η setting is more conducive to ARSML-GCL achieving the best performance compared to most λ cases. Therefore, in general, when λ is set to 0.3, η is set to 10*10 -1 Make ARSML-GCL more conducive to achieving optimal performance during training.
[0257] In summary, comparative analysis was carried out on four real datasets such as Amazon-cds and Yelp2018 and 9 methods such as CML and SML. At the same time, ablation experiments and cold start analysis were carried out to demonstrate the rationality and effectiveness of the proposed ARSML method.
[0258] ARSML-GCL, a recommendation method that integrates angular distance and robust scale metric learning, is proposed to solve the problem that traditional metric learning methods based on Euclidean distance may not be able to handle the problem of unbalanced item categories and different intra-class variances. First, the patent of this invention analyzes the ternary relationship consisting of users, items of interest (positive samples) and items of no interest (negative samples) to understand the principle of the model in an intuitive way. Specifically, the patent of this invention first proposes a new weighted user popularity sampling method to better balance positive and negative samples and enhance metric accuracy. Based on the optimized triples, the patent of this invention derives a ternary hinge loss function, called the ARSML loss function. In order to capture more preference difference information, the patent of this invention integrates the pairwise ranking loss function into the scale-invariant loss function of the model. In the process of optimizing the loss function, negative sample items gradually move away from positive sample items and users, and positive samples gradually move closer to users, thereby learning users' discriminative preferences for positive and negative samples. Secondly, the patent of this invention innovatively combines the metric learning-based method with the popular graph network framework in the field of recommendation systems, and utilizes the ability of GCL to aggregate neighbor node information, thereby further improving the generalization ability of the model.
[0259] In the experimental phase, this section conducts sufficient experiments on the public data sets Amazon-Books, Amazon-CDs, Movie-Lens and Yelp2018 data sets. The experimental results show that: in terms of recommendation system performance evaluation, NDCG and HR are higher than the currently proposed recommendation algorithms based on metric learning; in the scenario of sparse user-item interaction information, ARSML-GCL can still better predict items for users in dealing with cold start problems; in terms of hyperparameter sensitivity, the influence of hyperparameters on ARSML-GCL in HR and NDCG indicators is explored, proving the superiority of the loss function. The above experiments fully demonstrate the advantages of ARSML-GCL in solving the key problems faced by recommendation systems, thus reflecting the application prospects of ARSML-GCL in e-commerce, social platforms, video sharing and advertising recommendations.
[0260] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A recommendation method integrating angular distance and robust scale metric learning, characterized in that: The following steps are involved: The data is converted into sample points, and the sample points are represented by triples (u, i, j); the data includes user ID, item ID and preference information, and the preference information includes one or any combination of click information, purchase information and rating information; u is an anchor sample, representing user u; i is a positive sample, representing an item that user u likes; j is a negative sample, representing an item that user u does not like or has not been exposed to; The proposed weighted user popularity sampling method is used to preprocess the triples to obtain a triple with balanced positive and negative samples. The processed triple data is used to construct a user-item interaction graph, in which users and items are nodes in the graph, and positive and negative samples are connected by interaction behaviors as edges. The weighted user popularity sampling method includes the following steps: (1) In order to ensure that users with rich preferences are fully explored, calculate the user u i The probability of being sampled is: Among them, p(u i ) represents user u i The weight of the current space; p(u k ) represents user u k The weight of the current space; Interaction(u i ,v j ) represents user u i With items v j Frequency of interaction; Interaction(u k ,v j ) represents user u k With items v j Frequency of interaction; K means there are K users in total; u k represents the kth user; v j represents the jth item; (2) Based on the sampled users, continue to sample the popularity of positive samples and negative samples separately: Among them, p(v i ) indicates item v i The weight of the current space; p(v k ) indicates item v k The weight of the current space; Interaction(u i ,v i ) represents user u i With items v i Frequency of interaction; Interaction(u i ,v k ) represents user u i With items v k Frequency of interaction; K means there are K users in total; v k represents the kth item; u i represents the i-th user; Calculate the angular distance between preprocessed triplets, perform metric learning, and learn the similarity between nodes in the graph; and use the ternary hinge loss function to optimize metric learning and achieve item recommendation; The loss function is in, Represents the loss function after cross entropy optimization; Represents N pairs of loss functions; η, λ are two hyperparameters that can weight the importance between pairwise loss and scale-invariant loss.
2. The recommendation method of claim 1 that integrates angular distance and robust scale metric learning, characterized in that: The calculation formula is as follows: θ represents a weight parameter used to balance the performance of the model under different types of interactions; · T is the transposition symbol; q u Represents the embedding vector corresponding to user u; v i represents the i-th item; v j represents the jth item; (u,i,j) represents triple relationship information; represents all triples.
3. The recommendation method of integrating angular distance and robust scale metric learning according to claim 1, characterized in that: The calculation formula is as follows: Among them, (u,i,j) represents the triple relationship information; T is the transposition symbol; q u Represents the embedding vector corresponding to user u; v i represents the i-th user; v j represents the jth user; represents all triples; N represents the total number of samples in the dataset.
4. The recommendation method of claim 1 that combines angular distance and robust scale metric learning, characterized in that: The item may also be an item, a service, or content.
5. The recommendation method of integrating angular distance and robust scale metric learning according to claim 1, characterized in that: Also includes: The recommendation method that integrates angular distance and robust scale metric learning is combined with graph contrastive learning. Graph contrastive learning learns the representation of nodes by comparing the similarity between nodes and their neighbor nodes, and uses the relationship and co-occurrence pattern between nodes to measure similarity, thereby better capturing the potential associations between users and items.
