A multi-objective movie recommendation method for large-scale users
By improving the method of reinforcing the learning calculation combined with the enhanced learning method, the user group and the knowledge migration of users have solved the efficiency and diversity of the movie recommendation system in the existing technologies in massive data processing and large -scale user scenarios to achieve A more efficient movie recommendation effect.
Patent Information
- Application Number
- CN202410291086.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-03-14
AI Technical Summary
When the existing movie recommendation system processes massive movie data, it is difficult to recommend movies that meet user needs, resulting in insufficient diversity and fairness of recommendations, poor user experience, and low recommendation efficiency in large-scale user scenarios.
Use improved cluster algorithms to group users, and use evolutionary calculations and enhanced learning methods to migrate internal and external knowledge to achieve user synergistic evolution and improve recommendation effects.
It effectively improves the accuracy of multi-target movie recommendation, fairness and diversity of movie exposure, and improves user experience and recommendation efficiency.
Smart Images

Figure CN118364166B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of recommendation methods, and in particular to a multi-objective movie recommendation method for large-scale users. Background Art
[0002] With the rapid development of the Internet, information is growing at an exponential rate, and people are in an era of information explosion. As a result, people are exposed to a large amount of information every day. How to find movies that people are interested in from a large amount of movie information and recommend them to users has undoubtedly become a problem worth studying. The design and implementation of the current movie recommendation system has solved these recommendation problems encountered in the information age to a certain extent.
[0003] However, in actual use, processing massive amounts of movie data will cause the following major problems:
[0004] 1. The huge amount of movie data often reduces the data mining effect, making it difficult to recommend movies that meet user needs.
[0005] 2. During use, recommendations are often made for a single goal of accuracy. It is difficult to get recommendations for low-exposure long-tail movies, which is unfair to movies and leads to poor user experience. The recommended movies feel lacking in novelty. When the diversity of movie recommendations is not good, it will also lead to poor user experience.
[0006] 3. In the real movie recommendation scenario, when the number of users is large, the traditional multi-objective recommendation method will have low recommendation efficiency and poor effect.
[0007] Based on the above-mentioned technical problems, it can be seen that the current multi-objective movie recommendation methods still have a lot of room for improvement. Summary of the invention
[0008] In order to avoid and overcome the technical problems existing in the prior art, the present invention provides a multi-objective movie recommendation method for large-scale users. The present invention uses an improved clustering algorithm to group users, and all groups of users perform evolutionary calculations synchronously, and combines the reinforcement learning method to transfer knowledge within and outside the group to achieve the collaborative evolution of all users, which can effectively improve the multi-objective recommendation effect, thereby increasing the accuracy of the recommendation results, the fairness and diversity of movie exposure.
[0009] To achieve the above object, the present invention provides the following technical solutions:
[0010] A multi-objective movie recommendation method for large-scale users includes the following steps:
[0011] S1. Obtain the data of the user's historical movie browsing, calculate the comprehensive score of each movie based on the data, and arrange each movie in the corresponding movie recommendation candidate set in descending order according to the comprehensive score, and store each user in the user set;
[0012] S2, clustering and classifying users by using the improved k-means algorithm, and dividing the users in the user set into a set number of user groups;
[0013] S3, perform evolutionary operations, repeated chromosome operations, crossover and intra-group knowledge transfer operations, chromosome mutation operations and elite strategy operations on users in each user group to generate a recommendation list and recommend it to users in each group.
[0014] As a further solution of the present invention, the process of obtaining the movie recommendation candidate set is as follows:
[0015] S11, obtaining movies that the user has browsed in the past, numbering all the obtained movies in sequence, and storing all the numbered movies in a movie set, and storing all the users in a user set;
[0016] S12. Obtain movies that have not been browsed by each user from the movie collection, and store the corresponding movies in the movie subset of each user; use the LightGCN algorithm to calculate the accuracy score of each movie in each movie subset, and independently sort each movie in each movie subset in descending order of accuracy score to obtain the movie accuracy sorting set of each user;
[0017] S13. Calculate the exposure fairness of each movie according to the number of times each movie in the movie set has been viewed. The calculation formula is as follows:
[0018]
[0019] Among them, f (item-fair) Represents the exposure fairness score of the movie item; n item,(u-c) Represents the number of users who browsed movie items in the movie collection, n (u) Represents the total number of users in the user set;
[0020] S14. Calculate the diversity score of each movie according to the number of movie categories to which each movie in the movie set belongs. The calculation formula is as follows:
[0021]
[0022] Among them, f (item-div) Represents the diversity score of movie items in the movie collection, s itemIndicates the number of movie categories to which the movie item in the movie collection belongs, s (total) Represents the total number of movie categories in the movie collection;
[0023] S15. Calculate the comprehensive score of the movie for the user based on the accuracy score, exposure fairness score and diversity score of the movie. The comprehensive score calculation formula is as follows:
[0024]
[0025] in, Indicates the i-th movie sub-set of user i in the movie set j The comprehensive score of movies, j represents the jth movie in the movie collection. At this time, the movie is also in the movie subset of user i, numbered i j ; Indicates the i-th movie sub-set of user i in the movie set j The accuracy score of a movie calculated by the LightGCN algorithm; j represents the exposure fairness index score of the jth movie in the movie set; z j represents the diversity score of the jth movie in the movie collection; express The weight coefficient of Represents y j The weight coefficient of
[0026] S16. Sort the movies in each user set independently in descending order of comprehensive scores to obtain a candidate set of movies for recommendation for each user.
[0027] As a further solution of the present invention: the specific steps of step S2 are as follows:
[0028] S21. Clustering and classifying users by using an improved k-means algorithm, dividing users in a user set into C user groups; using the historical trajectory of movies browsed by each user, as well as the gender, occupation, and age of the user as user characteristic attributes; and establishing a multidimensional space using the user characteristic attributes as dimensions, wherein the coordinates of each user are presented in the multidimensional space through vectorized representation;
[0029] S22. Randomly select a user as the central user, calculate the Euclidean distance between the central user and other users in the multidimensional space, calculate the sum of the distances between the central user and other users, calculate the mean of the distances dis-mean, and retain users whose distances from the central user are greater than the dis-mean as candidates for central users.
[0030] S23, performing normalization calculation based on the distances between the central user and all the candidate central users, and marking the normalized data on the number axis, the sum of these normalized distance values being 1;
[0031] S24, randomly generate a number from 0 to 1, and when the number falls into different intervals, select the corresponding user as the next central user. According to this method, the user far from the central user has a higher probability of being selected;
[0032] S25. Continue to process the users in the user set according to the contents of step S22 to step S24 to obtain C group of user groups and generate the required cluster centers. The improved k-means algorithm can increase the calculation speed of grouping and effectively avoid the phenomenon of over-concentration of cluster centers. Using this method to group users will also be more accurate.
[0033] As a further solution of the present invention: the users in the C group of users are simultaneously subjected to evolutionary computation, so that the users in the Z group of users are c Take the evolutionary computation process of (c∈[0,C]) as an example, as follows:
[0034] Group Z c There are M users. A movies are randomly selected with replacement from each user's movie recommendation candidate set to form a movie recommendation list chromosome for the user. The random selection is repeated N times, and each user obtains N movie recommendation list chromosomes. All the movie recommendation list chromosomes of M users together constitute the initial parent population P0. The number of movie recommendation list chromosomes in the initial parent population P0 is L=M×N.
[0035] As a further solution of the present invention: c Generate duplicate chromosomes. The specific process is as follows:
[0036] S321, construct a new population P'0; for each user's N movie recommendation list chromosomes, randomly select two movie recommendation list chromosomes, compare the sizes of each objective function value between the two movie recommendation list chromosomes, and select the movie recommendation list chromosome with a larger objective function value and put it into the population P'0;
[0037] S322. If the objective function values between the two movie recommendation list chromosomes are the same, calculate the crowding distance between the two movie recommendation list chromosomes, select the movie recommendation list chromosomes with a large crowding distance and keep them in P'0, and repeat this operation N times with replacement until N chromosomes are selected and saved in P'0.
[0038] As a further solution of the present invention: cThe M users in generate repeated chromosomes. The specific process is as follows: the chromosomes generated by the M users are saved in P'0; P0 and P'0 are merged to form a parent population P1, and the number of chromosomes in P1 is 2L.
[0039] As a further solution of the present invention: crossover and intra-group knowledge transfer operations are performed, and the specific steps are as follows:
[0040] S341, construct a new population P2; randomly select two chromosomes R from the P1 population p11 and chromosome R p12 , while deleting chromosome R in the P1 population p11 and chromosome R p12 If chromosome R p11 and chromosome R p12 Chromosomes from the same user, then randomly exchange R p11 and R p12 Part of the movie gene in the new chromosome R' p11 and chromosome R' p12 ;
[0041] If the new chromosome R' p11 and chromosome R' p12 If there are duplicate movie genes in , the duplicate movie genes are restored to the previous movie genes to ensure R' p11 and R' p12 There are no duplicate movie genes in the chromosome R' p11 and chromosome R' p12 Save to the new population P2;
[0042] If R p11 and R p12 The chromosomes from two users u1 and u2 are calculated as R p11 and R p12 The duplicate movie genes are retained and put into set B. For chromosome R p11 and chromosome R p12 Other non-repeated movie genes are placed in the temporary set H; when the sub-chromosome R' of u1 is generated p11 When, it is preferred to save all movies in B to R' p11 Then two movie genes d are randomly selected from H without replacement. i and d j , compare u1 to d i and d j The movie genes with high comprehensive scores are put into the temporary set H u1 Repeat this process until H u1The number of movies in reached half of that in H;
[0043] S342, then from H u1 Randomly select two movies from d' i and d' j , compare user u2's i and d' j The movie genes with high comprehensive scores are saved to the sub-chromosome R' of u1 p11 Repeat this process until the sub-chromosome R' of u1 p11 The length is A only;
[0044] S343. The same process can also be used to obtain the sub-chromosome R' of user u2. p12 , and finally R' p11 and R' p12 Save to the new population P2.
[0045] As a further solution of the present invention, a mutation operation is performed on the 2L movie recommendation list chromosomes in the population P2. The specific process is as follows:
[0046] S351, calculating the three objective function values of accuracy, diversity and fairness of the 2L movie recommendation list chromosomes in P2, and obtaining the three extreme chromosomes with the highest three values respectively, and these three chromosomes are retained without mutation;
[0047] S352. Perform mutation operation on the remaining 2L-3 chromosomes. The mutation operation adopts the multi-chromosome probability method to perform mutation. Each time, q chromosomes are randomly selected from 2L-3 chromosomes, and the number of times all movies appear in these q chromosomes is calculated. If a movie i appears r (i) times, then the probability formula for the movie being mutated is as follows:
[0048]
[0049] Among them, f (mutate-i) represents the probability of mutation of movie i, r (i) is the number of times movie i appears; a random number num from 0 to 1 is given, and if num is greater than f (mutate-i) If the number of mutations is large, movie i will be mutated, otherwise it will not be mutated. Repeat this operation for a set number of times to complete this round of mutation and obtain population P3.
[0050] As a further solution of the present invention: elite strategy operation is performed, and the specific process is as follows:
[0051] S261. Construct three objective functions, including an accuracy objective function, a fairness objective function, and a diversity objective function;
[0052] The accuracy objective function is specifically expressed as follows:
[0053]
[0054] Among them, f1 represents the accuracy value of the chromosome of the movie recommendation list; u i (tp) represents the number of movies accurately recommended for the i-th user in the recommendation list chromosome; u i (fp) represents the number of movies wrongly recommended for the i-th user in the recommendation list chromosome;
[0055] The fairness objective function is specifically expressed as follows:
[0056]
[0057] Where f2 represents the fairness objective function value of the recommendation list chromosome; K represents the number of movies in the recommendation list chromosome; μ j represents the fairness score of movie j;
[0058] Diversity objective function:
[0059]
[0060] Among them, f3 represents the diversity objective function value of the recommendation list chromosome; K represents the number of movies in the recommendation list chromosome; β j represents the diversity score of movie j;
[0061] S362, calculating the function value of each chromosome in the population P3 in each objective function;
[0062] S363, select any two chromosomes from population P3 and define them as the first chromosome and the second chromosome; compare the function values of the same objective function of the first chromosome and the second chromosome. When all the function values of the first chromosome are greater than or equal to the function value corresponding to the second chromosome, and there is at least one function value of the first chromosome that is greater than the function value corresponding to the second chromosome, the first chromosome is said to dominate the second chromosome;
[0063] S364, find all the first chromosomes in population P3 in the manner of step S363, store these first chromosomes in level A1, and delete these first chromosomes from population P3;
[0064] S365, looping through the population P3 according to the contents of step S362 to step S364, generating level A2, level A3, ..., level AW in sequence, that is, generating a total of W levels;
[0065] S366. Add each level to the candidate set in sequence according to the sequence number of the generated levels; when the w-th level Aw is added to the candidate set, the number of chromosomes in the candidate set is greater than L. If the level Aw is not added to the candidate set, the number of individuals in the candidate set is less than L. Therefore, the crowding distance of each chromosome in the level Aw is calculated, and they are sorted from large to small according to the crowding distance. In order to avoid deleting adjacent individuals at the same time, the crowding distance is recalculated and re-sorted every time the last chromosome is deleted until the remaining chromosomes can make the number of chromosomes in the candidate set reach L, and these L chromosomes constitute the population P4; if the w-th level Aw is added to the candidate set, the number of chromosomes in the candidate set is exactly equal to L, then there is no need to calculate the crowding distance, and these L chromosomes directly constitute the population P4.
[0066] S367, replace the chromosomes in the parent population P with the chromosomes in the parent population P4, perform a cyclic iteration process, stop the iteration after reaching the iteration stop condition, and output the recommendation result;
[0067] S368, During the evolution process, if a user u k If the number of chromosomes in the recommended list exceeds a certain proportion g and has not changed for two consecutive generations, the out-group migration operation will be performed. Here, the g value is set to three proportion values g1%, g2% and g3%. The three proportions are selected through the Q-learning algorithm of reinforcement learning, and the three proportions are used as three actions of reinforcement learning;
[0068] S369, select a proportional g value, when a user u k If the recommended list exceeds this ratio and remains unchanged for two consecutive generations, the out-of-group migration operation will be initiated;
[0069] S3610, calculate all users outside the group and user u k The similarity is calculated based on the similarity of the movies in the recommendation list and find the similarity with user u k The most similar out-of-group user u s , and then user u k Migrate to user u outside the group s In the group where they belong; users are clustered according to their browsing history and attributes before evolution, and migrated according to the newly appeared movie recommendation list during the optimization process. External knowledge migration can move users to more appropriate groups, thereby better accelerating the convergence speed;
[0070] S2263, set an evolutionary generation v, and reselect the ratio value g of the out-of-group migration operation every v generations. Calculate the positive change ratio of the Pareto front center position of each group solution set when v generations are completed and the Pareto front center position of each group solution set before v generations, and obtain the mean of the change ratio of each group. Use the mean as the reward value of the reinforcement learning algorithm, and select the g value adaptively through the reinforcement learning algorithm;
[0071] S23611, when the set evolutionary generation t is completed max Finally, the Pareto solution set of each group is obtained, and a recommendation list is generated and recommended to users in each group.
[0072] Compared with the prior art, the present invention has the following beneficial effects:
[0073] 1. The present invention firstly comprehensively scores and roughly sorts the massive amount of movie data. On the one hand, it can effectively reduce the noise in the data to improve the purity of the data; on the other hand, through the rough sorting, it can reduce the complexity of the model when processing the data, thereby improving the efficiency of the operation.
[0074] 2. The present invention groups users, and all user groups perform evolutionary calculations in parallel, which can improve calculation efficiency and recommendation effects.
[0075] 3. After constructing user portraits for users, the present invention groups users through an improved k-means clustering algorithm. The improved clustering algorithm can increase the calculation speed of grouping and can also effectively improve the accuracy of user grouping, which is beneficial to improving the calculation effect of subsequent algorithms.
[0076] 4. The present invention realizes mutual interaction among users in the evolution process through knowledge transfer learning within and outside each user group, realizes collaborative evolution among users, improves the convergence speed of genetic algorithms, and improves the recommendation effect.
[0077] 5. When performing mutation operations, the present invention proposes a multi-chromosome probability method for mutation, which can improve the convergence speed of the genetic algorithm and improve the recommendation effect.
[0078] 6. The present invention combines the reinforcement learning method when performing knowledge transfer operations outside the user group, and can adaptively select corresponding operations, thereby improving the convergence effect of the algorithm.
[0079] 7. During application, the present invention can achieve a recommendation effect that meets the three goals of accuracy, fairness and diversity of movies, achieve a balance among multiple goals, and improve the recommendation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is the main flow chart of the present invention. DETAILED DESCRIPTION
[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] See also Figure 1 , calculate the comprehensive score of each movie for the user, and obtain the rough-ranked movie recommendation candidate set for each user; then use the improved k-means algorithm to group the users, and each user group performs evolutionary calculation simultaneously; for one group of users, select movies from the candidate set to form a parent population P, and perform crossover and intra-group knowledge transfer operations on the parent population P to form a population P2; then perform multi-chromosome probability mutation operations to form a population P3; then perform non-dominated sorting on population P3 and calculate the crowding distance; according to the sorting results and calculation results, select the corresponding number of movie recommendation list chromosomes and store them in the parent population P4; finally, replace the chromosomes in the parent population P with the movie recommendation list chromosomes in the parent population P4, and perform cyclic iterative processing according to the above content. After reaching the number of iterations, stop the iteration and output the recommendation results; during the evolutionary process, if a user u k If more than a certain proportion of chromosomes g in the chromosomes of the recommendation list have not changed for two consecutive generations, the out-group migration operation is performed in combination with reinforcement learning. The present invention groups users with an improved clustering method for large-scale users, and each group of users evolves in parallel through synchronous operation. In the evolution process, reinforcement learning is combined to realize the knowledge transfer between the group and the outside group, which can effectively improve the recommendation effect and realize the recommendation of multiple goals of movie accuracy, movie diversity and fairness of movie exposure.
[0083] 1. Get movie recommendation candidate sets.
[0084] First, on the movie website, obtain the movies that the user has browsed in the past, and number the movies that the user has browsed. The numbered movies are stored in the movie collection.
[0085] Then, the LightGCN algorithm is used to calculate the accuracy scores of each movie that each user has not watched, and the movies in the numbered sorted set are sorted in descending order according to the accuracy scores, so that the numbered sorted set constitutes the movie accuracy sorted set of each user.
[0086] Then, based on the number of views of each movie, the exposure fairness index of each movie is calculated. The calculation formula for the exposure fairness score of a single movie is as follows:
[0087]
[0088] Among them, f (item-fair) Represents the exposure fairness score of the movie item, n item,(u-c) Represents the number of users who browsed the movie item, n (u) represents the total number of users, f (item-fair) The larger the value, the higher the fairness score of movie item exposure.
[0089] Then, according to the number of category attributes contained in each movie, the diversity score of the movie is calculated. The calculation formula for the diversity score of a single movie is as follows:
[0090]
[0091] Among them, f (item-div) Represents the diversity score of movie items, s item Represents the number of movie categories contained in a single movie item, s (total) Represents the total number of movie categories, f (item-div) The larger the value, the higher the movie item diversity score.
[0092] Then, the comprehensive score of movie j for user i is calculated according to the accuracy index value, exposure fairness index value and diversity score of the movie.
[0093] The comprehensive score calculation formula is as follows:
[0094]
[0095] in, Indicates the i-th movie sub-set of user i in the movie set j The comprehensive score of movies, j represents the jth movie in the movie collection. At this time, the movie is also in the movie subset of user i, numbered i j ; Indicates the i-th movie sub-set of user i in the movie set j The accuracy score of a movie calculated by the LightGCN algorithm; j represents the exposure fairness index score of the jth movie in the movie set; z j represents the diversity score of the jth movie in the movie collection; express The weight coefficient of Represents y j The weight coefficient of and The sum is a value between 0 and 1.
[0096] Finally, based on the comprehensive ratings of the movies for each user, a rough ranking of movie recommendation candidates is obtained for each user in descending order.
[0097] 2. Improved clustering algorithm.
[0098] The users are clustered and classified by the improved k-means algorithm, and the users are divided into C groups. The present invention proposes an improved k-means method, and the specific operation is to first randomly select a user as the cluster center, and the other several users as the center are selected according to probability. According to the historical trajectory of the movies browsed by each user and the user's gender, occupation, age and other attributes, the user's portrait is constructed, and the user is vectorized and represented. First, a user is randomly selected as the center for initialization, and then the distance between other users and the center user is calculated, and the center user to be selected is selected. The calculated distance of each user to be selected is normalized, and the normalized data is marked on the number axis, and the sum of these normalized distance values is 1. A number from 0 to 1 is randomly generated, and when the number falls into different intervals, the corresponding user is selected as the next center user. According to this method, the probability of users far away from the center user being selected will be higher. According to this method, the required cluster center is generated, and the improved k-means algorithm can effectively avoid the phenomenon of excessive concentration of cluster centers, and the user grouping using this method will also be more accurate.
[0099] 3. Perform evolutionary computation on C groups of users in parallel and synchronously.
[0100] For one of the groups C i The user evolution process of a group is as follows:
[0101] C i The group contains M users. A movies are randomly selected from the coarse-ranked candidate sets of each user to form a movie recommendation list chromosome. N movie recommendation list chromosomes are generated for each user. All movie recommendation list chromosomes of M users together constitute the initial parent population P0. The number of movie recommendation list chromosomes of the initial parent population P0 is L=M*N.
[0102] 4. Perform the operation of generating duplicate chromosomes.
[0103] Construct a new population P'0, and for each user's N movie recommendation list chromosomes, randomly select two chromosomes N i and N j , compare N i and N jEach objective function value, select the chromosome with the largest objective function and put it into a new population P'0. If N i and N j The objective function values of C are the same, calculate their crowding distance, select the chromosome with the largest crowding distance and save it in P'0, repeat this operation N times until N chromosomes are selected and saved in P'0. i All M users in the group perform this operation, and the chromosomes generated by the M users are saved in P'0. P0 and P'0 are merged to form the parent population P1, and the number of chromosomes in P1 is 2L.
[0104] 5. Perform cross- and intra-group knowledge transfer operations.
[0105] Construct a new population P2. Randomly select two chromosomes R from the P1 population. p11 and R p12 , and delete R in the P1 population p11 and R p12 , if R p11 and R p12 Chromosomes from the same user, then randomly exchange R p11 and R p12 Part of the movie, forming a new chromosome R' p11 and R' p12 , if the new chromosome R' p11 and R' p12 If there are duplicate movie genes in , the duplicate movie genes are restored to the previous movies to ensure R' p11 and R' p12 There are no repeated movie genes in the final R' p11 and R' p12 Save to the new population P2. If R p11 and R p12 The chromosomes from two users u1 and u2 are calculated as R p11 and R p12 The repeated movie genes in the set B are retained and put into set B. p11 and R p12 Other non-repeated movie genes are put into the temporary set H, and when the sub-chromosome R' of u1 is generated p11 When we first save all the movies in B to R' p11 Then we randomly select two movie genes d from H i and d j , and remove d from H i and d j , compare u1 to d i and d jThe comprehensive score of the , retain the higher score into the temporary set H u1 Repeat this process until H u1 The number of movies in H reaches half of that in H, and then u1 Randomly select two movies from d' i and d' j , considering the factors of internal knowledge transfer among different users, this time we compare user u2’s understanding of movie d’ i and d' j The comprehensive score of the movie is saved to the sub-chromosome R' of u1. p11 In this way, the preferences of users u1 and u2 are taken into account at the same time, and the knowledge transfer within the user is realized, which can accelerate the convergence of the algorithm. Because the length of the chromosome of the movie recommendation list is A, the above operation is repeated until the sub-chromosome R' of u1 is p11 The length is A. The same method can also be used to obtain the sub-chromosome R' of user u2. p12 , and finally R' p11 and R' p12 Save to the new population P2.
[0106] 6. Perform mutation operation on the 2L movie recommendation list chromosomes in population P2.
[0107] The three objective function values of accuracy, diversity and fairness of the 2L movie recommendation list chromosomes in P2 are calculated, and the three extreme chromosomes with the highest three values are obtained. These three chromosomes are retained without mutation.
[0108] The mutation operation is performed on the remaining 2L-3 chromosomes. The mutation operation adopts the multi-chromosome probability method to perform mutation. Each time, q chromosomes are randomly selected from 2L-3 chromosomes, and the number of times all movies appear in these q chromosomes is calculated. If a movie i appears r (i) times, then the probability formula for the movie being mutated is as follows:
[0109]
[0110] Among them, f (mutate-i) represents the probability of mutation of movie i, r (i) is the number of times movie i appears. Randomly assign a number num between 0 and 1. If num is greater than f (mutate-i) If the number of mutations is large, then movie i will mutate, otherwise it will not mutate. In this way, the probability of mutation of movie i that appears more times will be lower. The multi-chromosome probability method is conducive to the convergence of the algorithm. Repeat this operation many times to complete this round of mutation and obtain population P3.
[0111] 7. Perform elite strategy operations.
[0112] Three objective functions are constructed, including accuracy objective function, fairness objective function and diversity objective function.
[0113] The accuracy objective function is specifically expressed as follows:
[0114]
[0115] Among them, f1 represents the accuracy value of the chromosome of the movie recommendation list; u i (tp) represents the number of movies accurately recommended for the i-th user in the recommendation list chromosome; u i (fp) represents the number of movies wrongly recommended for the i-th user in the recommendation list chromosome.
[0116] The fairness objective function is specifically expressed as follows:
[0117]
[0118] Among them, f2 represents the fairness objective function value of the recommendation list chromosome; K represents the number of movies in the recommendation list chromosome. j represents the fairness score of movie j.
[0119] Diversity objective function:
[0120]
[0121] Among them, f3 represents the diversity objective function value of the recommendation list chromosome; K represents the number of movies in the recommendation list chromosome. j represents the diversity score of movie j.
[0122] Calculate the function value of each chromosome in population P3 in each objective function;
[0123] Select any two chromosomes from population P3 and define them as the first chromosome and the second chromosome; compare the function values of the same objective function of the first chromosome and the second chromosome. When all the function values of the first chromosome are greater than or equal to the function value corresponding to the second chromosome, and there is at least one function value of the first chromosome that is greater than the function value corresponding to the second chromosome, the first chromosome is said to dominate the second chromosome.
[0124] According to the above steps, all the first chromosomes in the population P3 are found, and these first chromosomes are stored in the level A1, and these first chromosomes are deleted from the population P3.
[0125] The population P3 is processed cyclically according to the above steps to generate level A2, level A3, ..., level AW in sequence, that is, a total of W levels are generated.
[0126] According to the sequence number of the generated levels, each level is added to the candidate set in turn; when the w-th level Aw is added to the candidate set, the number of chromosomes in the candidate set is greater than L. If the level Aw is not added to the candidate set, the number of individuals in the candidate set is less than L; therefore, the crowding distance of each chromosome in the level Aw is calculated, and they are sorted from large to small according to the crowding distance. In order to avoid deleting adjacent individuals at the same time, the crowding distance is recalculated and re-sorted every time the last chromosome is deleted until the remaining chromosomes can make the number of chromosomes in the candidate set reach L, and these L chromosomes constitute the population P4; if the number of chromosomes in the alternative set is exactly equal to L when the w-th level Aw is added to the alternative set, there is no need to calculate the crowding distance, and these L chromosomes directly constitute the population P4.
[0127] Replace the chromosomes in the parent population P with the chromosomes in the parent population P4, perform cyclic iteration, and stop the iteration after reaching the iteration stop condition, and output the recommendation results.
[0128] During the evolution process, if a user u k If the number of chromosomes in the recommended list exceeds a certain proportion g and has not changed for two consecutive generations, the out-group migration operation will be entered. Here, the g value is set to three proportion values g1%, g2% and g3%. The three proportions are selected through the Q-learning algorithm of reinforcement learning, and the three proportions are used as three actions of reinforcement learning.
[0129] Select a proportional g value, when a user u k If the number of recommendation lists exceeding this ratio has not changed for two consecutive generations, the out-of-group migration operation will be initiated.
[0130] Calculate all users outside the group and user u k The similarity is calculated based on the similarity of the movies in the recommendation list and find the similarity with user u k The most similar out-of-group user u s , and then user u k Migrate to user u outside the group s Users are clustered according to their browsing history and attributes before evolution, and migrated according to the newly emerged movie recommendation list during the optimization process. External knowledge migration can move users to more appropriate groups, thereby better accelerating the convergence speed.
[0131] Set an evolutionary generation v, and reselect the ratio g of the out-group migration operation every v generations. Calculate the positive change ratio of the Pareto front center position of each group solution set when v generations are completed and the Pareto front center position of each group solution set before v generations, and get the mean of the change ratio of each group. Use the mean as the reward value of the reinforcement learning algorithm, and select the g value adaptively through the reinforcement learning algorithm.
[0132] When the set evolution generation t is completed max Finally, the Pareto solution set of each group is obtained, and a recommendation list is generated and recommended to users in each group.
[0133] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A multi-objective movie recommendation method for large-scale users, characterized in that: The following steps are involved: S1. Obtain the data of the user's historical movie browsing, calculate the comprehensive score of each movie based on the data, and arrange each movie in the corresponding movie recommendation candidate set in descending order according to the comprehensive score, and store each user in the user set; S2. Clustering and classifying users by using an improved k-means algorithm, and dividing users in the user set into a set number of user groups; S3, performing evolution operations, repeating chromosome operations, crossover and intra-group knowledge transfer operations, chromosome mutation operations and elite strategy operations on users in each user group to generate a recommendation list and recommend it to users in each group; The process of obtaining movie recommendation candidate sets is as follows: S11, obtaining movies that the user has browsed in the past, numbering all the obtained movies in sequence, and storing all the numbered movies in a movie set, and storing all the users in a user set; S12. Obtain movies that have not been browsed by each user from the movie collection, and store the corresponding movies in the movie subset of each user; use the LightGCN algorithm to calculate the accuracy score of each movie in each movie subset, and independently sort each movie in each movie subset in descending order of accuracy score to obtain the movie accuracy sorting set of each user; S13. Calculate the exposure fairness of each movie according to the number of times each movie in the movie set has been viewed. The calculation formula is as follows: Among them, f (item-fair) Represents the exposure fairness score of the movie item; n item,(u-c) Represents the number of users who browsed movie items in the movie collection, n (u) Represents the total number of users in the user set; S14. Calculate the diversity score of each movie according to the number of movie categories to which each movie in the movie set belongs. The calculation formula is as follows: Among them, f (item-div) Represents the diversity score of movie items in the movie collection, s item Indicates the number of movie categories to which the movie item in the movie collection belongs, s (total) Represents the total number of movie categories in the movie collection; S15. Calculate the comprehensive score of the movie for the user based on the accuracy score, exposure fairness score and diversity score of the movie. The comprehensive score calculation formula is as follows: in, Indicates the i-th movie sub-set of user i in the movie set j The comprehensive score of movies, j represents the jth movie in the movie collection. At this time, the movie is also in the movie subset of user i, numbered i j ; Indicates the i-th movie sub-set of user i in the movie set j The accuracy score of a movie calculated by the LightGCN algorithm; j represents the exposure fairness index score of the jth movie in the movie set; z j represents the diversity score of the jth movie in the movie collection; express The weight coefficient of Represents y j The weight coefficient of and The sum is between 0 and 1; S16, independently sorting each movie in each user set in descending order of comprehensive scores to obtain a movie recommendation candidate set for each user; The specific steps of step S2 are as follows: S21. Clustering and classifying users by using an improved k-means algorithm, dividing users in a user set into C user groups; constructing user portraits using the historical trajectory of movies browsed by each user, as well as the user's gender, occupation, and age as user characteristic attributes; and establishing a multidimensional space using user characteristic attributes as dimensions, wherein each user is presented in the multidimensional space through coordinates represented by vectorization; S22, randomly select a user as the central user, calculate the Euclidean distance between the central user and other users in the multidimensional space, calculate the sum of the distances between the central user and other users, calculate the mean of the distances dis-mean, and retain the users whose distances from the central user are greater than the dis-mean as the candidate central users; S23, performing normalization calculation based on the distances between the central user and all the candidate central users, and marking the normalized data on the number axis, the sum of these normalized distance values being 1; S24, randomly generate a number from 0 to 1, and when the number falls into different intervals, select the corresponding user as the next central user; S25, continue to process the users in the user set according to the contents of step S22 to step S24, determine C core users, and obtain C user groups by using the improved k-means algorithm; Evolutionary computation is performed on the users in group C at the same time, with group Z as the c Take the evolutionary computation process of (c∈[0,C]) as an example, as follows: Group Z c There are M users. A number of movies are randomly selected with replacement from each user's movie recommendation candidate set to form a movie recommendation list chromosome for the user. The random selection is repeated N times, and each user obtains N movie recommendation list chromosomes. All the movie recommendation list chromosomes of M users together form the initial parent population P0. The number of movie recommendation list chromosomes in the initial parent population P0 is L = M × N. For group Z c Generate duplicate chromosomes. The specific process is as follows: S321, construct a new population P'0; for each user's N movie recommendation list chromosomes, randomly select two movie recommendation list chromosomes, compare the sizes of each objective function value between the two movie recommendation list chromosomes, and select the movie recommendation list chromosome with a larger objective function value and put it into the population P'0; S322, if the values of each objective function between the two movie recommendation list chromosomes are the same, calculate the crowding distance between the two movie recommendation list chromosomes, select the movie recommendation list chromosomes with a larger crowding distance and keep them in P'0, repeat this operation N times with replacement, until N chromosomes are selected and saved in P'0; For group Z c The M users in the table generate duplicate chromosomes. The specific process is as follows: the chromosomes generated by the M users are saved in P'0; P0 and P'0 are merged to form the parent population P1, and the number of chromosomes in P1 is 2L; Perform cross and intra-group knowledge transfer operations. The specific steps are as follows: S341, construct a new population P2; randomly select two chromosomes R from the P1 population p11 and chromosome R p12 , while deleting chromosome R in the P1 population p11 and chromosome R p12 If chromosome R p11 and chromosome R p12 Chromosomes from the same user, then randomly exchange R p11 and R p12 Part of the movie gene in the new chromosome R' p11 and chromosome R' p12 ; If the new chromosome R' p11 and chromosome R' p12 If there are duplicate movie genes in , the duplicate movie genes are restored to the previous movie genes to ensure R' p11 and R' p12 There are no duplicate movie genes in the chromosome R' p11 and chromosome R' p12 Save to the new population P2; If R p11 and R p12 The chromosomes from two users u1 and u2 are calculated as R p11 and R p12 The duplicate movie genes are retained and put into set B. For chromosome R p11 and chromosome R p12 Other non-repeated movie genes are placed in the temporary set H; when the sub-chromosome R' of u1 is generated p11 When all movies in B are saved to R' p11 Then two movie genes d are randomly selected from H without replacement. i and d j , compare u1 to d i and d j The movie genes with high comprehensive scores are put into the temporary set H u1 Repeat this process until H u1 The number of movies in reached half of that in H; S342, then from H u1 Randomly select two movies from d' i and d' j , compare user u2's i and d' j The movie genes with high comprehensive scores are saved to the sub-chromosome R' of u1 p11 Repeat this process until the sub-chromosome R' of u1 p11 The length is A only; S343. The same process can also be used to obtain the sub-chromosome R' of user u2. p12 , and finally R' p11 and R' p12 Save to the new population P2; Perform mutation operation on the 2L movie recommendation list chromosomes in population P2. The specific process is as follows: S351, calculating the three objective function values of accuracy, diversity and fairness of the 2L movie recommendation list chromosomes in P2, and obtaining the three extreme chromosomes with the highest three values respectively, and these three chromosomes are retained without mutation; S352. Perform mutation operation on the remaining 2L-3 chromosomes. The mutation operation adopts the multi-chromosome probability method to perform mutation. Each time, q chromosomes are randomly selected from 2L-3 chromosomes, and the number of times all movies appear in these q chromosomes is calculated. If a movie i appears r (i) times, then the probability formula for the movie being mutated is as follows: Among them, f (mutate-i) represents the probability of mutation of movie i, r (i) is the number of times movie i appears; a random number num from 0 to 1 is given, and if num is greater than f (mutate-i) If the value is large, the movie i will be mutated, otherwise it will not be mutated. Repeat this operation for a set number of times to complete the round of mutation and obtain population P3. To carry out elite strategy operation, the specific process is as follows: S261. Construct three objective functions, including an accuracy objective function, a fairness objective function, and a diversity objective function; The accuracy objective function is specifically expressed as follows: Among them, f1 represents the accuracy value of the chromosome of the movie recommendation list; u i (tp) represents the number of movies accurately recommended for the i-th user in the recommendation list chromosome; u i (fp) represents the number of movies wrongly recommended for the i-th user in the recommendation list chromosome; The fairness objective function is specifically expressed as follows: Where f2 represents the fairness objective function value of the recommendation list chromosome; K represents the number of movies in the recommendation list chromosome; μ j represents the fairness score of movie j; Diversity objective function: Among them, f3 represents the diversity objective function value of the recommendation list chromosome; K represents the number of movies in the recommendation list chromosome; β j represents the diversity score of movie j; S362, calculating the function value of each chromosome in the population P3 in each objective function; S363, select any two chromosomes from population P3 and define them as the first chromosome and the second chromosome; compare the function values of the same objective function of the first chromosome and the second chromosome. When all the function values of the first chromosome are greater than or equal to the function value corresponding to the second chromosome, and there is at least one function value of the first chromosome that is greater than the function value corresponding to the second chromosome, the first chromosome is said to dominate the second chromosome; S364, find all the first chromosomes in population P3 in the manner of step S363, store these first chromosomes in level A1, and delete these first chromosomes from population P3; S365, looping through the population P3 according to the contents of step S362 to step S364, generating level A2, level A3, ..., level AW in sequence, that is, generating a total of W levels; S366. According to the sequence number of the generated levels, each level is added to the candidate set in turn; when the w-th level Aw is added to the candidate set, the number of chromosomes in the candidate set is greater than L. If the level Aw is not added to the candidate set, the number of individuals in the candidate set is less than L; therefore, the crowding distance of each chromosome in the level Aw is calculated, and the crowding distance is sorted from large to small. In order to avoid deleting adjacent individuals at the same time, the crowding distance is recalculated and re-sorted every time the last chromosome is deleted until the remaining chromosomes can make the number of chromosomes in the candidate set reach L, and these L chromosomes constitute the population P4; if the number of chromosomes in the candidate set is exactly equal to L when the w-th level Aw is added to the candidate set, there is no need to calculate the crowding distance, and these L chromosomes directly constitute the population P4; S367, replace the chromosomes in the parent population P with the chromosomes in the parent population P4, perform a cyclic iteration process, stop the iteration after reaching the iteration stop condition, and output the recommendation result; S368, During the evolution process, if a user u k If the number of chromosomes in the recommended list exceeds a certain proportion g and has not changed for two consecutive generations, the out-group migration operation will be performed. Here, the g value is set to three proportion values g1%, g2% and g3%. The three proportions are selected through the Q-learning algorithm of reinforcement learning, and the three proportions are used as three actions of reinforcement learning; S369, select a proportional g value, when a user u k If the recommended list exceeds this ratio and remains unchanged for two consecutive generations, the out-of-group migration operation will be initiated; S3610, calculate all users outside the group and user u k The similarity is calculated based on the similarity of the movies in the recommendation list and find the similarity with user u k The most similar out-of-group user u s , and then user u k Migrate to user u outside the group s In the group where they belong; users are clustered according to their browsing history and attributes before evolution, and migrated according to the newly appeared movie recommendation list during the optimization process. External knowledge migration can move users to more appropriate groups, thereby better accelerating the convergence speed; S2263, set an evolutionary generation v, when each evolution v generations, reselect the proportion value g of the out-group migration operation; and calculate the positive change ratio of the Pareto front center point position of each group solution set when v generations are completed this time to the Pareto front center point position of each group solution set before v generations, and obtain the mean of the change ratio of each group, and use the mean as the reward value of the reinforcement learning algorithm, and select the g value adaptively through the reinforcement learning algorithm; S23611, when the set evolutionary generation t is completed max Finally, the Pareto solution set of each group is obtained, and a recommendation list is generated and recommended to users in each group.
Citation Information
Patent Citations
Collaborative filtering recommendation method based on elastic dimensional feature vector optimized extraction
CN105868422A
Movie recommendation method using improved multi-objective genetic algorithm based on grid and difference substitution
CN107256241A