Cold start recommendation method and device based on preference recovery generative adversarial network and readable medium
By adopting the cold start recommendation method of preferring recovery to generate adversarial networks in the Internet insurance recommendation system, the information dependence and model stability problems in cold start user recommendations are solved, and a more accurate and personalized recommendation effect is achieved.
Patent Information
- Application Number
- CN202411472032.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-18
AI Technical Summary
The existing technology has limitations when providing accurate recommendations to cold-start users in the Internet insurance recommendation system. It is difficult to collect additional information based on users and involves privacy protection issues. The model training is unstable, sensitive to hyperparameters, and long training time. .
The cold start recommendation method based on preference recovery generates adversarial networks is adopted. The warm score vector is converted into cold score vectors through the preference recovery function, and a generative adversarial network is constructed for training. The generation network is responsible for generating predicted warm score vectors and distinguishing the real and The generated warm score vector improves recommendation accuracy through adversarial training mechanism.
Reduce dependence on user additional information, improve model stability and recommendation accuracy, provide cold-start users with personalized project recommendation sequences, and improve the coverage and accuracy of the recommendation system.
Smart Images

Figure CN119475050A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a field, and in particular to a cold start recommendation method, device and readable medium based on a preference recovery generative adversarial network. Background Art
[0002] With the booming Internet economy, the insurance industry has also ushered in an online transformation. Internet insurance recommendation systems have become particularly important because they can provide users with personalized insurance product choices. However, with the continuous influx of new users and new insurance products, recommendation systems face a significant challenge: how to provide accurate recommendations for these cold-start users who lack historical interaction data. Cold-start recommendation models can help solve the problem of recommending new users or new items in recommendation systems and improve the coverage and accuracy of recommendation systems.
[0003] In traditional recommendation systems, collaborative filtering is a common method that makes recommendations by analyzing users' historical behaviors and preferences. Traditional recommendation algorithms such as collaborative filtering may not be able to effectively generate accurate recommendation results for new users or new items (a defect of traditional collaborative filtering algorithms). In response to this situation, cold-start recommendation models usually use user attribute information, content information, or other metadata to help make recommendations. Previous studies have used various additional information of users and items to solve the sparsity problem of cold-start user ratings, such as user demographic data (such as age, gender, location, etc.), item features (such as text descriptions, audio or images), and social relationships to generate appropriate recommendations for new users. However, due to the difficulty in collecting additional information and the data privacy protection policies of various industries, the above methods do not have good application scenarios.
[0004] In some past studies, recommender systems have begun to use GANs to enhance item recommendation performance. For example, IRGAN pioneered the first GAN-based recommender system. This method is based on two major schools of thought in information retrieval, namely generative models and discriminative models. As the first GAN-based recommender system, IRGAN adopts the ideas of generative models and discriminative models, with the generator selecting preferred items and the discriminator identifying real user-item pairs. However, the training process of IRGAN is unstable and prone to model collapse. CFGAN is the first vector GAN method that uses a generator to generate effective item recommendations. This method collects the purchase records of a set of users and represents each user as a binary purchase vector. CFGAN converts user purchase records into binary vectors and uses negative sampling techniques to enable the generator to learn to identify items that users do not like. Despite this, CFGAN takes a long time to train and is very sensitive to hyperparameters. Tong et al. developed a collaborative generative adversarial network for item recommendations. In order to reduce the impact of data noise (e.g., biased rating feedback) on recommendation performance, the authors implemented the generator through a variational autoencoder (VAE). The generator is implemented through a variational autoencoder (VAE) to reduce the impact of data noise on recommendation performance. VAE learns the rating distribution of users and makes recommendations by reconstructing the rating vector. This approach helps deal with data privacy issues, but requires complex model training. CoFiGAN introduces the concept of paired learning, training the generator by comparing positive items and negative items to maximize the score difference between the two. This approach helps identify items that are highly correlated with user preferences, but the training process is complex and highly data-dependent.
[0005] In summary, although existing studies have made some progress in using GAN to improve the performance of recommendation systems, they still have limitations in dealing with the cold start problem in Internet insurance recommendation systems. These methods usually rely on additional information of users, such as demographic data or social relationships, which are often difficult to collect in the insurance field and involve privacy protection issues. Especially in the special field of Internet insurance, the collection and use of additional information is even more challenging. The choice of insurance products usually needs to consider the user's personal situation and specific needs, and this information often involves user privacy and is not easy to obtain. Therefore, how to provide effective recommendations for new users and new insurance products without relying on this sensitive information has become an important topic in the design of recommendation systems.
[0006] In addition, although models such as IRGAN, CFGAN, VAE-based collaborative GAN, and CoFiGAN have improved the recommendation quality, they still face challenges such as unstable training, sensitivity to hyperparameters, long training time, and high data dependence. To overcome these problems, a new recommendation method is needed that should reduce the dependence on additional user information while improving the stability of the model and the accuracy of recommendations. Summary of the invention
[0007] The purpose of this application is to propose a cold start recommendation method, device and readable medium based on a preference recovery generative adversarial network to address the above-mentioned technical problems.
[0008] In a first aspect, the present invention provides a cold start recommendation method based on a preference recovery generative adversarial network, comprising the following steps:
[0009] Obtain the user set and project set of Internet insurance products and construct a user rating matrix;
[0010] Based on the user rating matrix, a warm user rating set and a cold start user rating set are constructed, and the real user's warm rating vector and the real user's cold rating vector are obtained according to the warm user rating set and the cold start user rating set respectively, and the preference recovery function is used to convert the real user's warm rating vector into the generated user's cold rating vector;
[0011] Construct a generative adversarial network, which includes a generative network and a discriminative network. The training process of the generative adversarial network is as follows: randomly initialize the parameters of the generative network and the discriminative network, fix the parameters of the generative network, input the generated user's cold score vector into the generative network, obtain the predicted user's warm score vector, train the discriminative network based on the predicted user's warm score vector and the real user's warm score vector, and obtain a trained discriminative network; fix the parameters of the trained discriminative network, input the predicted user's warm score vector and the real user's warm score vector into the trained discriminative network, obtain the discrimination result, make the discrimination result of the corresponding score in the predicted user's warm score vector false, and make the discrimination result of the corresponding score in the real user's warm score vector true, train the generative network based on the trained discriminative network, and obtain a trained generative network; repeat the above process until the loss function converges, and finally obtain a trained generative network;
[0012] The cold rating vectors of real users in the cold start user rating set are input into the trained generative network to obtain the predicted warm rating vectors of the users. Top-k recommendations are performed based on the cold rating vectors of real users and the predicted warm rating vectors of users to obtain a sequence of recommended items for each user.
[0013] As a preference, the user set is represented as U = {u1,u2,…,u m}, i = 1, 2, ..., m, m is the total number of users; the project set is represented by V = {v1, v2, ..., v n}, j = 1, 2, ..., n, n is the total number of items, all items in the item set are arranged in ascending order of time; the user rating matrix is It is expressed as:
[0014]
[0015] Among them, r ij represents the i-th user u i For the jth item v j The rating data, r ij ∈[0,1,2,3,4,5], when r ij = 0 represents the i-th user u i For the jth product v j Unrated, when r ij ∈[1,2,3,4,5] represents the i-th user u i For the jth product v j The rating value is 1, 2, 3, 4 or 5;
[0016] The warm user rating set and the cold start user rating set are expressed as:
[0017] O={ i ,v j ,r ij >|count(e r )≥ξ1};
[0018] T={ i ,v j ,r ij >|count(e r )<ξ2};
[0019] Among them, O represents the warm user rating set, T represents the cold start user rating set, and e r represents the i-th user u i The rating vector is the rating vector composed of the rating data in the i-th row in the user rating matrix R, count(e r ) means e r ξ1 and ξ2 represent the thresholds for distinguishing warm users from cold start users, respectively, and are defined as follows:
[0020]
[0021]
[0022] Among them, α represents the user rating matrix The sparseness rate;
[0023] The warm rating vector of a real user is the rating vector of any user in the warm user rating set;
[0024] The cold rating vector of a real user is the rating vector of any user in the cold start user rating set.
[0025] Preferably, the preference recovery function is as follows:
[0026]
[0027] Among them, p g (j) represents the true warm rating vector w of the g-th user in the warm user rating set. g The gth user u in g For the jth item v j The score will be in the cold score vector c g The probability of being retained in , count represents the real warm rating vector w of the g-th user g The number of items rated in the parameter p min represents the lowest possible value of the score, p max represents the highest possible value of the score, p min 、p max and a are both real numbers, 0≤p min <p max ≤1, a represents the attenuation coefficient, pop(v j ) represents the jth item v j The popularity of , the range of pop is [0,1], and is defined as follows:
[0028] F=[freq(v1),freq(v2),...freq(v n )];
[0029] pop(v j )=freq(v j ) / max(F);
[0030] Among them, F represents the set of the number of users who have rated each item, freq(v j ) represents the jth item v that has been rated j The number of users;
[0031] Traverse each item and get the real warm rating vector w of the gth user in the warm user rating set g The gth user u in g The rating for each item will be in the cold rating vector cg The set P of probabilities retained in g , as shown below:
[0032] P g =[p g (1),p g (2),...,p g (n)];
[0033] For the set P g All the p g (j) Sort from large to small and retain the real warm rating vector w of the gth user in the warm user rating set according to the order g The gth user u in g For the ratings of the first ξ2 items, the real warm rating vector w of the gth user in the warm user rating set is g The gth user u in g Set the scores of all items except the first ξ2 items to 0, and obtain the generated cold score vector c of the g-th user g .
[0034] Preferably, both the generative network and the discriminative network use multi-layer perceptrons.
[0035] Preferably, during the training process of the generative adversarial network, the loss function of the discriminant network is:
[0036]
[0037] in, represents the loss function of the discriminant network, w g represents the true warm rating vector of the g-th user, w′ g represents the predicted warm score vector of the g-th user, D represents the function corresponding to the discriminant network, and E represents the expectation;
[0038] The loss function of the generated network is:
[0039]
[0040] in, represents the loss function of the generated network, L relevant represents the related item loss function, which is defined as:
[0041]
[0042] Among them, N g represents the number of items rated by the g-th user, w' g,l Represents the predicted warm rating vector w' of the g-th user gThe rating of the g-th user on the l-th item in Represents the warm rating vector w of the real g-th user g If the true warm rating vector w of the g-th user is g The rating w of the g-th user on the l-th item g,l Greater than the true warm rating vector w of the g-th user g The average value of all the scores in the , then the element value is 1, otherwise it is 0, sigmoid(w' g,l ) represents the predicted warm rating vector w' of the g-th user g The value obtained by applying the sigmoid function to the score of the g-th user on the l-th item. represents the cross entropy loss function.
[0043] Preferably, the cold score vector of the real user in the cold start user score set is input into the trained generation network to obtain the predicted warm score vector of the user, and Top-k recommendation is performed according to the cold score vector of the real user and the predicted warm score vector of the user to obtain the recommended item sequence for each user, specifically including:
[0044] The actual cold rating vector of the s-th user in the cold start user rating set is input into the trained generative network to obtain the predicted warm rating vector of the s-th user, and the ratings corresponding to the items in the predicted warm rating vector of the s-th user except the rated items in the actual cold rating vector of the s-th user are sorted from large to small, and the top k ranked items are selected as the recommended item sequence for the s-th user.
[0045] In a second aspect, the present invention provides a cold start recommendation device based on a preference recovery generative adversarial network, comprising:
[0046] A data acquisition module, configured to acquire a user set and a project set of Internet insurance products and construct a user rating matrix;
[0047] A data processing module is configured to construct a warm user rating set and a cold start user rating set based on the user rating matrix, obtain a real user's warm rating vector and a real user's cold rating vector according to the warm user rating set and the cold start user rating set, respectively, and convert the real user's warm rating vector into a generated user's cold rating vector using a preference recovery function;
[0048] The model building module is configured to build a generative adversarial network, which includes a generative network and a discriminative network. The training process of the generative adversarial network is as follows: randomly initialize the parameters of the generative network and the discriminative network, fix the parameters of the generative network, input the generated user's cold score vector into the generative network, obtain the predicted user's warm score vector, train the discriminative network based on the predicted user's warm score vector and the real user's warm score vector, and obtain a trained discriminative network; fix the parameters of the trained discriminative network, input the predicted user's warm score vector and the real user's warm score vector into the trained discriminative network, obtain the discrimination result, make the discrimination result of the corresponding score in the predicted user's warm score vector false, and make the discrimination result of the corresponding score in the real user's warm score vector true, train the generative network based on the trained discriminative network, and obtain a trained generative network; repeat the above process until the loss function converges, and finally obtain a trained generative network;
[0049] The recommendation module is configured to input the cold rating vector of the real user in the cold start user rating set into the trained generation network to obtain the predicted warm rating vector of the user, perform Top-k recommendation based on the cold rating vector of the real user and the predicted warm rating vector of the user, and obtain a recommended item sequence for each user.
[0050] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0051] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0052] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] (1) The cold start recommendation method based on preference recovery generative adversarial network proposed in the present invention restores the warm rating vector to the cold rating vector through the preference recovery function. This data preprocessing method takes into account the time of item rating and the popularity of the rated items, thereby more realistically simulating the initial state of the cold start user in the recommendation system.
[0055] (2) The cold start recommendation method based on preference recovery generative adversarial network proposed in the present invention introduces a generative adversarial network. The generative network is responsible for generating predicted warm rating vectors, while the discriminative network is responsible for distinguishing between real warm rating vectors and predicted warm rating vectors. Through this adversarial training mechanism, the generative network can learn a more accurate and real distribution of warm rating vectors, thereby providing more accurate recommendations for cold start users.
[0056] (3) The cold-start recommendation method based on preference-recovery generative adversarial network proposed in the present invention utilizes a trained generative network to generate predicted warm rating vectors for cold-start users, and performs Top-k recommendations based on these predicted warm rating vectors, which can provide cold-start users with personalized item recommendation sequences, thereby improving the coverage and accuracy of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 A flowchart of a cold start recommendation method based on a preference recovery generative adversarial network according to an embodiment of the present application;
[0059] Figure 2 A schematic diagram of a recommendation process of a cold start recommendation method based on a preference recovery generative adversarial network according to an embodiment of the present application;
[0060] Figure 3 A schematic diagram of a generative adversarial network of a cold start recommendation method based on a preference recovery generative adversarial network according to an embodiment of the present application;
[0061] Figure 4 A schematic diagram of a cold start recommendation device based on a preference recovery generative adversarial network according to an embodiment of the present application;
[0062] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.
[0064] Figure 1 A cold start recommendation method based on a preference recovery generative adversarial network provided by an embodiment of the present application is shown, comprising the following steps:
[0065] S1, obtain the user set and project set of Internet insurance products and construct a user rating matrix.
[0066] In a specific embodiment, the user set is represented as U = {u1,u2,…,u m}, i = 1, 2, ..., m, m is the total number of users; the project set is represented by V = {v1, v2, ..., v n}, j = 1, 2, ..., n, n is the total number of items, all items in the item set are arranged in ascending order of time; the user rating matrix is It is expressed as:
[0067]
[0068] Among them, r ij represents the i-th user u i For the jth item v j The rating data, r ij ∈[0,1,2,3,4,5], when r ij = 0 represents the i-th user u i For the jth product v j Unrated, when r ij ∈[1,2,3,4,5] represents the i-th user u i For the jth product v j The rating value is 1, 2, 3, 4 or 5;
[0069] The warm user rating set and the cold start user rating set are expressed as:
[0070] O={ i ,v j ,r ij >|count(e r )≥ξ1};
[0071] T={ i ,v j ,r ij >|count(e r )<ξ2};
[0072] Among them, O represents the warm user rating set, T represents the cold start user rating set, and e r represents the i-th user u i The rating vector is the rating vector composed of the rating data in the i-th row in the user rating matrix R, count(er ) means e r ξ1 and ξ2 represent the thresholds for distinguishing warm users from cold start users, respectively, and are defined as follows:
[0073]
[0074]
[0075] Among them, α represents the user rating matrix The sparseness rate;
[0076] The warm rating vector of a real user is the rating vector of any user in the warm user rating set;
[0077] The cold rating vector of a real user is the rating vector of any user in the cold start user rating set.
[0078] Specifically, in order to distinguish warm users in the warm user rating set and cold start users in the cold start user rating set, the embodiment of the present application uses the idea of quartiles in mathematical statistics. First, the data set is divided into two parts using n×α. Then, using the idea of quartiles, the first half is averaged on [0, n×α] as the boundary of cold start users, and the front and back parts are averaged on [n×α, n] as the boundary of warm users. The ratings given by users to items may be affected by more factors, such as market changes, changes in personal preferences, etc. This part of data can be used with collaborative filtering algorithms to make recommendations by analyzing users' historical behaviors and preferences.
[0079] For an Internet insurance platform, a user with multiple rating records is basically a cold start user when he first enters the insurance platform. Therefore, a time-based preference recovery function is introduced to restore the user's warm rating vector to the cold rating vector in the cold start state when the user first enters the platform. M warm users and S cold start users are selected from the m users in the user set U. Therefore, the total number of warm users in the warm user rating set is M, and the total number of cold start users in the cold start user rating set is S. Assume that the g-th user u g The warmth score vector is w g ∈O, restore the user's warm rating vector to the cold rating vector c in the cold start state through the time-based preference recovery function g The cold rating vector in the cold start state is input into the generator network to generate a predicted warm rating vector, and the warm rating vector is input into the discriminant network to determine whether it is true or false. The generator network is trained until the discriminant network cannot determine which warm rating vector is predicted by the generator network and which warm rating vector is true. Therefore, the goal is to use the user's warm rating vector w g∈O trains the generative network through the time-based preference recovery function. After the generative network is trained, the cold rating vector c of the cold start user is s ∈T is input into the trained generative network to obtain the user's warm score vector, which is used for Top-k recommendation to recommend item sequences for cold start users.
[0080] refer to Figure 2 , assuming that each warm user is a cold start user when he first enters the platform, a time-based preference recovery function is introduced to restore the user's warm score vector to the cold score vector in the cold start state through the preference recovery function. Then the cold score vector in the cold start state is used as the input of the generative network in the generative adversarial network to generate a fake predicted warm score vector. Then the fake predicted warm score vector and the real warm score vector are input into the discriminant network to judge the truth. Then the generative network is trained to generate better predicted score vectors until the discriminant network cannot judge the truth. Finally, the trained generative network is used as a recommender, the cold score vector is input into the trained generative network to generate a predicted warm score vector, and the predicted warm score vector output by the trained generative network is used for Top-k recommendation. For example, the initial data of user u1 is that he has no rating for product 1, is very satisfied with product 2, is satisfied with product 3, and is very satisfied with product n. 0-5 represents the ratings from very dissatisfied (0 points) to very satisfied (5 points). Then the cold rating vector of user u1 is w1=[0,5,2,...,0,4], and the jth position represents the rating of the jth item. Then the predicted warm rating vector of user u1 generated by the trained generative network is w1'=[0,4.3,1.1,...,0,3.8]. After Top-k recommendation, excluding existing items, the most likely items of interest are: <Item 2 (4.3 points), Item n (3.8 points),...,Item 3 (1.1 points).
[0081] S2, construct a warm user rating set and a cold start user rating set based on the user rating matrix, obtain the real user's warm rating vector and the real user's cold rating vector according to the warm user rating set and the cold start user rating set respectively, and use the preference recovery function to convert the real user's warm rating vector into the generated user's cold rating vector.
[0082] In a specific embodiment, the preference recovery function is as follows:
[0083]
[0084] Among them, p g (j) represents the true warm rating vector w of the g-th user in the warm user rating set. g The gth user u ing For the jth item v j The score will be in the cold score vector c g The probability of being retained in , count represents the real warm rating vector w of the g-th user g The number of items rated in the parameter p min represents the lowest possible value of the score, p max represents the highest possible value of the score, p min 、p max and a are both real numbers, 0≤p min <p max ≤1, a represents the attenuation coefficient, pop(v j ) represents the jth item v j The popularity of , the range of pop is [0,1], and is defined as follows:
[0085] F=[freq(v1),freq(v2),...freq(v n )];
[0086] pop(v j )=freq(v j ) / max(F);
[0087] Among them, F represents the set of the number of users who have rated each item, freq(v j ) represents the jth item v that has been rated j The number of users;
[0088] Traverse each item and get the real warm rating vector w of the gth user in the warm user rating set g The gth user u in g The rating for each item will be in the cold rating vector c g The set P of probabilities retained in g , as shown below:
[0089] P g =[p g (1),p g (2),...,p g (n)];
[0090] For the set P g All the p g (j) Sort from large to small and retain the real warm rating vector w of the g-th user in the warm user rating set according to the order g The gth user u in g For the ratings of the first ξ2 items, the real warm rating vector w of the gth user in the warm user rating set is g The gth user u ing Set the scores of all items except the first ξ2 items to 0, and obtain the generated cold score vector c of the g-th user g .
[0091] Specifically, in the preference recovery function, p min 、p max The values of are set to 0 and 0.85 respectively. a represents a parameter, which is used in the formula to adjust the decay rate of the exponential function. a affects the probability p as time t changes. g (j) Reference min to p max The rate of change of v j If it is a popular item, the value of pop is close to 1. The items in the item set V that have been rated are arranged in ascending order of time, ensuring that the earlier the item is rated, the smaller j is. The closer it is to 0, the The closer it is to 1, the greater the retention score.
[0092] Specifically, the function of the preference recovery function is to restore the warm state to the cold start state by considering two important factors: the time when the item was rated and the popularity of the rated items. Intuitively, the cold start state only needs to retain the user's early item ratings. However, the herd effect often affects Internet users to start using e-services to purchase products. Therefore, in addition to the time when the item was rated, the preference recovery function also measures the popularity of the rated items by the frequency of the items being rated. If many users have rated an item, it will be popular. Assume that the warm rating vector of user u1 is w1=[0,5,2,...,1,4], the jth position in the warm rating vector represents the rating of the jth item, and the warm state rating vector evaluated by user u2 is w2=[1,0,4,...,0,4], then the probability of the rating being retained obtained by the preference recovery function is P1=[0,0.8,0.1,...,0,0.9], P2=[0.9,0,0.8,...,0,0.1], the jth position in the probability of the rating being retained represents the probability of the rating of the jth item being retained, and after sorting, take the first ξ2=5, then the finally restored cold rating vector of user u1 is c1=[0,5,0,...,0,4], and the generated cold rating vector of user u2 is c2=[1,0,4,...,0,0].
[0093] S3, constructing a generative adversarial network, which includes a generative network and a discriminative network. The training process of the generative adversarial network is as follows: randomly initialize the parameters of the generative network and the discriminative network, fix the parameters of the generative network, input the generated user's cold score vector into the generative network, obtain the predicted user's warm score vector, train the discriminative network based on the predicted user's warm score vector and the real user's warm score vector, and obtain a trained discriminative network; fix the parameters of the trained discriminative network, input the predicted user's warm score vector and the real user's warm score vector into the trained discriminative network, obtain the discrimination result, make the discrimination result of the corresponding score in the predicted user's warm score vector false, and the discrimination result of the corresponding score in the real user's warm score vector true, train the generative network based on the trained discriminative network, and obtain a trained generative network; repeat the above process until the loss function converges, and finally obtain a trained generative network.
[0094] In a specific embodiment, both the generating network and the discriminating network adopt multi-layer perceptrons.
[0095] Specifically, Generative Adversarial Network (GAN) is an advanced deep learning technique that builds two adversarial networks: a generator network G and a discriminator network D. Given imprecise data (e.g., an image corrupted by noise), the generator network learns to regenerate precise data (e.g., the original image) from the imprecise data; the generated data is then evaluated by a discriminator network trained to detect imprecise data. GAN has had a huge impact on deep learning because it enables supervised learning to be performed in an unsupervised manner by automatically generating precise data. The benefits of precise data generation have also prompted more and more researchers to use GAN to solve the problem of cold-start recommendation for new users, which is why warm rating vectors are used as precise data. The preference restoration function corrupts the warm rating vector by restoring it to a cold rating vector. The proposed GAN model then learns the distribution of rating vectors in the warm state or cold-start state so that the trained generator network can recommend items that cold-start users may be interested in in the future.
[0096] For further reference, Figure 3 , the calculation process of generating the network is as follows:
[0097]
[0098]
[0099]
[0100] The calculation process of the discriminant network is as follows:
[0101] or
[0102]
[0103]
[0104] Where L represents the number of hidden layers in the multilayer perceptron. and Respectively represent the output of the generator network G and the discriminator network D in the lth hidden layer, and at the same time, the above two symbols are also used as the input of the l+1th hidden layer in the multilayer perceptron during the iteration process. φ represents the Relu activation function, and σ represents the sigmoid function, which converts the output of the discriminator network D into a scalar value of 0 or 1. The input of the generator network G is That is, the cold score vector c g , the output is the predicted warmth score vector w' g . Represents the input of the discriminant network D, that is, the true warmth score vector w g Or the generative network generates the predicted warm score vector w' g Output y g is an integer value of 0 or 1, and it represents the probability that the discriminant network D will judge the input as a true warm rating vector. and Represents the weight matrices and biases of the generator and discriminator networks, which are model parameters.
[0105] In a specific embodiment, during the training process of the generative adversarial network, the loss function of the discriminant network is:
[0106]
[0107] in, represents the loss function of the discriminant network, w g represents the true warm rating vector of the g-th user, w′ g represents the predicted warm score vector of the g-th user, D represents the function corresponding to the discriminant network, and E represents the expectation;
[0108] The loss function of the generated network is:
[0109]
[0110] in, represents the loss function of the generated network, L relevant represents the related item loss function, which is defined as:
[0111]
[0112] Among them, N grepresents the number of items rated by the g-th user, w' g,l Represents the predicted warm rating vector w' of the g-th user g The rating of the g-th user on the l-th item in Represents the warm rating vector w of the real g-th user g If the true warm rating vector w of the g-th user is g The rating w of the g-th user on the l-th item g,l Greater than the true warm rating vector w of the g-th user g The average value of all the scores in the , then the element value is 1, otherwise it is 0, sigmoid(w' g,l ) represents the predicted warm rating vector w' of the g-th user g The value obtained by applying the sigmoid function to the score of the g-th user on the l-th item. represents the cross entropy loss function.
[0113] Specifically, during model training, the model parameters θ are first randomly assigned. G and θ D , and then iterate the following two steps until the two loss functions converge.
[0114] Training the discriminant network D: The embodiment of the present application fixes the parameters θ of the generating network G , and treat the discriminant network D as a binary classifier. The input of the discriminant network D is a set of predicted warm score vectors w' that generate the network output g and the true warmth score vector w g If the discriminant network D judges the input as a true warmth score vector, the discriminant network D outputs 1, otherwise, the discriminant network D outputs 0. The training discriminant network D is used to distinguish the true warmth score vector from the predicted warmth score vector output by the generating network, that is, D(w g )=1 and D(w' g )=0.
[0115] Train the generative network G:
[0116] In the embodiment of the present application, the parameters θ of the discriminant network are fixed. D , the embodiment of the present application uses a set of generated cold score vectors c obtained by the preference recovery function g To train the generative network G. Each user's cold rating vector c g The generative network G outputs a plausible predicted warm score vector w' g , and adjust the weights of the generator network G during training to maximize D(w' g ), that is, the generated network G can deceive the discriminative network D.
[0117] The loss function used in the embodiments of the present application is roughly the same as the loss function commonly used in GAN, except that the loss function of the generated network G is A related project loss function L is added relevant In order to minimize The discriminant network needs to reduce D(w g )and In other words, during the training process, we must try our best to prevent the discriminant network from being biased towards w g and w' g Conversely, the goal of the discriminant network is to make the predicted warm score vector output by the generator network be misclassified by the discriminant network.
[0118] The loss function of the generative network in its ordinary form has the following disadvantages. Since the discriminative network is a set of w g and w' g In order to deceive it, the trained generative network can summarize the distribution of rating vectors of warm users, which also leads to the collapse of the model, that is, the warm rating vectors generated using the normal loss function of the generative network are very similar, which cannot meet the personalized recommendation needs of different cold start users. In order to correct this deviation, the related item loss function is introduced into the loss function of the generative network. By adding the related item loss, the generative network can generate predicted warm rating vectors specific to individual cold start users.
[0119] The warm score vector of user u1 obtained in step S2 is w1 = [0, 5, 2, ..., 0, 4], and the warm score vector of user u2 is w2 = [1, 0, 4, ..., 0, 4]. Then, the cold score vector of user u1 generated by the preference recovery function is c1 = [0, 5, 0, ..., 0, 4], and the cold score vector of user u2 generated is c2 = [1, 0, 4, ..., 0, 0]. Input c1=[0,5,0,...,0,4] and c2=[1,0,4,...,0,0] into the generative network G, which outputs the predicted warm rating vectors, the predicted warm rating vectors w1'=[0,4.3,0,...,0,3.8] for user u1 and w'2=[1.3,0,4.4,...,0,3.6] for user u2. The value at the jth position in the rating vector represents the rating of the jth item. The higher the rating, the more satisfied the user is with the item.
[0120] The predicted warm score vector w′1=[0,4.3,0,...,0,3 of user u1 and the predicted warm score vector w′2=[1.3,0,4.4,...,0,3 of user u2 as well as the real warm score vector w1=[0,5,2,...,0,4] of user u1 and the real warm score vector w2=[1,0,4,...,0,4] of user u2 are calculated. That is, the real warm score vector w g and the predicted warm score vector w' output by the generating network g Input the discriminant network D. The discriminant network D outputs the discriminant result And the judgment results If the discriminant network D judges the rating of the input warm rating vector as a true rating, the discriminant network D outputs 1, otherwise it outputs 0. As an example, the result indicates that the judgment network D believes that the score of the second item in user u1 is the true score, and the score of the third item is the predicted score output by the generation network G.
[0121] S4, input the cold rating vector of the real user in the cold start user rating set into the trained generation network to obtain the predicted warm rating vector of the user, perform Top-k recommendation based on the cold rating vector of the real user and the predicted warm rating vector of the user, and obtain a recommended item sequence for each user.
[0122] In a specific embodiment, step S4 specifically includes:
[0123] The actual cold rating vector of the s-th user in the cold start user rating set is input into the trained generative network to obtain the predicted warm rating vector of the s-th user, and the ratings corresponding to the items in the predicted warm rating vector of the s-th user except the rated items in the actual cold rating vector of the s-th user are sorted from large to small, and the top k ranked items are selected as the recommended item sequence for the s-th user.
[0124] Specifically, the trained generative network G is trained to be able to directly obtain the predicted warm rating vector from the user's cold rating vector. Therefore, after GAN training, the trained generative network G is used to provide a recommended item sequence for the cold start user. For the cold start user in the user set, the cold rating vector corresponding to the sth cold start user in the cold start user rating set is represented as c s . Cold score vector c s is input into the trained generative network G to produce the predicted warmth score vector w' s , w' s contains the possible ratings that cold-start users may make in the future. Then, except for s In addition to the items that have been rated, according to the predicted warm rating vector w's The scores in are used to rank all items and the top k items are recommended to the user.
[0125] Further references Figure 4 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a cold start recommendation device based on a preference recovery generative adversarial network. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0126] The embodiment of the present application provides a cold start recommendation device based on a preference recovery generative adversarial network, comprising:
[0127] Data acquisition module 1, configured to acquire a user set and a project set of Internet insurance products and construct a user rating matrix;
[0128] Data processing module 2 is configured to construct a warm user rating set and a cold start user rating set based on the user rating matrix, obtain a real user's warm rating vector and a real user's cold rating vector according to the warm user rating set and the cold start user rating set, respectively, and convert the real user's warm rating vector into a generated user's cold rating vector using a preference recovery function;
[0129] The model building module 3 is configured to build a generative adversarial network, which includes a generative network and a discriminant network. The training process of the generative adversarial network is as follows: randomly initialize the parameters of the generative network and the discriminant network, fix the parameters of the generative network, input the generated user's cold score vector into the generative network, obtain the predicted user's warm score vector, train the discriminant network based on the predicted user's warm score vector and the real user's warm score vector, and obtain a trained discriminant network; fix the parameters of the trained discriminant network, input the predicted user's warm score vector and the real user's warm score vector into the trained discriminant network, obtain the discrimination result, make the discrimination result of the corresponding score in the predicted user's warm score vector false, and the discrimination result of the corresponding score in the real user's warm score vector true, train the generative network based on the trained discriminant network, and obtain a trained generative network; repeat the above process until the loss function converges, and finally obtain a trained generative network;
[0130] The recommendation module 4 is configured to input the cold rating vector of the real user in the cold start user rating set into the trained generation network to obtain the predicted warm rating vector of the user, perform Top-k recommendation based on the cold rating vector of the real user and the predicted warm rating vector of the user, and obtain a recommended item sequence for each user.
[0131] Figure 5Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 5 As shown, the electronic device of this embodiment includes: a processor 501 and a memory 502; wherein the memory 502 is used to store computer-executable instructions; the processor 501 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0132] Optionally, the memory 502 may be independent or integrated with the processor 501 .
[0133] When the memory 502 is independently provided, the electronic device further includes a bus 503 for connecting the memory 502 and the processor 501 .
[0134] The embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When the processor 501 executes the computer execution instructions, the above method is implemented.
[0135] The embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by the processor 501, the above method is implemented.
[0136] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0137] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0138] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each module may exist physically separately, or two or more modules may be integrated into one unit. The unit formed by the above modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0139] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor 501 to perform some steps of the methods of various embodiments of the present application.
[0140] It should be understood that the processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor 501 may be any conventional processor 501, etc. The steps of the method disclosed in the invention may be directly embodied in the execution of the hardware processor 501, or may be executed by a combination of hardware and software modules in the processor 501.
[0141] The memory 502 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.
[0142] The bus 503 may be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 503 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 503 in the drawings of the present application is not limited to only one bus 503 or one type of bus 503.
[0143] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0144] An exemplary storage medium is coupled to the processor 501, so that the processor 501 can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor 501. The processor 501 and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor 501 and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0145] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cold start recommendation method based on preference recovery generative adversarial network, characterized in that: The following steps are involved: Obtain the user set and project set of Internet insurance products and construct a user rating matrix; constructing a warm user rating set and a cold start user rating set based on the user rating matrix, obtaining a real user's warm rating vector and a real user's cold rating vector according to the warm user rating set and the cold start user rating set, respectively, and converting the real user's warm rating vector into a generated user's cold rating vector using a preference recovery function; Constructing a generative adversarial network, the generative adversarial network includes a generative network and a discriminative network, and the training process of the generative adversarial network is as follows: randomly initializing the parameters of the generative network and the discriminative network, fixing the parameters of the generative network, inputting the generated user's cold score vector into the generative network to obtain the predicted user's warm score vector, and training the discriminative network based on the predicted user's warm score vector and the real user's warm score vector to obtain a trained discriminative network; fixing the parameters of the trained discriminative network, inputting the predicted user's warm score vector and the real user's warm score vector into the trained discriminative network to obtain a discrimination result, making the discrimination result of the corresponding score in the predicted user's warm score vector false, and the discrimination result of the corresponding score in the real user's warm score vector true, and training the generative network based on the trained discriminative network to obtain a trained generative network; Repeat the above process until the loss function converges, and finally obtain the trained generation network; The cold rating vectors of real users in the cold start user rating set are input into the trained generation network to obtain the predicted warm rating vectors of the users, and Top-k recommendations are performed based on the cold rating vectors of the real users and the predicted warm rating vectors of the users to obtain a recommended item sequence for each user.
2. The cold start recommendation method based on preference recovery generative adversarial network according to claim 1, characterized in that: The user set is represented as U = {u1,u2,…,u m }, i = 1, 2, ..., m, m is the total number of users; the item set is represented by V = {v1, v2, ..., v n }, j = 1, 2, ..., n, n is the total number of items, and all items in the item set are arranged in ascending order of time; the user rating matrix is It is expressed as: Among them, r ij represents the i-th user u i For the jth item v j The rating data, r ij ∈[0,1,2,3,4,5], when r ij = 0 represents the i-th user u i For the jth product v j Unrated, when r ij ∈[1,2,3,4,5] represents the i-th user u i For the jth product v j The rating value is 1, 2, 3, 4 or 5; The warm user rating set and the cold start user rating set are expressed as: O={<u i ,v j ,r ij >|count(e r )≥ξ1}; T={<u i ,v j ,r ij >|count(e r )<ξ2}; Among them, O represents the warm user rating set, T represents the cold start user rating set, and e r represents the i-th user u i The rating vector is the rating vector composed of the rating data of the i-th row in the user rating matrix R, count(e r ) means e r ξ1 and ξ2 represent the thresholds for distinguishing warm users from cold start users, respectively, and are defined as follows: Among them, α represents the user rating matrix The sparseness rate; The warm rating vector of the real user is a rating vector of any user in the warm user rating set; The cold rating vector of the real user is a rating vector of any user in the cold start user rating set.
3. The cold start recommendation method based on preference recovery generative adversarial network according to claim 2 is characterized in that: The preference recovery function is as follows: Among them, p g (j) represents the real warm rating vector w of the g-th user in the warm user rating set g The gth user u in g For the jth item v j The score will be in the cold score vector c g The probability of being retained in , count represents the real warm rating vector w of the g-th user g The number of items rated in the parameter p min represents the lowest possible value of the score, p max represents the highest possible value of the score, p min 、p max and a are real numbers, 0≤p min <p max ≤1, a represents the attenuation coefficient, pop(v j ) represents the jth item v j The popularity of , the range of pop is [0,1], and is defined as follows: F=[freq(v1),freq(v2),...freq(v n )]; pop(v j )=freq(v j ) / max(F); Among them, F represents the set of the number of users who have rated each item, freq(v j ) represents the jth item v that has been rated j The number of users; Traverse each item and obtain the real warm rating vector w of the gth user in the warm user rating set g The gth user u in g The rating for each item will be in the cold rating vector c g The set P of probabilities retained in g , as shown below: P g =[p g (1),p g (2),...,p g (n)]; For the set P g All the p g (j) Sort the warm user ratings set from large to small, and retain the real warm rating vector w of the g-th user in the warm user rating set according to the order. g The gth user u in g For the ratings of the first ξ2 items, the real warm rating vector w of the gth user in the warm user rating set is g The gth user u in g Set the scores of all items except the first ξ2 items to 0, and obtain the generated cold score vector c of the g-th user g .
4. The cold start recommendation method based on preference recovery generative adversarial network according to claim 1, characterized in that: The generation network and the discrimination network both use multi-layer perceptrons.
5. The cold start recommendation method based on preference recovery generative adversarial network according to claim 1, characterized in that: During the training process of the generative adversarial network, the loss function of the discriminant network is: in, represents the loss function of the discriminant network, w g represents the true warm rating vector of the g-th user, w′ g represents the predicted warm score vector of the g-th user, D represents the function corresponding to the discriminant network, and E represents the expectation; The loss function of the generated network is: in, represents the loss function of the generated network, L relevant represents the related item loss function, which is defined as: Among them, N g represents the number of items rated by the g-th user, w' g,l Represents the predicted warm rating vector w' of the g-th user g The rating of the g-th user on the l-th item in Represents the warm rating vector w of the real g-th user g If the true warm rating vector w of the g-th user is g The rating w of the g-th user on the l-th item g,l Greater than the true warm rating vector w of the g-th user g The average value of all the scores in the , then the element value is 1, otherwise it is 0, sigmoid(w' g,l ) represents the predicted warm rating vector w' of the g-th user g The score of the g-th user on the l-th item in is obtained after the sigmoid function is applied, and l represents the cross entropy loss function.
6. The cold start recommendation method based on preference recovery generative adversarial network according to claim 1, characterized in that: Inputting the cold score vector of the real user in the cold start user score set into the trained generation network to obtain the predicted warm score vector of the user, performing Top-k recommendation based on the cold score vector of the real user and the predicted warm score vector of the user to obtain a recommended item sequence for each user, specifically comprising: The actual cold rating vector of the s-th user in the cold start user rating set is input into the trained generation network to obtain a predicted warm rating vector of the s-th user, and the ratings corresponding to the items in the predicted warm rating vector of the s-th user except the rated items in the actual cold rating vector of the s-th user are sorted from large to small, and the top K ranked items are selected as the recommended item sequence for the s-th user.
7. A cold start recommendation device based on preference recovery generative adversarial network, characterized in that: include: A data acquisition module, configured to acquire a user set and a project set of Internet insurance products and construct a user rating matrix; A data processing module is configured to construct a warm user rating set and a cold start user rating set based on the user rating matrix, obtain a real user's warm rating vector and a real user's cold rating vector according to the warm user rating set and the cold start user rating set, respectively, and convert the real user's warm rating vector into a generated user's cold rating vector using a preference recovery function; The model building module is configured to build a generative adversarial network, wherein the generative adversarial network includes a generative network and a discriminative network, and the training process of the generative adversarial network is as follows: randomly initializing the parameters of the generative network and the discriminative network, fixing the parameters of the generative network, inputting the generated user's cold score vector into the generative network to obtain the predicted user's warm score vector, and training the discriminative network based on the predicted user's warm score vector and the real user's warm score vector to obtain a trained discriminative network; fixing the parameters of the trained discriminative network, inputting the predicted user's warm score vector and the real user's warm score vector into the trained discriminative network to obtain a discrimination result, making the discrimination result of the corresponding score in the predicted user's warm score vector false and the discrimination result of the corresponding score in the real user's warm score vector true, and training the generative network based on the trained discriminative network to obtain a trained generative network; Repeat the above process until the loss function converges, and finally obtain the trained generation network; The recommendation module is configured to input the cold score vector of the real user in the cold start user score set into the trained generation network to obtain the predicted warm score vector of the user, perform Top-k recommendation based on the cold score vector of the real user and the predicted warm score vector of the user, and obtain a recommended item sequence for each user.
8. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.