An item recommendation method based on self-supervised variational autoencoder
The self-supervised variational autoencoder method is used to perform data augmentation and feature learning in the user-item feedback matrix, which solves the problem of insufficient performance of variational autoencoders under sparsity and achieves high-quality recommendation performance and versatility. .
Patent Information
- Application Number
- CN202111087039.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-09-16
AI Technical Summary
When faced with a large number of users and items, existing collaborative filtering methods based on variational autoencoders are limited by the sparsity of user-item interaction data, making it difficult to learn high-quality user/item features, and the edges in different application scenarios The information difference is large, making the recommended methods difficult to transplant and use.
The self-supervised variational autoencoder (SSVAE) method is used to construct a user-item feedback matrix by obtaining user feedback data, and uses self-supervised auxiliary tasks for data augmentation, designing objective functions to optimize the model, learn user characteristics, and achieve future prediction. Recommendations for rated items.
It effectively alleviates the problem of data sparsity, improves recommendation performance, and does not rely on side information. It has strong versatility and is suitable for a variety of application scenarios.
Smart Images

Figure CN113868517B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of personalized recommendation technology, and in particular to an item recommendation method based on a self-supervised variational autoencoder. Background Art
[0002] Variational Autoencoder ( Variational Autoencoders, VAE ) consists of two parts: an encoder and a decoder; the encoder learns the variational distribution of user features based on the user-item feedback matrix and samples the user feature matrix from the distribution; the decoder predicts the items that the user is interested in based on the user feature matrix.
[0003] Self-supervised learning (SSL): Auxiliary tasks are used to mine the data’s own supervisory information from large-scale unsupervised data to improve the quality of learning features, and the model is trained through the constructed supervisory signals.
[0004] With the rapid development of the Internet, online information has exploded. Recommendation systems have become an effective tool to deal with the problem of information overload, playing an important role in many Internet platforms such as news recommendations, online shopping, restaurant reservations, and film and television recommendations.
[0005] Collaborative filtering is one of the core technologies for building personalized recommendation systems. The collaborative filtering method based on variational autoencoder (VAE) stands out from many collaborative filtering methods with its excellent performance. Its core idea is to input the user-item feedback matrix, let the encoder learn the variational distribution of user features, sample the user's feature matrix from the variational distribution, and then reconstruct the user-item feedback matrix according to the user's features by the decoder, so as to achieve the purpose of recommending items of interest to users.
[0006] One method of item recommendation in the prior art includes: in order to improve the performance of the variational autoencoder model in recommendation, higher quality user features are learned by changing the VAE network architecture, prior / posterior distribution, etc. However, with the rapid growth of the number of online users and items, the collaborative filtering method based on the variational autoencoder and its variant methods face the challenge of sparsity.
[0007] The disadvantage of the above-mentioned prior art item recommendation method is that it is limited by the sparsity of user-item interaction data and is difficult to learn high-quality user / item features. Some variational autoencoder models that integrate side information can alleviate the problem of sparsity of some interaction data. However, the side information that can be used in different application scenarios varies greatly (such as comment text, social network, user attributes, etc.), so it is difficult to transplant recommendation methods that use different side information. Summary of the invention
[0008] An embodiment of the present invention provides an item recommendation method based on a self-supervised variational autoencoder to effectively improve the item recommendation performance of users.
[0009] In order to achieve the above object, the present invention adopts the following technical scheme.
[0010] An item recommendation method based on a self-supervised variational autoencoder, comprising:
[0011] Obtain recommendation main task data, collect user feedback data, and build a user-item feedback matrix;
[0012] Acquire self-supervised auxiliary task data, and use the self-supervised auxiliary task data to perform data augmentation to obtain an augmented user-item feedback matrix;
[0013] Inputting the user-item feedback matrix and the augmented user-item feedback matrix into a self-supervised variational autoencoder SSVAE model, training the SSVAE model using an objective function optimization algorithm, and obtaining a trained SSVAE model;
[0014] The trained SSVAE model is used to predict the user’s preference for unrated items, and items with higher estimated scores are recommended to the user.
[0015] Preferably, the obtaining of recommendation main task data, collecting user feedback data, and constructing a user-item feedback matrix includes:
[0016] Obtain the recommendation main task data, collect user feedback data, and represent the user feedback data as a user-item feedback matrix X∈{0,1} m×n , where m and n represent the number of users and items respectively; the u-th row x of the matrix u ∈N n is the feedback vector of user u, which records the historical interaction behavior of user u, x ui =1 means that user u has interacted with item i, x ui =0 means that user u has not interacted with item i yet.
[0017] Preferably, the step of obtaining the self-supervised auxiliary task data and performing data augmentation using the self-supervised auxiliary task data to obtain an augmented user-item feedback matrix includes:
[0018] Obtain self-supervised auxiliary task data, augment user feedback data and construct positive and negative sample pairs for self-supervised learning tasks. For the user-item feedback matrix X, discard the node information of some historical interaction items in X with a fixed probability α, and replace the value of the discarded node with 0, as shown below:
[0019] X′=P′⊙X, X″=P”⊙X
[0020] where P′∈N d and P″∈N d are two independent mask vectors, ⊙ is the Hadamard product, X′ and X″ are the augmented user-item feedback matrices, representing two different views of user feedback, each view represents part of the user’s feedback data, and the u-th row x′ of the matrix X′ and X″ u and x″ u represents the feedback vector of user u in the corresponding view;
[0021] Feedback vector x′ of the same user in different views u and x″ u Considered as positive sample pairs, the feedback vectors x′ of different users in different views u and x″ v , u≠v is regarded as a negative sample pair.
[0022] Preferably, the step of inputting the user-item feedback matrix and the augmented user-item feedback matrix into a self-supervised variational autoencoder SSVAE model, training the SSVAE model using an objective function optimization algorithm, and obtaining a trained SSVAE model comprises:
[0023] The objective function of the SSVAE model is set as follows:
[0024] L=L VAE +λL self
[0025] Where L VAE represents the loss function of the recommendation task, L self represents the loss function of the self-supervised learning task, and λ is the parameter that controls the learning intensity of the self-supervised task;
[0026] The user-item feedback matrix X is input into the SSVAE model for training, the distribution of user features is learned, and the user feature matrix Z∈R is obtained according to the distribution sampling m×d , input Z into the decoder training and reconstruct the user-item feedback matrix; where the u-th row of Z is z u ∈R d represents the feature vector of user u, d is the vector dimension, and the loss function is defined as follows:
[0027]
[0028] The augmented user-item feedback matrices X′ and X″ are input into the SSVAE model for training to obtain the user feature matrix Z′∈R m×d and Z″∈R m×d ; where Z' and Z″ have the uth row z′ u ∈Rd and They represent the feature vectors of user u in the corresponding view, where d is the vector dimension; contrastive learning is used to maximize the user positive sample pair feature z′ u and z″ u The consistency between the negative samples and the feature z′ u and z″ v The difference between them is used to learn discriminative user features to assist in recommendation tasks. The loss function is defined as follows:
[0029]
[0030] Where U represents the user node set, u is the user node index, s(·) is the cosine similarity function used to measure the similarity of the same user node in two views, and τ is an adjustable hyperparameter
[0031] After merging and sorting out the various items, the final objective function of the self-supervised variational autoencoder model is expressed as follows:
[0032]
[0033] The final objective function is used to train the SSVAE model using an optimization algorithm to obtain a trained SSVAE model.
[0034] Preferably, predicting the user's preference for unrated items based on the trained SSVAE model and recommending items with higher estimated scores to the user includes:
[0035] For the user v to be recommended, convert the historical interaction behavior of user v into a feedback vector x v , and the feedback vector x v Input to the trained SSVAE model, the SSVAE model obtains the output vector after encoding and decoding stages The i-th element of corresponds to item i, The elements of each dimension are sorted in descending order, and the elements corresponding to the items that have been interacted with are removed, and the top k items are recommended to user v.
[0036] It can be seen from the technical solutions provided by the above embodiments of the present invention that the item recommendation method based on the self-supervised variational autoencoder (SSVAE) proposed in the embodiments of the present invention mines the intrinsic characteristics of user feedback information by designing a simple and effective self-supervised task, and assists the main task in obtaining higher-quality user representations. The recommendation performance is greatly improved without using side information, and the sparsity problem is alleviated.
[0037] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0039] Figure 1 A flowchart of a method for recommending items based on a self-supervised variational autoencoder is provided in accordance with an embodiment of the present invention.
[0040] Figure 2 The experimental results of the method of the present invention are compared with those of Mult-VAE and Rec-VAE on the DoubanBook dataset.
[0041] Figure 3 The experimental results of the method of the present invention are compared with those of Split-Merge CVAE and JVAE-CF on the MovieLens1M dataset. DETAILED DESCRIPTION
[0042] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0043] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or coupling. The term "and / or" used herein includes any unit and all combinations of one or more associated listed items.
[0044] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0045] To facilitate understanding of the embodiments of the present invention, several specific embodiments will be further explained below with reference to the accompanying drawings, and each embodiment does not constitute a limitation on the embodiments of the present invention.
[0046] The embodiment of the present invention proposes an item recommendation method based on a self-supervised variational autoencoder. The method constructs a self-supervised learning task and expands training samples by data augmentation, does not require any side information, and therefore has good versatility.
[0047] The processing flow of an item recommendation method based on a self-supervised variational autoencoder proposed in an embodiment of the present invention is as follows: Figure 1 As shown, the following processing steps are included:
[0048] Step S1: Obtain the recommendation main task data, collect user feedback data, and represent the user feedback data as a user-item feedback matrix X∈{0,1} m×n , where m and n represent the number of users and items respectively; the u-th row x of the matrix u ∈N n is the feedback vector of user u, which records the historical interaction behavior of user u, where x ui =1 indicates that user u has interacted with item i by clicking or purchasing. ui =0 means that user u has not interacted with item i yet.
[0049] Step S2: Obtain self-supervised auxiliary task data, augment user feedback data and construct positive and negative sample pairs for self-supervised learning tasks. For the user-item feedback matrix X, discard the node information of some historical interaction items in X (the corresponding node value is 1) with a fixed probability α, and replace the value of the discarded node with 0, as shown below:
[0050] X′=P′⊙X, X″=P″⊙X
[0051] where P′∈N d and P″∈N d are two independent mask vectors, and ⊙ is the Hadamard product. X′ and X″ are augmented user-item feedback matrices, representing two different views of user feedback, each view representing part of the user's feedback data. The u-th row x′ of the matrix X′ and X″ uand x″ u represents the feedback vector of user u in the corresponding view.
[0052] Feedback vector x′ of the same user in different views u and x″ u Considered as positive sample pairs, the feedback vectors x′ of different users in different views u and x″ v (u≠v) is regarded as a negative sample pair.
[0053] Step S3: Input the user-item feedback matrix X and the augmented user-item feedback matrices X′ and X″ into a self-supervised variational autoencoder model (SSVAE), and train the SSVAE model using the Adam optimization algorithm using the objective function.
[0054] The objective function of the self-supervised variational autoencoder model SSVAE is set as follows:
[0055] L=L VAE +λL self
[0056] Where L VAE represents the loss function of the recommendation task, L self represents the loss function of the self-supervised learning task, and λ is a parameter that controls the learning intensity of the self-supervised task.
[0057] The recommendation task is to input the user-item feedback matrix X into the encoder to learn the distribution of user features, and obtain the user feature matrix Z∈R according to the distribution sampling m×d , and then input Z into the decoder to train it to reconstruct the user-item feedback matrix; where the u-th row of Z is z u ∈R d represents the feature vector of user u, d is the vector dimension, and the loss function is defined as follows:
[0058]
[0059] The self-supervised learning task is to input the augmented user-item feedback matrices X′ and X″ into the self-supervised variational autoencoder for training to obtain the user feature matrix Z′∈R m×d and Z″∈R m×d ; where Z' and Z″ have the uth row z′ u ∈R d and They represent the feature vectors of user u in the corresponding view, where d is the vector dimension; then contrastive learning is used to maximize the user positive sample pair feature z′ u and z″ u The consistency between the negative samples and the feature z′ u and z″ vThe difference between (u≠v) is used to learn discriminative user features to assist in the recommendation task. The loss function is defined as follows:
[0060]
[0061] Where U represents the user node set, u is the user node index, s(·) is the cosine similarity function used to measure the similarity of the same user node in two views, and τ is an adjustable hyperparameter
[0062] After merging and sorting out the various items, the final objective function of the self-supervised variational autoencoder model is expressed as follows:
[0063]
[0064] Step S4: Predict the user's preference for unrated items based on the trained SSVAE model, and recommend k items with higher estimated scores to the user.
[0065] For the user v to be recommended, convert the user's historical interaction behavior into a feedback vector x v , and x v Input to the trained SSVAE model, and obtain the output vector after encoding and decoding stages The i-th element of corresponds to item i, The elements of each dimension are sorted in descending order, and the elements corresponding to the items that have been interacted with are removed, and the top k items are recommended to user v.
[0066] The present invention uses Rec-VAE as the variational autoencoder model in SSVAE. The recommendation performance of the present invention is verified on the Douban Book and MovieLens1M datasets. The MovieLens1M dataset originates from the MovieLen movie review website. The rows of its UI matrix represent moviegoers, the columns represent movies, and the rating range is 1.0-5.0 points. The density of the "user-item" interaction data of this dataset is 2.7%, and the dataset also includes the user's gender, age, and occupation information. The Douban Book dataset originates from the Douban review website. The rows of its UI matrix represent readers, the columns represent books, and the rating range is 1.0-5.0 points. The density of the "user-item" interaction data of this dataset is 0.26%. During the experiment, the user's interactive behavior of rating an item greater than 3 is regarded as x ui =1, and all other interactive behaviors with scores less than or equal to 3 or non-interactive behaviors with missing scores are considered as x ui= 0. The evaluation indicators are Normalized Discount Cumulative Gain (NDCG) and Recall. The larger the NDCG and Recall values, the better the recommendation performance.
[0067] On the Douban Book dataset, SSVAE is compared with the collaborative filtering models Mult-VAE and Rec-VAE, which also only consider user-item interaction information, to verify the effect of the present invention. Mult-VAE was published at WWW 2018, a top conference in the field of information retrieval, and is currently the most representative recommendation method based on variational autoencoders. Rec-VAE was published at WSDM 2020, a conference in the field of information retrieval and data mining, and is currently the best recommendation method based on variational autoencoders.
[0068] At the same time, on the MovieLens1M dataset, SSVAE is compared with the Split-Merge CVAE model (Split-Merge Conditional Variational Auto-encoders) and the JVAE-CF model (Joint VAE for Collaborative Filtering) in terms of recommendation accuracy. Split-Merge CVAE was published in the data mining conference PAKDD 2019, and JVAE-CF was published in the data mining conference CIKM 2017. Both are recommendation models for variational autoencoders that integrate side information.
[0069] Figure 2 The experimental results of SSVAE recommendation accuracy comparison on Douban Book dataset are shown. The experimental results show that the method of the present invention has a more obvious advantage in improving the performance of the recommendation system. At the same time, Douban Book is a relatively sparse dataset, which also proves that the present invention has a significant effect on alleviating the sparsity problem in the recommendation system.
[0070] Figure 3 The experimental results of comparing the recommendation accuracy of three recommendation methods, SSVAE, Split-Merge CVAE and JVAE-CF, on the MovieLens1M dataset are shown. The experimental results show that the method of the present invention has more obvious advantages in improving the performance of the recommendation system than the VAE recommendation method that integrates side information.
[0071] SSVAE is a general framework that is suitable for most existing recommendation models based on variational autoencoders. The method for item recommendation based on self-supervised variational autoencoders provided in the embodiments of the present invention focuses on protecting the SSVAE framework and its objective function design; in the embodiments, we adopt the strategy of simultaneously training self-supervised learning tasks and recommendation tasks. It is obvious that those familiar with the technology can easily make various modifications to the above embodiments; for example, the self-supervised learning task is used as a pre-training stage, and the recommendation task is used as a downstream task for fine-tuning to predict user preferences. Another example is to replace the VAE model with a variant of other autoencoder models, and apply the general principles described herein to other embodiments without creative labor. Therefore, all improvements and modifications made in accordance with the scope of the patent application of the present invention should be included in the scope of application of the patent of the present invention.
[0072] In summary, in the field of personalized recommendation technology, there is a large amount of user and item information, compared with only a small amount of user-item historical interaction behavior, and it is difficult to predict user interest preferences from a small amount of historical information. In order to alleviate such data sparsity problems, some recommendation algorithms use the method of fusing side information to alleviate data sparsity problems and achieve certain results. Since side information includes a variety of information such as pictures, texts, and social information, the differences between the information are very large, so it is difficult to transplant and use recommendation methods using different side information. The item recommendation method based on the self-supervised variational autoencoder (SSVAE) proposed in the embodiment of the present invention can effectively alleviate the data sparsity problem by designing a simple and effective self-supervised task to mine the intrinsic characteristics of user-item interaction information, and assist the main task to obtain higher quality user representation. Because it is not limited by the type of side information, it has strong versatility and can greatly improve the recommendation performance.
[0073] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0074] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0075] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0076] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An item recommendation method based on self-supervised variational autoencoder, characterized in that: include: Obtain recommendation main task data, collect user feedback data, and build a user-item feedback matrix; Acquire self-supervised auxiliary task data, and use the self-supervised auxiliary task data to perform data augmentation to obtain an augmented user-item feedback matrix; Inputting the user-item feedback matrix and the augmented user-item feedback matrix into a self-supervised variational autoencoder SSVAE model, training the SSVAE model using an objective function optimization algorithm, and obtaining a trained SSVAE model; Predict the user's preference for unrated items based on the trained SSVAE model, and recommend the top k items with the estimated scores to the user; The step of obtaining the self-supervised auxiliary task data and performing data augmentation using the self-supervised auxiliary task data to obtain an augmented user-item feedback matrix includes: Obtain self-supervised auxiliary task data, augment user feedback data and construct positive and negative sample pairs for self-supervised learning tasks. For the user-item feedback matrix X, discard the node information of some historical interaction items in X with a fixed probability α, and replace the value of the discarded node with 0, as shown below: X′=P′⊙X, X″=P″⊙X in and are two independent mask vectors, ⊙ is the Hadamard product, X′ and X″ are the augmented user-item feedback matrices, representing two different views of user feedback, each view represents part of the user’s feedback data, and the u-th row x′ of the matrix X′ and X″ u and x″ u represents the feedback vector of user u in the corresponding view; Feedback vector x′ of the same user in different views u and x″ u Considered as positive sample pairs, the feedback vectors x′ of different users in different views u and x″ v , u≠v is regarded as a negative sample pair; The step of inputting the user-item feedback matrix and the augmented user-item feedback matrix into a self-supervised variational autoencoder SSVAE model, training the SSVAE model using an objective function optimization algorithm, and obtaining a trained SSVAE model includes: The objective function of the SSVAE model is set as follows: in represents the loss function of the recommendation task, represents the loss function of the self-supervised learning task, and λ is the parameter that controls the learning intensity of the self-supervised task; Input the user-item feedback matrix X into the SSVAE model for training, learn the distribution of user features, and obtain the user feature matrix based on the distribution sampling Input Z into the decoder training to reconstruct the user-item feedback matrix; where the u-th row of Z represents the feature vector of user u, d is the vector dimension, and the loss function is defined as follows: The augmented user-item feedback matrices X′ and X″ are input into the SSVAE model for training to obtain the user feature matrix and The u-th row of Z′ and Z″ and They represent the feature vectors of user u in the corresponding view, where d is the vector dimension; contrastive learning is used to maximize the user positive sample pair feature z′ u and z″ u The consistency between the negative samples and the feature z′ u and z″ v The difference between them is used to learn discriminative user features to assist in recommendation tasks. The loss function is defined as follows: Where u represents the user node set, u is the user node index, s(·) is the cosine similarity function used to measure the similarity of the same user node in two views, and τ is an adjustable hyperparameter; After merging and sorting out the various items, the final objective function of the self-supervised variational autoencoder model is expressed as follows: The final objective function is used to train the SSVAE model using an optimization algorithm to obtain a trained SSVAE model.
2. The method according to claim 1, characterized in that The obtaining of recommendation main task data, collecting user feedback data, and constructing a user-item feedback matrix include: Obtain the recommendation main task data, collect user feedback data, and represent the user feedback data as a user-item feedback matrix X∈{0,1} m×n , where m and n represent the number of users and items respectively; the uth row of the matrix is the feedback vector of user u, which records the historical interaction behavior of user u, x ui =1 means that user u has interacted with item i, x ui =0 means that user u has not interacted with item i yet.
3. The method according to claim 1, characterized in that The method of predicting the user's preference for unrated items based on the trained SSVAE model and recommending the top k items with the estimated scores to the user includes: For the user v to be recommended, convert the historical interaction behavior of user v into a feedback vector x v , and the feedback vector x v Input to the trained SSVAE model, the SSVAE model obtains the output vector after encoding and decoding stages The i-th element of corresponds to item i, The elements of each dimension are sorted in descending order, and the elements corresponding to the items that have been interacted with are removed, and the top k items are recommended to user v.
