A recommendation algorithm based on enhanced weighted trust relationship
By using the TECosRA recommendation algorithm based on weighted trust relationships, the performance degradation caused by the sparsity of trust relationship data in social networks is solved, achieving more accurate and diversified recommendations, expanding the range of items, and breaking the 'information cocoon' dilemma.
Patent Information
- Application Number
- CN202411804733.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In existing technologies, the sparsity of trust relationship data in social networks leads to a decline in the performance of recommendation algorithms, trapping users in an 'information cocoon' dilemma.
The recommendation algorithm based on weighted trust relationship (TECosRA) is adopted. It initializes resources for the target user's items, calculates resource values using CosRA similarity, introduces the user's trust relationship for weighting, and uses adjustable parameters to control the final allocation of resources to generate a recommendation list.
It improves the accuracy and diversity of recommendation algorithms, expands the range of recommendable items, alleviates the cold start problem, and breaks the 'information cocoon' phenomenon.
Smart Images

Figure CN119622116B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of recommendation algorithm, more particularly, to a recommendation algorithm based on weighted trust relationship enhancement (TECosRA). BACKGROUND
[0002] In social networks, people are more likely to trust the recommendations of their friends than strangers, according to a Nielsen study. The popularity of social networks makes people become friends on the network and pay trust, and gives birth to community-based recommendation systems, which are attracting more and more attention. This recommendation system is called social recommendation system, which makes predictions based on user profiles and relationships between users. Studies have shown that users trust recommendations from friends more than recommendation systems, and that recommendations based on social influence are more important than recommendations based on user historical behavior similarity, for example, by analyzing social relationships, the recommendation accuracy of online shopping items can be improved.
[0003] There are many studies on social network recommendation algorithms at present, in which the social relationship is very complex and diverse. The basic idea of collaborative filtering recommendation algorithm is to use the similarity between users or items to make recommendations or predictions, which is the calculation of the similarity between users of a specified item, finding a group of users with the same preferences, then analyzing the common preferences of users to make recommendations to target users and finally generating a recommendation list. The advantage of collaborative filtering algorithm is that it does not focus on the content of the item itself, but mainly recommends resources based on user or item similarity. The system only needs to obtain enough item evaluation to reliably recommend items. However, this method needs to be evaluated based on large data, and needs to rely on the accuracy of similarity to improve the accuracy of recommendation.
[0004] CN117807329A describes a rating-weighted collaborative filtering recommendation method based on trust relationships. The method includes: constructing a user item category matrix by combining user item rating datasets and item category datasets; obtaining a user item category matrix under trust relationships based on trust relationships; performing clustering calculations on the user category matrix under trust relationships, assigning users with the same category to a cluster, thus obtaining k clusters; calculating the similarity between the target user and other users within the cluster, finding the M users with the highest similarity to form the target user's nearest neighbor set; applying an improved weighted Slope One algorithm to the target user's nearest neighbor set to predict the ratings of its unrated items, and deriving the top N based on the predicted ratings into a recommendation list. This method improves the performance and accuracy of the recommendation algorithm by increasing trust links between users. However, this patent still requires a large number of users and sufficient data to ensure the accuracy of the recommendation algorithm. The data sparsity inherent in trust relationships in social networks can reduce the performance of the recommendation algorithm, leading to users being trapped in an "information cocoon." Summary of the Invention
[0005] The main technical problem this invention aims to solve is to address the shortcomings of existing technologies where the data sparsity due to trust relationships in social networks reduces the performance of recommendation algorithms, leading to users being trapped in an "information cocoon" dilemma. This invention provides a recommendation algorithm based on weighted trust relationship enhancement (TECosRA).
[0006] The objective of this invention is achieved through the following technical solution:
[0007] A recommendation algorithm based on weighted trust relationship enhancement, comprising the following steps:
[0008] S1. For target user u i Select project α and initialize its resources;
[0009] S2. Calculate the target user u using CosRA similarity. i Resource value f obtained from the project ′(i) ;
[0010] S3. Introduce target user u i Establish a trust relationship to gain the target user u i Trust relationship resource value This resource value Is the target user u i other trusted users u j For project o α The average resource value is expressed as:
[0011]
[0012] where u i is the target user j α is the average rating value of item o i i is the degree of user u (i) i is the resource value of all items, and m is the total number of users in the network.
[0013] S4. Control the final allocation of resources of target user u i with adjustable parameter λ, and is expressed as:
[0014]
[0015] where λ is an adjustable parameter, and b ij i j is whether user u
[0016] S5. Sort the resulting resource values of items in descending order and exclude the selected items to obtain a recommendation list of length L.
[0017] Further, the resource initialization is expressed as:
[0018]
[0019] where u i α = 0 if target user u iα i = 1 if target user u α iα = 1. Further, the resource value f i ′(i) of all items of target user u
[0020] f ′(i) = S CosRA f (i)
[0021] where S CosRA is the CosRA similarity.
[0022] Further, the S CosRA is expressed as:
[0023]
[0024] where α and β represent item o α and item o β , respectively, and aiα and a iβ respectively represent the score of the user u i to the item o α and the item o β , k α , k β and k i respectively represent the degree of the item o α , o β and the user u i , η1, η2 represent the value between the range [-1, 1].
[0025] Further, the optimal η1, η2 of the recommendation performance of the CosRA algorithm is -0.5.
[0026] Further, the value range of the λ is 0.275-0.575. Preferably, in the FriendFeed dataset, λ is 0.375; in the Epinions dataset, λ is 0.275 or 0.575.
[0027] Further, if the target user u i trusts the user u j , b ij =1, otherwise b ij =0; when b ij =0, the final resource allocation obtained by the target user u i is represented as:
[0028] f ′(i) =S CosRA f (i) .
[0029] Further, the evaluation indexes of the accuracy of the algorithm include one or more of AUC, Ranking Score, nDCG, accuracy, recall rate and F1 index; the diversity indexes include Hamming distance, inner similarity and novelty.
[0030] Further, the length of the recommendation list is not more than 50.
[0031] Compared with the prior art, the beneficial effects are:
[0032] The recommendation algorithm based on the enhanced weighted trust relationship of the application firstly initializes the resource of the project selected by the user, then calculates the resource value obtained by the user from the project using the CosRA similarity, next introduces the trust relationship of the user, performs the weighted action of the score obtained based on the social similarity to the resource of the user, controls the final allocation of the resource of the user by using the adjustable parameter, and finally sorts the final resource value obtained by the item in descending order to generate the recommendation list with the length of L.
[0033] The CosRA similarity index used in this invention expands the scope by utilizing nodes with high degree while increasing the weight of nodes with low degree, thus balancing the dilemma of accuracy and diversity in recommendation algorithms. Furthermore, by introducing trust relationships from users' social networks into the algorithm, it supplements the "user-item" rating data. The recommendation algorithm calculates the taste similarity between users based on their historical behavior and recommends items selected by similar users. By introducing trust relationships, this invention uses social relationships to refine user behavior patterns, expanding the scope available for calculating user similarity and thus alleviating the cold start problem. On the other hand, it weights item resource values through user trust relationships, strengthening the positive impact of trust relationships on user behavior and improving the accuracy of the recommendation algorithm. Simultaneously, the sources of recommendable items for users include similar users and trusted users, expanding the range of recommendable items and positively contributing to breaking down the "information cocoon" in recommendation systems. Attached Figure Description
[0034] Figure 1 This is a graph showing the effects of adjustable parameters.
[0035] Figure 2 This is a graph showing the optimal values for adjustable parameters.
[0036] Figure 3 This is a graph showing how the accuracy of the recommendation results is affected by the list length.
[0037] Figure 4 This is a graph showing how the diversity and novelty of the recommendation results are affected by the list length. Detailed Implementation
[0038] The following examples further explain and clarify the invention, but the specific examples do not limit the invention in any way.
[0039] Example 1
[0040] This embodiment provides a recommendation algorithm based on weighted trust relationship enhancement. In the algorithm, users use u... i u j Indicates that the item is represented by o. α o β The steps include:
[0041] S1. For target user u i The selected project α is initialized with resources, represented as follows:
[0042]
[0043] Among them, target user u i No items selected α Then a iα =0, otherwise a iα=1.
[0044] S2. Calculate the resource value f′ obtained by the target user from the project using CosRA similarity. (i) :
[0045] f ′(i) =S CosRS f (i)
[0046] Where S CosRA CosRA similarity is expressed as:
[0047]
[0048] Where α and β represent item o α and items β a iα and a iβ They represent user u respectively i For item o α and items β The rating, k a k β and k i Each represents an item o α o β and user u i The degree, η1 and η2 represent values in the range [-1, 1] with a value interval of 0.05. The optimal parameter value is η1 = η2 = -0.5.
[0049] S3. Introduce the target user's trust relationship and obtain the target user's trust relationship resource value. This resource value is for the target user u. i other trusted users u j The project o α The average resource value is expressed as:
[0050]
[0051] in Indicates user u i Trusted user u j For item o α The average rating, k i Indicates user u i The degree, f′ (i) Let m represent the resource value of all items for user i, and m represent the total number of users in the network.
[0052] S4. The final allocation of user resources is controlled through adjustable parameters, as follows:
[0053]
[0054] Where λ is an adjustable parameter, b ij Indicates user u i For user u j Whether to trust, if user u i Trust user u j Then b ij =1, otherwise b ij =0; when b ij When = 0, the target user u i The final resource allocation obtained is represented as follows:
[0055] f ′(i) =S CosRA f (i)
[0056] S5. Sort the resource values obtained from the items in descending order to obtain a recommendation list of length L.
[0057] Example 2
[0058] This embodiment provides an experimental example of the impact of adjustable parameter scaling. The evaluation is based on eight metrics: accuracy (AUC, Ranking Score (RS), Precision (P), Recall (R), and F1); and diversity (Hamming distance (H), Intra-similarity (I), and Novelty (N). The details are as follows:
[0059] (1) The AUC metric is used to test the accuracy of a recommendation algorithm in predicting items globally. For a randomly sorted recommendation list with algorithmic intervention, the AUC value is around 0.5, with a maximum of 1. The higher the AUC value, the higher the prediction accuracy of the algorithm; therefore, the AUC value of an algorithm is directly proportional to its recommendation accuracy. The formula is expressed as:
[0060]
[0061] Where m represents the total number of users, N represents the number of independent comparisons, N1 represents the number of times the target user's collected objects have more resources than the uncollected objects, and N2 represents the number of times the target user's collected objects have the same resources as the uncollected objects.
[0062] (2) Accuracy (P) is used to test the proportion of correctly predicted items in the target user's recommendation list. P = 0 when no items in the target user's recommendation list are predicted, and P = 1 when all items are correctly predicted. Therefore, the higher the accuracy, the closer the algorithm's predictions are to the user's actual situation. Its formula is expressed as:
[0063]
[0064] Where d i(L) is the number of objects in the test set that have the same object in the recommended list of length L.
[0065] (3) Recall (R) is used to measure the proportion of items in the target user test set that are predicted correctly. R = 0 when none of the items in the target user test set are predicted correctly, and R = 1 when all of the items in the target user test set are predicted correctly. Therefore, the higher the recall, the better the prediction of the algorithm matches the user's interests. Its formula is expressed as:
[0066]
[0067] where D i (L) is the number of objects in the test set.
[0068] (4) The F1 index is an index that considers both precision and recall to comprehensively evaluate the performance of the algorithm. The F1 value is directly proportional to the accuracy of the algorithm. Its formula is expressed as:
[0069]
[0070] where P i (L) is the Precision value of user i, R i (L) is the Recall value of user i.
[0071] (5) The RS index is a ranking evaluation index similar to AUC. RS is used to measure the relative ranking of items in the target user test set in the user's recommended list. The lower the RS value, the better the ranking accuracy of the algorithm's predicted items. The sum of AUC and RS is approximately 1. Its formula is expressed as:
[0072]
[0073] where |E p | represents the size of the test set, p α is the position of the object in the recommended list, and l i is the number of objects not collected by user i in the training set.
[0074] (6) Internal similarity (I) is used to evaluate the diversity of items in the user's recommended list. The lower the I value, the more diverse the items recommended by the algorithm to the target user. Its formula is expressed as:
[0075]
[0076] where represents the cosine similarity of recommended objects a and b in the recommended list of user i.
[0077] (7) Hamming distance (H) evaluates the difference degree of items in the recommendation list of different users. When the items in the recommendation list of two different users are consistent, H = 0, and when they are completely inconsistent, H = 1. It is explained that the larger the H value is, the greater the difference of the recommendation list of the user is, and the more diverse the items recommended by the algorithm are. Its formula is expressed as:
[0078]
[0079] Wherein C(i,j) represents the number of same objects in the recommendation list of length L of user i and user j.
[0080] (8) Novelty (N) evaluates the index of the "popularity" degree of the items in the recommendation list of the user. The larger the N value is, the higher the popularity of the recommended items is, the smaller the N value is, the more "unpopular" the recommended items are, and the higher the novelty of the algorithm is, which is more suitable for application in the personalized recommendation scene. Its formula is expressed as:
[0081]
[0082] Wherein k α is the degree of the recommended object a in the recommendation list of the target user.
[0083] The three precision indexes adopted in the embodiment on the FriendFeed dataset and the Epinions dataset are evaluated, and the accuracy has a peak value with the change of λ. As shown in Figure 1 , on the FriendFeed dataset, the best accuracy result is when λ = 0.375. On the Epinions dataset, the results of global accuracy (AUC and RS) are when λ = 0.575. After that, the accuracy of the algorithm begins to gradually decrease.
[0084] From the (f) trend of Figure 2 , the F1(L) value on the Epinions dataset is at the highest when λ is about equal to 0.275, and when λ exceeds 0.275, the value of F1(L) begins to gradually decrease, which is different from the performance on the FriendFeed dataset.
[0085] During the experiment, we observed a phenomenon on the Epinions dataset: when performing k-fold cross validation, the dataset is divided into k parts. At this time, we found that some items were not selected by any user in the training set, but were selected by users in the test set, so there was no historical record to predict such items when using the training set to make predictions. AUC and RS are performance evaluations in a global situation, while F1(L) is a performance evaluation in terms of the length L of the recommendation list, so the values of AUC, RS and F1(L) on the Epinions dataset are different when λ * is optimal.
[0086] To determine the optimal value of the adjustable parameter λ, three accuracy indicators P, R and F1 depending on the length L of the recommendation list are used for testing, as shown in Figure 2 (a-b, d-e). It is shown that the optimal parameter λ * is not very sensitive to the length L of the recommendation list. For P and R indicators, the best parameter on the FriendFeed dataset is 0.575, as shown in Figure 2 (a). The best parameter on the Epinions dataset is 0.275, as shown in Figure 2 (d). For the F1 indicator, the same trend also appears Figure 2 (b) and Figure 2 (b)). In addition, in Figure 2 (a) and 2(d), the optimal parameter value λ * of the accuracy indicators P, R and F1 is determined by experiment. The results on FriendFeed and Epinions confirm that the results of the accuracy indicators (AUC and RS) that do not depend on L are FriendFeed (λ * ) ≈ 0.375 and Epinions (λ * ) ≈ 0.275. It can be observed from Epinions that the optimal parameter values of the five accuracy indicators on the FriendFeed dataset are the same. On the Epinions dataset, the best values of AUC and RS correspond to the same λ, and the best values of P(L), R(L) and F1(L) also correspond to the same λ, which shows that λ is stable. This shows the universality of the TECosRA algorithm under the optimal parameter, and the trust relationship indeed improves the performance of the recommendation algorithm.
[0087] Example 3
[0088] The performance of the method of the present application and five benchmark algorithms (MD, HC, UCF, CosRA and CosRA+T) on the same data sets is compared in this embodiment. Nine accuracy evaluation indexes are applied, including two indexes independent of L (AUC and RS) and three indexes dependent on L (nDCG, P, R and F1), two indexes dependent on L (H and I) and one index dependent on L (N). In the experiment, the recommended list length is set as L=10. In the comparison with the benchmark test method, the TECosRA algorithm uses the optimal parameter value λ of each data set in all evaluation indexes * (FriendFeed takes λ * =0.375, and Epinions takes λ * =0.275), and the operation result is the average value of 1000 independent operations. The recommended algorithm effect result is shown in Table 1:
[0089] Table 1
[0090] AUC RS MD P R F1 H I N HC 0.8255 0.1750 0.0189 0.0590 0.0286 0.6718 0.1134 229 UCF 0.7795 0.2211 0.0051 0.0153 0.0077 0.9749 0.0243 5 CosRA 0.8190 0.1921 0.0170 0.05371 0.02586 0.5673 0.1311 256 CosRA+T 0.8301 0.1703 0.0221 0.0629 0.0327 0.9520 0.0868 100 TECosRA 0.8321 0.1682 0.0226 0.0651 0.0336 0.9582 0.0890 94 Figure 3 0.8449 0.1551 0.0234 0.0718 0.0357 0.8364 0.1112 170
[0091]
[0092]
[0093] As can be seen from Table 1, the performance of the TECosRA algorithm of the present application is better than that of all benchmark algorithms on the FriendFeed and Epinions data sets. The AUC value of the algorithm on the FriendFeed and Epinions data sets is 0.8449 and 0.9151, respectively. In the accuracy index, the performance of the algorithm is better than that of the benchmark test algorithm. Specifically, the P, R and F1 values of the algorithm on the FriendFeed and Epinions data sets are the highest among all algorithms. In the ranking-based accuracy index RS, the RS value of the algorithm is the lowest among all benchmark algorithms, indicating that the performance of the new algorithm in the ranking accuracy is the best among all benchmark algorithms. In the diversity index, the performance of the algorithm of the present application is better than that of the UCF algorithm and close to that of the MD algorithm. The I value of the algorithm of the present application on the Epinions and FriendFeed data sets is much lower than that of the UCF algorithm, the H value is much higher than that of the UCF algorithm, and the N value is in the middle position among the benchmark algorithms. Therefore, the performance of the algorithm of the present application is better than that of several benchmark test algorithms as a whole.
[0094] Embodiment 4
[0095] The embodiment studies the influence of the length L of the recommendation list on the algorithm performance, changes the length of the recommendation list for experiment, and analyzes the influence on the recommendation result. The length L of the recommendation list in the recommendation algorithm can influence the evaluation of the recommendation performance under the evaluation indexes, wherein the three accuracy indexes (P(L), R(L) and F1(L)), two diversity indexes (H(L) and I(L)) and one novelty index (N(L)) are mainly included.
[0096] In order to explore the influence of the length L of the recommendation list on the algorithm performance, the change of the length L of the recommendation list from 0 to 100 is used to explore how L influences the performance of the recommendation algorithm. The TECosRA algorithm is compared with other five benchmark methods.
[0097] It can be known from the results of the three accuracy indexes of the recommendation algorithm shown in Figure 3 on the FriendFeed and Epinions datasets with the change of the length L of the recommendation list that for all the benchmark methods selected in the embodiment, the performance decreases with the increase of the value of P(L) (see Figure 3 (a) and 3(d)), and the value of R(L) increases (see Figure 4 (b) and 3(e)) with the increase of the length L of the recommendation list. With the increase of the length L of the recommendation list, the F1 value first increases and then decreases, and the F1(L) on the FriendFeed and Epinions reaches the maximum value when L≈5. In addition, the performance of the TECosRA algorithm is relatively superior to that of other benchmark methods under different lengths L of the recommendation list, and the effect is more obvious when L is near the optimal value of the adjustable parameter. It is also observed from the figure that the accuracy indexes of the TECosRA algorithm of the embodiment are obviously improved compared with the CosRA+T algorithm, the MD algorithm and the UCF algorithm compete with each other, and the accuracy of the HC algorithm is the lowest.
[0098] It can be known from the results of the two diversity indexes and the novelty index shown in Figure 4 that for the Hamming distance (H(L)), the value of H(L) decreases with the increase of L on the FriendFeed and Epinions datasets, as shown in Figure 4 (a) and Figure 4 (d). The effect of the HC algorithm is the best, followed by the CosRA algorithm and the CosRA+T algorithm, the performance of the TECosRA algorithm on H(L) is close to that of the MD algorithm, and the UCF algorithm has the worst performance. For the inner similarity I(L), the value of I(L) first rapidly increases and then slowly decreases with the increase of the length L of the recommendation list (see Figure 4 (b) and Figure 4(e)), on this evaluation metric, the maximum I(L) value of UCF indicates its worst performance, the improved new algorithm is better than UCF algorithm, and its performance is close to that of MD algorithm. HC algorithm is better than all other methods on the data set, because its I(L) value is the smallest. In terms of novelty N(L), N(L) value will decrease rapidly at first with the increase of the length L of the recommended list, and then show a slow downward trend, as shown in (c) and (f). The best performance is HC algorithm, and the new algorithm of the present application is in the middle position among all algorithms, which shows that the improved new algorithm has certain advantages on this index. It is observed from the results that, except for HC, the TECosRA algorithm is better than most of the benchmark methods in the novelty index, and the results of the algorithm start to be gradually insensitive to the change of L after the recommended list exceeds about 50, which shows that the weighted trust-based recommendation algorithm has higher diversity and better novelty in the recommendation of uncensored objects relative to other benchmark methods.
[0099] Obviously, the above embodiments of the present application are only examples for clearly illustrating the present application, and are not intended to limit the embodiments of the present application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art. All the embodiments do not need to be exhausted here. Any modification, equivalent replacement and improvement within the spirit and principle of the present application shall be included in the protection scope of the claims of the present application.
Claims
1. A recommendation algorithm based on weighted trust relationship enhancement, characterized by the steps of Includes: S1. To a target user Selected items Resource initialization is performed; S2. Use CosRA Similarity calculation target user Resource value obtained from the project ; S3. Introducing target users Building trust relationships to gain the target users Trust relationship resource value The value of this resource Target users other trusted users items The average resource value is expressed as: wherein represents a target user trusted users to an item an average rating value, represents a user a degree, represents a resource value for all items for a target user all items, m represents the total number of users in the network; S4. Controlling target users with adjustable parameters the final allocation of resources, denoted as: where λ is a tunable parameter, representing a user to the user whether to trust; S5. Sort the resulting resource values of the items in descending order and exclude the selected items to obtain a recommendation list of length L.
2. The recommendation algorithm based on the enhanced weighted trust relationship according to claim 1, characterized in that, Resource initialization is denoted as: Wherein, the target user Unselected item Then , the target user .
3. The recommendation algorithm based on the enhanced weighted trust relationship according to claim 1, characterized in that, If the target user trusts the user , then , otherwise ; when , the target user obtains the final resource allocation, which is expressed as: wherein is CosRA similarity.
4. The recommendation algorithm based on enhanced weighted trust relationship according to claim 3, characterized in that, The is represented as: wherein, α and β respectively represent items and items , and respectively denote ratings of users to items and items , , and respectively represent degrees of items , and users , are represented as values between the range [-1, 1].
5. The recommendation algorithm based on enhanced weighted trust relationship according to claim 4, characterized in that, CosRA the algorithm's recommended performance best .
6. The recommendation algorithm enhanced based on weighted trust relationship according to claim 1, characterized in that, The ranges from 0.275 to 0.
575.
7. The recommendation algorithm based on enhanced weighted trust relationships according to claim 6, characterized in that, In FriendFeed the data set, is 0.375; in Epinions the data set, is 0.275 or 0.
575.
8. The recommendation algorithm enhanced based on weighted trust relationship according to claim 1, characterized in that, The evaluation indexes of the accuracy of the algorithm include AUC 、 RankingScore 、 nDCG , accuracy, recall rate and F 1 index; the diversity indexes include one or more of Hamming distance, inner similarity and novelty.
9. The recommendation algorithm enhanced based on weighted trust relationship according to claim 1, characterized in that, The length of the recommendation list is no more than 50.
Citation Information
Patent Citations
Collaborative filtering recommendation method based on score weighting under trust relationship
CN117807329A
Collaborative filtering recommendation method based on social network energy diffusion
CN113221021A