Recommendation method and device based on adaptive feature map comparative learning
Through the adaptive feature map comparison learning method, multi-layer features of user-item interaction data are extracted, which solves the problem of traditional recommendation methods relying on supervised learning and overfitting, and achieves more efficient and accurate item recommendations.
Patent Information
- Application Number
- CN202411669537.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-18
AI Technical Summary
Traditional recommendation methods based on graph neural networks rely heavily on supervised learning, resulting in the need of a large amount of labeled data. In addition, the increase in the number of aggregated layers of graph neural networks will lead to excessive smoothing problems, making it difficult to distinguish node characterization, increase the risk of overfitting, and reduce the accuracy of item recommendations.
Using the recommendation method based on adaptive feature map comparison learning, an interaction matrix is constructed by obtaining the original user-item interactive data, normalization and PCA data enhancement, multi-layer graph convolution operation extracts interactive features, and improves feature expression through weighted summing processing, and finally inputs features into the pre-trained recommended model for recommendation.
It improves the accuracy and relevance of item recommendations, reduces dependence on labeled data, reduces the risk of overfitting, and enhances feature expression ability.
Smart Images

Figure CN119646291A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent recommendation, and in particular relates to a recommendation method and device based on adaptive feature graph contrast learning. Background Art
[0002] Traditional recommendation methods widely use graph neural networks (GNNs) to capture the complex interactive relationships between users and items, where items include commodities, articles, applications, and social connections. These methods use graph structured data to enhance the performance of recommendation algorithms by constructing interaction graphs between users and items. These methods represent the historical interactions of users as user-item bidirectional graphs, which are easy to access high-order connectivity. Among them, for example, GCMC uses the encoder-decoder structure on the graph to complete the interaction matrix, while SpectralCF first studies the spectral domain of the user-item bidirectional graph. Spectral convolution operations are proposed to find potential interactions and greatly improve the recommendation performance of cold start items. In addition, PinSAGE designs a special random walk to accelerate the learning of large-scale bi-element graphs and applies it to the Pinterest platform. NGCF directly aggregates the information of neighbors in the bidirectional graph and explicitly injects collaborative signals into the learned embedding. There is also LightGCN, which simplifies NGCF and removes the overhead calculation of linear transformation and nonlinear activation. The simplified operation not only achieves better performance, but also shortens the training time. UltraGCN further simplifies the graph convolution network. It skips the aggregation of finite layers and directly calculates the infinite convolution stage as a constraint during training.
[0003] However, traditional recommendation methods based on graph neural networks (GNNs) rely heavily on supervised learning, which requires a large amount of labeled data to generate accurate user and item representations. In addition, the increase in the number of aggregation layers of graph neural networks (GNNs) leads to over-smoothing problems, resulting in highly similar node representations that are difficult to distinguish, increasing the risk of overfitting and weakening its expressive power, resulting in low accuracy of item recommendations. Summary of the invention
[0004] The present invention provides a recommendation method and device based on adaptive feature graph contrast learning, which can improve the accuracy of item recommendation.
[0005] To achieve the above object, the present invention provides a recommendation method based on adaptive feature map contrast learning, comprising:
[0006] Obtaining original user-item interaction data, and constructing an interaction matrix using the original user-item interaction data;
[0007] Normalizing the interaction matrix to obtain a normalized adjacency matrix, and performing data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data;
[0008] Performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and performing a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature;
[0009] Performing weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature;
[0010] The final interaction features are input into the pre-trained recommendation model to obtain the final recommendation result.
[0011] Optionally, the using a PCA data enhancement algorithm to perform data enhancement on the normalized adjacency matrix to obtain reconstructed interaction data includes:
[0012] Performing principal component analysis on the normalized adjacency matrix, selecting the number of principal components in the principal component analysis, and using a covariance matrix to extract eigenvectors in the normalized adjacency matrix having the same number as the number of principal components, to obtain selected eigenvectors;
[0013] The selected eigenvectors are used to form a projection matrix, and a reconstruction matrix calculation formula is used to convert the projection matrix into the reconstructed interaction data.
[0014] Optionally, performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature includes:
[0015] The number of graph convolution layers is selected based on the data size of the original user-item interaction data;
[0016] The normalized adjacency matrix is convolved using the graph convolution layer with the selected number of graph convolution layers to obtain the first interaction feature.
[0017] Optionally, before performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain the first interaction feature, it also includes calculating an adaptive feature decorrelation loss of the features of each layer of the graph convolution.
[0018] Optionally, the calculating the adaptive feature decorrelation loss of the features of each layer of the graph convolution includes:
[0019] Obtaining the feature dimension of the features in each layer of the graph convolution, and calculating the column correlation of each column of the features in each layer of the graph convolution based on the feature dimension;
[0020] Calculate the average value of the column correlation of all columns of the features in each layer of the graph convolution to obtain a correlation mean, and calculate the penalty coefficient of each layer of the graph convolution based on the correlation mean;
[0021] A decorrelation loss function is constructed according to the correlation mean and the penalty coefficient of each layer of the graph convolution, and an adaptive feature decorrelation loss is calculated using the decorrelation loss function, and the penalty coefficient of each layer of the graph convolution is adjusted according to the adaptive feature decorrelation loss.
[0022] Optionally, the method further includes: training a recommendation model.
[0023] Optionally, the training of the recommendation model includes:
[0024] Calculate the contrast loss value using the preset contrast loss function according to the final interaction features;
[0025] The pairwise loss objective function is used to calculate the pairwise loss value of the interaction prediction score and the sampled interaction prediction score;
[0026] Calculating an adaptive feature decorrelation loss using the decorrelation loss function;
[0027] The contrast loss value, the pairwise loss value, and the adaptive feature decorrelation loss are used to adjust the model parameters of the recommendation model to complete the training of the recommendation model.
[0028] In order to solve the above problems, the present invention also provides a recommendation device based on adaptive feature map contrast learning, the device comprising:
[0029] A data enhancement module is used to obtain original user-item interaction data and construct an interaction matrix using the original user-item interaction data; normalize the interaction matrix to obtain a normalized adjacency matrix, and perform data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data;
[0030] A feature processing module, configured to perform a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and perform a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature; and perform weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature;
[0031] The recommendation module is used to input the final interaction features into the pre-trained recommendation model to obtain the final recommendation result.
[0032] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0033] at least one processor; and,
[0034] a memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the above-mentioned recommendation method based on adaptive feature map contrast learning.
[0036] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned recommendation method based on adaptive feature map contrast learning.
[0037] The present invention uses the user-item original interaction data to construct an interaction matrix, which can quantify the relationship between each user and the item, and can more clearly express the relationship between the user and the item. In addition, the normalized adjacency matrix is enhanced using the PCA data enhancement algorithm, which can better obtain the potential features between the user and the item, thereby improving the accuracy and relevance of the item recommendation. In addition, the first interaction feature and the second interaction feature are weighted and summed according to the output of each layer of the graph convolution in the multi-layer graph convolution operation, which can improve the expressiveness between the features, thereby improving the accuracy of subsequent item recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a flow chart of a recommendation method based on adaptive feature graph contrast learning provided by an embodiment of the present invention;
[0039] Figure 2 An algorithm structure flow chart of a recommendation method based on adaptive feature graph contrast learning provided by an embodiment of the present invention;
[0040] Figure 3 A functional module diagram of a recommendation device based on adaptive feature map contrast learning provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the structure of an electronic device for implementing the recommendation method based on adaptive feature map contrast learning provided by an embodiment of the present invention.
[0042] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0044] The embodiment of the present application provides a recommendation method based on adaptive feature graph contrast learning. The execution subject of the recommendation method based on adaptive feature graph contrast learning includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided in the embodiment of the present application. In other words, the recommendation method based on adaptive feature graph contrast learning can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0045] Reference Figure 1 FIG. 1 is a flow chart of a recommendation method based on adaptive feature graph contrast learning provided by an embodiment of the present invention. In this embodiment, the recommendation method based on adaptive feature graph contrast learning includes:
[0046] S1. Obtain original user-item interaction data, and construct an interaction matrix using the original user-item interaction data.
[0047] In an embodiment of the present invention, the items refer to objects with which users interact in each field. For example, in the consumption field, the items include but are not limited to commodities. In the content recommendation field, the items include but are not limited to articles, blogs, and music. In the service recommendation field, the items include but are not limited to travel services and financial services. In the application software field, the items may be apps that users can download and use, etc. In the social connection field, the items may be people or groups that users are interested in.
[0048] Exemplarily, the construction of the interaction matrix using the original user-item interaction data may be implemented by the following steps:
[0049] The user set is denoted as U = {u1,…,u i ,…,u I}(|U|=I), the set of items is denoted as V={v1,…,v j ,…,v J}(|V|=J), and construct the interaction matrix A∈R according to the original interaction data I×J, the interaction matrix represents the implicit interaction relationship between each user and item in U (such as consumption, viewing, and clicking). If user u i Items used before j , then A i,j =1, otherwise A i,j =0.
[0050] S2. Normalizing the interaction matrix to obtain a normalized adjacency matrix, and performing data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data.
[0051] The embodiment of the present invention performs normalization processing on the interaction matrix to obtain a normalized adjacency matrix The following formula can be used:
[0052]
[0053] Among them, D u ∈R I×I is the user's angle matrix, D t ∈R J×J is the diagonal matrix of user items, and A is the interaction matrix.
[0054] Among them, the transformation relationship of each element in the normalized adjacency matrix can be expressed by the following formula:
[0055]
[0056] Among them, |N i | is the degree of node i, |N j | is the degree of node j.
[0057] As an embodiment of the present invention, the PCA data enhancement algorithm is used to perform data enhancement on the normalized adjacency matrix to obtain reconstructed interaction data, including:
[0058] Performing principal component analysis on the normalized adjacency matrix, selecting the number of principal components in the principal component analysis, and using a covariance matrix to extract eigenvectors in the normalized adjacency matrix having the same number as the number of principal components, to obtain selected eigenvectors;
[0059] The selected eigenvectors are used to form a projection matrix, and a reconstruction matrix calculation formula is used to convert the projection matrix into the reconstructed interaction data.
[0060] In the embodiment of the present invention, the principal component analysis refers to a statistical method for extracting the most important features from the original data, thereby reducing the data dimension while retaining most of the original data information.
[0061] Exemplarily, the normalized adjacency matrix is enhanced using the PCA data enhancement algorithm to obtain reconstructed interaction data, and the following implementation steps may be used:
[0062] Normalized adjacency matrix Perform principal component analysis (PCA):
[0063]
[0064] Where k is The number of principal components required, W∈R (n×k) , is the projection matrix composed of the selected eigenvectors.
[0065] The specific implementation process of PCA is as follows:
[0066] Calculate the normalized matrix The covariance matrix ∑ of is:
[0067]
[0068] ∑v i =λ i v i
[0069] Among them, ∑ is the covariance matrix, which describes the linear relationship between the variables in the data, v i is the i-th eigenvector, λ i is the corresponding eigenvalue, and the k eigenvectors with the largest eigenvalue λ are selected. These eigenvectors define the main direction of change of the data.
[0070] W=[v1,v2,…,v k ]
[0071] Among them, W is the projection matrix composed of the selected eigenvectors, which is considered to retain the most important user behavior features.
[0072] is the reconstructed interaction data of the user-item interaction graph, and its calculation formula is as follows:
[0073]
[0074] in, To reconstruct the interaction data, μ is The mean matrix, each column of which is a copy of the original feature mean, W T is the transposed matrix of the projection matrix.
[0075] S3. Perform a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and perform a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature.
[0076] As an embodiment of the present invention, performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature includes:
[0077] The number of graph convolution layers is selected based on the data size of the original user-item interaction data;
[0078] The normalized adjacency matrix is convolved using the graph convolution layer with the selected number of graph convolution layers to obtain the first interaction feature.
[0079] Exemplarily, the normalized adjacency matrix is convolved using the graph convolution layer with the selected number of graph convolution layers to obtain the first interaction feature, and the following implementation steps may be adopted:
[0080]
[0081]
[0082] in, is the embedding vector of the item component in the normalized adjacency matrix at the lth convolutional layer, is the embedding vector of the user component in the normalized adjacency matrix at the lth convolutional layer.
[0083] Exemplarily, a multi-layer graph convolution operation is performed on the reconstructed interaction data to obtain a second interaction feature, and the following implementation steps may be adopted:
[0084]
[0085]
[0086] in, To reconstruct the embedding vector of the item component in the interaction data at the lth convolutional layer, is the embedding vector of the user component in the reconstructed interaction data at the lth convolutional layer.
[0087] As an embodiment of the present invention, before performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain the first interactive feature, it also includes calculating an adaptive feature decorrelation loss of the features of each layer of the graph convolution.
[0088] Furthermore, the adaptive feature decorrelation loss of the features of each layer of the computation graph convolution includes:
[0089] Obtaining the feature dimension of the features in each layer of the graph convolution, and calculating the column correlation of each column of the features in each layer of the graph convolution based on the feature dimension;
[0090] Calculate the average value of the column correlation of all columns of the features in each layer of the graph convolution to obtain a correlation mean, and calculate the penalty coefficient of each layer of the graph convolution based on the correlation mean;
[0091] A decorrelation loss function is constructed according to the correlation mean and the penalty coefficient of each layer of the graph convolution, and an adaptive feature decorrelation loss is calculated using the decorrelation loss function, and the penalty coefficient of each layer of the graph convolution is adjusted according to the adaptive feature decorrelation loss.
[0092] Exemplarily, the adaptive feature decorrelation loss is calculated for the features of each layer of the graph convolution, and the following implementation steps may be adopted:
[0093] Step 1. Calculation Pearson correlation coefficient between each column
[0094] Step 2: Calculate the average correlation between columns:
[0095] Among them, d represents the dimension of the feature, E *i represents the i-th feature of a user or item, i.e., the i-th column, and ρ(x, y) represents the Pearson correlation coefficient between vectors x and y:
[0096] Step 3: Calculate the penalty coefficient:
[0097]
[0098] Step 4: Calculate the adaptive feature decorrelation loss
[0099]
[0100] S4. Perform weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature.
[0101] In the embodiment of the present invention, the weighted summing of the first interaction feature and the second interaction feature to obtain the final interaction feature may be performed by the following implementation steps:
[0102] Step 1: and The feature output of each layer of the graph convolution is weighted and summed to obtain the final feature representation e U ,g U and e I ,g I , where e UThe weighted sum of multi-layer features of the user component of the normalized adjacency matrix for graph convolution, e I is the weighted sum of the multi-layer features of the item components of the graph convolution for the normalized adjacency matrix, g U To reconstruct interaction data The weighted sum of multi-layer features of the user component of the graph convolution, g I To reconstruct interaction data Perform graph convolution on the weighted sum of multiple layers of features of item components.
[0103]
[0104]
[0105] where α l It is a performance parameter, usually set to 1-l / (L+1), where L is the final number of graph convolutional layers.
[0106] S5. Input the final interaction feature into the pre-trained recommendation model to obtain the final recommendation result.
[0107] As an embodiment of the present invention, it also includes: training the recommendation model.
[0108] Furthermore, the training of the recommendation model includes:
[0109] Calculate the contrast loss value using the preset contrast loss function according to the final interaction features;
[0110] The pairwise loss objective function is used to calculate the pairwise loss value of the interaction prediction score and the sampled interaction prediction score;
[0111] Calculating an adaptive feature decorrelation loss using the decorrelation loss function;
[0112] The contrast loss value, the pairwise loss value, and the adaptive feature decorrelation loss are used to adjust the model parameters of the recommendation model to complete the training of the recommendation model.
[0113] In the embodiment of the present invention, the contrast loss value is calculated using a preset contrast loss function according to the final interaction feature, and the following formula may be used:
[0114] use and We jointly compute the contrastive loss, treating view-specific embeddings of the same node as positive pairs (e.g. On the other hand, the embeddings of nodes that are different in the two views are considered as negative pairs (e.g., ):
[0115]
[0116] in, The following calculation formula can be used for calculation:
[0117]
[0118] The final contrast loss is:
[0119] In the embodiment of the present invention, the two views refer to the weighted sum of multi-layer features calculated by normalizing the adjacency matrix and the weighted sum of multi-layer features calculated by reconstructing the interactive features.
[0120] Furthermore, the pairwise loss objective function is used to calculate the pairwise loss value of the interactive prediction score and the sampled interactive prediction score, and the following formula can be used:
[0121]
[0122] in,
[0123] Interactive prediction score is the sampled interaction prediction score, σ(·) is the sigmoid function, O={(u,β,π)|R u,β =1,R u,π =0} represents paired training data, β represents the sampled items with which user u interacts, and π represents the sampled items with which user u does not interact.
[0124] In the embodiment of the present invention, the sample interaction prediction score refers to the prediction score of the sample item with which the user u has not interacted.
[0125] The present invention uses the user-item original interaction data to construct an interaction matrix, which can quantify the relationship between each user and the item, and can more clearly express the relationship between the user and the item. In addition, the normalized adjacency matrix is enhanced using the PCA data enhancement algorithm, which can better obtain the potential features between the user and the item, thereby improving the accuracy and relevance of the item recommendation. In addition, the first interaction feature and the second interaction feature are weighted and summed according to the output of each layer of the graph convolution in the multi-layer graph convolution operation, which can improve the expressiveness between the features, thereby improving the accuracy of subsequent item recommendations.
[0126] Reference Figure 2 , which is a flowchart of the algorithm structure of a recommendation method based on adaptive feature graph contrast learning provided by an embodiment of the present invention.
[0127] like Figure 3 , which is a functional module diagram of a recommendation device based on adaptive feature graph contrast learning provided by an embodiment of the present invention.
[0128] The device 100 for recommending based on adaptive feature graph contrast learning of the present invention can be installed in an electronic device. According to the implemented functions, the device 100 for recommending based on adaptive feature graph contrast learning can include a data enhancement module 101, a feature processing module 102 and a recommendation module 103.
[0129] The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and is stored in a memory of the electronic device.
[0130] In this embodiment, the functions of each module / unit are as follows:
[0131] The low-light image processing module 101 is used to obtain original user-item interaction data and construct an interaction matrix using the original user-item interaction data; normalize the interaction matrix to obtain a normalized adjacency matrix, and use the PCA data enhancement algorithm to perform data enhancement on the normalized adjacency matrix to obtain reconstructed interaction data.
[0132] In an embodiment of the present invention, the items refer to objects with which users interact in each field. For example, in the consumption field, the items include but are not limited to commodities. In the content recommendation field, the items include but are not limited to articles, blogs, and music. In the service recommendation field, the items include but are not limited to travel services and financial services. In the application software field, the items may be apps that users can download and use, etc. In the social connection field, the items may be people or groups that users are interested in.
[0133] Exemplarily, the construction of the interaction matrix using the original user-item interaction data may be implemented by the following steps:
[0134] The user set is denoted as U = {u1,…,u i ,…,u I}(|U|=I), the set of items is denoted as V={v1,…,v j ,…,v J}(|V|=j), and construct the interaction matrix A∈R based on the original interaction data I×J , the interaction matrix represents the implicit interaction relationship between each user and item in U (such as consumption, viewing, and clicking). If user u i Items used before j , then A i,j =1, otherwise A i,j =0.
[0135] The embodiment of the present invention performs normalization processing on the interaction matrix to obtain a normalized adjacency matrix The following formula can be used:
[0136]
[0137] Among them, D u ∈R I×I is the user's angle matrix, D t ∈R J×J is the diagonal matrix of user items, and A is the interaction matrix.
[0138] Among them, the transformation relationship of each element in the normalized adjacency matrix can be expressed by the following formula:
[0139]
[0140] Among them, |N i | is the degree of node i, |N j | is the degree of node j.
[0141] As an embodiment of the present invention, the PCA data enhancement algorithm is used to perform data enhancement on the normalized adjacency matrix to obtain reconstructed interaction data, including:
[0142] Performing principal component analysis on the normalized adjacency matrix, selecting the number of principal components in the principal component analysis, and using a covariance matrix to extract eigenvectors in the normalized adjacency matrix having the same number as the number of principal components, to obtain selected eigenvectors;
[0143] The selected eigenvectors are used to form a projection matrix, and a reconstruction matrix calculation formula is used to convert the projection matrix into the reconstructed interaction data.
[0144] In the embodiment of the present invention, the principal component analysis refers to a statistical method for extracting the most important features from the original data, thereby reducing the data dimension while retaining most of the original data information.
[0145] Exemplarily, the normalized adjacency matrix is enhanced using the PCA data enhancement algorithm to obtain reconstructed interaction data, and the following implementation steps may be used:
[0146] Normalized adjacency matrix Perform principal component analysis (PCA):
[0147]
[0148] Where k is The number of principal components required, W∈R (n×k) , is the projection matrix composed of the selected eigenvectors.
[0149] The specific implementation process of PCA is as follows:
[0150] Calculate the normalized matrix The covariance matrix ∑ of is:
[0151]
[0152] ∑v i =λ i v i
[0153] Among them, ∑ is the covariance matrix, which describes the linear relationship between the variables in the data, v i is the i-th eigenvector, λ i is the corresponding eigenvalue, and the k eigenvectors with the largest eigenvalue λ are selected. These eigenvectors define the main direction of change of the data.
[0154] W=[v1,v2,…,v k ]
[0155] Among them, W is the projection matrix composed of the selected eigenvectors, which is considered to retain the most important user behavior features.
[0156] is the reconstructed interaction data of the user-item interaction graph, and its calculation formula is as follows:
[0157]
[0158] in, To reconstruct the interaction data, μ is The mean matrix, each column of which is a copy of the original feature mean, W T is the transposed matrix of the projection matrix.
[0159] The feature processing module 102 is used to perform a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and to perform a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature; and to perform weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature.
[0160] As an embodiment of the present invention, performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature includes:
[0161] The number of graph convolution layers is selected based on the data size of the original user-item interaction data;
[0162] The normalized adjacency matrix is convolved using the graph convolution layer with the selected number of graph convolution layers to obtain the first interaction feature.
[0163] Exemplarily, the normalized adjacency matrix is convolved using the graph convolution layer with the selected number of graph convolution layers to obtain the first interaction feature, and the following implementation steps may be adopted:
[0164]
[0165]
[0166] in, is the embedding vector of the item component in the normalized adjacency matrix at the lth convolutional layer, is the embedding vector of the user component in the normalized adjacency matrix at the lth convolutional layer.
[0167] Exemplarily, a multi-layer graph convolution operation is performed on the reconstructed interaction data to obtain a second interaction feature, and the following implementation steps may be adopted:
[0168]
[0169]
[0170] in, To reconstruct the embedding vector of the item component in the interaction data at the lth convolutional layer, is the embedding vector of the user component in the reconstructed interaction data at the lth convolutional layer.
[0171] As an embodiment of the present invention, before performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain the first interactive feature, it also includes calculating an adaptive feature decorrelation loss of the features of each layer of the graph convolution.
[0172] Furthermore, the adaptive feature decorrelation loss of the features of each layer of the computation graph convolution includes:
[0173] Obtaining the feature dimension of the features in each layer of the graph convolution, and calculating the column correlation of each column of the features in each layer of the graph convolution based on the feature dimension;
[0174] Calculate the average value of the column correlation of all columns of the features in each layer of the graph convolution to obtain a correlation mean, and calculate the penalty coefficient of each layer of the graph convolution based on the correlation mean;
[0175] A decorrelation loss function is constructed according to the correlation mean and the penalty coefficient of each layer of the graph convolution, and an adaptive feature decorrelation loss is calculated using the decorrelation loss function, and the penalty coefficient of each layer of the graph convolution is adjusted according to the adaptive feature decorrelation loss.
[0176] Exemplarily, the adaptive feature decorrelation loss is calculated for the features of each layer of the graph convolution, and the following implementation steps may be adopted:
[0177] Step 1. Calculation Pearson correlation coefficient between each column
[0178] Step 2: Calculate the average correlation between columns:
[0179] Among them, d represents the dimension of the feature, E *i represents the i-th feature of a user or item, i.e., the i-th column, and ρ(x, y) represents the Pearson correlation coefficient between vectors x and y:
[0180] Step 3: Calculate the penalty coefficient:
[0181]
[0182] Step 4: Calculate the adaptive feature decorrelation loss
[0183]
[0184] In the embodiment of the present invention, the weighted summing of the first interaction feature and the second interaction feature to obtain the final interaction feature may be performed by the following implementation steps:
[0185] Step 1: and The feature output of each layer of the graph convolution is weighted and summed to obtain the final feature representation e U ,g U and e I ,g I , where e U The weighted sum of multi-layer features of the user component of the normalized adjacency matrix for graph convolution, e I is the weighted sum of multi-layer features of item components for graph convolution of the normalized adjacency matrix, g U To reconstruct interaction data The weighted sum of multi-layer features of the user component of the graph convolution, g I To reconstruct interaction data Perform graph convolution on the weighted sum of multiple layers of features of item components.
[0186]
[0187]
[0188] where α l It is a performance parameter, usually set to 1-l / (L+1), where L is the final number of graph convolutional layers.
[0189] The recommendation module 103 is used to input the final interaction features into the pre-trained recommendation model to obtain the final recommendation result.
[0190] As an embodiment of the present invention, it also includes: training the recommendation model.
[0191] Furthermore, the training of the recommendation model includes:
[0192] Calculate the contrast loss value using the preset contrast loss function according to the final interaction features;
[0193] The pairwise loss objective function is used to calculate the pairwise loss value of the interaction prediction score and the sampled interaction prediction score;
[0194] Calculating an adaptive feature decorrelation loss using the decorrelation loss function;
[0195] The contrast loss value, the pairwise loss value, and the adaptive feature decorrelation loss are used to adjust the model parameters of the recommendation model to complete the training of the recommendation model.
[0196] In the embodiment of the present invention, the contrast loss value is calculated using a preset contrast loss function according to the final interaction feature, and the following formula may be used:
[0197] use and We jointly compute the contrastive loss, treating view-specific embeddings of the same node as positive pairs (e.g. On the other hand, the embeddings of nodes that are different in the two views are considered as negative pairs (e.g., ):
[0198]
[0199] in, The following calculation formula can be used for calculation:
[0200]
[0201] The final contrast loss is:
[0202] In the embodiment of the present invention, the two views refer to the weighted sum of multi-layer features calculated by normalizing the adjacency matrix and the weighted sum of multi-layer features calculated by reconstructing the interactive features.
[0203] Furthermore, the pairwise loss objective function is used to calculate the pairwise loss value of the interactive prediction score and the sampled interactive prediction score, and the following formula can be used:
[0204]
[0205] Among them, the interactive prediction score is the sampled interaction prediction score, σ(·) is the Sigmoid function, O={(u,β,π)|R u,β =1,R u,π =0} represents paired training data, β represents the sampled items with which user u interacts, and π represents the sampled items with which user u does not interact.
[0206] In the embodiment of the present invention, the sample interaction prediction score refers to the prediction score of the sample item with which the user u has not interacted.
[0207] like Figure 4 , is a schematic diagram of the structure of an electronic device for implementing a recommendation method based on adaptive feature map contrast learning provided by an embodiment of the present invention.
[0208] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a recommendation method program based on adaptive feature map contrast learning.
[0209] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a recommendation method program based on adaptive feature map contrast learning, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0210] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as a code of a recommendation method program based on adaptive feature map contrast learning, but also can be used to temporarily store data that has been output or is to be output.
[0211] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0212] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0213] Figure 4 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 4The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0214] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0215] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0216] The recommendation method program based on adaptive feature map contrast learning stored in the memory 11 of the electronic device is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0217] Obtaining original user-item interaction data, and constructing an interaction matrix using the original user-item interaction data;
[0218] Normalizing the interaction matrix to obtain a normalized adjacency matrix, and performing data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data;
[0219] Performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and performing a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature;
[0220] Performing weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature;
[0221] The final interaction features are input into the pre-trained recommendation model to obtain the final recommendation result.
[0222] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0223] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0224] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0225] Obtaining original user-item interaction data, and constructing an interaction matrix using the original user-item interaction data;
[0226] Normalizing the interaction matrix to obtain a normalized adjacency matrix, and performing data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data;
[0227] Performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and performing a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature;
[0228] Performing weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature;
[0229] The final interaction features are input into the pre-trained recommendation model to obtain the final recommendation result.
[0230] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0231] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0232] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0233] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0234] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0235] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0236] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0237] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0238] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A recommendation method based on adaptive feature map contrast learning, characterized in that: The method comprises: Obtaining original user-item interaction data, and constructing an interaction matrix using the original user-item interaction data; Normalizing the interaction matrix to obtain a normalized adjacency matrix, and performing data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data; Performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and performing a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature; Performing weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature; The final interaction features are input into the pre-trained recommendation model to obtain the final recommendation result.
2. The recommendation method based on adaptive feature map contrast learning according to claim 1, characterized in that: The PCA data enhancement algorithm is used to perform data enhancement on the normalized adjacency matrix to obtain reconstructed interaction data, including: Performing principal component analysis on the normalized adjacency matrix, selecting the number of principal components in the principal component analysis, and using a covariance matrix to extract eigenvectors in the normalized adjacency matrix having the same number as the number of principal components, to obtain selected eigenvectors; The selected eigenvectors are used to form a projection matrix, and a reconstruction matrix calculation formula is used to convert the projection matrix into the reconstructed interaction data.
3. The recommendation method based on adaptive feature map contrast learning according to claim 1, characterized in that: The step of performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature includes: The number of graph convolution layers is selected based on the data size of the original user-item interaction data; The normalized adjacency matrix is convolved using the graph convolution layer with the selected number of graph convolution layers to obtain the first interaction feature.
4. The recommendation method based on adaptive feature map contrast learning according to claim 3, characterized in that: Before performing a multi-layer graph convolution operation on the normalized adjacency matrix to obtain the first interactive feature, it also includes calculating the adaptive feature decorrelation loss of the features of each layer of the graph convolution.
5. The recommendation method based on adaptive feature map contrast learning according to claim 4, characterized in that: The adaptive feature decorrelation loss of the features of each layer of the computation graph convolution includes: Obtaining the feature dimension of the features in each layer of the graph convolution, and calculating the column correlation of each column of the features in each layer of the graph convolution based on the feature dimension; Calculate the average value of the column correlation of all columns of the features in each layer of the graph convolution to obtain a correlation mean, and calculate the penalty coefficient of each layer of the graph convolution based on the correlation mean; A decorrelation loss function is constructed according to the correlation mean and the penalty coefficient of each layer of the graph convolution, and an adaptive feature decorrelation loss is calculated using the decorrelation loss function, and the penalty coefficient of each layer of the graph convolution is adjusted according to the adaptive feature decorrelation loss.
6. The recommendation method based on adaptive feature map contrast learning according to any one of claims 1 to 5, characterized in that: Also includes: Train the recommendation model.
7. The recommendation method based on adaptive feature map contrast learning according to claim 6, characterized in that: The training of the recommendation model includes: Calculate the contrast loss value using the preset contrast loss function according to the final interaction features; The pairwise loss objective function is used to calculate the pairwise loss value of the interaction prediction score and the sampled interaction prediction score; Calculating an adaptive feature decorrelation loss using the decorrelation loss function; The contrast loss value, the pairwise loss value, and the adaptive feature decorrelation loss are used to adjust the model parameters of the recommendation model to complete the training of the recommendation model.
8. A recommendation device based on adaptive feature map contrast learning, characterized in that: The device can implement the recommendation method based on adaptive feature map contrast learning as described in any one of claims 1 to 7, and the device includes: A data enhancement module is used to obtain original user-item interaction data and construct an interaction matrix using the original user-item interaction data; normalize the interaction matrix to obtain a normalized adjacency matrix, and perform data enhancement on the normalized adjacency matrix using a PCA data enhancement algorithm to obtain reconstructed interaction data; A feature processing module, configured to perform a multi-layer graph convolution operation on the normalized adjacency matrix to obtain a first interaction feature, and perform a multi-layer graph convolution operation on the reconstructed interaction data to obtain a second interaction feature; and perform weighted sum processing on the first interaction feature and the second interaction feature according to the output of each layer of the graph convolution in the multi-layer graph convolution operation to obtain a final interaction feature; The recommendation module is used to input the final interaction features into the pre-trained recommendation model to obtain the final recommendation result.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the recommendation method based on adaptive feature map contrast learning as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the recommendation method based on adaptive feature map contrast learning as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Content recommendation based on graph enhanced collaborative filtering
CN116340645A
Adaptive noise data collaborative comparison recommendation model
CN116720005A
Graph contrast learning recommendation method based on relational graph convolutional neural network
CN118013135A
Cited By
Recommendation weight optimization method based on group feature aggregation
CN121681939A