BPR-RNN-based e-commerce platform commodity automatic recommendation system
By adopting the BPR-RNN model on the e-commerce platform, optimizing user behavior data and product association relationships, the shortcomings of the existing recommendation system in terms of personalization and dynamics are solved, and more accurate and personalized recommendation effects are achieved, improving the user experience and platform commercial value.
Patent Information
- Application Number
- CN202510026957.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-25
AI Technical Summary
The automatic product recommendation system of existing e-commerce platforms is insufficient in terms of personalization and dynamics, and cannot accurately tap user needs. The recommendation results are lagging, which affects user experience and limits the improvement of the platform's commercial value.
The automatic product recommendation system of e-commerce platform based on BPR-RNN is adopted. By collecting user historical behavior data, optimizing the sorting using the BPR algorithm, and using the RNN model to capture user dynamic interests and generate a personalized recommendation list.
The breakthrough of personalized and dynamic recommendations has been achieved, and the recommendation results are more accurate and personalized, which improves recommendation efficiency and user experience, and significantly enhances the commercial value of the platform.
Smart Images

Figure CN119887335A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of e-commerce platforms, and in particular to an automatic product recommendation system for e-commerce platforms based on BPR-RNN. Background Art
[0002] Currently, the automatic product recommendation algorithms of most e-commerce platforms mainly rely on traditional rule-based methods and simple machine learning models; In the rule-based recommendation method, the system usually sorts according to explicit indicators (such as sales volume and ratings), and makes insufficient use of implicit behavior data (such as user purchase records). It does not deeply explore the potential preference patterns in user behavior, resulting in fixed logic, mechanical recommendation results, and lack of personalization. Simple machine learning models (such as logistic regression or matrix decomposition) are usually based on static data modeling and fail to effectively capture the dynamic changes in user interests, causing recommendation results to lag behind user needs. Therefore, the existing recommendation system is not good at personalization and dynamism, and cannot accurately explore user needs. The recommendation results are lagging, which not only affects the user experience, but also limits the improvement of the platform's commercial value. For this reason, an automatic recommendation system for e-commerce platform products based on BPR-RNN is proposed. Summary of the invention
[0003] In view of the shortcomings of the prior art, the present invention provides an automatic product recommendation system for an e-commerce platform based on BPR-RNN to solve the background technology problems.
[0004] To achieve the above purpose, the present invention provides the following technical solution: an automatic product recommendation system for an e-commerce platform based on BPR-RNN, the system comprising: S10: Collect user historical behavior and perform data cleaning: Collect user historical behavior data, including purchased items and the order in which they were purchased; then clean and filter the data to improve data quality.
[0005] S20: Use the BPR-RNN model to optimize sorting and model user behavior sequences: According to S10, the BPR algorithm is used to optimize and sort the user's implicit data, and the RNN model is used to capture the user's dynamic interests to complete the modeling of the user behavior sequence.
[0006] S30: Generate a pull matrix between products and optimize product associations: According to S20, a pull matrix between products is generated, and combined with the optimization results of the BPR and RNN models, the weights of the associated values in the pull matrix are dynamically adjusted to further improve the personalization and accuracy of the recommendations.
[0007] S40: Generate a personalized recommendation list according to the associated value and output the result.
[0008] According to S30, based on the association values in the optimized pull matrix and in combination with the user's purchase records, the total association value of each user for all unpurchased products is calculated, and the unpurchased products are sorted according to the total association value, and a personalized recommendation list is generated and the result is output.
[0009] Preferably, the step S20 further comprises: S201: Implicit feedback sorting optimization based on BPR algorithm A data set is constructed based on the cleaned data, including positive samples and negative samples. The BPR algorithm is used to train the model by maximizing the prediction ranking accuracy of positive samples relative to negative samples. The ranking results are generated to screen the top N products that users are most likely to be interested in, forming the basis for preliminary recommendations.
[0010] Preferably, the step S20 further comprises: S202: User Behavior Sequence Modeling Based on RNN Arrange the user's commodity purchase behavior in chronological order, construct the user's purchase behavior sequence, and input the behavior sequence into the RNN model for time-step processing to capture the changes in user interests in the time dimension and provide support for personalized recommendation generation.
[0011] Preferably, in step S10, the historical behavior data is the user's purchase record, and is directly mapped to a commodity purchase sequence based on the order of the purchase record.
[0012] Preferably, in the step S10, two thresholds are set, the first threshold is the threshold for the number of goods purchased by users, and the second threshold is the threshold for the number of times core users purchase the same product. Data cleaning includes deleting user data whose number of purchased goods is less than the preset first threshold, and eliminating goods that have been purchased by all core users less than the preset second threshold.
[0013] Preferably, in S40, the total association value is determined by accumulating the pull values corresponding to the products that the user has purchased, so as to measure the user's potential interest in each unpurchased product.
[0014] Preferably, in S40, a threshold value for the number of personalized recommended commodities is set, and a personalized recommendation list is generated for the sorted unpurchased commodities according to the number of the threshold value.
[0015] Compared with the prior art, the present invention has the following beneficial effects: This paper combines the BPR and RNN models to comprehensively optimize the recommendation algorithm of the e-commerce platform, achieving a breakthrough in personalized and dynamic recommendations. The BPR algorithm deeply mines the user's implicit behavior data to generate an accurate preliminary ranking; the RNN model captures the temporal dynamics of user interests and effectively adapts to the user's real-time needs. The optimized pull matrix integrates user preferences and product relevance, making the recommendation results more accurate and personalized. The overall method improves recommendation efficiency and user experience, while significantly enhancing the commercial value of the platform.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flowchart of the automatic product recommendation system for e-commerce platforms based on BPR-RNN in the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this technical field without creative work are within the scope of protection of the present invention.
[0019] See also Figure 1 The present invention provides an automatic product recommendation system for an e-commerce platform based on BPR-RNN, the system comprising: S10: Collect user historical behavior and perform data cleaning Collect user historical behavior data, including purchased items and the order in which they were purchased. Then clean and filter the data to improve data quality.
[0020] The specific operations of this step are: The user's historical behavior data is obtained through the user's purchase record on the e-commerce platform. The user's purchase history is directly mapped to the product purchase sequence. For example, a record in the database may be represented as (1, 0, 1, 3, 2, 4), where the number represents the specific product identifier, and the repeated appearance of the number indicates that the user has purchased a certain product multiple times; if it is represented in a table form, the data structure is: each user represents a row, and each product represents a column, as shown in Table 1.
[0021] Table 1 After completing data collection, the raw data is cleaned to improve quality and ensure the accuracy of subsequent model training and recommendation results.
[0022] The specific operations of this step are: First, delete the data of users who purchased less than 10 items, and only retain users with relatively active purchasing behavior to ensure that the data is focused on core user needs.
[0023] Secondly, in the purchasing behavior data of the remaining users, the total purchase times of all products are counted, and the products purchased less than 3 times by all core users are screened and eliminated; specifically, if the total number of times a certain product appears in the purchase records of all core users is less than 3 times, no matter which users' records it appears in, the product will be removed from the purchase records of the corresponding user to avoid the interference of sparse data on model training and recommendation results.
[0024] S20: Using the BPR-RNN model to optimize sorting and model user behavior sequences In order to accurately and personally recommend unpurchased items to users and meet their dynamic and diverse needs, this step optimizes and sorts user implicit data through the BPR algorithm (Bayesian Personalized Ranking), and uses the RNN model (Recurrent Neural Network) to capture users' dynamic interests and complete the modeling of user behavior sequences.
[0025] The specific operations of this step are: S201: Implicit feedback sorting optimization based on BPR algorithm A dataset is constructed based on the cleaned data, where each row represents a user's purchase record, including positive samples (products actually purchased by the user) and negative samples (randomly selected products that the user did not purchase). The BPR algorithm is used to train the model by maximizing the prediction ranking accuracy of positive samples relative to negative samples. The algorithm optimizes the ranking by comparing the preference values of positive samples and negative samples. The specific loss function is:
[0026] Among them, u represents the user, i represents the positive sample product, and j represents the negative sample product. Taste, and They are the user's preference values for these products predicted by the model; The generated ranking results are used to filter the top ten products that users are most likely to be interested in, forming the basis for preliminary recommendations.
[0027] S20: User behavior sequence modeling based on RNN In this step, the user's purchase behavior sequence is dynamically modeled through the RNN model (Recurrent Neural Network) to capture the changes in user interests in the time dimension and provide support for the generation of personalized recommendations.
[0028] The specific operations of this step are: First, the user's product purchase behavior is arranged in chronological order to construct the user's purchase behavior sequence. Each product in the purchase sequence is mapped to a vector representation through the product feature matrix R. Each row of the matrix R represents a d-dimensional feature vector of a product, which is initially assigned by random initialization and optimized during the training process. For example, if a user's purchase sequence is: [Product B, Product A, Product C], the input sequence will be mapped to [R[B], R[A], R[C]]. These feature vectors not only carry the basic characteristics of the product, but also reflect the user's preferences.
[0029] Then, the above behavior sequence is input into the RNN model for time-step processing. At each time step t, the RNN will combine the vector feature R[Xt] of the current product and the hidden state h[t-1] of the previous time step to calculate the hidden state h[t] of the current time step. The update formula of the hidden state is:
[0030] Among them, the weight matrix M is responsible for controlling the transfer of hidden states between time steps, and the weight matrix W determines the contribution of the current product feature vector to the hidden state update; σ is an activation function (such as tahh or ReLU), which is used to introduce nonlinear features; during initialization, the weights of matrices M and W are randomly assigned to avoid gradient vanishing or gradient exploding problems.
[0031] During the training process, the model continuously updates parameters such as R, M, and W by optimizing the loss function. The goal of the loss function is to minimize the error between the user's actual purchase behavior and the model's prediction results, thereby improving the accuracy of the recommendation system. Specifically, the model takes the user behavior sequence as input and iteratively adjusts the parameters so that the prediction results gradually approach the user's actual preferences. After training, the RNN model generates prediction results of the user's future interests. These results are presented in the form of potential interest scores, indicating the distribution of the user's interest intensity in the entire product space. Products with higher scores represent higher potential interest levels of users.
[0032] S30: Generate a pull matrix between products and optimize product associations In order to accurately and personally recommend unpurchased products to users, this step generates a pull matrix between products, and combines the optimization results of the BPR and RNN models to dynamically adjust the weights of the associated values in the pull matrix to further improve the personalization and accuracy of the recommendations.
[0033] The specific operations of this step are: First, based on the cleaned user purchase data, calculate the pull value of each product on other products; specifically, the pull value measures the degree of influence of the purchase of one product on the purchase of another product; the calculation method is to count the proportion of users who purchase product i and also purchase product j, that is, pull value i, j = P (user purchases product j | user purchases product i). In the specific implementation process, the system traverses the purchase records of each user and calculates each pair of product combinations (i.e., product i and product j), and stores the results in an N×N pull matrix, where N is the total number of products. Each element in the matrix (pull value i, j) reflects the potential pull strength of product i on product j, reflecting the correlation between products.
[0034] After the pull matrix is generated, it is further optimized by combining it with the previously trained BPR-RNN model. Specifically, the preference ranking results generated by the BPR model can be used to optimize and adjust the weights of the association values in the pull matrix. For products with higher user preferences, their association values in the matrix will be given higher weights, thereby highlighting the importance of these products in user recommendations. This adjustment mechanism effectively combines the user's historical preference information and enhances the matrix's ability to reflect the user's individual interests. At the same time, the dynamic interests of users captured by the RNN model are further used to optimize the matrix; by modeling the user's current behavior sequence, the products with which the user has recently interacted with high frequency are identified, and the relationship weights between these products and unpurchased products are appropriately increased accordingly; this process clarifies that the pull matrix is not only based on the user's historical preferences, but also adapts to their recent behavior trends, thereby improving the real-time and personalization of the recommendation results.
[0035] S40: Generate a personalized recommendation list based on the association value and output the result In this embodiment, the optimized pull matrix is used to generate a personalized recommendation list.
[0036] For each user, the system uses the association value in the optimized pull matrix and combines the user's purchase record to calculate the total association value of each user for all unpurchased items; the total association value is determined by accumulating the pull values corresponding to the user's purchased items to measure the user's potential interest in each unpurchased item.
[0037] The unpurchased products are sorted according to the total association value, and the top ten products with the highest total association value are selected to generate a personalized recommendation list for each user.
[0038] For example, for a certain user, the calculation result may generate the following recommendation list: [Product B, Product C, Product D...], among which Product B has the highest total association value and is therefore recommended first; finally, the system outputs the recommendation list to the user interface to provide users with accurate and personalized product recommendations.
[0039] Through the above steps, S40 achieves a seamless transformation from the optimized pull matrix to the final recommendation results. At the same time, it fully integrates the optimization results of the BPR and RNN models into the recommendation generation process, further improving the personalization level and timeliness of the recommendations.
[0040] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. An automatic product recommendation system for e-commerce platforms based on BPR-RNN, characterized in that: The system includes: S10: Collect user historical behavior and perform data cleaning: Collect user historical behavior data, including purchased items and their purchase order; then clean and filter the data to improve data quality. S20: Use the BPR-RNN model to optimize sorting and model user behavior sequences: According to S10, the BPR algorithm is used to optimize and sort the user's implicit data, and the RNN model is used to capture the user's dynamic interests to complete the modeling of the user behavior sequence. S30: Generate a pull matrix between products and optimize product associations: According to S20, a pull matrix between products is generated, and the weights of the associated values in the pull matrix are dynamically adjusted in combination with the optimization results of the BPR and RNN models to further improve the personalization and accuracy of the recommendations. S40: Generate a personalized recommendation list based on the association value and output the result. According to S30, based on the association values in the optimized pull matrix and in combination with the user's purchase records, the total association value of each user for all unpurchased products is calculated, and the unpurchased products are sorted according to the total association value, and a personalized recommendation list is generated and the result is output.
2. According to claim 1, the BPR-RNN-based e-commerce platform commodity automatic recommendation system is characterized in that: The step S20 further includes: S201: Implicit feedback sorting optimization based on BPR algorithm A data set is constructed based on the cleaned data, including positive samples and negative samples. The BPR algorithm is used to train the model by maximizing the prediction ranking accuracy of positive samples relative to negative samples. The ranking results are generated to screen the top N products that users are most likely to be interested in, forming the basis for preliminary recommendations.
3. According to claim 2, the BPR-RNN-based e-commerce platform commodity automatic recommendation system is characterized in that: The step S20 further includes: S202: User Behavior Sequence Modeling Based on RNN Arrange the user's commodity purchase behavior in chronological order, construct the user's purchase behavior sequence, and input the behavior sequence into the RNN model for time-step processing to capture the changes in user interests in the time dimension and provide support for personalized recommendation generation.
4. According to claim 1, the BPR-RNN-based e-commerce platform commodity automatic recommendation system is characterized in that: In the step S10, the historical behavior data is the user's purchase record, and is directly mapped to a commodity purchase sequence based on the order of the purchase record.
5. According to claim 4, the BPR-RNN-based e-commerce platform commodity automatic recommendation system is characterized in that: In the step S10, two thresholds are set, the first threshold is the threshold for the number of products purchased by users, and the second threshold is the threshold for the number of times core users purchase the same product. Data cleaning includes deleting user data whose number of purchased products is less than the preset first threshold, and eliminating products whose number of purchases by all core users is less than the preset second threshold.
6. The BPR-RNN-based e-commerce platform commodity automatic recommendation system according to claim 1, characterized in that: In S40, the total association value is determined by accumulating the pull values corresponding to the products that the user has purchased, and measures the user's potential interest in each unpurchased product.
7. The BPR-RNN-based automatic product recommendation system for e-commerce platforms according to claim 6 is characterized in that: In the above S40, a threshold value of the number of personalized recommended commodities is set, and a personalized recommendation list is generated for the sorted unpurchased commodities according to the number of the threshold value.