Product recommendation method based on spectrogram theory and characterization uniformity
By using spectral theory and characterization uniformity methods in the recommendation system, the graph encoder and comparison learning objectives are optimized, and the problem of insufficient design of graph encoder and comparison learning optimization objectives in the existing technology is solved, and more efficient user and product characterization learning is achieved, which significantly improves recommendation accuracy.
Patent Information
- Application Number
- CN202510504658.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-07-11
AI Technical Summary
The existing recommendation system ignores the design of the diagram encoder and the comparison learning optimization target in the implicit feedback scenario, resulting in unsatisfactory recommendation results.
Using spectral theory and characterization uniformity methods, the user-product two-part graph is constructed, and the user and product characterization matrix is learned using a graph encoder with band-stop filtering properties, and the loss function is constructed by explicit comparison learning and interactive information, and the characterization matrix is optimized to improve recommendation accuracy.
By optimizing the graph encoder and comparing the learning objectives, more uniform user and product characterization is learned, significantly improving the accuracy and efficiency of the recommendation system.
Smart Images

Figure CN120298081A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation, and specifically to a product recommendation method based on spectral graph theory and representation uniformity. Background Art
[0002] Recommendation systems have now become indispensable in various life scenarios, and the academic community has also conducted extensive research on recommendation algorithms. In the recommendation scenario of implicit feedback, learning high-quality user and product representations is the core of the recommendation system. Due to its ability to model high-order interaction information, the graph convolutional network has been successfully introduced into collaborative filtering recommendations. In recent years, thanks to the excellent performance of contrastive learning in various representation learning fields, researchers have used the method of graph contrastive learning to improve recommendation performance, becoming an important new paradigm in recommendation research.
[0003] The method based on graph contrastive learning consists of three important parts, namely data augmentation, graph encoder design, and contrastive learning optimization objective design. Previous recommendation methods emphasized the role of data augmentation and ignored the reasonable design of the other two key components, thus failing to achieve ideal recommendation effects. How to design the graph encoder and contrastive learning objective is a key issue in improving recommendation effects. Summary of the Invention
[0004] The present invention is to solve the above-mentioned deficiencies existing in the prior art, and proposes a product recommendation method based on spectral graph theory and representation uniformity, in order to learn user and product representations in the recommendation scenario of implicit feedback, obtain a more uniform representation distribution based on spectral graph theory and representation uniformity, and thus improve the accuracy of product recommendation.
[0005] The present invention adopts the following technical solutions to solve the technical problems:
[0006] A product recommendation method based on spectral graph theory and representation uniformity according to the present invention is characterized in that it is carried out according to the following steps:
[0007] Step 1: Construct a user-product bipartite graph , where represents the user set, represents the product set, represents the interaction matrix of users with products;
[0008] Step 2: Use a graph encoder with band-stop filtering properties to learn the user representation matrix and the product representation matrix for recommendation, and form the recommendation representation matrix , and construct the loss function of the recommendation task;
[0009] Step 3: According to the recommendation representation matrix , construct explicit contrastive learning loss functions for the user side and the item side based on gradient information, and a contrastive learning loss function based on user-product interaction information;
[0010] Step 4, jointly optimize and update the initial representation matrix to obtain the optimal user representation matrix and the optimal product representation matrix , which are used to achieve high-quality product recommendations.
[0011] Another feature of the product recommendation method based on spectral graph theory and representation uniformity described in the present invention is that the step 1 includes:
[0012] Let represent the user set, and , where represents the th user, represents the total number of users, ;
[0013] Let represent the product set, and , where represents the th product, represents the total number of products, ;
[0014] Let represent the th user 's interaction data with the th product , then the user-product interaction matrix is denoted as . If the th user has an interaction record with the th product , then let , otherwise, let ;
[0015] According to the user-product interaction matrix , with users and products as nodes and their interaction records as edges, construct a user-product bipartite graph .
[0016] Furthermore, the step 2 includes:
[0017] Step 2.1, initialize the user initial representation matrix using the Xavier uniform distribution, where represents the th user Characterization;
[0018] Initialize the initial characterization matrix of the product using the Xavier uniform distribution , where represents the th product Characterization;
[0019] Step 2.2, obtain the adjacency matrix according to Equation (1) :
[0020] (1)
[0021] In Equation (1), represents the transpose;
[0022] Step 2.3, obtain the normalized adjacency matrix according to Equation (2) :
[0023] (2)
[0024] In Equation (2), represents the degree matrix of the adjacency matrix ;
[0025] Step 2.4, select a graph encoder with band-stop filtering properties and use the second layer convolution in the graph convolutional network as the graph encoder, so as to obtain the recommendation characterization matrix of users and products according to Equation (3) :
[0026] (3)
[0027] In Equation (3), represents the initial characterization matrix of users and products, and ;
[0028] Step 2.5, obtain the final user characterization matrix and the final product characterization matrix :
[0029] (4)
[0030] In Equation (4), represents the th row of the matrix , represents the th row of the matrix ;
[0031] Step 2.6, construct the loss function of the recommendation task according to Equation (5) :
[0032] (5)
[0033] In formula (5), represents the th user 's interaction records for all products, ; represents the set of products th user has interacted with; represents the th user and the th product as well as the th un-interacted product to form a triple; is the Sigmoid activation function, represents the th row representation vector in the final user representation matrix , and respectively represent the th row and the th row representation vectors in the final product representation matrix .
[0034] represents the regularization loss function of the model. Specifically, it uses the initial representation matrices of users and products to calculate the L2 regularization loss function.
[0035] Furthermore, step 3 includes:
[0036] Step 3.1: Construct the first contrast representation view and the second contrast representation view according to formula (6):
[0037] (6)
[0038] In formula (6), are two noise matrices subject to a uniform distribution of 0 - 1, is a scalar for controlling the noise amplitude;
[0039] Step 3.2: Obtain the normalized first contrast representation view and the normalized second contrast representation view according to formula (7):
[0040] (7)
[0041] In formula (7), represents the normalization operation on each row vector;
[0042] Step 3.3. Construct the explicit contrastive learning loss function on the user side according to formula (8) :
[0043] (8)
[0044] In formula (8), represents the th user corresponding representation vector in the normalized first contrast view ; represents the th user corresponding representation vector in the normalized second contrast view ; , is a predetermined threshold; represents the absolute value operation, represents the temperature coefficient of contrastive learning;
[0045] Step 3.4. Construct the explicit contrastive learning loss of the product according to formula (9) :
[0046] (9)
[0047] In formula (9), represents the th product corresponding representation vector in the normalized first contrast view ; represents the th product corresponding representation vector in the normalized second contrast view ; ;
[0048] Step 3.5. Construct the contrastive learning loss of the user-product interaction information according to formula (10) :
[0049] (10)
[0050] Furthermore, the said step 4 includes:
[0051] Step 4.1. Establish the total optimization loss function according to formula (11) :
[0052] (11)
[0053] In formula (11), and are hyperparameters for adjusting the explicit contrast learning and interactive contrast learning loss functions respectively, represents the explicit contrast learning loss, and ;
[0054] Step 4.2: Solve the total optimization loss through the gradient descent method, and update the initial representation matrix , until converges to the minimum value, and obtain the optimal user representation matrix and the optimal product representation matrix ;
[0055] Step 4.3: Predict the optimal interaction probability of the th user for the th product according to formula (12), so as to obtain the prediction interaction matrix of the user set for the product set , and complete high-quality product recommendation:
[0056] (12)
[0057] In formula (12), represents the optimal representation vector of the th user in , and represents the optimal representation vector of the
[0058] An electronic device of the present invention includes a memory and a processor, characterized in that the memory is used to store a program for supporting the processor to execute the product recommendation method, and the processor is configured to execute the program stored in the memory.
[0059] A computer-readable storage medium of the present invention, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the product recommendation method when run by a processor.
[0060] Compared with the prior art, the beneficial effects of the present invention are reflected in:
[0061] 1. The present invention considers two important components in graph contrastive learning. Through a graph encoder based on spectral graph theory, more expressive representations are learned; through the improvement of contrastive learning, more uniform user and product representations are learned. With the synergistic effect of the two modules, the method significantly improves the recommendation effect.
[0062] 2. The optimization methods for the two components proposed by the present invention are universal and can be applied to other recommendation methods based on representation learning.
[0063] 3. The graph contrastive learning optimization recommendation method proposed by the present invention does not require the introduction of any model parameters. At the same time, due to the lightweight design of the model, the model training is greatly accelerated, and it has strong application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a flowchart of the recommendation method based on spectral graph theory and representation uniformity of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0065] In this example, a recommendation method based on spectral graph theory and representation uniformity optimizes the main components in the previous graph contrastive recommendation method. First, the design of the encoder is analyzed from the perspective of spectral graph theory, and a filtering curve suitable for the recommendation scenario is selected. Second, to further optimize the representation uniformity, the contrastive learning optimization objective is improved, so as to obtain more uniform representations for improving the recommendation effect. Specifically, as Figure 1 shown, it is carried out according to the following steps:
[0066] Step 1: According to the interaction records of users and products, use user IDs and product IDs to construct a user-product bipartite graph , where represents the user set, represents the product set, represents the interaction matrix of users with products;
[0067] Let represent the user set, and , where represents the th user, represents the total number of users, ; Let represent the product set, and , where represents the th product, represents the total number of products, ; Let represent the th user to the th product For the interaction data, the interaction matrix of the user with respect to the product is denoted as . If for the -th user there is an interaction record with the -th product , then let ; otherwise, let . According to the user-product interaction matrix , taking users and products as nodes and their interaction records as edges, construct a user-product bipartite graph .
[0068] In the embodiment, four common real datasets are selected for testing. 80% of the interaction records of each user with respect to the products in the dataset are used for training to obtain a training set, and the remaining 20% are used for testing to obtain a test set. That is, the user-product interaction matrix is derived from the training set.
[0069] Step 2: Use a graph encoder with band-stop filtering properties to learn the user representation matrix for recommendation and the product representation matrix , form the recommendation representation matrix , and construct the loss function for the recommendation task;
[0070] Step 2.1: Initialize the user initial representation matrix using the Xavier uniform distribution, where represents the representation of the -th user ;
[0071] Initialize the product initial representation matrix using the Xavier uniform distribution, where represents the representation of the -th product ;
[0072] Step 2.2: Obtain the adjacency matrix according to Equation (1):
[0073] (1)
[0074] In Equation (1), denotes transpose.
[0075] Step 2.3: Obtain the normalized adjacency matrix according to Equation (2):
[0076] (2)
[0077] In formula (2), Represents the adjacency matrix The degree matrix of
[0078] Step 2.4: Select a graph encoder with band-stop filtering properties. Specifically, use the second convolution layer in the graph convolutional network as the graph encoder and obtain the recommendation representation matrix of users and products according to formula (3): :
[0079] (3)
[0080] In formula (3), represents the initial representation matrix of users and products, and ;
[0081] Step 2.5: Obtain the final user representation matrix according to formula (4): and the final product characterization matrix :
[0082] (4)
[0083] In formula (4), Representation Matrix No. OK, Representation Matrix No. OK.
[0084] Step 2.6: Construct the loss function of the recommendation task according to formula (5) :
[0085] (5)
[0086] In formula (5), Indicates Users Interaction records for all products, ; Indicates Users The collection of products that have been interacted with; Indicates Users With Products and Uninteracted products The triples formed; is the Sigmoid activation function, Represents the end-user characterization matrix The Rows represent vectors, and respectively represent the row and column representation vectors in the final product characterization matrix in the row and the column.
[0087] denotes the regularization loss function of the model. Specifically, the initial characterization matrices of users and products are used to calculate the L2 regularization loss function.
[0088] In the embodiments, the training set of each data set is used to construct the adjacency matrix through formulas (1) and (2) . Two forward graph convolutions are performed according to Equation (3), i.e., the graph encoding is completed, and corresponding characterizations are obtained for each user and product node. Formulas (4) and (5) are the recommendation loss functions of the model, which are used to guide the learning of characterizations, and the weight of the regularization loss function is set to 0.0001.
[0089] Step 3. Based on the recommended characterization matrix , explicitly constructed contrastive learning loss functions for the user side and the item side based on gradient information, as well as a contrastive learning loss function based on user-product interaction information;
[0090] Step 3.1. Construct the first contrastive characterization view and the second contrastive characterization view according to Equation (6):
[0091] (6)
[0092] In Equation (6), are two noise matrices subject to a uniform distribution of 0-1, is a scalar for controlling the noise amplitude;
[0093] Step 3.2. Obtain the normalized first contrastive characterization view and the normalized second contrastive characterization view according to Equation (7):
[0094] (7)
[0095] In Equation (7), represents the normalization operation for each row vector.
[0096] Step 3.3. Construct the explicit contrastive learning loss function for the user side according to Equation (8):
[0097] (8)
[0098] In Equation (8), represents the th user in the corresponding representation vector in the normalized first comparison view ; represents the th user in the corresponding representation vector in the normalized second comparison view , , is a predetermined threshold; represents the absolute value operation, represents the temperature coefficient of contrastive learning.
[0099] Step 3.4. Construct the explicit contrastive learning loss of the product according to Equation (9) :
[0100] (9)
[0101] In Equation (9), represents the th product in the corresponding representation vector in the normalized first comparison view ; represents the th product in the corresponding representation vector in the normalized second comparison view , .
[0102] Step 3.5. Construct the contrastive learning loss of the user-product interaction information according to Equation (10) :
[0103] (10)
[0104] In the embodiment, to accelerate the negative sampling process, the batch training method is adopted, and the contrastive learning loss function is constructed in each batch for contrastive learning. In Equation (6), the hyperparameter of the noise amplitude is set to 0.1. In Equation (8), the hyperparameters are set as follows, the predetermined threshold is set to 0.2, and the contrastive learning temperature coefficient is set to 0.2 (set to 0.15 in the Yelp2018 dataset).
[0105] Step 4. Jointly optimize and update the initial representation matrix to obtain the optimal user representation matrix and the optimal product representation matrix , for implementing high-quality product recommendations;
[0106] Step 4.1: Establish the total optimization loss function according to Equation (11) :
[0107] (11)
[0108] In Equation (11), and are hyperparameters used to adjust the explicit contrast learning and interactive contrast learning loss functions respectively, represents the explicit contrast learning loss, and .
[0109] Step 4.2: Solve the total optimization loss by the gradient descent method, and update the initial representation matrix , until converges to the minimum value, and obtain the optimal user representation matrix and the optimal product representation matrix ;
[0110] Step 4.3: Predict the optimal interaction probability of the th user for the th product , so as to obtain the predicted interaction matrix of the user set for the product set , and complete high-quality product recommendations:
[0111] (12)
[0112] In Equation (12), represents the optimal representation vector of the th user in represents the optimal representation vector of the th product in
[0113] In the embodiment, the Adam optimizer is used to solve and optimize the gradient descent, and the learning rate is set to 0.001. In formula (11), the hyperparameters and used to adjust the explicit contrast learning and interactive contrast learning loss functions vary according to the dataset, and their optimal hyperparameter settings are as follows: Douban-Book: ; Yelp2018: ; Amazon - Book: ; Amazon - Kindle: .
[0114] In this embodiment, an electronic device includes a memory and a processor. The memory is used to store a program that supports the processor to execute the above - mentioned method, and the processor is configured to execute the program stored in the memory.
[0115] In this embodiment, a computer - readable storage medium stores a computer program on the computer - readable storage medium. When the computer program is run by a processor, it executes the steps of the above - mentioned method.
[0116] In summary, the present invention solves the deficiencies of existing graph - based contrastive recommendation. Starting from two basic components, namely the graph encoder and the contrastive learning optimization objective, it is optimized respectively. Specifically, the spectral graph theory is used to select a graph encoder with a band - stop filter curve to replace the traditional average - pooling operation to obtain user and product representations. Then, from the perspective of the overall uniformity of the representations, the optimization objective of contrastive learning is improved by using gradient analysis and mutual information. Through the optimization of the two components, more uniform user and product representations are learned, reducing the popularity bias and significantly improving the recommendation effect.
[0117] Embodiment
[0118] To verify the effectiveness of the method of the present invention, a large number of experiments are carried out on 4 commonly used datasets in the recommendation system, namely Douban - Book, Yelp2018, Amazon - Book, and Amazon - Kindle. The datasets, data partitioning methods used in the present invention are the same as those in previous studies. The present invention selects all products that the user has not interacted with for verification, and uses Recall@K and Normalized Discounted Cumulative Gain (NDCG@K) as evaluation indicators for the accuracy of the recommendation system. The larger the values of the two indicators, the higher the recommendation accuracy.
[0119] The present invention selects 5 representative graph - based contrastive learning methods for effect comparison, which are
[0120] SGL-ED (Self-supervised Graph Learning for Recommendation, SIGIR2021); SimGCL (Are Graph Augmentations Necessary? Simple Graph Contrastive Learning for Recommendation, SIGIR 2022); XSimGCL (XSimGCL: Towards Extremely Simple Graph Contrastive Learning for Recommendation, TKDE 2023); VGCL (Generative-Contrastive Graph Learning for Recommendation, SIGIR 2023); NESCL (Neighborhood-Enhanced Supervised Contrastive Learning for Collaborative Filtering, TKDE 2024);
[0121] For recall and normalized discounted cumulative gain (NDCG), a commonly used setting of K = 20 was selected. Regarding other parameters, the present invention used the same parameter settings as these methods to ensure the fairness of the comparison. Specifically, Tables 1 to 4 respectively show the experimental results on four datasets.
[0122] Table 1 Comparison of the recommendation effects of the method of the present invention and the comparative methods on the Douban-Book dataset
[0123]
[0124] Table 2 Comparison of the recommendation effects of the method of the present invention and the comparative methods on the Yelp2018 dataset
[0125]
[0126] Table 3 Comparison of the recommendation effects of the method of the present invention and the comparative methods on the Amazon-Book dataset
[0127]
[0128] Table 4 Comparison of the recommendation effects of the method of the present invention and the comparative methods on the Amazon-Kindle dataset
[0129]
[0130] As can be seen from the above four tables, on the three datasets of Douban-Book, Amazon-Book, and Amazon-Kindle, the SGCL method proposed by the present invention is significantly better than the comparative methods in terms of both Recall@20 and NDCG@20. On Yelp2018, the effect is second only to NESCL, but significantly better than other recommendation methods.
Claims
1. A product recommendation method based on spectral graph theory and representational uniformity, characterized in that It is carried out according to the following steps: Step 1: Construct a bipartite graph of users and products , where represents the user set, represents the product set, represents the interaction matrix of users with products; Step 2: Use a graph encoder with band-stop filtering properties to learn a user representation matrix for recommendation and a product representation matrix to form a recommendation representation matrix and construct a loss function for the recommendation task ; Step 3: According to the recommended representation matrix , respectively construct an explicit contrastive learning loss function for the user side and the item side based on gradient information, and a contrastive learning loss function based on user-product interaction information; Step 4. Combine various losses to optimize and update the initial representation matrix so as to obtain the optimal user representation matrix and the optimal product representation matrix for realizing high-quality product recommendations.
2. The product recommendation method based on spectral graph theory and representation uniformity according to claim 1, wherein The said step 1 includes: Let represent the user set, and , where represents the th user and ; Let represent the product set, and , where represents the th product, represents the total number of products, ; Let represent the th user 's interaction data with the th product . Then the interaction matrix of users with products is denoted as . If the th user has an interaction record with the th product , then let . Otherwise, let ; According to the interaction matrix of the product by the user , taking the user and the product as nodes and the interaction records between the two as edges, construct a user-product bipartite graph .
3. The product recommendation method based on spectral graph theory and characterization uniformity according to claim 2, characterized in that The said step 2 includes: Step 2.1: Initialize the user initial representation matrix using the Xavier uniform distribution , where represents the representation of the -th user ; Initialize the initial representation matrix of the product using the Xavier uniform distribution , where represents the representation of the th product ; Step 2.2: Obtain the adjacency matrix according to Equation (1) :[[]] (1) In formula (1), represents transpose; Step 2.3: Obtain the normalized adjacency matrix according to Equation (2) : (2) In formula (2), represents the adjacency matrix of the degree matrix; Step 2.4: Select a graph encoder with band-stop filtering properties, and use the second layer convolution in the graph convolutional network as the graph encoder, so as to obtain the recommendation representation matrix of users and products according to Equation (3). : (3) In formula (3), represents the initial characterization matrix of the user and the product, and ; Step 2.5: Obtain the final user representation matrix and the final product representation matrix : (4) In formula (4), represents the th row of the matrix and represents the th row of the matrix Step 2.
6. Construct the loss function of the recommendation task according to Equation (5). : (5) In formula (5), represents the th user's interaction records for all products, ; represents the set of products interacted by the th user; represents the triple th user formed with the th product and the th non - interacted product ; is the Sigmoid activation function, represents the th row representation vector in the final user representation matrix and respectively represent the th row and the th row representation vectors in the final product representation matrix represents the regularization loss function of the model. Specifically, it uses the initial representation matrices of users and products to calculate the L2 regularization loss function.
4. A product recommendation method based on spectral graph theory and characterization uniformity according to claim 3, characterized in that The said step 3 includes: Step 3.
1. Construct the first comparative representation view according to Equation (6) and the second comparative representation view : (6) In Equation (6), are two noise matrices subject to a uniform distribution of 0 - 1, is a scalar for controlling the noise amplitude; Step 3.2: Obtain the normalized first comparison representation view according to Equation (7) and the normalized second comparison representation view : (7) In formula (7), represents the normalization operation on each row vector; Step 3.
3. Construct the explicit contrastive learning loss function on the user side according to Equation (8). : (8) In formula (8), represents the th user 's corresponding representation vector in the normalized first comparison view ; represents the th user 's corresponding representation vector in the normalized second comparison view ; , is a predetermined threshold; represents the absolute value operation, represents the temperature coefficient of contrastive learning; Step 3.
4. Construct the explicit contrastive learning loss of the product according to Equation (9). : (9) In formula (9), represents the th product in the normalized first comparison view corresponding representation vector; represents the th product in the normalized second comparison view corresponding representation vector, ; Step 3.
5. Construct the contrastive learning loss of user-product interaction information according to Equation (10). : (10)。 5. A product recommendation method based on spectral graph theory and characterization uniformity according to claim 4, characterized in that, The said step 4 includes: Step 4.
1. Establish the total optimization loss function according to Equation (11). : (11) In Equation (11), and are hyperparameters for adjusting the explicit contrast learning and interactive contrast learning loss functions, respectively, represents the explicit contrast learning loss, and ; Step 4.2: Solve the total optimization loss by the gradient descent method to update the initial representation matrix until it converges to the minimum value to obtain the optimal user representation matrix and the optimal product representation matrix ; Step 4.
3. Predict the optimal interaction probability of the th user for the th product to obtain the predicted interaction matrix of the user set for the product set to complete high-quality product recommendations: (12) In formula (12), represents the optimal representation vector of the n-th user, and represents the optimal representation vector of the m-th product.
6. An electronic device, comprising a memory and a processor, characterized in that, The said memory is used to store a program that supports the processor to execute any one of the product recommendation methods in claims 1-5, and the processor is configured to execute the program stored in the said memory.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the said computer program is run by the processor, it executes the steps of any one of the product recommendation methods in claims 1-5.