A recommended method, apparatus, and storage medium
By preprocessing the original interaction matrix and training the model, and combining graph neural networks with adaptive views, the problems of data sparsity and cold start in recommendation methods are solved, and the robustness and generalization performance of the recommendation model are enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUILIN UNIV OF ELECTRONIC TECH
- Filing Date
- 2023-12-06
- Publication Date
- 2026-06-30
AI Technical Summary
Existing recommendation methods cannot effectively solve the problems of data sparsity and cold start, and cannot provide users with accurate recommendation results.
By preprocessing the original interaction matrix, a training model is constructed, and the robustness and generalization performance of the recommendation model are enhanced by combining graph neural networks and adaptive views.
It captures useful new information, improves the robustness and generalization performance of recommendation models, and solves the problems of data sparsity and cold start.
Smart Images

Figure CN117828177B_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of data recommendation technology, specifically to a recommendation method, apparatus, and storage medium. Background Technology
[0002] In recent years, the rapid development of internet applications, especially mobile applications, has enabled people to easily browse a vast amount of online information resources. How to recommend resources (such as goods, movies, and books) that meet users' needs from this massive amount of information has become a key research focus. Recommendation methods can effectively filter and select information, helping users retrieve information resources that meet their needs in a personalized way, thus alleviating the problem of information overload. Recommendation technology has undergone continuous development and updates and is now widely used in education, music, e-commerce, social networks, and other fields. Since the introduction of collaborative filtering algorithms, recommendation methods have gradually become a new research hotspot. However, existing recommendation methods cannot solve the problems of data sparsity (i.e., too few user ratings for recommended items) and cold start (i.e., no rating data for new recommended items and new users). Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a recommended method, apparatus and storage medium to address the shortcomings of the prior art.
[0004] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: A recommended method, comprising the following steps:
[0005] Import the original interaction matrix, preprocess the original interaction matrix, and use the preprocessed result as the training set;
[0006] Construct a training model, and train the training model using the training set to obtain a recommendation model;
[0007] The original interaction matrix is used to make recommendations using the recommendation model to obtain recommendation results.
[0008] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: A recommended device, comprising:
[0009] The import module is used to import the original interaction matrix;
[0010] The preprocessing module is used to preprocess the original interaction matrix and use the preprocessed result as the training set.
[0011] The training module is used to build a training model and train the training model using the training set to obtain a recommendation model.
[0012] The recommendation result acquisition module is used to make recommendations based on the original interaction matrix through the recommendation model to obtain recommendation results.
[0013] Based on the above-described recommendation method, the present invention also provides a recommendation system.
[0014] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a recommendation system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the recommendation method described above is implemented.
[0015] Based on the aforementioned recommended method, the present invention also provides a computer-readable storage medium.
[0016] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the recommended method as described above.
[0017] The beneficial effects of this invention are: by preprocessing the original interaction matrix and using the preprocessed result as a training set, a recommendation model is obtained by training the training model using the training set, and a recommendation result is obtained by using the recommendation model to make recommendations on the original interaction matrix. This captures useful new information and, combined with the adaptive view, can effectively enhance the robustness and generalization performance of the recommendation model. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a recommended method provided in an embodiment of the present invention;
[0019] Figure 2 A block diagram of a recommended device provided in an embodiment of the present invention. Detailed Implementation
[0020] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0021] Figure 1 This is a flowchart illustrating a recommended method provided in an embodiment of the present invention.
[0022] like Figure 1 As shown, a recommended method includes the following steps:
[0023] Import the original interaction matrix, preprocess the original interaction matrix, and use the preprocessed result as the training set;
[0024] Construct a training model, and train the training model using the training set to obtain a recommendation model;
[0025] The original interaction matrix is used to make recommendations using the recommendation model to obtain recommendation results.
[0026] In the above embodiments, by preprocessing the original interaction matrix and using the preprocessed result as a training set, the training model is trained using the training set to obtain a recommendation model, and the recommendation model is used to make recommendations on the original interaction matrix to obtain recommendation results. This captures useful new information and, combined with the adaptive view, can effectively enhance the robustness and generalization performance of the recommendation model.
[0027] Optionally, as an embodiment of the present invention, the process of preprocessing the original interaction matrix and using the preprocessed result as the training set includes:
[0028] The original interaction matrix is updated to obtain the updated interaction matrix;
[0029] The original adjacency matrix is obtained by calculating the updated interaction matrix using the first equation, which is:
[0030]
[0031] Where R is the original adjacency matrix, A is the updated interaction matrix, and T is the transpose;
[0032] Multiple user nodes and multiple project nodes are extracted from the updated interaction matrix;
[0033] Each user node and each project node is vectorized to obtain the original user vector corresponding to each user node and the original project vector corresponding to each project node.
[0034] The random negative sampling algorithm is used to extract negative samples from all user nodes and all item nodes, and the original adjacency matrix, all original user vectors, all original item vectors, and all extracted negative samples are used as the training set.
[0035] Specifically, user set Represents I users;
[0036] Project Collection This represents J items.
[0037] User u i and Project v j The embedding vector is set as (i.e., the original user vector) and (i.e., the original project vector). User and project embeddings are set to... Using the interaction matrix express The implicit relationship between each user and the items they consume; if user u i Previously, project v was used j Then each item A in A i,j Set it to 1, otherwise set it to A. i,j =0. The adjacency matrix (i.e., the original adjacency matrix) is generated from the interaction matrix (i.e., the updated interaction matrix), using the following formula:
[0038]
[0039] The Random Negative Sampling (RNS) algorithm is used, which involves randomly selecting an item that does not appear in the positive samples of that user for each positive sample (user-item pair) as a negative sample.
[0040] It should be understood that the idea behind the random negative sampling algorithm is to treat each item in the sampling pool equally and sample them with equal probability.
[0041] In the above embodiments, the original interaction matrix is preprocessed, and the preprocessed result is used as a training set to capture useful new information. Combined with the adaptive view, this can effectively enhance the robustness and generalization performance of the recommendation model.
[0042] Optionally, as an embodiment of the present invention, the process of updating the original interaction matrix to obtain the updated interaction matrix includes:
[0043] The original interaction matrix is normalized using the second equation to obtain the normalized interaction matrix. The second equation is:
[0044]
[0045] Where, U = Diag(A′1), V = Diag(1 T A′),
[0046] in, Let A' be the normalized interaction matrix, where 1 is a column vector consisting entirely of 1s, Diag is a diagonal matrix, V is the first diagonal matrix, U is the second diagonal matrix, and A' is the original interaction matrix.
[0047] Singular value decomposition is performed on the normalized interaction matrix to obtain singular vectors;
[0048] Importing fuzzy time, the normalized interaction matrix, the singular vector, the first diagonal matrix, the original interaction matrix, and the fuzzy time are fuzzified using the third equation to obtain the target fuzzy matrix and multiple original fuzzy matrices. The third equation is:
[0049]
[0050] in, B(0) = A′,
[0051] in,
[0052] Among them, B l Let B(0) be the target fuzzy matrix, and T be the original fuzzy matrix at time 0. b For fuzzy time, b HE (B(t)) represents the heat loss rate at time t, b IDL (B(t)) represents the low-frequency filter rate at time t, and k is the thermal capacity coefficient. Let V be the original fuzzy matrix at time t, and let V be the first diagonal matrix. Let I be the normalized adjacency matrix, and let I be the identity matrix. Let A' be a singular vector, A′ be the original interaction matrix, μ be the drift rate, and σ1 be the volatility. This is the normalized interaction matrix;
[0053] Importing the sharpening time, the original interaction matrix, the normalized interaction matrix, the target blur matrix, the sharpening time, and multiple original blur matrices are sharpened using the fourth equation to obtain the updated interaction matrix. The fourth equation is:
[0054]
[0055] in,
[0056] in,
[0057] in, For the updated interaction matrix, T s Let S(0) be the initial sharpening matrix at time 0, S(t) be the initial sharpening matrix at time t, s(S(t)) be the sharpening matrix to be processed at time t, and s() be the sharpening function. l For the target fuzzy matrix, For the normalized adjacency matrix, Let B(t) be the normalized interaction matrix, and let B(t) be the original fuzzy matrix at time t. Both a and b are hyperparameters.
[0058] It should be understood that a perturbation-recovery framework is designed, where the blurring process destroys (or perturbs) the original information in the user-item interaction matrix, and the sharpening process attempts to recover the original information, incorporating promising additional information. The blurring and sharpening processes are applied directly to the interaction matrix in a continuous-time manner.
[0059] It should be understood that Singular Value Decomposition (SVD) is an important matrix decomposition in linear algebra, and it is a generalization of eigenvalue decomposition to arbitrary matrices. It has important applications in signal processing, statistics, and other fields.
[0060] Specifically, the fuzzy process is defined as follows:
[0061]
[0062] Where B(0) = A, that is, B(0) is the original interaction matrix. It is a heat equation that describes the rate of heat loss of an object. This is a coefficient called heat capacity. B(t) represents the fuzzy matrix after the original interaction matrix has been fuzzed for time t. Where μ is the drift rate and σ is the volatility. I is the identity matrix. It is a normalized item-item adjacency matrix, where Let U be the normalized interaction matrix (i.e., the normalized interaction matrix). Where U = Diag(A1), V = Diag(1... T A) The symbol Diag means to take a diagonal matrix, and U and V are diagonal matrices. 1 represents a column vector consisting entirely of 1s. It is an ideal low-profile filter. That is The top-k singular vectors. Combining them yields the fuzzy process: B l =B HE (T b )+B IDL (T b ).
[0063] It should be understood that, in order to improve the overall accuracy of recommendations while reducing the degree of recommendation items, a sharpening process needs to be added after the interaction matrix is blurred.
[0064] Specifically, the sharpening process is defined as follows:
[0065]
[0066]
[0067] Where S(0) = B l =B HE (T b )+B IDL (T b S(1) is the sharpening matrix of the input matrix S(0). S(t) = aB(t) + b, where a and b are hyperparameters. It is a sharpening function, and This is the recovered interaction matrix (i.e., the updated interaction matrix).
[0068] In the above embodiments, the original interaction matrix is updated to obtain the updated interaction matrix, which improves the overall accuracy of recommendations and reduces the degree of recommendation items.
[0069] Optionally, as an embodiment of the present invention, the training model includes a reconstruction layer and a denoising layer.
[0070] The process of constructing a training model and training the training model using the training set to obtain a recommendation model includes:
[0071] By using a graph neural network to predict each of the original user vectors and each of the original item vectors, the target user vectors corresponding to each of the original user vectors and the target item vectors corresponding to each of the original item vectors are obtained.
[0072] Collect all the target user vectors and all the target item vectors into a dataset to be processed;
[0073] The reconstruction layer performs reconstruction analysis on the dataset to be processed, and obtains a reconstruction graph and reconstruction loss value.
[0074] The original adjacency matrix is denoised using the denoising layer to obtain the target denoised map and denoising loss value.
[0075] The user preference reconstruction loss value and the user preference denoising loss value are obtained by performing predictive analysis on the reconstructed graph, the target denoised graph, and all the negative samples through the graph neural network.
[0076] The contrast loss value is calculated by comparing the reconstructed image and the target denoised image.
[0077] The model loss value is obtained by calculating the loss values of the reconstruction loss value, the denoising loss value, the user preference reconstruction loss value, the user preference denoising loss value, and the contrast loss value using the fifth equation. The fifth equation is:
[0078]
[0079] in, This represents the model loss value. To reconstruct the loss value, The loss value is reconstructed based on user preferences, where λ1 and λ2 are hyperparameters, and Θ is a trainable parameter. Let the square of the F-norm be , This represents the noise reduction loss value. The noise reduction loss value is set according to user preference. To compare the loss values;
[0080] The parameters of the trained model are updated based on the model loss value to obtain the recommendation model.
[0081] It should be understood that the prediction of each of the original user vectors and each of the original item vectors is performed using a graph neural network, specifically as follows:
[0082] The formal definition of the message passing process from layer l-1 to layer l-th is as follows:
[0083]
[0084] This represents the aggregation of neighbor information from a project / user to the central node u. i and v j The final embedding of a node is obtained by summing its embeddings across all layers, and the final embedding is the user u. i and Project v j The inner product between them is used to predict u i For v j The preferences are as follows:
[0085]
[0086] Specifically, the model training is divided into two parts. In the upper layer, a multi-task training strategy is adopted to jointly optimize the classic recommendation task and the self-supervised learning task:
[0087]
[0088] Θ is the set of model parameters in the main task. Furthermore, λ1 and λ2 are hyperparameters that control the strength of SSL and L2 regularization, respectively.
[0089] The lower layer of training is based on The optimized and denoised view generator is represented as follows:
[0090]
[0091] Specifically, the graph denoising model (i.e., the denoising layer) is trained using the BPR loss function, and the loss function is... Updated as follows:
[0092]
[0093] The BPR loss is calculated using node embeddings encoded by a variational autoencoder to train the graph generation model (i.e., the reconstruction layer), and the loss function is then applied. Updated as follows:
[0094]
[0095] Where Θ is the model parameter set, and λ² is a hyperparameter used to control the strength of weight decay regularization. Let Θ represent the square of Θ under the F norm.
[0096] In the above embodiments, a training model is constructed and trained using a training set to obtain a recommendation model. This model captures useful new information and, when combined with an adaptive view, effectively enhances the robustness and generalization performance of the recommendation model.
[0097] Optionally, as an embodiment of the present invention, the reconstruction layer includes an encoder and a decoder, wherein the encoder includes a plurality of first linear layers, a first ReLU activation function layer, a plurality of second linear layers, a second ReLU activation function layer, and a Softplus activation function layer;
[0098] The process of reconstructing and analyzing the dataset to be processed through the reconstruction layer to obtain the reconstruction graph and reconstruction loss value includes:
[0099] The dataset to be processed is averaged by multiple first linear layers to obtain a first averaged dataset;
[0100] The first mean dataset is mapped through the first ReLU activation function layer to obtain the mean matrix;
[0101] The dataset to be processed is averaged by multiple second linear layers to obtain a second averaged dataset;
[0102] The second mean-normalized dataset is mapped using the second ReLU activation function layer to obtain the matrix to be mapped;
[0103] The standard deviation matrix is obtained by mapping the matrix to be mapped through the Softplus activation function layer.
[0104] The mean matrix and the standard deviation matrix are decoded by the decoder to obtain the decoder adjacency matrix;
[0105] Import multiple real values of the reconstruction layer corresponding to the dataset to be processed, and construct the real matrix of the reconstruction layer using all the real values of the reconstruction layer.
[0106] The encoder loss value is obtained by calculating the loss values of the mean matrix, the standard deviation matrix, and the true matrix of the reconstruction layer using the KL divergence loss function.
[0107] The loss value of the decoder is obtained by calculating the loss value of the decoder adjacency matrix and the real matrix of the reconstruction layer using the cross-entropy loss function;
[0108] The encoder loss value is added to the decoder loss value to obtain the reconstruction loss value;
[0109] The parameters of the reconstruction layer are updated based on the reconstruction loss value to obtain the updated reconstruction layer.
[0110] The dataset to be processed is reconstructed through the updated reconstruction layer to obtain a reconstructed graph.
[0111] It should be understood that the number of both the first linear layer and the second linear layer can be 2.
[0112] Specifically, a Variational Graph Autoencoder (VGAE) is used as the generative model to generate the view. Graph embeddings (i.e., the dataset to be processed) are obtained through a multi-layer GCN. Then, two MLPs are designed to derive the mean and standard deviation of the graph embeddings, respectively. The MLP for deriving the mean consists of two linear layers (i.e., the first linear layer) and a ReLU activation function (i.e., the first ReLU activation function layer). The MLP for deriving the standard deviation consists of two linear layers (i.e., the second linear layer), a ReLU activation function (i.e., the second ReLU activation function layer), and a Softplus activation function (i.e., the Softplus activation function layer). The Softplus activation function (i.e., the Softplus activation function layer) is a smoothed version of the ReLU function, which avoids the hard saturation effect of the ReLU function in the negative part, thus preventing the complete vanishing gradient problem during backpropagation.
[0113] Specifically, another MLP is designed as the decoder. The input mean (i.e., the mean matrix) and the standard deviation with Gaussian noise (i.e., the standard deviation matrix) are decoded to generate the edge prediction values (i.e., the decoder adjacency matrix). Then, based on the predicted values and a threshold, a mask is generated to filter out the values in the new adjacency matrix. Finally, based on the mask and the original adjacency matrix, a new sparse adjacency matrix is constructed, and the reconstructed view (i.e., the reconstructed graph) is obtained.
[0114] It should be understood that the graph generation model loss (i.e., the reconstruction loss value) is defined as... The encoder loss value refers to the Kullback-Leibler divergence (KL divergence) between the node embedding distribution and the standard Gaussian distribution. The decoder loss (i.e., the decoder loss value) is a cross-entropy loss that quantifies the dissimilarity between the generated graph and the original graph.
[0115] In the above embodiments, the reconstruction layer performs reconstruction analysis on the dataset to be processed to obtain the reconstruction graph and reconstruction loss value, which avoids the hard saturation effect of the ReLU function in the negative part, so that the gradient vanishing problem will not occur during backpropagation, and also quantifies the dissimilarity between the generated graph and the original graph.
[0116] Optionally, as an embodiment of the present invention, the process of performing denoising analysis on the original adjacency matrix through the denoising layer to obtain the target denoised map and denoising loss value includes:
[0117] The original adjacency matrix is denoised using the denoising layer to obtain the original denoised image.
[0118] The loss value of the original denoised image is calculated using the cross loss function to obtain the denoising loss value;
[0119] The parameters of the denoising layer are updated according to the denoising loss value to obtain the updated denoising layer.
[0120] The original adjacency matrix is denoised using the updated denoising layer to obtain the target denoised map.
[0121] It should be understood that by designing a noise-removing graph neural network, the model's ability to process noisy data can be improved.
[0122] Specifically, attention weights between features are calculated using an attention mechanism, and hard-mix sampling is performed on these attention weights to obtain a binary (0,1) mask matrix. The adjacency matrix representation of the sparse matrix is then generated based on the mask, which is the denoised map (i.e., the target denoised map).
[0123] It should be understood that cross loss is utilized. (i.e., the denoising loss value) is used as the loss of the graph generation model, and training it can minimize the difference between the generated graph and the original graph.
[0124] In the above embodiments, the target denoised graph and denoising loss value are obtained by performing denoising analysis on the original adjacency matrix through a denoising layer, which improves the model's ability to process noisy data and minimizes the difference between the generated graph and the original graph.
[0125] Optionally, as an embodiment of the present invention, the process of performing predictive analysis on the reconstructed graph, the target denoised graph, and all the negative samples using the graph neural network to obtain the user preference reconstruction loss value and the user preference denoising loss value includes:
[0126] The reconstructed graph is predicted using the graph neural network to obtain multiple first user preference data.
[0127] The target denoised image is predicted using the graph neural network to obtain multiple second user preference data.
[0128] The user preference reconstruction loss value is obtained by calculating the loss value of all the first user preference data and all the negative samples using the sixth equation, which is:
[0129]
[0130] in,
[0131] in, Reconstruct the loss value for user preferences, O 1 This is a set of first-user preference data and negative samples. For the set of first user preference data, O - Let be the set of negative samples, and σ² be a trainable parameter. For the i-th first user preference data, This is the j-th negative sample;
[0132] The user preference denoising loss value is obtained by calculating the loss value of all the second user preference data and all the negative samples using the seventh formula, which is:
[0133]
[0134] in,
[0135] in, For the user's preferred denoising loss value, O 2 This is a set of second user preference data and negative samples. For the set of second user preference data, O - Let be the set of negative samples, and σ3 be a trainable parameter. For the i-th second user preference data, Let j be the j-th negative sample.
[0136] It should be understood that BPR loss is used to better adjust the generated view to suit the main CF task, as follows:
[0137]
[0138] The training data is O = (u,i,j) | (u,i)∈O + ,(u,j)∈O - It indicates that O + O represents the observed interactions (i.e., the set of first user preference data or the set of second user preference data). - =U×I / O+ This represents unobserved interactions (i.e., the set of negative samples).
[0139] In the above embodiments, the reconstruction graph, the target denoised graph, and all negative samples are predicted and analyzed by graph neural networks to obtain user preference reconstruction loss value and user preference denoising loss value. Useful new information is captured and combined with adaptive view, which can effectively enhance the robustness and generalization performance of recommendation model.
[0140] Optionally, as an embodiment of the present invention, the reconstruction graph includes multiple user reconstruction nodes and multiple project reconstruction nodes, and the target denoising graph includes multiple user denoising nodes and multiple project denoising nodes.
[0141] The process of calculating the contrast loss value between the reconstructed image and the target denoised image includes:
[0142] The user node loss value is obtained by calculating the loss value of all user reconstruction nodes and all user denoising nodes using the eighth equation, which is:
[0143]
[0144] in, Let e' be the user node loss value, U be the set of user reconstruction nodes and user denoising nodes, and e' be the loss value. a To reconstruct the node for the a-th user, e″ a For the denoising node of the a-th user, e″ m Let s(·) be the denoised node of the m-th user, s(·) be the cosine similarity function, and τ be the hyperparameter.
[0145] The loss value of each project node is obtained by calculating the loss value of all project reconstruction nodes and all project denoising nodes using the ninth formula. The ninth formula is as follows:
[0146]
[0147] in, Let V be the project node loss value, and let e′ be the set of project reconstruction nodes and project denoising nodes. b For the refactoring node of the b-th project, e″ b For the denoising node of the b-th project, e″ n Let s(·) be the denoised node for the nth item, τ be the cosine similarity function, and τ be the hyperparameter.
[0148] The user node loss value is added to the project node loss value to obtain the comparison loss value.
[0149] Specifically, views of the same node are considered to be directly opposite (i.e., ... Views of any two distinct nodes are considered negative pairs (i.e., ...) Formally, the contrastive loss function for maximizing positive consistency and minimizing negative consistency for a user is:
[0150]
[0151] s(·) is the cosine similarity function, the hyperparameter τ is the temperature in softmax, and the contrast loss of the items. Similarly, the formula is as follows:
[0152]
[0153] Combining these two losses, we obtain the objective function for the self-supervised task (i.e., the contrastive loss value), expressed as:
[0154] In the above embodiments, the comparative loss value is calculated by comparing the reconstructed graph and the target denoised graph. This can maximize the consistency of positive pairs and minimize the consistency of negative pairs, effectively enhancing the robustness and generalization performance of the recommendation model.
[0155] Optionally, as another embodiment of the present invention, the present invention includes the following steps:
[0156] This invention defines a dataset and initializes embedding vector representations of users and items. It then processes the interaction matrix using a fuzzy-sharpening process to obtain a new interaction matrix incorporating promising additional information. This invention combines a graph generation model and a graph denoising model to establish two views adapted to the data distribution, achieving an adaptive contrastive view for graph contrastive learning. These two adaptive contrastive views introduce additional high-quality training signals to adaptive graph contrastive learning, helping to alleviate data sparsity and noise problems. The model is trained according to a loss function until convergence; finally, the system selects the best item from the candidate items for recommendation. This invention integrates the fuzzy-sharpening process into the contrastive learning of the adaptive contrastive view, effectively enhancing the robustness and generalization performance of the recommendation system by combining the useful new information captured from the interaction matrix with the adaptive view.
[0157] Alternatively, as another embodiment of the present invention, the method of the present invention is as follows:
[0158] S1: Define the dataset and initialize the embedding vector representations of users and items;
[0159] S2: Learning by utilizing the fuzzy-sharpening process and local collaborative relationships;
[0160] S3: Use a graph generation model as a view generator;
[0161] S4: Use a graph denoising model as a view generator;
[0162] S5: Define the loss function for the two views;
[0163] S6: Train the model according to the loss function until it converges.
[0164] Figure 2 A block diagram of a recommended device provided in an embodiment of the present invention.
[0165] Alternatively, as another embodiment of the present invention, such as Figure 2 As shown, a recommended device includes:
[0166] The import module is used to import the original interaction matrix;
[0167] The preprocessing module is used to preprocess the original interaction matrix and use the preprocessed result as the training set.
[0168] The training module is used to build a training model and train the training model using the training set to obtain a recommendation model.
[0169] The recommendation result acquisition module is used to make recommendations based on the original interaction matrix through the recommendation model to obtain recommendation results.
[0170] Optionally, another embodiment of the present invention provides a recommendation system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the recommendation method as described above. This system can be a computer or similar system.
[0171] Optionally, another embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the recommended method as described above.
[0172] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0173] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0174] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0175] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0176] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0177] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0178] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A recommendation method characterized by comprising: Includes the following steps: Import the original interaction matrix, preprocess the original interaction matrix, and use the preprocessed result as the training set; Construct a training model, and train the training model using the training set to obtain a recommendation model; The original interaction matrix is used to make recommendations using the recommendation model to obtain recommendation results; The process of preprocessing the original interaction matrix and using the preprocessed result as the training set includes: The original interaction matrix is updated to obtain the updated interaction matrix; The original adjacency matrix is obtained by calculating the updated interaction matrix using the first equation, which is: , in, This is the original adjacency matrix. For the updated interaction matrix, For transpose; Multiple user nodes and multiple project nodes are extracted from the updated interaction matrix; Each user node and each project node is vectorized to obtain the original user vector corresponding to each user node and the original project vector corresponding to each project node. The random negative sampling algorithm is used to extract negative samples from all user nodes and all item nodes, and the original adjacency matrix, all original user vectors, all original item vectors, and all extracted negative samples are used as the training set. The process of updating the original interaction matrix to obtain the updated interaction matrix includes: The original interaction matrix is normalized using the second equation to obtain the normalized interaction matrix. The second equation is: , in, , , in, For the normalized interaction matrix, It is a column vector consisting entirely of 1s. To obtain a diagonal matrix, This is the first diagonal matrix. This is the second diagonal matrix. This is the original interaction matrix; Singular value decomposition is performed on the normalized interaction matrix to obtain singular vectors; Importing fuzzy time, the normalized interaction matrix, the singular vector, the first diagonal matrix, the original interaction matrix, and the fuzzy time are fuzzified using the third equation to obtain the target fuzzy matrix and multiple original fuzzy matrices. The third equation is: , in, , , , in, , , in, For the target fuzzy matrix, The original fuzzy matrix at time 0. For fuzzy time, For the first Heat loss rate at time t, For the first Low-frequency filter rate at any given time The coefficient of heat capacity, , For the first The original fuzzy matrix at time step, This is the first diagonal matrix. For the normalized adjacency matrix, It is the identity matrix. It is a singular vector. The original interaction matrix, For drift rate, For volatility, This is the normalized interaction matrix; Importing the sharpening time, the original interaction matrix, the normalized interaction matrix, the target blur matrix, the sharpening time, and multiple original blur matrices are sharpened using the fourth equation to obtain the updated interaction matrix. The fourth equation is: , in, , , in, , , in, For the updated interaction matrix, To sharpen time, This is the initial sharpening matrix at time 0. For the first The initial sharpening matrix at time step 1. For the first The sharpening matrix to be processed at time step, This is the sharpening function. For the target fuzzy matrix, For the normalized adjacency matrix, For the normalized interaction matrix, For the first The original fuzzy matrix at time step, and All of these are hyperparameters.
2. The recommended method according to claim 1, characterized in that, The training model includes a reconstruction layer and a denoising layer. The process of constructing a training model and training the training model using the training set to obtain a recommendation model includes: By using a graph neural network to predict each of the original user vectors and each of the original item vectors, the target user vectors corresponding to each of the original user vectors and the target item vectors corresponding to each of the original item vectors are obtained. Collect all the target user vectors and all the target item vectors into a dataset to be processed; The reconstruction layer performs reconstruction analysis on the dataset to be processed, and obtains a reconstruction graph and reconstruction loss value. The original adjacency matrix is denoised using the denoising layer to obtain the target denoised map and denoising loss value. The user preference reconstruction loss value and the user preference denoising loss value are obtained by performing predictive analysis on the reconstructed graph, the target denoised graph, and all the negative samples through the graph neural network. The contrast loss value is calculated by comparing the reconstructed image and the target denoised image. The model loss value is obtained by calculating the loss values of the reconstruction loss value, the denoising loss value, the user preference reconstruction loss value, the user preference denoising loss value, and the contrast loss value using the fifth equation. The fifth equation is: , in, This represents the model loss value. To reconstruct the loss value, Reconstruct the loss value based on user preferences. and All of these are hyperparameters. For trainable parameters, Let the square of the F-norm be , This represents the noise reduction loss value. The noise reduction loss value is set according to user preference. To compare the loss values; The parameters of the trained model are updated based on the model loss value to obtain the recommendation model.
3. The recommended method according to claim 2, characterized in that, The reconstruction layer includes an encoder and a decoder. The encoder includes multiple first linear layers, a first ReLU activation function layer, multiple second linear layers, a second ReLU activation function layer, and a Softplus activation function layer. The process of performing reconstruction analysis on the dataset to be processed through the reconstruction layer to obtain the reconstruction map and reconstruction loss value includes: The dataset to be processed is averaged by multiple first linear layers to obtain a first averaged dataset; The first mean dataset is mapped through the first ReLU activation function layer to obtain the mean matrix; The dataset to be processed is averaged by multiple second linear layers to obtain a second averaged dataset; The second mean-normalized dataset is mapped using the second ReLU activation function layer to obtain the matrix to be mapped; The standard deviation matrix is obtained by mapping the matrix to be mapped through the Softplus activation function layer. The mean matrix and the standard deviation matrix are decoded by the decoder to obtain the decoder adjacency matrix; Import multiple real values of the reconstruction layer corresponding to the dataset to be processed, and construct the real matrix of the reconstruction layer using all the real values of the reconstruction layer. The encoder loss value is obtained by calculating the loss values of the mean matrix, the standard deviation matrix, and the true matrix of the reconstruction layer using the KL divergence loss function. The loss value of the decoder is obtained by calculating the loss value of the decoder adjacency matrix and the real matrix of the reconstruction layer using the cross-entropy loss function; The encoder loss value is added to the decoder loss value to obtain the reconstruction loss value; The parameters of the reconstruction layer are updated based on the reconstruction loss value to obtain the updated reconstruction layer. The dataset to be processed is reconstructed through the updated reconstruction layer to obtain a reconstructed graph.
4. The recommended method according to claim 2, characterized in that, The process of performing denoising analysis on the original adjacency matrix through the denoising layer to obtain the target denoised map and denoising loss value includes: The original adjacency matrix is denoised using the denoising layer to obtain the original denoised image. The loss value of the original denoised image is calculated using the cross loss function to obtain the denoising loss value; The parameters of the denoising layer are updated according to the denoising loss value to obtain the updated denoising layer. The original adjacency matrix is denoised using the updated denoising layer to obtain the target denoised map.
5. The recommended method according to claim 2, characterized in that, The process of using the graph neural network to predict and analyze the reconstructed graph, the target denoised graph, and all the negative samples to obtain the user preference reconstruction loss value and the user preference denoising loss value includes: The reconstructed graph is predicted using the graph neural network to obtain multiple first user preference data. The target denoised image is predicted using the graph neural network to obtain multiple second user preference data. The user preference reconstruction loss value is obtained by calculating the loss value of all the first user preference data and all the negative samples using the sixth equation, which is: , in, , in, Reconstruct the loss value based on user preferences. This is a set of first-user preference data and negative samples. The first set of user preference data, The set of negative samples. For trainable parameters, For the first First user preference data, For the first One negative sample; The user preference denoising loss value is obtained by calculating the loss value of all the second user preference data and all the negative samples using the seventh formula, which is: , in, , in, The noise reduction loss value is set according to user preference. This is a set of second user preference data and negative samples. For the collection of second user preference data, The set of negative samples. For trainable parameters, For the first Second user preference data, For the first One negative sample.
6. The recommendation method according to claim 2, characterized in that, The reconstruction graph includes multiple user reconstruction nodes and multiple project reconstruction nodes, and the target denoising graph includes multiple user denoising nodes and multiple project denoising nodes. The process of calculating the contrast loss value between the reconstructed image and the target denoised image includes: The user node loss value is obtained by calculating the loss value of all user reconstruction nodes and all user denoising nodes using the eighth equation, which is: , in, The user node loss value, A set of user-reconstructed nodes and user-denoised nodes. For the first Individual user refactoring nodes, For the first Individual user noise reduction nodes For the first Individual user noise reduction nodes The cosine similarity function is used. For hyperparameters; The loss value of each project node is obtained by calculating the loss value of all project reconstruction nodes and all project denoising nodes using the ninth formula. The ninth formula is as follows: , in, This represents the project node loss value. This is a collection of project reconstruction nodes and project denoising nodes. For the first Project restructuring nodes, For the first Denoising nodes for each project For the first Denoising nodes for each project The cosine similarity function is used. For hyperparameters; The user node loss value is added to the project node loss value to obtain the comparison loss value.
7. A recommended device, characterized in that, include: The import module is used to import the original interaction matrix; The preprocessing module is used to preprocess the original interaction matrix and use the preprocessed result as the training set. The training module is used to build a training model and train the training model using the training set to obtain a recommendation model. The recommendation result acquisition module is used to make recommendations based on the original interaction matrix through the recommendation model to obtain recommendation results; The preprocessing module is specifically used for: The original interaction matrix is updated to obtain the updated interaction matrix; The original adjacency matrix is obtained by calculating the updated interaction matrix using the first equation, which is: , in, This is the original adjacency matrix. For the updated interaction matrix, For transpose; Multiple user nodes and multiple project nodes are extracted from the updated interaction matrix; Each user node and each project node is vectorized to obtain the original user vector corresponding to each user node and the original project vector corresponding to each project node. The random negative sampling algorithm is used to extract negative samples from all user nodes and all item nodes, and the original adjacency matrix, all original user vectors, all original item vectors, and all extracted negative samples are used as the training set. The preprocessing module updates the original interaction matrix to obtain the updated interaction matrix, including: The original interaction matrix is normalized using the second equation to obtain the normalized interaction matrix. The second equation is: , in, , , in, For the normalized interaction matrix, It is a column vector consisting entirely of 1s. To obtain a diagonal matrix, This is the first diagonal matrix. This is the second diagonal matrix. This is the original interaction matrix; Singular value decomposition is performed on the normalized interaction matrix to obtain singular vectors; Importing fuzzy time, the normalized interaction matrix, the singular vector, the first diagonal matrix, the original interaction matrix, and the fuzzy time are fuzzified using the third equation to obtain the target fuzzy matrix and multiple original fuzzy matrices. The third equation is: , in, , , , in, , , in, For the target fuzzy matrix, The original fuzzy matrix at time 0. For fuzzy time, For the first Heat loss rate at time t, For the first Low-frequency filter rate at any given time The coefficient of heat capacity, , For the first The original fuzzy matrix at time step, This is the first diagonal matrix. For the normalized adjacency matrix, It is the identity matrix. It is a singular vector. The original interaction matrix, For drift rate, For volatility, This is the normalized interaction matrix; Importing the sharpening time, the original interaction matrix, the normalized interaction matrix, the target blur matrix, the sharpening time, and multiple original blur matrices are sharpened using the fourth equation to obtain the updated interaction matrix. The fourth equation is: , in, , , in, , , in, For the updated interaction matrix, To sharpen time, This is the initial sharpening matrix at time 0. For the first The initial sharpening matrix at time step 1. For the first The sharpening matrix to be processed at time step, This is the sharpening function. For the target fuzzy matrix, For the normalized adjacency matrix, For the normalized interaction matrix, For the first The original fuzzy matrix at time step, and All of these are hyperparameters.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the recommended method as described in any one of claims 1 to 6.